From 66f84600ebfbe45a47d806af92b674eb6b02af55 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Tue, 3 Jun 2025 12:02:31 +0700 Subject: [PATCH] feat(webstatement): tambahkan kolom baru sektor, tipe pelanggan, dan tanggal lahir/pendirian pada model `Customer` - Memperbarui model `Customer` dengan menambahkan properti baru pada `$fillable`: - `sector` - `customer_type` - `birth_incorp_date` - Menambahkan migrasi baru `add_sector_customer_type_birth_incorp_date_to_customers_table`: - Menambahkan kolom `sector`, `customer_type`, dan `birth_incorp_date` pada tabel `customers`. - Semua kolom bersifat nullable untuk menjaga kompatibilitas data lama. - Menyediakan fungsi rollback dengan menghapus kolom yang ditambahkan. - Tujuan perubahan ini: - Mendukung penyimpanan data sektor, tipe pelanggan, dan tanggal lahir/pendirian pada entitas pelanggan. - Memfasilitasi validasi data tambahan dalam proses bisnis dan laporan. Signed-off-by: Daeng Deni Mardaeni --- app/Models/Customer.php | 5 +++- ...e_birth_incorp_date_to_customers_table.php | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2025_06_03_050056_add_sector_customer_type_birth_incorp_date_to_customers_table.php diff --git a/app/Models/Customer.php b/app/Models/Customer.php index 111e3dd..67e8dec 100644 --- a/app/Models/Customer.php +++ b/app/Models/Customer.php @@ -21,7 +21,10 @@ class Customer extends Model 'postal_code', 'branch_code', 'date_of_birth', - 'email' + 'email', + 'sector', + 'customer_type', + 'birth_incorp_date' ]; public function accounts(){ diff --git a/database/migrations/2025_06_03_050056_add_sector_customer_type_birth_incorp_date_to_customers_table.php b/database/migrations/2025_06_03_050056_add_sector_customer_type_birth_incorp_date_to_customers_table.php new file mode 100644 index 0000000..d6b5e62 --- /dev/null +++ b/database/migrations/2025_06_03_050056_add_sector_customer_type_birth_incorp_date_to_customers_table.php @@ -0,0 +1,30 @@ +string('sector')->nullable()->after('branch_code'); + $table->string('customer_type')->nullable()->after('sector'); + $table->string('birth_incorp_date')->nullable()->after('date_of_birth'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('customers', function (Blueprint $table) { + $table->dropColumn(['sector', 'customer_type', 'birth_incorp_date']); + }); + } +};