<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class SupplierPayment extends Model
{
    protected $fillable = ['supplier_id', 'purchase_id', 'amount', 'currency_code', 'method', 'payment_date', 'reference', 'notes'];
    protected function casts(): array { return ['amount' => 'decimal:2', 'payment_date' => 'date']; }
    public function supplier(): BelongsTo { return $this->belongsTo(Supplier::class); }
    public function purchase(): BelongsTo { return $this->belongsTo(Purchase::class); }
}
