<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Statistiky\Entities\Import;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Seka\Portal\Modul\Statistiky\Entities\Import\Enums\StavEnum;

/**
 * Class Import
 *
 * @package Seka
 * @property int                                                              $id
 * @property \Seka\Portal\Modul\Statistiky\Entities\Import\ValueObjects\Subor $subor
 * @property StavEnum                                                         $stav
 * @property \Carbon\CarbonImmutable|null                                     $datum_cas_akcie
 * @property string                                                           $sprava
 * @property \Carbon\CarbonImmutable                                          $created_at
 * @property \Carbon\CarbonImmutable                                          $updated_at
 */
class Import extends Model
{
    use HasFactory;

    /**
     * @var string
     */
    protected $table = 'modul_statistiky_historia_importov';

    /**
     * @var array
     */
    protected $guarded = [
        'id',
    ];

    /**
     * @var string[]
     */
    protected $casts = [
        'subor' => SuborCastable::class . ':subor_nazov,subor_povodne_umiestnenie,subor_presunuty_do,subor_velkost',
        'stav' => StavEnum::class . ':nullable',
    ];

    /**
     * @var string[]
     */
    protected $dates = [
        'datum_cas_akcie',
    ];
}
