Skip to content

Feat/define api specification for skill put and patch#520

Open
HabtamuTesafaye wants to merge 3 commits into
mainfrom
feat/define-api-specification-for-skill-PUT-and-PATCH
Open

Feat/define api specification for skill put and patch#520
HabtamuTesafaye wants to merge 3 commits into
mainfrom
feat/define-api-specification-for-skill-PUT-and-PATCH

Conversation

@HabtamuTesafaye

Copy link
Copy Markdown
Contributor

This pull request contains changes for :

  • api spec definition for the skill for PUT and PATCH
  • backend impenation for the skill PUT and PATCH

Comment thread backend/src/esco/skill/[id]/PUT/request.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds full (PUT) and partial (PATCH) update capabilities for skills, spanning API specification updates (schemas, OpenAPI generation) and backend implementation (routing, controllers, service/repository methods), plus accompanying unit/integration tests.

Changes:

  • Added Skill PUT/PATCH API-spec schemas/types/constants/enums and wired them into OpenAPI generation.
  • Implemented backend PUT/PATCH handlers for /models/{modelId}/skills/{id}, including routing + AJV validation schema registration.
  • Extended skill service/repository with update + patch, and updated/added tests across layers.

Reviewed changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backend/src/validator.ts Registers AJV schemas for Skill PUT/PATCH request/response payloads.
backend/src/import/async/parseFiles.test.ts Updates skill repository mock to include update/patch.
backend/src/export/esco/skill/SkillsToCSVTransform.test.ts Updates skill repository mock to include update/patch.
backend/src/esco/skillGroup/index.test.ts Adds routing tests for POST skillGroup parents.
backend/src/esco/skill/services/skill.service.types.ts Extends skill service contract with update/patch and related types.
backend/src/esco/skill/services/skill.service.ts Implements update/patch with model validation prior to repository write.
backend/src/esco/skill/services/skill.service.test.ts Adds unit tests for service update/patch and extra history edge-case coverage.
backend/src/esco/skill/repository/skill.repository.ts Adds repository update/patch methods using mongoose doc updates + populate.
backend/src/esco/skill/repository/skill.repository.test.ts Adds in-memory MongoDB tests for repository update/patch.
backend/src/esco/skill/index.ts Routes PUT/PATCH /skills/{id} to new handlers.
backend/src/esco/skill/index.test.ts Adds router tests for PUT/PATCH dispatch.
backend/src/esco/skill/[id]/PUT/response.ts Builds PUT response via existing skill transform.
backend/src/esco/skill/[id]/PUT/request.ts Adds PUT request parsing, length check, and AJV validation.
backend/src/esco/skill/[id]/PUT/index.ts Implements PUT controller (authz, param extraction, service call, error mapping).
backend/src/esco/skill/[id]/PUT/index.test.ts Adds unit tests for Skill PUT handler behaviors and error cases.
backend/src/esco/skill/[id]/PUT/index.integration.test.ts Adds DB-backed integration test validating PUT response schema.
backend/src/esco/skill/[id]/PATCH/response.ts Builds PATCH response via existing skill transform.
backend/src/esco/skill/[id]/PATCH/request.ts Adds PATCH request parsing, length check, and AJV validation.
backend/src/esco/skill/[id]/PATCH/index.ts Implements PATCH controller (authz, param extraction, service call, error mapping).
backend/src/esco/skill/[id]/PATCH/index.test.ts Adds unit tests for Skill PATCH handler behaviors and error cases.
backend/src/esco/skill/[id]/PATCH/index.integration.test.ts Adds DB-backed integration test validating PATCH response schema.
backend/src/esco/skill/_shared/skill.types.ts Introduces IUpdateSkillSpec and IPartialUpdateSkillSpec types.
backend/src/esco/occupations/services/occupation.service.test.ts Updates mocks to include history-related repository/model methods used by occupation history.
backend/src/embeddings/asyncPublishEmbeddingsTask/index.integration.test.ts Adjusts a test timeout (30s) to reduce flakiness.
backend/openapi/generateOpenApiDoc.ts Includes Skill PUT/PATCH schemas and error schemas in generated OpenAPI.
api-specifications/src/esco/skill/index.test.ts Asserts PUT/PATCH schemas are exported by the skill module.
api-specifications/src/esco/skill/[id]/PUT/schema.response.ts Defines Skill PUT response schema.
api-specifications/src/esco/skill/[id]/PUT/schema.response.test.ts Tests Skill PUT response schema validity and additionalProperties behavior.
api-specifications/src/esco/skill/[id]/PUT/schema.request.ts Defines Skill PUT request schema (required fields, additionalProperties false).
api-specifications/src/esco/skill/[id]/PUT/schema.request.test.ts Tests Skill PUT request schema validation and field constraints.
api-specifications/src/esco/skill/[id]/PUT/index.ts Exposes PUT operation namespace (schemas/types/errors/constants).
api-specifications/src/esco/skill/[id]/PUT/index.test.ts Smoke tests PUT operation exports.
api-specifications/src/esco/skill/[id]/PUT/enums.ts Defines PUT-specific error codes.
api-specifications/src/esco/skill/[id]/PUT/constants.ts Adds PUT payload size constants.
api-specifications/src/esco/skill/[id]/PATCH/schema.response.ts Defines Skill PATCH response schema.
api-specifications/src/esco/skill/[id]/PATCH/schema.response.test.ts Tests Skill PATCH response schema validity and additionalProperties behavior.
api-specifications/src/esco/skill/[id]/PATCH/schema.request.ts Defines Skill PATCH request schema (all fields optional, additionalProperties false).
api-specifications/src/esco/skill/[id]/PATCH/schema.request.test.ts Tests Skill PATCH request schema validation and field constraints.
api-specifications/src/esco/skill/[id]/PATCH/index.ts Exposes PATCH operation namespace (schemas/types/errors/constants).
api-specifications/src/esco/skill/[id]/PATCH/index.test.ts Smoke tests PATCH operation exports.
api-specifications/src/esco/skill/[id]/PATCH/enums.ts Defines PATCH-specific error codes.
api-specifications/src/esco/skill/[id]/PATCH/constants.ts Adds PATCH payload size constants.
api-specifications/src/esco/skill/[id]/index.ts Wires PUT/PATCH operation exports into the skill detail module.
api-specifications/src/esco/skill/_shared/types.ts Adds/extends type namespaces for skill PUT/PATCH operations.
api-specifications/src/esco/skill/snapshots/index.test.ts.snap Updates snapshots to include newly exported PUT/PATCH namespaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/src/esco/skill/[id]/PUT/request.ts Outdated
Comment thread backend/src/esco/skill/[id]/PATCH/request.ts Outdated
Comment thread backend/src/esco/skill/[id]/PUT/index.ts Outdated
Comment thread backend/src/esco/skill/[id]/PATCH/index.ts Outdated
…sing AJV schemas in skill request validation, while adding nullish fallbacks to occupation history service.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants