Conversation
… better-sqlite3 to version 11.9.1 fix(routes): ensure productLink is always defined in dossier routes refactor(tests): add link field to campaign test data
chore(deps): update @appquality/tryber-database to version 0.44.0 and better-sqlite3 to version 11.9.1
Tests difference:New Tests |
…preselectionFormId
GET /campaigns/id add plan to response if exist
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new optional "plan" property to the campaign operations schema and adds corresponding support for it in various routes and tests.
- Update schema interface with a new optional nested property "plan".
- Modify multiple endpoints and tests (_put, _post, and _get) to incorporate a new "link" field and handle the new "plan" property.
- Adjust unit tests to verify correct behavior when campaign plan data is present or absent.
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/schema.ts | Added an optional “plan” object in the operations interface |
| src/routes/users/me/campaigns/campaignId/forms/_get/visibility.spec.ts | Added a new “link” field in test data |
| src/routes/users/me/campaigns/_get/target.spec.ts | Added a new “link” field in test data |
| src/routes/users/me/campaigns/_get/cap.spec.ts | Added a new “link” field in test data |
| src/routes/dossiers/campaignId/_put/index.ts | Updated dossier PUT endpoint with a default empty string for “link” and re-ordered the import |
| src/routes/dossiers/_post/index.ts | Updated dossier POST endpoint to assign “link” with a fallback value |
| src/routes/campaigns/campaignId/_get/index.ts | Introduced a helper to fetch campaign plan and include it in the campaign response |
| src/routes/campaigns/campaignId/_get/index.spec.ts | Updated tests to check for existence and absence of the “plan” field and ensure preselectionFormId is not returned when not applicable |
Files not reviewed (2)
- package.json: Language not supported
- src/reference/openapi.yml: Language not supported
Comments suppressed due to low confidence (2)
src/routes/dossiers/campaignId/_put/index.ts:164
- Review the change from a conditional assignment to an unconditional default assignment for 'link' to ensure it aligns with your API contract and client expectations.
link: "",
src/routes/dossiers/_post/index.ts:299
- Ensure that defaulting 'link' to an empty string in the POST route is consistent with the API design and that the implications of omitting 'productLink' are well understood.
link: this.getBody().productLink || "",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.