<?php
// app/Models/TrialApprovalRequest.php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class TrialApprovalRequest extends Model
{
    protected $table = 'trial_approval_requests';
    
    protected $fillable = [
        'hotel_id',
        'hotel_name',
        'hotel_email',
        'package',
        'monthly_price',
        'billing_cycle',
        'trial_started_at',
        'trial_ended_at',
        'status',
        'requested_at',
        'processed_at',
        'processed_by',
        'admin_notes'
    ];
    
    protected $casts = [
        'trial_started_at' => 'datetime',
        'trial_ended_at' => 'datetime',
        'requested_at' => 'datetime',
        'processed_at' => 'datetime'
    ];
    
    public function hotel()
    {
        return $this->belongsTo(Hotel::class);
    }
    
    public function processor()
    {
        return $this->belongsTo(User::class, 'processed_by');
    }
}