Skip to content

connect assessment handlers to repositories #19

@adarshm11

Description

@adarshm11

Wire Up Assessment Handlers to Real Repos

Handler logic and the service layer are fully implementedinternal/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

  • In cmd/server/main.go: instantiate the concrete Assessment, Question, and TestCase repos (from issue 02) with the DB pool
  • In cmd/server/main.go: create AssessmentService via services.NewAssessmentService(assessmentRepo, questionRepo, testCaseRepo)
  • In cmd/server/main.go: call handlers.SetAssessmentService(svc) before starting the server

That's it — ~5 lines of code.

Note: this requires issue #18 to be completed first.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions