ldc-arcadia-api/database/arcadia-replicate/Factories/Refp/IncoCompoFactory.php
Jérémy Munsch 1842223ddc
refactor(database): improve replicated factories, seeders, and config injection
- AbstractTableFactory delegates connection resolution without hardcoded config keys
- Enforce mandatory connection parameter on Migrator without Infra dependencies
- Inject ArcadiaStorageConfig, AppConfig, and HmacAuthConfig into services, seeders, and health checkers
- Enhance factories and seeders with helper methods (truncate, count, query, new)
- Clean up covers annotations on database seeders integration tests
2026-08-26 17:29:13 +02:00

277 lines
10 KiB
PHP

<?php
declare(strict_types=1);
namespace Database\ArcadiaReplicate\Factories\Refp;
use Database\ArcadiaReplicate\Factories\AbstractTableFactory;
use Database\ArcadiaReplicate\Tables\Refp\IncoCompoTable;
final class IncoCompoFactory extends AbstractTableFactory
{
public static function table(): string
{
return IncoCompoTable::class;
}
/**
* @return array<string, mixed>
*/
public function definition(): array
{
$id = fake()->unique()->numberBetween(10000, 99999);
return [
'ID' => $id,
'ID_INCO' => $id,
'NUMERO' => (string) $id,
'NOM' => 'BQ 2 STEAKS DINDE S/ATM LG OCB',
'UVERSION' => 1,
'TAILLE_REF' => 100.0,
'VAL_ENERG_KJ_R' => 522,
'VAL_ENERG_KCAL_R' => 124,
'MAT_GRASS_R' => 4.6,
'AGS_R' => 1.5,
'GLUCIDES_R' => 0.7,
'SUCRE_R' => 0.0,
'FIB_ALIM_R' => 0.0,
'PROTEINE_R' => 20.0,
'SEL_R' => 0.18,
'TAILLE_PORT' => 100.0,
'VAL_ENERG_KJ_P' => 522,
'VAL_ENERG_KCAL_P' => 124,
'MAT_GRASS_P' => 4.6,
'AGS_P' => 1.5,
'GLUCIDES_P' => 0.7,
'SUCRE_P' => 0.0,
'FIB_ALIM_P' => 0.0,
'PROTEINE_P' => 20.0,
'SEL_P' => 0.18,
'POURCENT_APPORT_REF_E14_P' => 6.0,
'POURCENT_APPORT_REF_KJO_P' => 6.0,
'POURCENT_APPORT_REF_FAT_P' => 7.0,
'POURCENT_APPORT_REF_FATSAT_P' => 8.0,
'POURCENT_APPORT_REF_CHOVAL_P' => 0.0,
'POURCENT_APPORT_REF_SUGAR_P' => 0.0,
'POURCENT_APPORT_REF_PRO_P' => 40.0,
'POURCENT_APPORT_REF_SALTEQ_P' => 3.0,
'APPORT_PORT' => 'Apport de référence pour un adulte type (8400Kj-2000Kcal)',
'MAT_GRASS_R_PREC' => null,
'AGS_R_PREC' => null,
'GLUCIDES_R_PREC' => null,
'SUCRE_R_PREC' => null,
'FIB_ALIM_R_PREC' => null,
'PROTEINE_R_PREC' => null,
'SEL_R_PREC' => null,
'P_SUR_L' => '4.35',
'COMPOSANTE_P' => 5,
'COMPOSANTE_N' => 2,
'FRUITS_R' => 0.0,
'SODIUM_P' => 0.07,
'SODIUM_R' => 0.07,
'SCORE_NUTRI' => -3,
'CLASSEMENT' => 'A',
'FRUITS_COQUE_SECH_R' => 0.0,
'POURCENT_FRUITS' => 0.0,
'SOURCE' => 1,
'SCORE_NUTRI_2022' => -5,
'NUTRI_SCORE_2022' => 'A',
'FNL_FRAIS' => 0.0,
'VIANDE_ROUGE' => 0,
'POURCENT_FNL_FRAIS' => 0.0,
];
}
public function steaksDinde(): self
{
return $this->state([
'ID' => 96504,
'ID_INCO' => 47789,
'NOM' => 'NUGGETS DE POULET DU VOLAILLER LE GAULOIS',
'VAL_ENERG_KJ_R' => 890,
'VAL_ENERG_KCAL_R' => 212,
'MAT_GRASS_R' => 9.5,
'AGS_R' => 1.8,
'GLUCIDES_R' => 16.0,
'SUCRE_R' => 0.8,
'FIB_ALIM_R' => 1.5,
'PROTEINE_R' => 15.0,
'SEL_R' => 1.10,
'CLASSEMENT' => 'B',
'NUTRI_SCORE_2022' => 'B',
]);
}
public function pouletFermierNoir(): self
{
return $this->state([
'ID' => 124503,
'ID_INCO' => 47996,
'NOM' => 'GESIERS ET FOIES CONFITS LE GAULOIS',
'VAL_ENERG_KJ_R' => 710,
'VAL_ENERG_KCAL_R' => 170,
'MAT_GRASS_R' => 8.5,
'AGS_R' => 2.8,
'GLUCIDES_R' => 0.5,
'SUCRE_R' => 0.2,
'PROTEINE_R' => 23.0,
'SEL_R' => 1.30,
'CLASSEMENT' => 'B',
'NUTRI_SCORE_2022' => 'B',
]);
}
public function pouletFermierLoue(): self
{
return $this->state([
'ID' => 124504,
'ID_INCO' => 4,
'NOM' => 'POULET FERMIER DE LOUE LABEL ROUGE',
'VAL_ENERG_KJ_R' => 620,
'VAL_ENERG_KCAL_R' => 148,
'MAT_GRASS_R' => 6.8,
'AGS_R' => 1.9,
'GLUCIDES_R' => 0.0,
'SUCRE_R' => 0.0,
'PROTEINE_R' => 21.5,
'SEL_R' => 0.15,
'CLASSEMENT' => 'A',
'NUTRI_SCORE_2022' => 'A',
]);
}
public function cordonBleuDinde(): self
{
return $this->state([
'ID' => 130101,
'ID_INCO' => 51201,
'NOM' => 'CORDON BLEU DE DINDE MAITRE COQ',
'VAL_ENERG_KJ_R' => 1010,
'VAL_ENERG_KCAL_R' => 242,
'MAT_GRASS_R' => 12.5,
'AGS_R' => 4.2,
'GLUCIDES_R' => 18.0,
'SUCRE_R' => 1.2,
'PROTEINE_R' => 14.0,
'SEL_R' => 1.45,
'CLASSEMENT' => 'D',
'NUTRI_SCORE_2022' => 'D',
]);
}
public function lasagnesBolognaise(): self
{
return $this->state([
'ID' => 140205,
'ID_INCO' => 62305,
'NOM' => 'LASAGNES A LA BOLOGNAISE PUR BOEUF MARIE',
'VAL_ENERG_KJ_R' => 590,
'VAL_ENERG_KCAL_R' => 141,
'MAT_GRASS_R' => 5.8,
'AGS_R' => 2.5,
'GLUCIDES_R' => 13.5,
'SUCRE_R' => 2.4,
'FIB_ALIM_R' => 1.2,
'PROTEINE_R' => 8.2,
'SEL_R' => 0.78,
'CLASSEMENT' => 'B',
'NUTRI_SCORE_2022' => 'B',
]);
}
public function nemsPoulet(): self
{
return $this->state([
'ID' => 150312,
'ID_INCO' => 73412,
'NOM' => 'NEMS AU POULET TRADITION D ASIE',
'VAL_ENERG_KJ_R' => 845,
'VAL_ENERG_KCAL_R' => 202,
'MAT_GRASS_R' => 8.2,
'AGS_R' => 1.6,
'GLUCIDES_R' => 23.0,
'SUCRE_R' => 2.1,
'PROTEINE_R' => 8.5,
'SEL_R' => 1.25,
'CLASSEMENT' => 'C',
'NUTRI_SCORE_2022' => 'C',
]);
}
public function emincesPouletRoti(): self
{
return $this->state([
'ID' => 160420,
'ID_INCO' => 84520,
'NOM' => 'EMINCES DE POULET ROTI REGHALAL',
'VAL_ENERG_KJ_R' => 480,
'VAL_ENERG_KCAL_R' => 114,
'MAT_GRASS_R' => 2.1,
'AGS_R' => 0.6,
'GLUCIDES_R' => 0.8,
'SUCRE_R' => 0.5,
'PROTEINE_R' => 23.0,
'SEL_R' => 1.40,
'CLASSEMENT' => 'A',
'NUTRI_SCORE_2022' => 'A',
]);
}
public function filetCanardSudOuest(): self
{
return $this->state([
'ID' => 170502,
'ID_INCO' => 48102,
'NOM' => 'MAGRET DE CANARD DU SUD OUEST LE GAULOIS',
'VAL_ENERG_KJ_R' => 790,
'VAL_ENERG_KCAL_R' => 189,
'MAT_GRASS_R' => 11.0,
'AGS_R' => 3.8,
'GLUCIDES_R' => 0.0,
'SUCRE_R' => 0.0,
'PROTEINE_R' => 22.5,
'SEL_R' => 0.12,
'CLASSEMENT' => 'A',
'NUTRI_SCORE_2022' => 'A',
]);
}
public function aiguillettesPouletThym(): self
{
return $this->state([
'ID' => 180640,
'ID_INCO' => 52340,
'NOM' => 'AIGUILLETTES DE POULET MARINES THYM CITRON MAITRE COQ',
'VAL_ENERG_KJ_R' => 495,
'VAL_ENERG_KCAL_R' => 118,
'MAT_GRASS_R' => 2.8,
'AGS_R' => 0.5,
'GLUCIDES_R' => 0.9,
'SUCRE_R' => 0.4,
'PROTEINE_R' => 22.0,
'SEL_R' => 0.95,
'CLASSEMENT' => 'A',
'NUTRI_SCORE_2022' => 'A',
]);
}
public function gratinDauphinois(): self
{
return $this->state([
'ID' => 190750,
'ID_INCO' => 63450,
'NOM' => 'GRATIN DAUPHINOIS A LA CREME FRAICHE MARIE',
'VAL_ENERG_KJ_R' => 680,
'VAL_ENERG_KCAL_R' => 163,
'MAT_GRASS_R' => 9.8,
'AGS_R' => 6.2,
'GLUCIDES_R' => 14.2,
'SUCRE_R' => 1.8,
'FIB_ALIM_R' => 1.6,
'PROTEINE_R' => 3.8,
'SEL_R' => 0.85,
'CLASSEMENT' => 'C',
'NUTRI_SCORE_2022' => 'C',
]);
}
}