<?php

namespace App\Models;

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

class Payment extends Model
{
    protected $fillable = [
        'recruitment_case_id',
        'amount',
        'method',
        'trx_id',
        'paid_at',
        'received_by',
        'note',
    ];

    protected $casts = [
        'paid_at' => 'datetime',
    ];

    public function case(): BelongsTo
    {
        return $this->belongsTo(RecruitmentCase::class, 'recruitment_case_id');
    }
}
