From 3d14dc2c2ba4f4ea6874f875906e5c8ac90ab600 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Mon, 6 Nov 2023 10:35:19 +0700 Subject: [PATCH] Add Field Authorization, --- ...023_10_02_033421_create_branches_table.php | 70 ++++++++++--------- ...3_10_10_034538_create_currencies_table.php | 4 ++ ...10_042307_create_guarantee_types_table.php | 5 +- Entities/Branch.php | 6 +- Entities/Currency.php | 6 +- Entities/GuaranteeType.php | 7 +- 6 files changed, 60 insertions(+), 38 deletions(-) diff --git a/Database/Migrations/2023_10_02_033421_create_branches_table.php b/Database/Migrations/2023_10_02_033421_create_branches_table.php index 8e6f754..f49db08 100644 --- a/Database/Migrations/2023_10_02_033421_create_branches_table.php +++ b/Database/Migrations/2023_10_02_033421_create_branches_table.php @@ -1,38 +1,42 @@ id(); - $table->string('kode',9)->unique(); - $table->string('name'); - $table->timestamps(); - $table->softDeletes(); + return new class extends Migration { + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('branches', function (Blueprint $table) { + $table->id(); + $table->string('kode', 9)->unique(); + $table->string('name'); + $table->char('status', 1)->default('A'); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); - $table->unsignedBigInteger('created_by')->nullable(); - $table->unsignedBigInteger('updated_by')->nullable(); - $table->unsignedBigInteger('deleted_by')->nullable(); - }); - } + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('branches'); - } -}; + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('branches'); + } + }; diff --git a/Database/Migrations/2023_10_10_034538_create_currencies_table.php b/Database/Migrations/2023_10_10_034538_create_currencies_table.php index 440e712..edc5b56 100644 --- a/Database/Migrations/2023_10_10_034538_create_currencies_table.php +++ b/Database/Migrations/2023_10_10_034538_create_currencies_table.php @@ -17,12 +17,16 @@ return new class extends Migration $table->id(); $table->string('kode',3)->unique(); $table->string('name'); + $table->char('status', 1)->default('A'); $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); $table->softDeletes(); $table->unsignedBigInteger('created_by')->nullable(); $table->unsignedBigInteger('updated_by')->nullable(); $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); }); } diff --git a/Database/Migrations/2023_10_10_042307_create_guarantee_types_table.php b/Database/Migrations/2023_10_10_042307_create_guarantee_types_table.php index 74d7a90..555b54e 100644 --- a/Database/Migrations/2023_10_10_042307_create_guarantee_types_table.php +++ b/Database/Migrations/2023_10_10_042307_create_guarantee_types_table.php @@ -17,13 +17,16 @@ return new class extends Migration $table->id(); $table->string('kode',3)->unique(); $table->string('name'); - $table->string('status', 1)->default('A'); + $table->char('status', 1)->default('A'); $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); $table->softDeletes(); $table->unsignedBigInteger('created_by')->nullable(); $table->unsignedBigInteger('updated_by')->nullable(); $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); }); } diff --git a/Entities/Branch.php b/Entities/Branch.php index 2483bf3..6a07d20 100644 --- a/Entities/Branch.php +++ b/Entities/Branch.php @@ -9,7 +9,11 @@ { protected $fillable = [ 'kode', - 'name' + 'name', + 'status', + 'authorized_at', + 'authorized_status', + 'authorized_by', ]; } diff --git a/Entities/Currency.php b/Entities/Currency.php index b1b6003..f8a0f62 100644 --- a/Entities/Currency.php +++ b/Entities/Currency.php @@ -9,7 +9,11 @@ { protected $fillable = [ 'kode', - 'name' + 'name', + 'status', + 'authorized_at', + 'authorized_status', + 'authorized_by', ]; } diff --git a/Entities/GuaranteeType.php b/Entities/GuaranteeType.php index 7d7f6ee..0c87222 100644 --- a/Entities/GuaranteeType.php +++ b/Entities/GuaranteeType.php @@ -7,10 +7,13 @@ class GuaranteeType extends BaseModel { - protected $table = 'guarantee_types'; protected $fillable = [ 'kode', - 'name' + 'name', + 'status', + 'authorized_at', + 'authorized_status', + 'authorized_by', ]; }