Wire Up Assessment Handlers to Real Repos
Handler logic and the service layer are fully implemented — internal/handlers/assessments.go and internal/core/services/assessment_service.go have working validation, error handling, and business logic. The only missing piece is wiring real repository implementations into the service at startup.
Already done
CreateAssessment, ListAssessments, GetAssessment, AddQuestion, AddTestCases handlers — complete with input validation and error mapping
AssessmentService — complete with validation logic, type checking, ownership enforcement
SetAssessmentService() function exists for DI
- Routes registered in
main.go
Remaining work
That's it — ~5 lines of code.
Note: this requires issue #18 to be completed first.
Wire Up Assessment Handlers to Real Repos
Handler logic and the service layer are fully implemented —
internal/handlers/assessments.goandinternal/core/services/assessment_service.gohave working validation, error handling, and business logic. The only missing piece is wiring real repository implementations into the service at startup.Already done
CreateAssessment,ListAssessments,GetAssessment,AddQuestion,AddTestCaseshandlers — complete with input validation and error mappingAssessmentService— complete with validation logic, type checking, ownership enforcementSetAssessmentService()function exists for DImain.goRemaining work
cmd/server/main.go: instantiate the concrete Assessment, Question, and TestCase repos (from issue 02) with the DB poolcmd/server/main.go: createAssessmentServiceviaservices.NewAssessmentService(assessmentRepo, questionRepo, testCaseRepo)cmd/server/main.go: callhandlers.SetAssessmentService(svc)before starting the serverThat's it — ~5 lines of code.
Note: this requires issue #18 to be completed first.