L14 Abrechnungsübersicht: Datenmodell, Migration, Rechte und Modul

Neue Tenant-Tabellen work_order_milestones und billing_records (RLS, TENANT_MODELS, PII-Felder), Partial-Unique-Indizes je Quelle, billing_record_id an time_entries/material_usages. Rechte billing:read/billing:write (Backoffice, Mandantenadmin), Modul billing, Events milestone.*.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 10:35:20 +02:00
co-authored by Claude Opus 5
parent 9b087168d1
commit 6358d5762c
11 changed files with 220 additions and 3 deletions
+3
View File
@@ -123,6 +123,9 @@ const TENANT_MODELS = new Set<string>([
"Notification",
"SyncOperation",
"AiGeneration",
// L14 Abrechnungsübersicht
"WorkOrderMilestone",
"BillingRecord",
// WebAuthnCredential/Identity sind identitäts-global (kein tenant_id) → NICHT hier.
// Craftvia-Fachmodelle hier ergänzen — UND in src/server/backup/topology.ts
// (TENANT_MODELS) sowie per `SELECT enable_tenant_rls('<table>')` in der Migration