<?php

namespace App\Models\Hotel;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ConsumptionPayments extends Model
{
    use HasFactory;

  //* Associated Table & Primary Key
    protected $table = 'consumption_payments';
    protected $primaryKey = 'id';

  //* Fillable Fields
    protected $fillable = [
        'reservation_id',
        'payment_date',
        'payment_concept',
        'payment_price',
        'payment_method',
        'status',
    ];

  //* Cast Columns
    protected $casts = [
        'payment_date'   => 'datetime',
    ];


  //* Relationships
    public function reservation() {
        return $this->belongsTo(Reservation::class, 'reservation_id');
    }
}
