first commit
This commit is contained in:
49
database/factories/MedicalReportFormTemplateFactory.php
Normal file
49
database/factories/MedicalReportFormTemplateFactory.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\HospitalUnit;
|
||||
use App\Models\MedicalReportFormTemplate;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<MedicalReportFormTemplate>
|
||||
*/
|
||||
class MedicalReportFormTemplateFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$hospitalUnit = HospitalUnit::factory();
|
||||
|
||||
return [
|
||||
'hospital_unit_id' => $hospitalUnit,
|
||||
'department_key' => fake()->unique()->slug(2),
|
||||
'name' => fake()->sentence(3),
|
||||
'description' => fake()->sentence(),
|
||||
'schema' => [
|
||||
'title' => 'Тестовый шаблон',
|
||||
'description' => 'Тестовое описание',
|
||||
'sections' => [
|
||||
[
|
||||
'key' => 'main',
|
||||
'title' => 'Основной блок',
|
||||
'economist_label' => 'Тестовый шаблон / Основной блок',
|
||||
'fields' => [
|
||||
['key' => 'department_id', 'label' => 'Отделение', 'type' => 'department-select'],
|
||||
['key' => 'value', 'label' => 'Значение', 'type' => 'number'],
|
||||
],
|
||||
'default_entries' => [
|
||||
['department_id' => '', 'value' => '0'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user