ldc-arcadia-api/database/factories/IncoSheetFactory.php
Jérémy Munsch 1d55dff5f4
feat(seeders): add IncoSheet and IncoCompo seeders
Implement seeders for IncoSheet and IncoCompo to populate the database with initial data.
2026-08-14 10:35:21 +02:00

71 lines
2.3 KiB
PHP

<?php
declare(strict_types=1);
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Infra\Database\Models\IncoSheet;
/**
* @extends Factory<IncoSheet>
*/
final class IncoSheetFactory extends Factory
{
protected $model = IncoSheet::class;
/**
* @return array<string, mixed>
*/
#[\Override]
public function definition(): array
{
return [
'id' => (string) fake()->unique()->numberBetween(10000, 99999),
'name' => 'Poulet Rôti 1kg',
'label' => 'Poulet Rôti Classe A',
'description' => 'Poulet prêt à cuire élevé en France',
'allegations' => [
'allegations' => ['Volaille française'],
'health' => [],
'nutrition' => ['Riche en protéines'],
'other' => [],
],
'sell_arguments' => 'Origine France garantie',
'preparation_advices' => 'Cuisson au four 1h à 180°C',
'tips' => 'Servir chaud',
'sell_familly' => 'Volaille',
'ingredients' => [
'Ingrédients' => ['Viande de poulet (98%)', 'Sel', 'Epices'],
],
'portions' => [
'lowPart' => 100,
'highPart' => 150,
'approximative' => false,
],
'allergens' => [
['code' => 1, 'label' => 'Gluten'],
],
'brand' => [
'code' => 'M01',
'label' => 'Le Gaulois',
],
'is_seasonal' => false,
'weight' => [
'netWeight' => 1000,
'grossWeight' => 1100,
'theoreticalAverage' => 1050,
],
'nutriscore' => [
'grade' => 'A',
],
'storage_condition' => [
'instructions' => 'À conserver entre 0°C et 4°C',
],
'additives' => [
['code' => 'E300', 'label' => 'Acide ascorbique'],
],
'compo_id' => (string) fake()->numberBetween(10000, 99999),
];
}
}