<?php

namespace App\Domains\Purchase\Models;

use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

#[Fillable([
    'compra_id',
    'qr_order_id',
    'qr_code',
])]
class TelepagosQr extends Model
{
    use HasFactory;

    protected $table = 'telepagos_qr';

    protected function casts(): array
    {
        return [
            'compra_id' => 'integer',
        ];
    }

    /**
     * @return BelongsTo<Purchase, $this>
     */
    public function compra(): BelongsTo
    {
        return $this->belongsTo(Purchase::class, 'compra_id');
    }
}
