<?php

namespace App\Models;

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

class PassengerExtraServiceRequest extends Model
{
    protected $fillable = [
        'user_id',
        'passenger_extra_service_id',
        'status',
        'notes',
        'admin_notes',
        'fee_snapshot',
        'wheel_milestone_pending',
        'wheel_promo_fee_amount',
        'wheel_result',
        'wheel_spun_at',
        'completed_at',
    ];

    protected $casts = [
        'fee_snapshot' => 'decimal:2',
        'wheel_milestone_pending' => 'boolean',
        'wheel_promo_fee_amount' => 'decimal:2',
        'wheel_result' => 'integer',
        'wheel_spun_at' => 'datetime',
        'completed_at' => 'datetime',
    ];

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }

    public function service(): BelongsTo
    {
        return $this->belongsTo(PassengerExtraService::class, 'passenger_extra_service_id');
    }
}
