<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;

#[Fillable(['bonus_disbursement_id', 'order_detail_id', 'bonus_amount'])]
class BonusDisbursementItem extends Model
{
    protected function casts(): array
    {
        return ['bonus_amount' => 'decimal:2'];
    }

    public function disbursement()
    {
        return $this->belongsTo(BonusDisbursement::class, 'bonus_disbursement_id');
    }

    public function orderDetail()
    {
        return $this->belongsTo(OrderDetail::class);
    }
}
