feat(customer): tambah field alamat lengkap & pemrosesan CSV dinamis

- Tambah 13 field alamat KTP & domisili di tabel customers (nullable, aman untuk rollback)
- Update model Customer: fillable & casting tanggal
- ProcessCustomerDataJob: header CSV dinamis, mapping otomatis, trim value
- Batch save pakai DB::transaction(), logging detail, error handling lengkap
- Fleksibel untuk CSV dengan header bervariasi & backward-compatible
This commit is contained in:
Daeng Deni Mardaeni
2025-08-07 08:45:50 +07:00
parent 8a6469ecc9
commit 7af5bf2fe5
3 changed files with 176 additions and 13 deletions

View File

@@ -29,8 +29,33 @@ class Customer extends Model
'home_rw',
'ktp_rt',
'ktp_rw',
'local_ref'
'local_ref',
'ktp_kelurahan',
'ktp_kecamatan',
'town_country',
'ktp_provinsi',
'post_code',
'l_dom_street',
'l_dom_rt',
'l_dom_kelurahan',
'l_dom_rw',
'l_dom_kecamatan',
'l_dom_provinsi',
'l_dom_t_country',
'l_dom_post_code'
];
/**
* Get the attributes that should be cast.
* Mendefinisikan casting untuk field-field tertentu
*/
protected function casts(): array
{
return [
'date_of_birth' => 'date',
'birth_incorp_date' => 'date',
];
}
public function accounts(){
return $this->hasMany(Account::class, 'customer_code', 'customer_code');
}