diff --git a/database/factories/ArcadiaBrandFactory.php b/database/factories/ArcadiaBrandFactory.php deleted file mode 100644 index 611b966..0000000 --- a/database/factories/ArcadiaBrandFactory.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -final class ArcadiaBrandFactory extends Factory -{ - protected $model = ArcadiaBrand::class; - - /** - * @return array - */ - #[\Override] - public function definition(): array - { - return [ - 'code' => fake()->unique()->numberBetween(100, 999), - 'libelle' => fake()->company(), - ]; - } -} diff --git a/database/factories/BrandFactory.php b/database/factories/BrandFactory.php index 46a8b59..0c9333b 100644 --- a/database/factories/BrandFactory.php +++ b/database/factories/BrandFactory.php @@ -7,7 +7,6 @@ namespace Database\Factories; use Domain\Models\ValueObjects\Brand\BrandName; use Domain\Services\BrandCodeGenerator; use Illuminate\Database\Eloquent\Factories\Factory; -use Infra\Database\Models\ArcadiaBrand; use Infra\Database\Models\Brand; use Ramsey\Uuid\Uuid; @@ -31,7 +30,7 @@ final class BrandFactory extends Factory return [ 'id' => Uuid::uuid7()->toString(), 'name' => $name, - 'arcadia_id' => ArcadiaBrand::factory(), + 'arcadia_id' => fake()->unique()->numberBetween(1, 9999), 'uwil_public_id' => $code->value, ]; } diff --git a/database/factories/EmployeeFactory.php b/database/factories/EmployeeFactory.php deleted file mode 100644 index db46758..0000000 --- a/database/factories/EmployeeFactory.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -final class EmployeeFactory extends Factory -{ - protected $model = Employee::class; - - /** - * @return array - */ - #[\Override] - public function definition(): array - { - return [ - 'public_employee_number' => (string) fake()->unique()->numberBetween(1000000, 9999999), - 'last_name' => strtoupper(fake()->lastName()), - 'first_name' => fake()->firstName(), - 'start_date' => '2024-01-15', - 'end_date' => null, - 'planned_end_date' => null, - 'establishment' => '01', - 'site' => 'LDCSER', - 'service' => '097', - 'created_at' => now()->toDateTimeString(), - 'updated_at' => now()->toDateTimeString(), - ]; - } -} diff --git a/database/factories/IncoCompoFactory.php b/database/factories/IncoCompoFactory.php deleted file mode 100644 index 6e52cdf..0000000 --- a/database/factories/IncoCompoFactory.php +++ /dev/null @@ -1,213 +0,0 @@ - - */ -final class IncoCompoFactory extends Factory -{ - protected $model = IncoCompo::class; - - /** - * @return array - */ - #[\Override] - public function definition(): array - { - $idInco = (string) fake()->unique()->numberBetween(10000, 99999); - - return [ - 'id' => $idInco, - 'id_inco' => $idInco, - 'identification' => [ - 'name' => 'Poulet Rôti 1kg', - 'number' => $idInco, - 'source' => 'LDC', - ], - 'energy' => [ - 'reference' => ['size' => '100g', 'energyKj' => '500', 'energyKcal' => '120'], - 'portion' => ['size' => '150g', 'energyKj' => '750', 'energyKcal' => '180'], - ], - 'reference_macronutrients' => [ - 'fat' => ['amount' => '10.0', 'precision' => null], - 'saturatedFat' => ['amount' => '2.5', 'precision' => null], - 'carbohydrates' => ['amount' => '0.5', 'precision' => null], - 'sugars' => ['amount' => '0.1', 'precision' => null], - 'fiber' => ['amount' => '0.0', 'precision' => null], - 'protein' => ['amount' => '22.0', 'precision' => null], - 'salt' => ['amount' => '1.2', 'precision' => null], - 'sodium' => '0.48', - ], - 'portion_macronutrients' => [ - 'fat' => ['amount' => '15.0', 'precision' => null], - 'saturatedFat' => ['amount' => '3.75', 'precision' => null], - 'carbohydrates' => ['amount' => '0.75', 'precision' => null], - 'sugars' => ['amount' => '0.15', 'precision' => null], - 'fiber' => ['amount' => '0.0', 'precision' => null], - 'protein' => ['amount' => '33.0', 'precision' => null], - 'salt' => ['amount' => '1.8', 'precision' => null], - 'sodium' => '0.72', - ], - 'fresh_produce_and_nuts' => [ - 'reference' => ['fruits' => '0', 'nuts' => '0'], - 'portion' => ['fruits' => '0', 'nuts' => '0'], - 'freshFnlPercentage' => ['value' => '0'], - 'fruitsPercentage' => ['value' => '0'], - ], - 'reference_intakes' => [ - 'energyE14' => ['value' => '6%'], - 'energyKj' => ['value' => '6%'], - 'fat' => ['value' => '14%'], - 'saturatedFat' => ['value' => '13%'], - 'carbohydrates' => ['value' => '0%'], - 'sugars' => ['value' => '0%'], - 'protein' => ['value' => '44%'], - 'salt' => ['value' => '20%'], - 'portionAmount' => '150g', - 'proteinToLipidRatio' => '2.2', - ], - 'nutri_score' => [ - 'class' => 'A', - 'score' => -2, - 'isFnl' => false, - 'status' => 'valid', - ], - 'nutri_score_points' => [ - 'energyPoints' => '1', - 'saturatedFatPoints' => '1', - 'sugarsPoints' => '0', - 'saltPoints' => '2', - 'fiberPoints' => '0', - 'proteinPoints' => '5', - 'freshFnlPoints' => '0', - ], - 'minerals' => [ - 'calcium' => '12.0', - 'magnesium' => '25.0', - 'potassium' => '300.0', - 'phosphorus' => '200.0', - 'chloride' => '0.0', - 'iron' => '1.1', - 'zinc' => '1.5', - 'copper' => '0.1', - 'manganese' => '0.0', - 'selenium' => '15.0', - 'iodine' => '0.0', - 'chromium' => '0.0', - 'molybdenum' => '0.0', - 'sulfur' => '0.0', - 'nitrates' => '0.0', - ], - 'vitamins' => [ - 'vitaminA' => '0.0', - 'vitaminB6' => '0.4', - 'vitaminB12' => '0.5', - 'vitaminC' => '0.0', - 'vitaminD' => '0.0', - 'vitaminE' => '0.2', - 'vitaminK' => '0.0', - 'cholecalciferol' => '0.0', - 'niacin' => '8.0', - 'riboflavin' => '0.2', - 'thiamine' => '0.1', - 'pantothenicAcid' => '1.0', - 'biotin' => '0.0', - 'folates' => '10.0', - ], - 'carbohydrates_detail' => [ - 'starch' => '0.0', - 'maltodextrin' => '0.0', - 'sucrose' => '0.0', - 'glucose' => '0.0', - 'lactose' => '0.0', - 'maltose' => '0.0', - 'galactose' => '0.0', - 'carbohydrateHydrates' => '0.0', - 'boundFructose' => '0.0', - 'freeFructose' => '0.0', - 'oligosaccharides' => '0.0', - 'polyols' => '0.0', - 'solubleFiber' => '0.0', - 'inositol' => '0.0', - ], - 'fatty_acids' => [ - 'fd' => '0.0', - 'cholesterol' => '70.0', - 'transFat' => '0.1', - 'formic' => '0.0', - 'acetic' => '0.0', - 'propionic' => '0.0', - 'butyric' => '0.0', - 'valeric' => '0.0', - 'caproic' => '0.0', - 'enanthic' => '0.0', - 'caprylic' => '0.0', - 'pelargonic' => '0.0', - 'capric' => '0.0', - 'undecylic' => '0.0', - 'lauric' => '0.0', - 'tridecylic' => '0.0', - 'myristic' => '0.1', - 'pentadecylic' => '0.0', - 'f16d0' => '0.0', - 'margaric' => '0.0', - 'stearic' => '0.8', - 'arachidic' => '0.0', - 'heneicosylic' => '0.0', - 'behenic' => '0.0', - 'tricosylic' => '0.0', - 'lignoceric' => '0.0', - 'carboceric' => '0.0', - 'cerotic' => '0.0', - 'ceroplastic' => '0.0', - 'montanic' => '0.0', - 'nonacosylic' => '0.0', - 'melissic' => '0.0', - 'laceric' => '0.0', - 'hentriacontylic' => '0.0', - 'hextriacontylic' => '0.0', - 'heptatriacontylic' => '0.0', - 'octatriacontylic' => '0.0', - 'nonadylie' => '0.0', - 'psyllic' => '0.0', - 'palmitic' => '1.5', - 'oleic' => '2.0', - 'f18d' => '0.0', - 'f19d' => '0.0', - 'f11eico' => '0.0', - 'geddic' => '0.0', - 'erucic' => '0.0', - 'nervonic' => '0.0', - 'hyenic' => '0.0', - 'amscis' => '0.0', - 'f18d2cn6' => '0.5', - 'f18d3n3' => '0.1', - 'f20d4' => '0.0', - 'f20d5n3' => '0.0', - 'f22d6n3' => '0.0', - 'fapun3' => '0.0', - 'fapun6' => '0.0', - 'fapun9' => '0.0', - 'fapucis' => '0.0', - 'fapulc' => '0.0', - ], - 'amino_acids' => [ - 'essentialAminoAcids' => '8.5', - 'caseins' => '0.0', - 'wheyProtein' => '0.0', - ], - 'special_compounds' => [ - 'choline' => '60.0', - 'carnitine' => '5.0', - 'taurine' => '0.0', - 'nucleotides' => '0.0', - ], - ]; - } -} diff --git a/database/factories/IncoSheetFactory.php b/database/factories/IncoSheetFactory.php deleted file mode 100644 index 4bb2169..0000000 --- a/database/factories/IncoSheetFactory.php +++ /dev/null @@ -1,87 +0,0 @@ - - */ -final class IncoSheetFactory extends Factory -{ - protected $model = IncoSheet::class; - - /** - * @return array - */ - #[\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' => 1, - '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), - ]; - } - - #[\Override] - public function configure(): static - { - return $this->afterCreating(function (IncoSheet $sheet): void { - $raw = is_array($sheet->brand) ? $sheet->brand : []; - $code = isset($raw['code']) && is_numeric($raw['code']) ? (int) $raw['code'] : 1; - $label = isset($raw['label']) && is_string($raw['label']) ? $raw['label'] : (string) ($raw['libelle'] ?? 'Le Gaulois'); - - ArcadiaBrand::query()->firstOrCreate( - ['code' => $code], - ['libelle' => $label] - ); - }); - } -} diff --git a/database/migrations/2026_08_11_000000_create_employees_table.php b/database/migrations/2026_08_11_000000_create_employees_table.php deleted file mode 100644 index 7de009a..0000000 --- a/database/migrations/2026_08_11_000000_create_employees_table.php +++ /dev/null @@ -1,50 +0,0 @@ -environment('local', 'testing')) { - $schema->dropIfExists('employees'); - } - - $schema->create('employees', function (Blueprint $table) { - $table->string('public_employee_number', 8)->primary(); - $table->string('last_name'); - $table->string('first_name'); - $table->date('start_date'); - $table->date('end_date')->nullable(); - $table->date('planned_end_date')->nullable(); - $table->string('establishment', 20); - $table->string('site', 20); - $table->string('service', 20); - $table->dateTime('created_at')->nullable(); - $table->dateTime('updated_at')->nullable(); - - $table->index('site'); - $table->index('service'); - $table->index('establishment'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::connection(Config::string('database.arcadia_meta_model')) - ->dropIfExists('employees'); - } -}; diff --git a/database/migrations/2026_08_14_000001_create_inco_sheets_table.php b/database/migrations/2026_08_14_000001_create_inco_sheets_table.php deleted file mode 100644 index d86c775..0000000 --- a/database/migrations/2026_08_14_000001_create_inco_sheets_table.php +++ /dev/null @@ -1,59 +0,0 @@ -environment('local', 'testing')) { - $schema->dropIfExists('inco_sheets'); - } - - $schema->create('inco_sheets', function (Blueprint $table) { - $table->string('id')->primary(); - $table->string('name'); - $table->string('label'); - $table->text('description'); - $table->json('allegations'); - $table->text('sell_arguments'); - $table->text('preparation_advices'); - $table->text('tips')->nullable(); - $table->string('sell_familly')->nullable(); - $table->json('ingredients'); - $table->json('portions')->nullable(); - $table->json('allergens'); - $table->json('brand'); - $table->boolean('is_seasonal')->default(false); - $table->json('weight')->nullable(); - $table->json('nutriscore')->nullable(); - $table->json('storage_condition')->nullable(); - $table->json('additives'); - $table->string('compo_id')->nullable(); - $table->dateTime('created_at')->nullable(); - $table->dateTime('updated_at')->nullable(); - - $table->index('name'); - $table->index('compo_id'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::connection(Config::string('database.arcadia_meta_model')) - ->dropIfExists('inco_sheets'); - } -}; diff --git a/database/migrations/2026_08_14_000002_create_inco_compos_table.php b/database/migrations/2026_08_14_000002_create_inco_compos_table.php deleted file mode 100644 index 62b811d..0000000 --- a/database/migrations/2026_08_14_000002_create_inco_compos_table.php +++ /dev/null @@ -1,55 +0,0 @@ -environment('local', 'testing')) { - $schema->dropIfExists('inco_compos'); - } - - $schema->create('inco_compos', function (Blueprint $table) { - $table->string('id')->primary(); - $table->string('id_inco'); - $table->json('identification'); - $table->json('energy'); - $table->json('reference_macronutrients'); - $table->json('portion_macronutrients'); - $table->json('fresh_produce_and_nuts'); - $table->json('reference_intakes'); - $table->json('nutri_score'); - $table->json('nutri_score_points'); - $table->json('minerals'); - $table->json('vitamins'); - $table->json('carbohydrates_detail'); - $table->json('fatty_acids'); - $table->json('amino_acids'); - $table->json('special_compounds'); - $table->dateTime('created_at')->nullable(); - $table->dateTime('updated_at')->nullable(); - - $table->index('id_inco'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::connection(Config::string('database.arcadia_meta_model')) - ->dropIfExists('inco_compos'); - } -}; diff --git a/database/migrations/2026_08_20_114010_create_arcadia_brands_table.php b/database/migrations/2026_08_20_114010_create_arcadia_brands_table.php deleted file mode 100644 index a0aed76..0000000 --- a/database/migrations/2026_08_20_114010_create_arcadia_brands_table.php +++ /dev/null @@ -1,38 +0,0 @@ -environment('local', 'testing')) { - $schema->dropIfExists('arcadia_brands'); - } - - $schema->create('arcadia_brands', function (Blueprint $table) { - $table->integer('code')->unsigned()->primary(); - $table->string('libelle'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - $schema = Schema::connection(Config::string('database.arcadia_meta_model')); - - $schema->dropIfExists('arcadia_brands'); - } -}; diff --git a/database/seeders/BrandSeeder.php b/database/seeders/BrandSeeder.php index 4b4037f..9ea2f06 100644 --- a/database/seeders/BrandSeeder.php +++ b/database/seeders/BrandSeeder.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Database\Seeders; use Illuminate\Database\Seeder; -use Infra\Database\Models\ArcadiaBrand; use Infra\Database\Models\Brand; use Ramsey\Uuid\Uuid; @@ -27,11 +26,6 @@ final class BrandSeeder extends Seeder ]; foreach ($brands as $brandData) { - ArcadiaBrand::query()->updateOrCreate( - ['code' => $brandData['code']], - ['libelle' => $brandData['libelle']], - ); - Brand::query()->firstOrCreate( ['arcadia_id' => $brandData['code']], [ diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index a3b1949..0cf433d 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -15,7 +15,6 @@ final class DatabaseSeeder extends Seeder { $this->call([ EmployeeSeeder::class, - IncoSheetSeeder::class, ApiClientSeeder::class, BrandSeeder::class, ArcadiaReplicateSeeder::class, diff --git a/database/seeders/EmployeeSeeder.php b/database/seeders/EmployeeSeeder.php deleted file mode 100644 index fff68b4..0000000 --- a/database/seeders/EmployeeSeeder.php +++ /dev/null @@ -1,84 +0,0 @@ -upsert([ - [ - 'public_employee_number' => '01155902', - 'last_name' => 'DOE', - 'first_name' => 'John', - 'start_date' => '2024-01-15', - 'end_date' => null, - 'planned_end_date' => null, - 'establishment' => '01', - 'site' => 'LDCSER', - 'service' => '097', - 'created_at' => $timestamp, - 'updated_at' => $timestamp, - ], - [ - 'public_employee_number' => '1234567', - 'last_name' => 'MARTIN', - 'first_name' => 'Alice', - 'start_date' => '2024-01-08', - 'end_date' => null, - 'planned_end_date' => null, - 'establishment' => 'LY', - 'site' => 'LDCSER', - 'service' => '101', - 'created_at' => $timestamp, - 'updated_at' => $timestamp, - ], - [ - 'public_employee_number' => '2345678', - 'last_name' => 'DUPONT', - 'first_name' => 'Louis', - 'start_date' => '2023-05-15', - 'end_date' => null, - 'planned_end_date' => '2026-12-31', - 'establishment' => 'PA', - 'site' => 'SLELA', - 'service' => '097', - 'created_at' => $timestamp, - 'updated_at' => $timestamp, - ], - [ - 'public_employee_number' => '3456789', - 'last_name' => 'BERNARD', - 'first_name' => 'Nora', - 'start_date' => '2022-09-01', - 'end_date' => null, - 'planned_end_date' => null, - 'establishment' => 'BO', - 'site' => 'DDE', - 'service' => '205', - 'created_at' => $timestamp, - 'updated_at' => $timestamp, - ], - ], ['public_employee_number'], [ - 'last_name', - 'first_name', - 'start_date', - 'end_date', - 'planned_end_date', - 'establishment', - 'site', - 'service', - 'updated_at', - ]); - } -} diff --git a/database/seeders/IncoSheetSeeder.php b/database/seeders/IncoSheetSeeder.php deleted file mode 100644 index 932ad49..0000000 --- a/database/seeders/IncoSheetSeeder.php +++ /dev/null @@ -1,63 +0,0 @@ - '1', - 'compo_id' => '1', - 'name' => 'Poulet Rôti 1kg', - 'label' => 'Poulet Rôti aux Herbes', - ], - [ - 'id' => '2', - 'compo_id' => '2', - 'name' => 'Salade Niçoise 300g', - 'label' => 'Salade Niçoise', - ], - [ - 'id' => '3', - 'compo_id' => '3', - 'name' => 'Lasagnes Bolognaise 400g', - 'label' => 'Lasagnes Bolognaise', - ], - [ - 'id' => '4', - 'compo_id' => null, - 'name' => 'Pain de Mie Brut 500g', - 'label' => 'Pain de Mie Nature', - ], - ]; - - foreach ($sheetDataList as $data) { - if (! IncoSheet::query()->where('id', $data['id'])->exists()) { - IncoSheet::factory()->create([ - 'id' => $data['id'], - 'compo_id' => $data['compo_id'], - 'name' => $data['name'], - 'label' => $data['label'], - ]); - } - - if ($data['compo_id'] !== null && ! IncoCompo::query()->where('id', $data['compo_id'])->exists()) { - IncoCompo::factory()->create([ - 'id' => $data['compo_id'], - 'id_inco' => $data['compo_id'], - ]); - } - } - } -} diff --git a/src/Infra/Database/Models/ArcadiaBrand.php b/src/Infra/Database/Models/ArcadiaBrand.php deleted file mode 100644 index 55487ff..0000000 --- a/src/Infra/Database/Models/ArcadiaBrand.php +++ /dev/null @@ -1,61 +0,0 @@ - */ - use HasFactory; - - protected static function newFactory(): ArcadiaBrandFactory - { - return ArcadiaBrandFactory::new(); - } - - #[\Override] - public function getConnectionName(): string - { - return resolve(ArcadiaStorageConfig::class)->databaseConnection; - } - - protected $table = 'arcadia_brands'; - - protected $primaryKey = 'code'; - - public $incrementing = false; - - /** @var string */ - protected $keyType = 'int'; - - public $timestamps = false; - - /** @var list */ - protected $fillable = [ - 'code', - 'libelle', - ]; - - /** @return array */ - #[\Override] - protected function casts(): array - { - return [ - 'code' => 'integer', - ]; - } -} diff --git a/src/Infra/Database/Models/Employee.php b/src/Infra/Database/Models/Employee.php deleted file mode 100644 index 5bcf9ee..0000000 --- a/src/Infra/Database/Models/Employee.php +++ /dev/null @@ -1,82 +0,0 @@ - */ - use HasFactory; - - protected static function newFactory(): EmployeeFactory - { - return EmployeeFactory::new(); - } - - #[\Override] - public function getConnectionName(): string - { - return resolve(ArcadiaStorageConfig::class)->databaseConnection; - } - - protected $table = 'employees'; - - protected $primaryKey = 'public_employee_number'; - - public $incrementing = false; - - public $timestamps = false; - - protected $keyType = 'string'; - - protected $fillable = [ - 'public_employee_number', - 'last_name', - 'first_name', - 'start_date', - 'end_date', - 'planned_end_date', - 'establishment', - 'site', - 'service', - 'created_at', - 'updated_at', - ]; - - /** @return array */ - #[\Override] - protected function casts(): array - { - return [ - 'start_date' => UtcDateTimeCast::class, - 'end_date' => UtcDateTimeCast::class, - 'planned_end_date' => UtcDateTimeCast::class, - 'created_at' => UtcDateTimeCast::class, - 'updated_at' => UtcDateTimeCast::class, - ]; - } -} diff --git a/src/Infra/Database/Models/IncoCompo.php b/src/Infra/Database/Models/IncoCompo.php deleted file mode 100644 index 4e99481..0000000 --- a/src/Infra/Database/Models/IncoCompo.php +++ /dev/null @@ -1,104 +0,0 @@ - $identification - * @property array $energy - * @property array $reference_macronutrients - * @property array $portion_macronutrients - * @property array $fresh_produce_and_nuts - * @property array $reference_intakes - * @property array $nutri_score - * @property array $nutri_score_points - * @property array $minerals - * @property array $vitamins - * @property array $carbohydrates_detail - * @property array $fatty_acids - * @property array $amino_acids - * @property array $special_compounds - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * - * @method static \Database\Factories\IncoCompoFactory factory($count = null, $state = []) - * - * @mixin \Eloquent - */ -final class IncoCompo extends Model -{ - /** @use HasFactory */ - use HasFactory; - - protected static function newFactory(): IncoCompoFactory - { - return IncoCompoFactory::new(); - } - - #[\Override] - public function getConnectionName(): string - { - return resolve(ArcadiaStorageConfig::class)->databaseConnection; - } - - protected $table = 'inco_compos'; - - protected $primaryKey = 'id'; - - public $incrementing = false; - - public $timestamps = false; - - protected $keyType = 'string'; - - protected $fillable = [ - 'id', - 'id_inco', - 'identification', - 'energy', - 'reference_macronutrients', - 'portion_macronutrients', - 'fresh_produce_and_nuts', - 'reference_intakes', - 'nutri_score', - 'nutri_score_points', - 'minerals', - 'vitamins', - 'carbohydrates_detail', - 'fatty_acids', - 'amino_acids', - 'special_compounds', - ]; - - /** @return array */ - #[\Override] - protected function casts(): array - { - return [ - 'identification' => 'array', - 'energy' => 'array', - 'reference_macronutrients' => 'array', - 'portion_macronutrients' => 'array', - 'fresh_produce_and_nuts' => 'array', - 'reference_intakes' => 'array', - 'nutri_score' => 'array', - 'nutri_score_points' => 'array', - 'minerals' => 'array', - 'vitamins' => 'array', - 'carbohydrates_detail' => 'array', - 'fatty_acids' => 'array', - 'amino_acids' => 'array', - 'special_compounds' => 'array', - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - ]; - } -} diff --git a/src/Infra/Database/Models/IncoSheet.php b/src/Infra/Database/Models/IncoSheet.php deleted file mode 100644 index da2371c..0000000 --- a/src/Infra/Database/Models/IncoSheet.php +++ /dev/null @@ -1,106 +0,0 @@ - $allegations - * @property string $sell_arguments - * @property string $preparation_advices - * @property string|null $tips - * @property string|null $sell_familly - * @property array $ingredients - * @property array|null $portions - * @property array $allergens - * @property array $brand - * @property bool $is_seasonal - * @property array|null $weight - * @property array|null $nutriscore - * @property array|null $storage_condition - * @property array $additives - * @property string|null $compo_id - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * - * @method static \Database\Factories\IncoSheetFactory factory($count = null, $state = []) - * - * @mixin \Eloquent - */ -final class IncoSheet extends Model -{ - /** @use HasFactory */ - use HasFactory; - - protected static function newFactory(): IncoSheetFactory - { - return IncoSheetFactory::new(); - } - - #[\Override] - public function getConnectionName(): string - { - return resolve(ArcadiaStorageConfig::class)->databaseConnection; - } - - protected $table = 'inco_sheets'; - - protected $primaryKey = 'id'; - - public $incrementing = false; - - public $timestamps = false; - - protected $keyType = 'string'; - - protected $fillable = [ - 'id', - 'name', - 'label', - 'description', - 'allegations', - 'sell_arguments', - 'preparation_advices', - 'tips', - 'sell_familly', - 'ingredients', - 'portions', - 'allergens', - 'brand', - 'is_seasonal', - 'weight', - 'nutriscore', - 'storage_condition', - 'additives', - 'compo_id', - ]; - - /** @return array */ - #[\Override] - protected function casts(): array - { - return [ - 'allegations' => 'array', - 'ingredients' => 'array', - 'portions' => 'array', - 'allergens' => 'array', - 'brand' => 'array', - 'is_seasonal' => 'boolean', - 'weight' => 'array', - 'nutriscore' => 'array', - 'storage_condition' => 'array', - 'additives' => 'array', - 'created_at' => 'datetime', - 'updated_at' => 'datetime', - ]; - } -} diff --git a/tests/Integration/Database/Seeders/IncoSheetSeederTest.php b/tests/Integration/Database/Seeders/IncoSheetSeederTest.php deleted file mode 100644 index d155bf3..0000000 --- a/tests/Integration/Database/Seeders/IncoSheetSeederTest.php +++ /dev/null @@ -1,30 +0,0 @@ -run(); - - // THEN - expect(IncoSheet::count())->toBe(4) - ->and(IncoCompo::count())->toBe(3) - ->and(IncoSheet::query()->whereNull('compo_id')->count())->toBe(1); - }); -});