8bc8c53a3b
- ImportLog: $attributes зеркалят DB DEFAULT'ов (status/entity_type/dry_run), CREATED_AT/UPDATED_AT=null (таблица использует started_at/finished_at), casts для mapping_config (array) и dry_run (boolean) - ImportUnknownStatus: scope unresolved() (whereNull mapped_to_slug), BelongsTo tenant - Фабрики ImportLogFactory + ImportUnknownStatusFactory - Тест ImportModelsTest (2/2, DatabaseTransactions, idempotent) - ide-helper:models перегенерирован под новые модели - phpstan-baseline регенерирован (квирк 25: TestCall::$tenant/$user) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
26 lines
614 B
PHP
26 lines
614 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\ImportUnknownStatus;
|
|
use App\Models\Tenant;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/** @extends Factory<ImportUnknownStatus> */
|
|
class ImportUnknownStatusFactory extends Factory
|
|
{
|
|
protected $model = ImportUnknownStatus::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'tenant_id' => Tenant::factory(),
|
|
'status_ru' => $this->faker->unique()->word(),
|
|
'occurrences' => $this->faker->numberBetween(1, 20),
|
|
'mapped_to_slug' => null,
|
|
];
|
|
}
|
|
}
|