fix: Build-Fehler — LegalContext Namenskollision + Registration Handler
- LegalContext → LegalDomainContext (Kollision mit legal_rag.go LegalContext) - ExplainResponse.LegalContext bleibt unveraendert (RAG-Typ) - Registration Handler: Intake ist struct, kein []byte - Unbenutzten json Import entfernt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/breakpilot/ai-compliance-sdk/internal/ucca"
|
"github.com/breakpilot/ai-compliance-sdk/internal/ucca"
|
||||||
@@ -173,13 +172,9 @@ func (h *RegistrationHandlers) Prefill(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract intake data
|
// Pre-fill registration from assessment intake
|
||||||
var intake ucca.UseCaseIntake
|
intake := assessment.Intake
|
||||||
if assessment.Intake != nil {
|
|
||||||
json.Unmarshal(assessment.Intake, &intake)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pre-fill registration from assessment
|
|
||||||
reg := ucca.AIRegistration{
|
reg := ucca.AIRegistration{
|
||||||
TenantID: tenantID,
|
TenantID: tenantID,
|
||||||
SystemName: intake.Title,
|
SystemName: intake.Title,
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ type UseCaseIntake struct {
|
|||||||
HRContext *HRContext `json:"hr_context,omitempty"`
|
HRContext *HRContext `json:"hr_context,omitempty"`
|
||||||
EducationContext *EducationContext `json:"education_context,omitempty"`
|
EducationContext *EducationContext `json:"education_context,omitempty"`
|
||||||
HealthcareContext *HealthcareContext `json:"healthcare_context,omitempty"`
|
HealthcareContext *HealthcareContext `json:"healthcare_context,omitempty"`
|
||||||
LegalContext *LegalContext `json:"legal_context,omitempty"`
|
LegalDomainContext *LegalDomainContext `json:"legal_context,omitempty"`
|
||||||
PublicSectorContext *PublicSectorContext `json:"public_sector_context,omitempty"`
|
PublicSectorContext *PublicSectorContext `json:"public_sector_context,omitempty"`
|
||||||
CriticalInfraContext *CriticalInfraContext `json:"critical_infra_context,omitempty"`
|
CriticalInfraContext *CriticalInfraContext `json:"critical_infra_context,omitempty"`
|
||||||
AutomotiveContext *AutomotiveContext `json:"automotive_context,omitempty"`
|
AutomotiveContext *AutomotiveContext `json:"automotive_context,omitempty"`
|
||||||
@@ -281,8 +281,8 @@ type HealthcareContext struct {
|
|||||||
ClinicalValidation bool `json:"clinical_validation"` // Klinisch validiert
|
ClinicalValidation bool `json:"clinical_validation"` // Klinisch validiert
|
||||||
}
|
}
|
||||||
|
|
||||||
// LegalContext captures legal/justice-specific compliance data (AI Act Annex III Nr. 8)
|
// LegalDomainContext captures legal/justice-specific compliance data (AI Act Annex III Nr. 8)
|
||||||
type LegalContext struct {
|
type LegalDomainContext struct {
|
||||||
LegalAdvice bool `json:"legal_advice"` // KI gibt Rechtsberatung
|
LegalAdvice bool `json:"legal_advice"` // KI gibt Rechtsberatung
|
||||||
ContractAnalysis bool `json:"contract_analysis"` // KI analysiert Vertraege
|
ContractAnalysis bool `json:"contract_analysis"` // KI analysiert Vertraege
|
||||||
CourtPrediction bool `json:"court_prediction"` // KI prognostiziert Urteile
|
CourtPrediction bool `json:"court_prediction"` // KI prognostiziert Urteile
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ func (e *PolicyEngine) getFieldValue(field string, intake *UseCaseIntake) interf
|
|||||||
}
|
}
|
||||||
return e.getHealthcareContextValue(parts[1], intake)
|
return e.getHealthcareContextValue(parts[1], intake)
|
||||||
case "legal_context":
|
case "legal_context":
|
||||||
if len(parts) < 2 || intake.LegalContext == nil {
|
if len(parts) < 2 || intake.LegalDomainContext == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return e.getLegalContextValue(parts[1], intake)
|
return e.getLegalContextValue(parts[1], intake)
|
||||||
@@ -630,13 +630,13 @@ func (e *PolicyEngine) getHealthcareContextValue(field string, intake *UseCaseIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *PolicyEngine) getLegalContextValue(field string, intake *UseCaseIntake) interface{} {
|
func (e *PolicyEngine) getLegalContextValue(field string, intake *UseCaseIntake) interface{} {
|
||||||
if intake.LegalContext == nil { return nil }
|
if intake.LegalDomainContext == nil { return nil }
|
||||||
switch field {
|
switch field {
|
||||||
case "legal_advice": return intake.LegalContext.LegalAdvice
|
case "legal_advice": return intake.LegalDomainContext.LegalAdvice
|
||||||
case "contract_analysis": return intake.LegalContext.ContractAnalysis
|
case "contract_analysis": return intake.LegalDomainContext.ContractAnalysis
|
||||||
case "court_prediction": return intake.LegalContext.CourtPrediction
|
case "court_prediction": return intake.LegalDomainContext.CourtPrediction
|
||||||
case "access_to_justice": return intake.LegalContext.AccessToJustice
|
case "access_to_justice": return intake.LegalDomainContext.AccessToJustice
|
||||||
case "client_confidential": return intake.LegalContext.ClientConfidential
|
case "client_confidential": return intake.LegalDomainContext.ClientConfidential
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user