AP1.4b: Gate-Checkliste, Verify, Reopen und Plan-Detail-UI
Deploy Development / deploy (push) Successful in 48s
Test Suite / pytest-backend (push) Successful in 1m36s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Deploy Development / deploy (push) Successful in 48s
Test Suite / pytest-backend (push) Successful in 1m36s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Kriterien mit waive/defer per Decision; Verify gegen Checkliste; Reopen active mit Audit; Schema 012. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e70e3196ec
commit
9bf6ccee36
17 files changed
+1607
-54
No files matched your search
@@ -0,0 +1,76 @@
|
||||
-- AP1.4b: Gate-Checkliste (Prüfplan pro RoadmapItem)
|
||||
|
||||
CREATE TABLE roadmap_item_criteria (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
tenant_id UUID NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
|
||||
roadmap_item_id UUID NOT NULL REFERENCES roadmap_items(id) ON DELETE CASCADE,
|
||||
sort_order INT NOT NULL DEFAULT 0,
|
||||
title TEXT NOT NULL,
|
||||
description TEXT NOT NULL DEFAULT '',
|
||||
criterion_kind VARCHAR(32) NOT NULL DEFAULT 'evidence_required'
|
||||
CHECK (criterion_kind IN ('manual', 'evidence_required', 'review_required', 'metric')),
|
||||
verification_hint TEXT NOT NULL DEFAULT '',
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'open'
|
||||
CHECK (status IN ('open', 'satisfied', 'waived', 'deferred', 'failed')),
|
||||
waived_or_deferred_decision_id UUID NULL REFERENCES decisions(id) ON DELETE SET NULL,
|
||||
satisfied_by_evidence_id UUID NULL REFERENCES evidence(id) ON DELETE SET NULL,
|
||||
satisfied_at TIMESTAMPTZ NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX idx_roadmap_criteria_item ON roadmap_item_criteria(tenant_id, roadmap_item_id);
|
||||
CREATE INDEX idx_roadmap_criteria_status ON roadmap_item_criteria(tenant_id, status);
|
||||
|
||||
-- Compat: Default-Kriterium pro bestehendem Plan-Element
|
||||
INSERT INTO roadmap_item_criteria (
|
||||
tenant_id, roadmap_item_id, sort_order, title, description, criterion_kind, status
|
||||
)
|
||||
SELECT
|
||||
ri.tenant_id,
|
||||
ri.id,
|
||||
0,
|
||||
'Gate allgemein',
|
||||
COALESCE(NULLIF(ri.goal_description, ''), 'Akzeptierter Nachweis oder abgeschlossenes Review am Plan-Element.'),
|
||||
'evidence_required',
|
||||
'open'
|
||||
FROM roadmap_items ri;
|
||||
|
||||
-- Bereits vorhandene accepted Evidence → Default-Kriterium satisfied
|
||||
UPDATE roadmap_item_criteria ric
|
||||
SET
|
||||
status = 'satisfied',
|
||||
satisfied_at = NOW(),
|
||||
satisfied_by_evidence_id = sub.evidence_id
|
||||
FROM (
|
||||
SELECT DISTINCT ON (ric2.id)
|
||||
ric2.id AS criterion_id,
|
||||
e.id AS evidence_id
|
||||
FROM roadmap_item_criteria ric2
|
||||
JOIN evidence e
|
||||
ON e.tenant_id = ric2.tenant_id
|
||||
AND e.roadmap_item_id = ric2.roadmap_item_id
|
||||
AND e.status = 'accepted'
|
||||
WHERE ric2.title = 'Gate allgemein'
|
||||
ORDER BY ric2.id, e.updated_at DESC
|
||||
) sub
|
||||
WHERE ric.id = sub.criterion_id;
|
||||
|
||||
-- Bereits reached Gates ohne Evidence: Review completed
|
||||
UPDATE roadmap_item_criteria ric
|
||||
SET status = 'satisfied', satisfied_at = NOW()
|
||||
FROM roadmap_items ri
|
||||
WHERE ric.roadmap_item_id = ri.id
|
||||
AND ric.tenant_id = ri.tenant_id
|
||||
AND ric.title = 'Gate allgemein'
|
||||
AND ric.status = 'open'
|
||||
AND ri.status = 'reached'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM reviews rev
|
||||
WHERE rev.tenant_id = ri.tenant_id
|
||||
AND rev.initiative_id IN (
|
||||
SELECT r.initiative_id FROM roadmaps r WHERE r.id = ri.roadmap_id
|
||||
)
|
||||
AND rev.status = 'completed'
|
||||
AND (rev.roadmap_item_id = ri.id OR rev.milestone_id = ri.id)
|
||||
);
|
||||
Reference in new issue
Block a user