Files
portal/app/database/factories/ImportUnknownStatusFactory.php
T
Дмитрий 8bc8c53a3b feat(import): Eloquent-модели ImportLog + ImportUnknownStatus
- 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>
2026-05-16 17:29:33 +03:00

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,
];
}
}