Adding some docs.

This commit is contained in:
sergiotarxz 2022-03-17 05:08:05 +01:00
parent 04824db8f4
commit 3433112546
4 changed files with 133 additions and 1 deletions

View File

@ -19,7 +19,12 @@
"DBD::Mock" : "0",
"DBD::Pg" : "0",
"DBI" : "0",
"Mojolicious" : "0"
"DateTime" : "0",
"DateTime::Format::Pg" : "0",
"Mojolicious" : "0",
"Test::MockModule" : "0",
"Test::MockObject" : "0",
"Test::Most" : "0"
}
}
},

View File

@ -22,3 +22,20 @@ sub startup {
$r->post('/users')->to('user#post');
}
1;
=encoding utf8
=head1 NAME
Peace - Onlie GNU/Linux flatpak apps store.
=head1 SYNOPSIS
./peace
=head1 DESCRIPTION
Peace is the server backend for flatstore a shop
to be able to sell or buy flatpak applications.
=cut

View File

@ -156,3 +156,45 @@ EOF
return $value;
}
1;
=encoding utf8
=head1 NAME
Peace::DB - Database handler generator for the Peace shop.
=head1 SYNOPSIS
my $config =
$self->plugin(
JSONConfig => {
file => "$home/.config/peace/peace.conf"
}
);
my $dbh = Peace::DB->dbh( config => $config );
=head1 DESCRIPTION
This module helps to recover a database handle and runs
the migrations automatically when doing so.
=head1 FUNCTIONS
Peace::DB implements the following functions:
=head2 dbh
Recovers a database handle, requires the config of the app as
its parameter.
my $dbh = Peace::DB->dbh( config => $config );
=head2 run_migrations
Runs the migrations manually.
Peace::DB->run_migrations($dbh);
=head1 SEE ALSO
L<DBI>, L<DBD::Pg>

View File

@ -84,3 +84,71 @@ use DateTime;
}
}
1;
=encoding utf8
=head1 NAME
Peace::Model::Customer - The customer object representation
=head1 SYNOPSIS
my $customer = Peace::Model::Customer->new(
secret_bcrypt => $secret_bcrypt
);
=head1 DESCRIPTION
Describes a customer of Peace capable of buy applications.
=head1 INSTANCE METHODS
Peace::Model::Customer implements the following instance methods:
=head2 new
my $customer = Peace::Model::Customer->new(
uuid => $uuid, # optional
date_creation => $date_creation, # optional
secret_bcrypt => $secret_bcrypt,
stripe_id => $stripe_id, # optional
);
Instances a new Peace::Model::Customer.
=head1 METHODS
Peace::Model::Customer implements the following methods:
=head2 uuid
my $uuid = $customer->uuid;
$customer->uuid($uuid);
Allows to retrive and set the customer uuid.
=head2 date_creation
my $date_creation = $customer->date_creation;
$customer->date_creation($date_creation);
Allows to retrive and set the customer date_creation.
=head2 secret_bcrypt
my $secret_bcrypt = $customer->secret_bcrypt;
$customer->secret_bcrypt($secret_bcrypt);
Allows to retrive and set the customer secret_bcrypt.
=head2 stripe_id
my $stripe_id = $customer->stripe_id;
$customer->stripe_id($stripe_id);
=head1 SEE ALSO
L<Peace::DAO::Customer>