Return 'averageTestScore' property in TraineeEducationInfo#282
Return 'averageTestScore' property in TraineeEducationInfo#282
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds a computed averageTestScore property to the TraineeEducationInfo schema, making it available in the response of the GET /trainees/{id} endpoint. The average is calculated from test scores using an existing utility function that selects the highest score for each test type. Additionally, the PR includes formatting improvements to consistently quote HTTP status codes in the OpenAPI specification.
Changes:
- Added
averageTestScorevirtual property toTraineeEducationInfoSchemausing the existingcalculateAverageTestScoreutility function - Configured
TraineeEducationInfoSchemato include virtual properties in JSON output - Updated the OpenAPI specification to document the new
averageTestScoreproperty inTraineeEducationInfo - Standardized HTTP status code formatting in the API specification (unquoted to quoted)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| server/src/schemas/TraineeSchema.ts | Added import for calculateAverageTestScore, created virtual property for averageTestScore on TraineeEducationInfoSchema, and configured JSON serialization to include virtuals |
| server/api.yaml | Added averageTestScore property to TraineeEducationInfo schema definition and standardized HTTP status code formatting throughout the specification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Affects the response of GET /trainees/{id}