E3: Rechtstext-Versionierung in der DB (legal_documents)
Jede veroeffentlichte Fassung eines Rechtstexts ist eine Zeile mit type/version/effective_from — alte Fassungen sind unloeschbar, zukuenftige werden erst ab Stichtag wirksam (LegalDocument::current). Seeder legt die fuenf aktuellen Fassungen an (AGB 0.6, Datenschutz 0.3, Richtlinien 0.1, Meldeverfahren 0.1, Impressum 0.1). Die Unternehmer-Bestaetigung (T1neu) referenziert jetzt die konkrete Fassung (legal_document_id am Buchungsdatensatz, restrictOnDelete); AGB-Seite und Buchungs-Modal ziehen Version/Stand aus der DB. config/legal.php bleibt reiner Fallback. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
7624064ea0
commit
196f83a377
12 changed files with 294 additions and 11 deletions
37
database/factories/LegalDocumentFactory.php
Normal file
37
database/factories/LegalDocumentFactory.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\LegalDocument;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<LegalDocument>
|
||||
*/
|
||||
class LegalDocumentFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'type' => LegalDocument::TYPE_AGB,
|
||||
'version' => '0.'.fake()->unique()->numberBetween(1, 999),
|
||||
'effective_from' => today()->subDays(fake()->numberBetween(1, 365)),
|
||||
'note' => null,
|
||||
];
|
||||
}
|
||||
|
||||
public function agb(): static
|
||||
{
|
||||
return $this->state(['type' => LegalDocument::TYPE_AGB]);
|
||||
}
|
||||
|
||||
public function effectiveFrom(string $date): static
|
||||
{
|
||||
return $this->state(['effective_from' => $date]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue