Files
webstatement/app/Models/StmtEntry.php
Daeng Deni Mardaeni 23611ef79b refactor(webstatement): update job and model for arrangement processing
- Refactor `ProcessArrangementDataJob`:
  - Mengubah parameter dari array periods menjadi string period untuk simplifikasi proses.
  - Mengadaptasi logika proses file CSV dari multiple periods menjadi single period.
  - Menghapus logika iterasi folder `_parameter` dan menyederhanakan nama file dengan menggunakan single period.
  - Menambahkan validasi dan penanganan error jika file tidak ditemukan atau tidak dapat dibuka.
  - Menyederhanakan proses membaca dan memproses row dari file CSV dengan pendekatan baru.
  - Memperbaiki logging untuk mencatat catatan processing dan error yang lebih tepat.

- Update Model `StmtEntry`:
  - Menambahkan relasi baru:
    - `tt`: Relasi dengan model `Teller` berdasarkan `trans_reference`.
    - `dc`: Relasi dengan model `DataCapture` berdasarkan `trans_reference`.
    - `aa`: Relasi dengan model `TempArrangement` berdasarkan `trans_reference`.

Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
2025-05-26 08:44:10 +07:00

80 lines
1.8 KiB
PHP

<?php
namespace Modules\Webstatement\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
// use Modules\Webstatement\Database\Factories\StmtEntryFactory;
class StmtEntry extends Model
{
use HasFactory;
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'stmt_entry';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'stmt_entry_id',
'account_number',
'company_code',
'amount_lcy',
'transaction_code',
'narrative',
'product_category',
'value_date',
'amount_fcy',
'exchange_rate',
'trans_reference',
'booking_date',
'stmt_no',
'date_time',
'currency',
'crf_type',
'consol_key',
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function account()
{
return $this->belongsTo(Account::class, 'account_number', 'account_number');
}
public function ft(){
return $this->belongsTo(TempFundsTransfer::class, 'trans_reference', 'ref_no');
}
public function transaction(){
return $this->belongsTo(TempTransaction::class, 'transaction_code', 'transaction_code');
}
public function tt(){
return $this->belongsTo(Teller::class, 'trans_reference', 'id_teller');
}
public function dc(){
return $this->belongsTo(DataCapture::class, 'trans_reference', 'id');
}
public function aa(){
return $this->belongsTo(TempArrangement::class, 'trans_reference', 'arrangement_id');
}
}