Skip to content

Conversation

@Kariamos
Copy link
Contributor

This pull request introduces several new features, updates, and improvements across the codebase. The most significant changes include the addition of new API routes for customer agreements and survey imports, enhancements to user filtering logic for campaign notifications, and updates to dependencies. Below are the most important changes grouped by theme:

New Features:

  • Added a new GET API route src/routes/customers/customer/agreements/_get/index.ts to retrieve customer agreements, including logic for permission checks and calculation of remaining tokens.
  • Added a new POST API route src/routes/campaigns/campaignId/tasks/usecase/survey/jotform/_post/index.ts to import Jotform surveys into usecase surveys, with corresponding tests. [1] [2]
  • Added comprehensive tests for customer agreements API in src/routes/customers/customer/agreements/_get/index.spec.ts.

User Filtering and Notification Logic:

  • Enhanced user selection logic in src/routes/dossiers/_post/index.ts to exclude users with pending customer account invitations when notifying campaign watchers.
  • Updated dossier notification tests in src/routes/dossiers/_post/notifyEveryone.spec.ts to cover scenarios with pending invitations and multiple users, ensuring correct watcher notifications. [1] [2] [3]

Dependency Updates:

  • Updated @appquality/tryber-database dependency in package.json to version ^0.46.4.
  • Added yaml-sort as a new development dependency in package.json.

Bug Review Versioning:

  • Changed AI bug review retrieval logic in src/routes/campaigns/campaignId/bugs/bugId/aiReview/_get/index.ts to use version "v2" instead of "v1", and updated related tests. [1] [2] [3]

sinatragianpaolo and others added 30 commits December 2, 2025 11:14
feat(ai-review): update version filter to v2 in AI review retrieval
feat(api): update tryber-database to v0.46.2 and add human resources endpoint
Modified src/reference/openapi.yml

feat: add endpoint to retrieve agreements for a specific customer

fix: remove unnecessary x-stoplight ID from get customer agreements operation

feat: implement GET endpoint for retrieving customer agreements

refactor: improve access control logic for customer agreements

feat: enhance agreement retrieval logic to include token usage calculations

refactor: refactored methods and retrieval

refactor: streamline customer campaign access checks by separating logic into distinct methods
…ements

UN-2154 get customers id agreements
it@app-quality.com and others added 16 commits December 5, 2025 09:24
feat(schema): add hasPlan property to operations interface

feat(campaign): add hasPlan property to campaign response and related tests

feat: add hasPlan property to operations interface and reorder name field in items

chore: sort openapi
feat(dossiers): add endpoint for retrieving dossier rates

fix(dependencies): update @appquality/tryber-database to version 0.46.01

fix(dependencies): update @appquality/tryber-database to version 0.46.1

feat(dossiers): implement GET endpoint for retrieving dossier rates with access control

fix(dossiers): update access control logic for campaign OLPS in dossier rates route

feat: sort reference
- Implemented POST endpoint for campaigns to handle Jotform surveys.
- Created route handler to process Jotform submissions and store responses.
- Added unit tests to validate access control and response handling.
- Updated schema to include new endpoint and request/response structures.
- Upgraded tryber-database dependency to version 0.46.4.
feat: add Jotform survey integration for campaign tasks
Modified src/reference/openapi.yml

feat: implement PUT route for updating human resources in campaign

test: enhance PUT route tests for human resources with additional assertions

feat: enhance validation for human resources PUT route to check profile and work rate existence

Modified src/reference/openapi.yml

Modified src/reference/openapi.yml

fix: remove exclusiveMinimum property from assignee in campaigns path
test: enhance PUT route tests for human resources with additional assertions
fix: rename work_rate to rate in human resources routes
feat: add handling for empty body in human resources PUT route
…tation-users

fix: update invitation handling in dossier post route and related tests
@github-actions
Copy link

Tests difference:

New Tests

< Campaign Plan - Should return whether the campaign has a plan or not
< GET /customers/customerId/agreements - Should answer 200 if logged as user with full access on campaigns
< GET /customers/customerId/agreements - Should answer 200 if logged as user with olps to some owned campaigns
< GET /customers/customerId/agreements - Should answer 403 if customer does not exists
< GET /customers/customerId/agreements - Should answer 403 if logged as user with olps to only other campaigns
< GET /customers/customerId/agreements - Should answer 403 if logged in without permissions
< GET /customers/customerId/agreements - Should answer 403 if not logged in
< GET /customers/customerId/agreements - Should answer with a list of all agreements of the customer if has full access
< GET /dossiers/campaignId/agreements - Should answer 200 if logged as user with full access on the campaign
< GET /dossiers/campaignId/agreements - Should answer 400 if campaign does not exists
< GET /dossiers/campaignId/agreements - Should answer 403 if logged as user without permissions on the campaign
< GET /dossiers/campaignId/agreements - Should answer 403 if logged in without permissions
< GET /dossiers/campaignId/agreements - Should answer 403 if not logged in
< GET /dossiers/campaignId/agreements - Should answer with the campaigns agreement
< GET /dossiers/campaignId/costs - Should answer 200 if logged as user with full access on the campaign
< GET /dossiers/campaignId/costs - Should answer 400 if campaign does not exists
< GET /dossiers/campaignId/costs - Should answer 403 if logged as user without permissions on the campaign
< GET /dossiers/campaignId/costs - Should answer 403 if logged in without permissions
< GET /dossiers/campaignId/costs - Should answer 403 if not logged in
< GET /dossiers/campaignId/costs - Should answer with the campaigns costs
< GET /dossiers/campaignId/costs - Should filterBy the costs by multiple work_type_id
< GET /dossiers/campaignId/costs - Should filterBy the costs by work_type_id
< GET /dossiers/campaignId/costs - Should ignore the filter if it the filter is invalid
< GET /dossiers/campaignId/costs - Should ignore the filter if it the type is invalid
< Invalid body - Should return 400 if agreementId is missing
< Invalid body - Should return 400 if agreementId is not a positive integer
< Invalid body - Should return 400 if body is missing
< Invalid body - Should return 400 if both tokens and agreementId are not valid
< Invalid body - Should return 400 if tokens is missing
< Invalid body - Should return 400 if tokens is not a positive number
< Link between campaign and agreement already exists - Should update the link between campaign and agreement
< Link between campaign and agreement does not exists - Should create the link between campaign and agreement
< POST /campaigns/{campaignId}/tasks/{usecase}/survey/jotform - should answer 400 if user is logged with permission but campaign does not exists
< POST /campaigns/{campaignId}/tasks/{usecase}/survey/jotform - should answer 403 if user is logged in without manage_preselection_forms 
< POST /campaigns/{campaignId}/tasks/{usecase}/survey/jotform - should answer 403 if user is not logged in 
< POST /campaigns/{campaignId}/tasks/{usecase}/survey/jotform - should return 200 if user is logged in with manage_preselection_forms permission
< Route GET /dossiers/:campaignId/humanResources - Should answer 200 if admin
< Route GET /dossiers/:campaignId/humanResources - Should answer 200 if has access to campaign
< Route GET /dossiers/:campaignId/humanResources - Should answer 400 if tester
< Route GET /dossiers/:campaignId/humanResources - Should answer 403 if not logged in
< Route GET /dossiers/rates - Should answer 200 if user is admin
< Route GET /dossiers/rates - Should answer 401 if not admin
< Route GET /dossiers/rates - Should answer 403 if not logged in
< Route GET /dossiers/rates - Should return 200 if user has full campaign olps
< Route GET /dossiers/rates - Should return 200 if user has only some campaign olps
< Route GET /dossiers/rates - Should return array of items
< Route GET /dossiers/rates - Should return items with id, name and rate
< Route PUT /dossiers/:id/agreements - Should return 200 if has access to the campaign
< Route PUT /dossiers/:id/agreements - Should return 200 if has all campaign olps
< Route PUT /dossiers/:id/agreements - Should return 200 if logged in as admin
< Route PUT /dossiers/:id/agreements - Should return 400 if campaign does not exists
< Route PUT /dossiers/:id/agreements - Should return 403 if logged in as tester
< Route PUT /dossiers/:id/agreements - Should return 403 if not logged in
< Route PUT/dossiers/:campaignId/humanResources - Should answer 200 if admin
< Route PUT/dossiers/:campaignId/humanResources - Should answer 200 if has access to campaign
< Route PUT/dossiers/:campaignId/humanResources - Should answer 400 if invalid body
< Route PUT/dossiers/:campaignId/humanResources - Should answer 400 if profile does not exist
< Route PUT/dossiers/:campaignId/humanResources - Should answer 400 if tester
< Route PUT/dossiers/:campaignId/humanResources - Should answer 400 if work rate does not exist
< Route PUT/dossiers/:campaignId/humanResources - Should answer 403 if no access to campaign
< Route PUT/dossiers/:campaignId/humanResources - Should answer 403 if not logged in
< Valid body - Should update the tokens usage and return 200
< With basic data - Should remove the old records and update the human resources
< With basic data - Should return 200 if body is empty and simply delete all human resources
< With basic data - Should return human resources for campaign 1

@d-beezee d-beezee merged commit 76a4111 into main Dec 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants