<?php

namespace App\Models;

use App\Enums\CardRequestStatus;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CardRequest extends Model
{
    protected $fillable = [
        'name',
        'phone',
        'store_id',
        'status',
        'admin_notes',
        'replied_at',
    ];

    protected function casts(): array
    {
        return [
            'status'     => CardRequestStatus::class,
            'replied_at' => 'datetime',
        ];
    }

    public function store(): BelongsTo
    {
        return $this->belongsTo(Store::class);
    }
}