feat: Variantenmanagement — Sub-Projekte mit GAP-Analyse

Backend:
- parent_project_id auf iace_projects (DB + Go Struct)
- POST/GET /variants + GET /variant-gap Endpoints
- GAP-Analyse: Differenz Hazards/Massnahmen/Kategorien

Frontend:
- VariantPanel auf Projekt-Uebersicht
- Variante erstellen Dialog
- Sidebar-Anzeige (Variantenanzahl / Basis-Link)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-09 10:47:01 +02:00
parent 2143840ee7
commit 8682522212
8 changed files with 592 additions and 11 deletions
@@ -12,6 +12,7 @@ import (
// CreateProjectRequest is the API request for creating a new IACE project
type CreateProjectRequest struct {
ParentProjectID *uuid.UUID `json:"parent_project_id,omitempty"`
MachineName string `json:"machine_name" binding:"required"`
MachineType string `json:"machine_type" binding:"required"`
Manufacturer string `json:"manufacturer" binding:"required"`
@@ -199,6 +200,28 @@ type ValidateMitigationHierarchyResponse struct {
Warnings []string `json:"warnings,omitempty"`
}
// VariantGap compares a variant project against its base project
type VariantGap struct {
BaseProject ProjectSummary `json:"base_project"`
Variant ProjectSummary `json:"variant"`
Gap GapDetail `json:"gap"`
}
// ProjectSummary is a lightweight project view for gap comparisons
type ProjectSummary struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
HazardCount int `json:"hazard_count"`
MeasureCount int `json:"measure_count"`
}
// GapDetail describes the delta between variant and base project
type GapDetail struct {
AdditionalHazards int `json:"additional_hazards"`
AdditionalMeasures int `json:"additional_measures"`
CategoriesAffected []string `json:"categories_affected"`
}
// CompletenessGate represents a single gate in the project completeness checklist
type CompletenessGate struct {
ID string `json:"id"`