<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Reservation extends Model
{
    protected $fillable = [
        'customer_name',
        'phone',
        'lodging_id',
        'adults',
        'kids_10_15',
        'kids_5_10',
        'package_type',
        'total_cost',
        'advance_payment',
        'balance',
        'payment_method',
        'reservation_date',
        'check_in',
        'check_out',
        'status',
        'user_id',
    ];

    public function extraServices()
    {
        return $this->hasMany(ExtraService::class);
    }

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

    public function lodging()
    {
        return $this->belongsTo(Lodging::class);
    }

    public function logs()
    {
        return $this->hasMany(ReservationLog::class)->orderBy('created_at', 'desc');
    }
}
