<?php

namespace App\Models;

use App\Models\BaseModel;

class ManualPayment extends BaseModel
{
    protected $table = 'manual_payments';

    // CI: useTimestamps = false
    public $timestamps = false;

    protected $fillable = [
        'invoice_number',
        'amount',
        'payment_method',
        'reference',
        'discount_number',
        'proof_path',
        'created_at',
        'school_year',
        'semester',
    ];

    protected $casts = [
        'amount'     => 'decimal:2', // adjust precision if needed
        'created_at' => 'datetime',
    ];

    /* Optional relationship if invoice_number maps to invoices.invoice_number */
    public function invoice()
    {
        return $this->belongsTo(Invoice::class, 'invoice_number', 'invoice_number');
    }
}