feat(iace): "Neu initialisieren" Button + DeleteHazard
- POST /initialize?force=true loescht bestehende Hazards + Mitigations und erstellt sie neu mit aktuellen Betriebszustaenden - Orange "Neu initialisieren" Button auf Interview-Seite (mit Confirm-Dialog) - DeleteHazard Store-Methode (kaskadiert Risk Assessments) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -199,6 +199,19 @@ func (s *Store) UpdateHazard(ctx context.Context, id uuid.UUID, updates map[stri
|
||||
return s.GetHazard(ctx, id)
|
||||
}
|
||||
|
||||
// DeleteHazard removes a hazard and its risk assessments.
|
||||
func (s *Store) DeleteHazard(ctx context.Context, id uuid.UUID) error {
|
||||
_, err := s.pool.Exec(ctx, `DELETE FROM iace_risk_assessments WHERE hazard_id = $1`, id)
|
||||
if err != nil {
|
||||
return fmt.Errorf("delete hazard assessments: %w", err)
|
||||
}
|
||||
_, err = s.pool.Exec(ctx, `DELETE FROM iace_hazards WHERE id = $1`, id)
|
||||
if err != nil {
|
||||
return fmt.Errorf("delete hazard: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Risk Assessment Operations
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user