<?php

namespace App\Models;

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

class PaymentTransaction extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

    protected $casts = [
        'source_id' => 'integer',
        'order_id' => 'integer',
        'amount' => 'float',
        'request_payload' => 'array',
        'callback_payload' => 'array',
        'verification_payload' => 'array',
        'verified_by_system' => 'boolean',
        'created_by_admin_id' => 'integer',
        'paid_at' => 'datetime',
        'expires_at' => 'datetime',
    ];

    public function order()
    {
        return $this->belongsTo(Order::class);
    }
}
