2026-03-26 12:46:00 -07:00

51 lines
2.6 KiB
Go

package models
// CriterionScore holds the evaluation result for a single job requirement criterion.
// Trace: SDD_LLD_0016 - Maps individual criteria scores to specific data fields
// Trace: SDD_HLD_0009 - Decompose output into job description criteria-based subsections
// Trace: SDD_HLD_0010 - Generate graded subsection categories on scale from 1-10
type CriterionScore struct {
Criterion string `json:"criterion"`
Score int `json:"score"`
Evidence string `json:"evidence"`
Comments string `json:"comments"`
}
// Recommendation holds the overall fit label and rationale for the candidate.
type Recommendation struct {
Label string `json:"label"`
Rationale string `json:"rationale"`
}
// GrammarSpelling holds grammar and spelling evaluation results
// Trace: SDD_LLD_0018 - Parse grammar/spelling evaluation
// Trace: SRD_FuncReq_0010 - Grade resume's grammar and spelling on 0-10 scale
// Trace: SRD_FuncReq_0011 - Suggest grammar corrections
type GrammarSpelling struct {
Score int `json:"score"` // 0-10 rating of grammar/spelling quality
IssuesFound []string `json:"issues_found"` // Specific grammar/spelling issues identified
Corrections []string `json:"corrections"` // Suggested corrections
}
// AnalysisResult is the full response returned by the analyze endpoint.
// It mirrors the ResumeAnalysisResult TypeScript type on the frontend.
// Trace: SDD_LLD_0015 - Extracts total score and summary from raw AI response
// Trace: SDD_LLD_0016 - Maps individual criteria scores to specific data fields
// Trace: SDD_LLD_0017 - Converts AI-generated text blocks into formatted arrays
// Trace: SDD_LLD_0018 - Parse grammar/spelling evaluation
// Trace: SDD_LLD_0019 - Marshals completed evaluation data structure into JSON
// Trace: SDD_HLD_0011 - Generate strengths and weaknesses found in resumes
// Trace: SDD_HLD_0012 - Generate grammar and spelling score and corrections
type AnalysisResult struct {
OverallScore int `json:"overall_score"`
Summary string `json:"summary"`
CriteriaScores []CriterionScore `json:"criteria_scores"`
Strengths []string `json:"strengths"`
Weaknesses []string `json:"weaknesses"`
MissingInformation []string `json:"missing_information"`
GrammarSpelling GrammarSpelling `json:"grammar_spelling"` // Trace: SRD_FuncReq_0010, SRD_FuncReq_0011
Recommendation Recommendation `json:"recommendation"`
InjectionDetected bool `json:"injection_detected"` // Trace: SRD_NonFuncReq_0010, SDD_LLD_0009
InjectionDetails string `json:"injection_details"` // Trace: SRD_QualAssurReq_0005
}