changes
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user