Initial commit

This commit is contained in:
Zdeněk Burda
2026-01-09 21:26:40 +01:00
parent e83aec6dca
commit 41e3ce6f25
404 changed files with 61250 additions and 28 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace Database\Factories;
use App\Models\Contest;
use App\Models\EvaluationRuleSet;
use App\Models\Round;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Round>
*/
class RoundFactory extends Factory
{
protected $model = Round::class;
public function definition(): array
{
$title = $this->faker->words(3, true);
$start = now()->startOfDay()->addHours(14);
$end = (clone $start)->addHours(2);
$deadline = (clone $end)->addDays(2);
return [
'contest_id' => Contest::factory(),
'rule_set_id' => EvaluationRuleSet::factory(),
'name' => [
'cs' => $title,
'en' => $title,
],
'description' => [
'cs' => $this->faker->sentence(),
'en' => $this->faker->sentence(),
],
'start_time' => $start,
'end_time' => $end,
'logs_deadline' => $deadline,
'is_active' => true,
];
}
}