This commit is contained in:
2025-10-08 18:26:47 +02:00
parent ee1af56d03
commit f40c3d0f2e
6 changed files with 134 additions and 15 deletions
+9
View File
@@ -22,6 +22,15 @@ class Account extends Model
'balance_amount',
];
protected function casts(): array
{
return [
'initial_amount' => 'decimal:4',
'balance_amount' => 'decimal:4',
'promise_date' => 'date',
];
}
public function debtor(): BelongsTo
{
return $this->belongsTo(\App\Models\Person\Person::class, 'debtor_id');
+1
View File
@@ -55,6 +55,7 @@ public function segments(): BelongsToMany
public function account(): HasOne
{
// Use latestOfMany to always surface newest account snapshot if multiple exist.
return $this->hasOne(\App\Models\Account::class)
->latestOfMany()
->with('type');