diff --git a/Build.PL b/Build.PL index 75da056..01c1c0a 100644 --- a/Build.PL +++ b/Build.PL @@ -24,6 +24,7 @@ my $build = Module::Build->new( 'Email::Valid' => 0, 'Crypt::Bcrypt' => 0, 'Email::Sender' => 0, + 'HTML::Entities' => 0, }, install_path => { 'templates' => "$HOME/.local/share/peace/template", diff --git a/db_tests/00002-developer-dao.t b/db_tests/00002-developer-dao.t index a9395f0..980a207 100644 --- a/db_tests/00002-developer-dao.t +++ b/db_tests/00002-developer-dao.t @@ -7,6 +7,7 @@ use warnings; use Test::Most tests => 2; +use Crypt::URandom q/urandom/; use DateTime; use Peace; @@ -32,6 +33,7 @@ use Peace::DAO::Developer; verified => 0, secret_bcrypt => $secret_bcrypt ); + $developer->email($developer->email =~ s/\@/unpack('H*', urandom(100)).'@'/er); my $developer_dao = Peace::DAO::Developer->new( dbh => $dbh ); ## WHEN diff --git a/db_tests/00003-application-dao.t b/db_tests/00003-application-dao.t index 9fb532e..89be3f5 100644 --- a/db_tests/00003-application-dao.t +++ b/db_tests/00003-application-dao.t @@ -10,6 +10,7 @@ use Data::Dumper; use Test::Most tests => 4; use DateTime; +use Crypt::URandom q/urandom/; use Peace; use Peace::DB; @@ -30,6 +31,7 @@ use Peace::Test::Mock::Model::Application; my $dbh = Peace::DB->dbh( config => $config ); my $developer = Peace::Test::Mock::Model::Developer->new; + $developer->email($developer->email =~ s/\@/unpack('H*', urandom(100)).'@'/er); my $developer_dao = Peace::DAO::Developer->new( dbh => $dbh ); $developer_dao->create( developer => $developer ); @@ -60,6 +62,7 @@ use Peace::Test::Mock::Model::Application; my $secret_bcrypt = 'hola'; my $developer = Peace::Test::Mock::Model::Developer->new; + $developer->email($developer->email =~ s/\@/unpack('H*', urandom(100)).'@'/er); my $developer_dao = Peace::DAO::Developer->new( dbh => $dbh ); $developer_dao->create( developer => $developer ); diff --git a/db_tests/00004-release-dao.t b/db_tests/00004-release-dao.t index e90234d..e5c52c5 100644 --- a/db_tests/00004-release-dao.t +++ b/db_tests/00004-release-dao.t @@ -10,6 +10,7 @@ use Data::Dumper; use Test::Most tests => 2; use DateTime; +use Crypt::URandom q/urandom/; use Peace; use Peace::DB; @@ -32,6 +33,7 @@ use Peace::Test::Mock::Model::Release; my $dbh = Peace::DB->dbh( config => $config ); my $developer = Peace::Test::Mock::Model::Developer->new; + $developer->email($developer->email =~ s/\@/unpack('H*', urandom(100)).'@'/er); my $developer_dao = Peace::DAO::Developer->new( dbh => $dbh ); $developer_dao->create( developer => $developer ); diff --git a/db_tests/00005-build-dao.t b/db_tests/00005-build-dao.t index 721cd0d..2b5f771 100644 --- a/db_tests/00005-build-dao.t +++ b/db_tests/00005-build-dao.t @@ -8,6 +8,7 @@ use warnings; use Test::Most tests => 2; use DateTime; +use Crypt::URandom q/urandom/; use Peace; use Peace::DB; @@ -31,6 +32,8 @@ use Peace::Test::Mock::Model::Build; my $release_dao = Peace::DAO::Release->new( dbh => $dbh ); my $application_dao = Peace::DAO::Application->new( dbh => $dbh ); my $build_dao = Peace::DAO::Build->new( dbh => $dbh ); + my $developer = $build->release->application->developer; + $developer->email($developer->email =~ s/\@/unpack('H*', urandom(100)).'@'/er); $developer_dao->create( developer => $build->release->application->developer ); $build->release->application->app_id( diff --git a/doc/index.html b/doc/index.html index 9d9a655..930460e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -8,6 +8,9 @@
Peace::Controller::Application - Application's http endpoint.
+ +# This object is used by mojolicious.
+
+Peace::Controller::Application allows to interact using a json http api with the Peace::Model::Application objects in Peace.
+ +Peace::Controller::Developer implements the following methods:
+ +# To be used by mojolicious.
+
+Creates a application in db with the data given by the user.
+ +Peace::Model::Application, Peace::DAO::Application
+ + + + + + + diff --git a/doc/lib/Peace/DAO/Developer.pm.html b/doc/lib/Peace/DAO/Developer.pm.html index 4053995..49b8cda 100644 --- a/doc/lib/Peace/DAO/Developer.pm.html +++ b/doc/lib/Peace/DAO/Developer.pm.html @@ -24,6 +24,7 @@Recovers the Peace::Model::Developer associated from an uuid from database.
+my $developer = $developer_dao->recover_by_identifier( identifier => $identifier );
+
+Recovers the Peace::Model::Developer associated from an identifier from database.
+Peace::DB, Peace::Model::Developer
diff --git a/doc/lib/Peace/Email.pm.html b/doc/lib/Peace/Email.pm.html new file mode 100644 index 0000000..17c3527 --- /dev/null +++ b/doc/lib/Peace/Email.pm.html @@ -0,0 +1,84 @@ + + + + +Peace::Email - The mail sender module for Peace.
+ +my $mailer = Peace::Email->new;
+
+$mailer->sendmail(
+ to => 'larry@perl,org',
+ text => 'hola',
+ html => '<b>hola</b>',
+ subject => 'Patch',
+);
+
+Peace::Email reads the Peace config to determine the credentials to send mail and does an abstraction around those.
+ +Peace::Email implements the following instance methods:
+ +my $mailer = Peace::Email->new;
+
+Instances a new mailer.
+ +Peace::Email implements the following methods:
+ +$mailer->sendmail(
+ to => 'larry@perl,org',
+ text => 'hola',
+ html => '<b>hola</b>',
+ subject => 'Patch',
+);
+
+Sends a mail to the given mail address.
+ +Peace::Model::Application implements the following methods:
+my $json = $application->to_json;
+
+Retrieves the json representation of the application.
+my $uuid = $application->uuid;
diff --git a/doc/lib/Peace/Model/Developer.pm.html b/doc/lib/Peace/Model/Developer.pm.html
index 8272c5d..fcf0aa8 100644
--- a/doc/lib/Peace/Model/Developer.pm.html
+++ b/doc/lib/Peace/Model/Developer.pm.html
@@ -23,6 +23,7 @@
METHODS
- to_json
+ - login
- applications
- uuid
- date_creation
@@ -33,6 +34,7 @@
- stripe_id
- country
- verified
+ - verification_secret
SEE ALSO
@@ -86,6 +88,12 @@
Renders the developer in a json like structure.
+login
+
+my $logged = $developer->login( secret => $secret );
+
+Returns true if the login is successful, false otherwise.
+
applications
my $applications = $developer->applications;
@@ -156,12 +164,20 @@ $developer->country($country);
my $verified = $developer->verified
+my $verified = $developer->verified;
$developer->verified($verified);
Allows to retrieve and set the developer verified.
+verification_secret
+
+my $verification_secret = $developer->verification_secret;
+
+$developer->verification_secret($verification_secret);
+
+Allows to retrieve and set the developer verification_secret.
+
SEE ALSO
Peace::DAO::Developer, Peace::Model::Application
diff --git a/doc/lib/Peace/Swagger.pm.html b/doc/lib/Peace/Swagger.pm.html
index 7a1f839..13a1b49 100644
--- a/doc/lib/Peace/Swagger.pm.html
+++ b/doc/lib/Peace/Swagger.pm.html
@@ -26,6 +26,7 @@
validate_request
developer
developer_post
+ developer_application_post
my $developer_post = $swagger->developer_post
+my $developer_post = $swagger->developer_post;
Returns the schema of the post request to the /developer enpoint.
+my $developer_application_post = $swagger->developer_application_post;
+
+Returns the schema of the post request to the /developer/:identifier/application endpoint.
+