<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ChestPrize extends Model
{
    protected $fillable = [
        'raffle_id',
        'name',
        'type', // action, extra_key, wallet_credit, physical_prize
        'value',
        'probability',
        'total_quantity',
        'remaining_quantity',
        'image_path',
    ];

    protected $casts = [
        'value' => 'decimal:2',
        'probability' => 'decimal:2',
        'total_quantity' => 'integer',
        'remaining_quantity' => 'integer',
    ];

    public function raffle()
    {
        return $this->belongsTo(Raffle::class);
    }
}
