Skip to content

Commit

Permalink
Merge pull request #23 from FrankFontcha/FF/v1
Browse files Browse the repository at this point in the history
update controllers, models
  • Loading branch information
Frank14b authored May 3, 2023
2 parents 1660386 + 87828f4 commit 64347a5
Show file tree
Hide file tree
Showing 76 changed files with 6,000 additions and 143 deletions.
15 changes: 15 additions & 0 deletions config/Admin-jwt/jwt.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCa5InOkE/fZbiMmMJqXvn4XB6tWbIN4r5Xv59Dje0nBWzKf1De
lUpZcWz70Az7ZNqMpGLewwMSCLIcDMystYBnygJ5wecy0VYDuvHlJTyaiN2HiIBr
/uy1Z8vMA2nnNV2XSB6sQTcAfTo5GsNt5db+pi6nf+ktBrSQdYoA0Pi2sQIDAQAB
AoGABv+GXmfUxAIjiW6pcgbigl8fH7PqwIfbE7nbp0C1U0sCdE+2Rqg2GL5wLxxi
ScVvvmT69peW/uyXp37IjJESwQu2uqmzEURcNA2ZLQHARqEc2wKEVkzdYtB8/FQI
9o73Ya0XnzaiOFo0FoiMAHemYBUQftouMAVdejpuv1gHKXECQQDL92gq+mMZY02C
rdOnKF6YInMrjoy+ThIVK86FvSBYOH9oRYk/N8akc+POgcXHDlj8ZkF/RZBxNog9
XgbcvhENAkEAwmg8sdYpmN6IEZmFsoi+47hjhpZUYnOcKF1Y9f+NM/QENSffdmrd
0dHw89nR/uUHPEcm6qzuf2cR0u6yj0orNQJBALLVAGM2V+8pjws1x243SgEPq3UU
LjipENe5KgE+mn5fQu40kap5B9Smu6UTSUpHPSRHr8OcRZHN41QS/edLSn0CQF/6
HDTj+WdaPa0KsSHiNvOv3Zrdbs2oK+kVpMzWHH0QtF8Vz1HkEpz6281XtT/1DCxr
KEBlnd1SIk+Tvp3VTR0CQQCLCOHw+JFne6PyzgYSak6GlznSe2ZSq18wISpzHtg8
jzQqKzSAJGgzJlSPb1FT6xhkmKKho9+b265E+AOD8ZRf
-----END RSA PRIVATE KEY-----
6 changes: 6 additions & 0 deletions config/Admin-jwt/jwt.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa5InOkE/fZbiMmMJqXvn4XB6t
WbIN4r5Xv59Dje0nBWzKf1DelUpZcWz70Az7ZNqMpGLewwMSCLIcDMystYBnygJ5
wecy0VYDuvHlJTyaiN2HiIBr/uy1Z8vMA2nnNV2XSB6sQTcAfTo5GsNt5db+pi6n
f+ktBrSQdYoA0Pi2sQIDAQAB
-----END PUBLIC KEY-----
62 changes: 62 additions & 0 deletions config/Migrations/20230224070317_CreateActivities.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class CreateActivities extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('activities');

// title
$table->addColumn("name", "string", [
"limit" => 255,
"null" => false
]);

// description
$table->addColumn("description", "string", [
"limit" => 255,
"null" => true
]);

// reference
$table->addColumn("reference", "string", [
"limit" => 255,
"null" => true
]);

// activity type_id
$table->addColumn("activity_type_id", "integer", [
"null" => false
]);

// status
$table->addColumn("status", "enum", [
"values" => ["0", "1", "2"], // 0 disable, 1 enable, 2 delete
"default" => "1"
]);

// created_at
$table->addColumn("created_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

// updated_at
$table->addColumn("updated_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

$table->addIndex(['name', 'reference'], [ 'unique' => true ]);

$table->create();
}
}
66 changes: 66 additions & 0 deletions config/Migrations/20230224070413_CreateActivityMetadatas.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class CreateActivityMetadatas extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('activity_metadatas');

// activity_id
$table->addColumn("activity_id", "integer", [
"null" => false
]);

// metakey
$table->addColumn("metakey", "string", [
"limit" => 255,
"null" => false
]);

// metavalue
$table->addColumn("metavalue", "string", [
"limit" => 1000,
"null" => false
]);

// extra data
$table->addColumn("extra", "string", [
"limit" => 1000,
"null" => true
]);

// unicity
$table->addColumn("unicity", "enum", [
"values" => ["0", "1"], // 0 multiple type key, 1 unique key
"default" => "1"
]);

// status
$table->addColumn("status", "enum", [
"values" => ["0", "1", "2"], // 0 disable, 1 enable, 2 delete
"default" => "1"
]);

// created_at
$table->addColumn("created_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

// updated_at
$table->addColumn("updated_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

$table->create();
}
}
86 changes: 86 additions & 0 deletions config/Migrations/20230224070425_CreateModules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class CreateModules extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('modules');

// title
$table->addColumn("name", "string", [
"limit" => 255,
"null" => false
]);

// description
$table->addColumn("description", "string", [
"limit" => 255,
"null" => true
]);

// reference
$table->addColumn("reference", "string", [
"limit" => 255,
"null" => true
]);

// activity_id
$table->addColumn("activity_id", "integer", [
"null" => false
]);

// price
$table->addColumn("price", "integer", [
"null" => false,
"default" => 0
]);

// price range
$table->addColumn("price_range", "integer", [
"null" => false,
"default" => 1
]);

// validity
$table->addColumn("validity", "enum", [
"values" => ["minutes", "hours", "days", "weeks", "months", "years"],
"default" => "months",
"null" => false
]);

// currency_id
$table->addColumn("currency_id", "integer", [
"null" => false
]);

// status
$table->addColumn("status", "enum", [
"values" => ["0", "1", "2"], // 0 disable, 1 enable, 2 delete
"default" => "1"
]);

// created_at
$table->addColumn("created_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

// updated_at
$table->addColumn("updated_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

$table->addIndex(['reference'], [ 'unique' => true ]);

$table->create();
}
}
51 changes: 51 additions & 0 deletions config/Migrations/20230224070433_CreateActivityTypes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class CreateActivityTypes extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('activity_types');

// title
$table->addColumn("name", "string", [
"limit" => 255,
"null" => false
]);

// description
$table->addColumn("description", "string", [
"limit" => 255,
"null" => true
]);

// status
$table->addColumn("status", "enum", [
"values" => ["0", "1", "2"], // 0 disable, 1 enable, 2 delete
"default" => "1"
]);

// created_at
$table->addColumn("created_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

// updated_at
$table->addColumn("updated_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

$table->addIndex(['name'], [ 'unique' => true ]);

$table->create();
}
}
63 changes: 63 additions & 0 deletions config/Migrations/20230224072832_CreateCurrencies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class CreateCurrencies extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('currencies');

// shortname
$table->addColumn("shortname", "string", [
"limit" => 255,
"null" => false
]);

// longname
$table->addColumn("longname", "string", [
"limit" => 255,
"null" => false
]);

// symbol
$table->addColumn("symbol", "string", [
"limit" => 255,
"null" => false
]);

// icon
$table->addColumn("icon", "string", [
"limit" => 1000,
"null" => false
]);

// status
$table->addColumn("status", "enum", [
"values" => ["0", "1", "2"], // 0 disable, 1 enable, 2 delete
"default" => "1"
]);

// created_at
$table->addColumn("created_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

// updated_at
$table->addColumn("updated_at", "timestamp", [
"default" => 'CURRENT_TIMESTAMP'
]);

$table->addIndex(['shortname', 'longname', 'symbol'], [ 'unique' => true ]);

$table->create();
}
}
20 changes: 20 additions & 0 deletions config/Migrations/20230315095359_CreateFolders.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class CreateFolders extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('folders');
$table->create();
}
}
Binary file modified config/Migrations/schema-dump-default.lock
Binary file not shown.
8 changes: 8 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,14 @@
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
],

'cloud' => [
'className' => Connection::class,
'driver' => Mysql::class,
'persistent' => false,
'timezone' => 'UTC',
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
],

/*
* The test connection is used during the test suite.
*/
Expand Down
Loading

0 comments on commit 64347a5

Please sign in to comment.