Merge lane/planung in feature/craftvia-mvp
Konflikte gelöst (additiv): Benachrichtigungstexte (Zeiterfassung + Planung, JSON zusammengeführt), Event-Typen, Navigation, Empfänger-Felder, handle-event (reason inkl. rejectionReason + Planungsfelder), Smoke-Prüfungen (Teamleiter: Zeiten + Planung). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
-- L13 Planung: capacity planning + geocoding cache. Columns only (no new table → RLS unchanged,
|
||||
-- no TENANT_MODELS change). No personal references (no DSGVO pii-fields change).
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "order_types" ADD COLUMN "default_duration_minutes" INTEGER;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "sites" ADD COLUMN "geocode_query" TEXT,
|
||||
ADD COLUMN "geocode_status" TEXT,
|
||||
ADD COLUMN "geocoded_at" TIMESTAMP(3);
|
||||
|
||||
-- AlterTable
|
||||
-- Team = crew (Kolonne): capacity is the crew's working day in minutes, not person-hours.
|
||||
ALTER TABLE "teams" ADD COLUMN "daily_capacity_minutes" INTEGER NOT NULL DEFAULT 480,
|
||||
ADD COLUMN "working_days" INTEGER NOT NULL DEFAULT 31;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "work_orders" ADD COLUMN "planned_duration_minutes" INTEGER;
|
||||
|
||||
-- Backfill: default durations of the standard order types (spec §10.2) for existing tenants.
|
||||
UPDATE "order_types" SET "default_duration_minutes" = CASE "key"
|
||||
WHEN 'montage' THEN 480
|
||||
WHEN 'reparatur' THEN 180
|
||||
WHEN 'wartung' THEN 120
|
||||
WHEN 'stoerung' THEN 120
|
||||
WHEN 'notdienst' THEN 120
|
||||
WHEN 'besichtigung' THEN 60
|
||||
WHEN 'abnahme' THEN 60
|
||||
WHEN 'nacharbeit' THEN 120
|
||||
END
|
||||
WHERE "default_duration_minutes" IS NULL
|
||||
AND "key" IN ('montage', 'reparatur', 'wartung', 'stoerung', 'notdienst', 'besichtigung', 'abnahme', 'nacharbeit');
|
||||
Reference in New Issue
Block a user