<?php

declare(strict_types=1);

use Carbon\Carbon;
use Seka\Portal\Modul\Statistiky\Entities\Import\Import;
use Seka\Portal\Modul\Statistiky\Entities\Import\Enums\StavEnum;
use Seka\Portal\Modul\Statistiky\Entities\Import\ValueObjects\Subor;

/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(Import::class, function () {
    $date = Carbon::now()->subDays(rand(0, 30));

    return [
        'subor' => new Subor(
            'NAZOV_SUBORU_' . Carbon::now()->subDays(rand(0, 200))->format('Ymd') . '.csv',
            'subory\pre\import',
            'subory\importovane',
            rand(1000, 5000000)
        ),
        'stav' => StavEnum::toValues()[rand(0, count(StavEnum::toArray()) - 1)],
        'datum_cas_akcie' => $date->subMinutes(rand(1, 5)),
        'sprava' => random_bytes(rand(80, 550))
    ];
});
