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
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/breakpilot/ai-compliance-sdk/internal/ucca"
|
||||
@@ -173,13 +172,9 @@ func (h *RegistrationHandlers) Prefill(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// Extract intake data
|
||||
var intake ucca.UseCaseIntake
|
||||
if assessment.Intake != nil {
|
||||
json.Unmarshal(assessment.Intake, &intake)
|
||||
}
|
||||
// Pre-fill registration from assessment intake
|
||||
intake := assessment.Intake
|
||||
|
||||
// Pre-fill registration from assessment
|
||||
reg := ucca.AIRegistration{
|
||||
TenantID: tenantID,
|
||||
SystemName: intake.Title,
|
||||
|
||||
@@ -226,7 +226,7 @@ type UseCaseIntake struct {
|
||||
HRContext *HRContext `json:"hr_context,omitempty"`
|
||||
EducationContext *EducationContext `json:"education_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"`
|
||||
CriticalInfraContext *CriticalInfraContext `json:"critical_infra_context,omitempty"`
|
||||
AutomotiveContext *AutomotiveContext `json:"automotive_context,omitempty"`
|
||||
@@ -281,8 +281,8 @@ type HealthcareContext struct {
|
||||
ClinicalValidation bool `json:"clinical_validation"` // Klinisch validiert
|
||||
}
|
||||
|
||||
// LegalContext captures legal/justice-specific compliance data (AI Act Annex III Nr. 8)
|
||||
type LegalContext struct {
|
||||
// LegalDomainContext captures legal/justice-specific compliance data (AI Act Annex III Nr. 8)
|
||||
type LegalDomainContext struct {
|
||||
LegalAdvice bool `json:"legal_advice"` // KI gibt Rechtsberatung
|
||||
ContractAnalysis bool `json:"contract_analysis"` // KI analysiert Vertraege
|
||||
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)
|
||||
case "legal_context":
|
||||
if len(parts) < 2 || intake.LegalContext == nil {
|
||||
if len(parts) < 2 || intake.LegalDomainContext == nil {
|
||||
return nil
|
||||
}
|
||||
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{} {
|
||||
if intake.LegalContext == nil { return nil }
|
||||
if intake.LegalDomainContext == nil { return nil }
|
||||
switch field {
|
||||
case "legal_advice": return intake.LegalContext.LegalAdvice
|
||||
case "contract_analysis": return intake.LegalContext.ContractAnalysis
|
||||
case "court_prediction": return intake.LegalContext.CourtPrediction
|
||||
case "access_to_justice": return intake.LegalContext.AccessToJustice
|
||||
case "client_confidential": return intake.LegalContext.ClientConfidential
|
||||
case "legal_advice": return intake.LegalDomainContext.LegalAdvice
|
||||
case "contract_analysis": return intake.LegalDomainContext.ContractAnalysis
|
||||
case "court_prediction": return intake.LegalDomainContext.CourtPrediction
|
||||
case "access_to_justice": return intake.LegalDomainContext.AccessToJustice
|
||||
case "client_confidential": return intake.LegalDomainContext.ClientConfidential
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user