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 <ddeni05@gmail.com>
This commit is contained in:
Daeng Deni Mardaeni
2025-06-03 12:02:31 +07:00
parent cc99883875
commit 66f84600eb
2 changed files with 34 additions and 1 deletions

View File

@@ -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(){

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('customers', function (Blueprint $table) {
$table->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']);
});
}
};