/richtlinien rendert jetzt alle aktiven Kategorien aus der neuen rejection_categories-Tabelle (stabiler code als Anker, public_label/desc, optionale Beispiele) statt der statischen K1-K6-Liste. Kategorien werden nie geloescht, nur deaktiviert; neue Kategorien erscheinen ohne Textaenderung und ohne neue AGB-Version (AGB par. 7 Abs. 3 verweist nicht abschliessend). Seeder legt K1-K6 idempotent an; Versionszeile der Seite kommt aus legal_documents. Go-Live-Checkliste um beide Seeder ergaenzt. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
36 lines
862 B
PHP
36 lines
862 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\RejectionCategory;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<RejectionCategory>
|
|
*/
|
|
class RejectionCategoryFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'code' => 'K'.fake()->unique()->numberBetween(1, 999),
|
|
'public_label' => fake()->sentence(3),
|
|
'public_desc' => fake()->sentence(12),
|
|
'examples' => null,
|
|
'severity' => 'rot',
|
|
'rubric_ref' => null,
|
|
'active' => true,
|
|
'sort_order' => fake()->numberBetween(0, 100),
|
|
];
|
|
}
|
|
|
|
public function inactive(): static
|
|
{
|
|
return $this->state(['active' => false]);
|
|
}
|
|
}
|