Skip to content

Conversation

@d-beezee
Copy link
Member

@d-beezee d-beezee commented Oct 6, 2025

No description provided.

d-beezee and others added 30 commits September 8, 2025 17:06
feat: Update put dossier with auto apply
feat: Add auto apply handling in api
UN-1777: Add endpoint to get preview data for user campaigns
feat: Add support for page version links in campaign responses
feat: Update campaign preview endpoint to include status and refactor response schema
sinatragianpaolo and others added 24 commits September 26, 2025 16:12
feat: Add support for bug language in campaign creation and update database accordingly
feat: GET - my campaigns Task ordered by position asc + POST task with prefix
…r-get-preview

Add not started status to user get preview
feat: add hasBugForm property to DossierCreationData schema and operations interface
@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Tests difference:

New Tests

< As admin - Should return 200 if campaign is V2
< As admin - Should return 200 if campaign is V2
< As admin - Should return 200 if campaign is V2
< As tester NOT in target - targetGroup - Should return 404 
< As tester NOT in target - targetGroup - Should return 404 
< As tester NOT in target - targetGroup - Should return 404 
< As tester NOT in target - targetGroup - Should return 404 
< As tester NOT selected - Should return 404 
< As tester in target - targetGroup - Should return 200 
< As tester in target - targetGroup - Should return acceptedDevices 
< As tester in target - targetGroup - Should return campaignType 
< As tester in target - targetGroup - Should return preview data 
< As tester in target - targetGroup - Should return start_date and end_date 
< As tester in target - targetGroup - Should return tester leader info 
< As tester in target - targetGroup - Should return title 
< Auto Apply - Should insert autoApply sent if send autoApply
< Auto Apply - Should insert autoApply value from the campaign type (if no send autoApply)
< Auto Apply - Should insert the default autoApply 0 if not specified and not in campaign type
< Auto apply - Should return autoApply value for the campaign
< Bug Language - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language DE
< Bug Language - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language ES
< Bug Language - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language FR
< Bug Language - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language GB
< Bug Language - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language IT
< Bug Language - Should set bug_lang = 1 in campaign if send any valid language
< Campaign V1 - Should return 404 if campaign is V1 as admin
< Campaign V1 - Should return 404 if campaign is V1 as tester
< Correct requests - Should change the visibility to internal, that's is_public = 0
< Correct requests - Should change the visibility to target, that's is_public = 4
< DELETE users/me/campaigns/:cId/tasks/:tId/media/:mId - Should return 403 if user is not authenticated
< DELETE users/me/campaigns/:cId/tasks/:tId/media/:mId - Should return 404 if campaign does not exists
< Decompose s3 url - Should return bucket and key
< Enough permissions - Should answer 200 if admin
< Enough permissions - Should answer 200 if user has access to the campaign
< Enough permissions - Should return 200 if logged in as admin
< Enough permissions - Should return 200 if logged in as user with olps
< GET /campaigns/{CampaignId}/tasks - Should return the usecases ordered by position ASC, id ASC
< GET /users/me/campaigns - manual and/or preview not public - not selected tester - should answer with a campaign if filter is by not accepted applications
< GET /users/me/campaigns - manual and/or preview not public - selected tester - should answer with new links on v2
< GET users/me/campaigns/:cId/payout_data - Should return 403 if user is not authenticated
< GET users/me/campaigns/:cId/payout_data - Should return 404 if campaign does not exists
< GET users/me/campaigns/:cId/preview - Page Version 2 - Should return 403 if user is not authenticated
< GET users/me/campaigns/:cId/preview - Page Version 2 - Should return 404 if campaign does not exists
< GET users/me/campaigns/:cId/tasks - Should return 403 if user is not authenticated
< GET users/me/campaigns/:cId/tasks - Should return 404 if campaign does not exists
< GET users/me/campaigns/:cId/tasks/:tId/media - Should return 403 if user is not authenticated
< GET users/me/campaigns/:cId/tasks/:tId/media - Should return 404 if campaign does not exists
< Invalid body - Should return 400 if payload has incorrect fields
< Invalid body - Should return 400 if status is missing
< Invalid body - Should return 400 if status is not valid
< Invalid body - Should return 400 if the body contains negative values
< Invalid body - Should return 400 if the body contains values that are not numbers
< Invalid body - Should return 400 if the body is missing
< Invalid body - Should return 400 if trying to pass a percentage over 100
< Invalid body - Should return 403 if the body contains wrong keys
< Invalid body - Should return 403 if the body is empty
< Not enough permissions - Should answer 403 if not admin
< Not enough permissions - Should answer 403 if not logged in
< Not enough permissions - Should return 403 if logged in as user without olps
< Not enough permissions - Should return 403 if logged out
< POST /campaigns/:campaignId/preview - Should answer 200 if user is admin
< POST /campaigns/:campaignId/preview - Should answer 403 if user is logged in without olp appq_campaign
< POST /campaigns/:campaignId/preview - Should answer 403 if user is not logged in 
< POST /campaigns/:campaignId/preview - Should answer 403 if user try to send preview to campaign not in v2
< POST /campaigns/:campaignId/preview - Should insert content on preview table
< POST /campaigns/:campaignId/preview - Should return an error if campaign does not exist
< POST /campaigns/{CampaignId}/tasks - Should answer 201 if logged in as admin
< POST /campaigns/{CampaignId}/tasks - Should answer 201 if logged in as tester with permission
< POST /campaigns/{CampaignId}/tasks - Should answer 400 if campaign not exist
< POST /campaigns/{CampaignId}/tasks - Should answer 403 if logged as tester
< POST /campaigns/{CampaignId}/tasks - Should answer 403 if logged as tester without campaign access
< POST /campaigns/{CampaignId}/tasks - Should answer 403 if not logged in
< POST /campaigns/{CampaignId}/tasks - Should create new task
< POST /campaigns/{CampaignId}/tasks - Should create new taskGroup for the task created
< POST /campaigns/{CampaignId}/tasks - Should return new task data
< POST /campaigns/{CampaignId}/tasks - Should return title with prefix if send prefix
< POST /campaigns/{CampaignId}/tasks - Should save allow_media = false if upload not provided in request body
< POST /campaigns/{CampaignId}/tasks - Should save allow_media = true and optimize_media = true if send upload.policy=optimize in request body
< POST /campaigns/{CampaignId}/tasks - Should save allow_media = true if send upload.policy=allow in request body
< POST /campaigns/{CampaignId}/tasks - Should save language if send upload.language in request body
< Page Version - Should insert pageVersion v1 as default (if pageVersion is not defined)
< Page Version - Should insert pageVersion v1 if send pageVersion v1
< Page Version - Should insert pageVersion v2 if send pageVersion v2
< Page Version - Should skip pageCreation if send pageVersion v2
< Route GET /users/me/campaigns/{campaignId}/ - user selected over a closed campaign - Should return 404 if campaign is overdue and status_id = 2 (closed)
< Route POST /dossiers - Should unset the campaign auto apply flag
< Route POST /dossiers - Should update the campaign with the auto apply flag
< Route POST /users/me/campaign/{campaignId}/media - Should add the campaign id to the path on s3
< Route POST /users/me/campaign/{campaignId}/media - Should answer 200 if logged in and everything is fine
< Route POST /users/me/campaign/{campaignId}/media - Should answer 200 with error code INVALID_FILE_EXTENSION if the extension is not in the whitelist
< Route POST /users/me/campaign/{campaignId}/media - Should answer 403 if logged in but not selected in the campaign
< Route POST /users/me/campaign/{campaignId}/media - Should answer 403 if not logged in
< Route POST /users/me/campaign/{campaignId}/media - Should crypt the filename on s3
< Route POST /users/me/campaign/{campaignId}/media - Should insert on DB uploaded files
< Route POST /users/me/campaign/{campaignId}/media - Should upload to optimized bucket if media is optimized
< Route POST /users/me/campaign/{campaignId}/media - Should upload to s3 if logged in and everything is fine
< Route POST /users/me/campaigns/{campaignId}/tasks/{taskId} - Should return 403 if user is logged in but the task does not exist
< Route POST /users/me/campaigns/{campaignId}/tasks/{taskId} - Should return 403 if user is not logged in
< Route POST /users/me/campaigns/{campaignId}/tasks/{taskId} - Should return 404 if user has appq_campaign olps but is not selected
< Route POST /users/me/campaigns/{campaignId}/tasks/{taskId} - Should return 404 if user is admin but not selected
< Route POST /users/me/campaigns/{campaignId}/tasks/{taskId} - Should return 404 if user is logged in but not selected
< Route POST /users/me/campaigns/{campaignId}/tasks/{taskId} - complete - Should complete the candidate if user complete all required tasks
< Route POST /users/me/campaigns/{campaignId}/tasks/{taskId} - complete - Should not complete the candidate if user not complete all required tasks
< Route POST /users/me/campaigns/{campaignId}/tasks/{taskId} - cp phase check - Should return 404 if campaign is unavailable
< Should Update BugLanguage and translated BugLanguage message on cp_meta - Should delete cp_meta bug_lang_message and bug_lang_code if send bug_language = false
< Should Update BugLanguage and translated BugLanguage message on cp_meta - Should delete old cp_meta (bug_lang_message and bug_lang_code) if send bug_language=IT
< Should Update BugLanguage and translated BugLanguage message on cp_meta - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language DE
< Should Update BugLanguage and translated BugLanguage message on cp_meta - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language ES
< Should Update BugLanguage and translated BugLanguage message on cp_meta - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language FR
< Should Update BugLanguage and translated BugLanguage message on cp_meta - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language GB
< Should Update BugLanguage and translated BugLanguage message on cp_meta - Should insert cp_metas bug_lang_code and translated bug_lang_message if send bug_language IT
< Tasks data present - Should call deleteFromS3 on success
< Tasks data present - Should delete media from database
< Tasks data present - Should not call deleteFromS3 on media not found
< Tasks data present - Should not contain media uploaded from other tester in the same task
< Tasks data present - Should return 200
< Tasks data present - Should return 200
< Tasks data present - Should return 200
< Tasks data present - Should return array of media data
< Tasks data present - Should return empty array if task not allowed uploaded
< Tasks data present - Should return error if try to get media of tasks of other testers
< Tasks data present - Should return error if try to get media of tasks of other testers
< Tasks data present - Should return tasks ordered by position asc
< Tasks data present - Should return tasks with correct data
< Tasks data present - Should return tasks with correct data
< Tasks data present - Should return tasks without userTask as pending 
< Tasks not present - Should return 200
< Tasks not present - Should return 403
< Tasks not present - Should return 404
< Tasks not present - Should return empty array if there are no tasks
< User role = admin - Should answer with selectionStatus ready if admin
< User role = administrator - Should answer with selectionStatus = ready
< User role = tester - Should answer with selection status not-started
< User role = tester with appq_campaign olp - Should answer with selectionStatus = ready
< Valid body - Checking payout data update in cp_meta - Should update correctly with floats
< Valid body - Checking payout data update in cp_meta - Should update critical_bug_payout
< Valid body - Checking payout data update in cp_meta - Should update high_bug_payout
< Valid body - Checking payout data update in cp_meta - Should update low_bug_payout
< Valid body - Checking payout data update in cp_meta - Should update medium_bug_payout
< Valid body - Checking payout data update in cp_meta - Should update multiple fields at once
< Valid body - Checking payout data update in cp_meta - Should update payout_limit
< Valid body - Checking payout data update in cp_meta - Should update percent_usecases
< Valid body - Checking payout data update in cp_meta - Should update point_multiplier_critical
< Valid body - Checking payout data update in cp_meta - Should update point_multiplier_high
< Valid body - Checking payout data update in cp_meta - Should update point_multiplier_low
< Valid body - Checking payout data update in cp_meta - Should update point_multiplier_medium
< Valid body - Checking payout data update in cp_meta - Should update point_multiplier_perfect
< Valid body - Checking payout data update in cp_meta - Should update point_multiplier_refused
< Valid body - Checking payout data update in cp_meta - Should update the campaign_complete_bonus_eur
< Valid body - Checking payout data update in cp_meta - Should update the campaign_pts
< Valid body - Checking payout data update in cp_meta - Should update top_tester_bonus
< Valid body - Should create the user task if it does not exist and return 200
< Valid body - Should return 200 if payload is valid
< Valid body - Should return 200 if user is logged and selected
< With auto apply - Should auto candidate
< With dossier data - Should not change campaign_type 0 if not send hasBugParade
< With dossier data - Should set campaign_type 0 if send hasBugParade 0
< With dossier data - Should set campaign_type 1 if send hasBugParade 1
< Without auto apply - Should not auto candidate
< Wrong requests - Should answer 400 if body is empty
< Wrong requests - Should answer 400 if body parameter is not valid
< Wrong requests - Should answer 400 if type does not exists
< Wrong requests - Should answer 403 if campaign does not exists
< Wrong requests - Should answer 404 if the campaign is not found
< hasBugParade and hasBugForm - Should insert campaign_type -1 if send hasBugForm 0
< hasBugParade and hasBugForm - Should insert campaign_type -1 if send hasBugForm 0 and hasBugForm 0
< hasBugParade and hasBugForm - Should insert campaign_type 0 as default if not send hasBugParade
< hasBugParade and hasBugForm - Should insert campaign_type 0 if send hasBugParade 0
< hasBugParade and hasBugForm - Should insert campaign_type 1 if send hasBugParade 1
< hasBugParade and hasBugForm - Should insert campaign_type 1 if send hasBugParade 1 and hasBugForm 1
< hasBugParade and hasBugForm - Should return an error if send hasBugParade 1 and hasBugForm 0
< hasBugParade and hasBugForm - Should return an error if send invalid hasBugParade
< payout data not present - Should return 200
< payout data not present - Should return payout data with all fields set to 0
< payout data not present - Should return payout data with campaign_pts field set to 200 as default
< payout data present - Should return 200
< payout data present - Should return payout data with campaign_complete_bonus_eur field
< payout data present - Should return payout data with critical_bug_payout field
< payout data present - Should return payout data with high_bug_payout field
< payout data present - Should return payout data with low_bug_payout field
< payout data present - Should return payout data with medium_bug_payout field
< payout data present - Should return payout data with minimum_bugs field
< payout data present - Should return payout data with payout_limit field
< payout data present - Should return payout data with percent_usecases field
< payout data present - Should return payout data with point_multiplier_critical field
< payout data present - Should return payout data with point_multiplier_high field
< payout data present - Should return payout data with point_multiplier_low field
< payout data present - Should return payout data with point_multiplier_medium field
< payout data present - Should return payout data with point_multiplier_perfect field
< payout data present - Should return payout data with point_multiplier_refused field
< payout data present - Should return payout data with top_tester_bonus field
< payout data present - Should return payout data with top_tester_bonus field 200 as default

Removed Tests

> GET /users/me/campaigns - manual and/or preview not public - not selected tester - should answer with a single campaign if filter is by not accepted applications

@d-beezee d-beezee requested a review from Copilot October 6, 2025 16:17
Copy link
Contributor

Copilot AI left a comment

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 implements API enhancements for Release 20251006, focusing on campaign V2 functionality and bug reporting improvements. The release adds comprehensive endpoints for campaign management, media handling, task management, and payout configuration.

  • Adds new API endpoints for campaign V2 features including preview, tasks, and media management
  • Implements bug language configuration and parade functionality for improved bug reporting
  • Introduces auto-apply campaign functionality and enhanced payout data management

Reviewed Changes

Copilot reviewed 59 out of 64 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/schema.ts Adds new API endpoints and data structures for campaign V2, including tasks, media, payouts, and visibility management
Task media routes Implements CRUD operations for campaign task media management with proper access controls
Campaign task routes Adds task creation and management endpoints for campaigns
User campaign endpoints Creates endpoints for tester interactions with campaigns including preview, payout data, and task completion
Dossier management routes Updates campaign creation and editing with auto-apply, bug language, and parade functionality
Campaign visibility route Implements endpoint for changing campaign visibility settings
Comments suppressed due to low confidence (2)

src/routes/dossiers/_post/creation.spec.ts:1

  • This line contains an orphaned number '4' which appears to be accidentally left behind and will cause a compilation error.
import app from "@src/app";

src/routes/campaigns/campaignId/preview/_post/index.spec.ts:1

  • Remove console.log statement from test as it's likely leftover debugging code and should not be in production tests.
import request from "supertest";

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

d-beezee and others added 2 commits October 6, 2025 18:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ec.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@d-beezee d-beezee merged commit 79f2b1c into main Oct 6, 2025
4 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.

4 participants