Skip to content

SIMSBIOHUB 881: Adding Ticket ID to Data Request#359

Open
J-pilon wants to merge 9 commits intodevfrom
SIMSBIOHUB-881
Open

SIMSBIOHUB 881: Adding Ticket ID to Data Request#359
J-pilon wants to merge 9 commits intodevfrom
SIMSBIOHUB-881

Conversation

@J-pilon
Copy link
Collaborator

@J-pilon J-pilon commented Mar 6, 2026

Links to Jira Tickets

https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-881

Description of Changes

Database – Adds ticket_id to data_request: migration adds ticket_id (UUID, NOT NULL), FK to ticket(ticket_id), and index data_request_ticket_idx.

API – Models – Data request models now include ticket_id: added to DataRequest (Zod), FlatDataRequestWithStatus, DataRequestWithStatus, and CreateDataRequestPayload.

API – OpenAPI & schematicket_id added to the data request response schema and OpenAPI spec (required, UUID, description: “ID of the ticket associated with this data request”).

API – Data request creation – When a data request is created, a ticket is created first via a new private DataRequestService.createTicket() (subject “Data Request”, description = request reason, priority “medium”). The new ticket’s ticket_id is passed into the repository so each data request is stored with a non-null ticket_id.

API – RepositoryDataRequestRepository selects and returns ticket_id in all relevant queries; createDataRequest accepts and persists ticket_id in the payload.

API – Utils_transformFlatDataRequestToNested in data-request.ts includes ticket_id in the nested response so all service responses expose it.

API – Tests – Data request service, repository, and route tests updated to use and assert ticket_id; seeds updated so data requests are created with linked tickets.

Testing Instructions

  • Create data request: Create a data request via the API; response and DB row should include a valid ticket_id pointing to a new ticket with subject “Data Request” and the request reason as description.
  • Get/list data requests: GET by ID and list endpoints should return ticket_id for each data request.
  • API tests: Run data request service, repository, and path tests; all should pass with the new ticket_id expectations.
  • Seeds: Run seeds; data requests should be created with valid ticket_id values.

@J-pilon J-pilon changed the title SIMSBIOHUB 881 SIMSBIOHUB 881: Adding Ticket ID to Data Request Mar 6, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

@J-pilon J-pilon marked this pull request as ready for review March 6, 2026 20:58
@J-pilon J-pilon added the Ready For Review PR is ready for review label Mar 6, 2026
@J-pilon J-pilon requested a review from mauberti-bc March 6, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant