<?php

namespace App\Models;

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

class Payment extends BaseModel
{
    protected function casts(): array
    {
        return [
            'amount' => 'decimal:2', 'processor_fee' => 'decimal:2',
            'refund_amount' => 'decimal:2', 'refunded_at' => 'datetime',
            'paid_at' => 'datetime',
        ];
    }

    public function booking(): BelongsTo { return $this->belongsTo(Booking::class); }
    public function transactions(): HasMany { return $this->hasMany(Transaction::class); }
}