<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\HasMany;

class Bonus extends BaseModel
{
    protected $fillable = [
        'name',
        'eligibility_type',
        'amount_type',
        'amount',
    ];

    protected function casts(): array
    {
        return [
            'eligibility_type' => 'array',
            'amount' => 'decimal:2',
        ];
    }

    public function generations(): HasMany
    {
        return $this->hasMany(BonusGeneration::class);
    }
}
