package handlers import ( "net/http" "github.com/breakpilot/ai-compliance-sdk/internal/iace" "github.com/gin-gonic/gin" "github.com/google/uuid" ) // GetRiskSuggestion returns BreakPilot's justified dual-model risk suggestion // for a hazard: the EN-62061-style F/W/P/S model and the Fine-Kinney P/E/C // model, each with suggested values, justifications and the visible formula. // Read-only and computed from public-data anchors — the professional adjusts // the values; no norm table is stored or reproduced. // // GET /projects/:id/hazards/:hid/risk-suggestion func (h *IACEHandler) GetRiskSuggestion(c *gin.Context) { hid, err := uuid.Parse(c.Param("hid")) if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": "invalid hazard ID"}) return } hz, err := h.store.GetHazard(c.Request.Context(), hid) if err != nil || hz == nil { c.JSON(http.StatusNotFound, gin.H{"error": "hazard not found"}) return } c.JSON(http.StatusOK, iace.BuildRiskSuggestion(hz)) }