Skip to content

SIMSBIOHUB-891: Backend for Ticket System#345

Merged
mauberti-bc merged 7 commits intodevfrom
SIMSBIOHUB-891
Mar 4, 2026
Merged

SIMSBIOHUB-891: Backend for Ticket System#345
mauberti-bc merged 7 commits intodevfrom
SIMSBIOHUB-891

Conversation

@mauberti-bc
Copy link
Collaborator

@mauberti-bc mauberti-bc commented Feb 27, 2026

Links to Jira Tickets

Description of Changes

  • Introduces ticket tables and lifecycle support in the database.
  • Adds backend APIs to create, list, view, update, change status, and delete tickets.
  • Adds support for ticket comments and retrieving ticket history.
  • Adds support for linking related tickets.
  • Associates tickets to teams for access
  • Includes seed data

API Endpoints

  • POST /api/tickets
  • GET /api/tickets (supports filters such as team_id, status, and pagination parameters)
  • GET /api/tickets/{ticketId}
  • PUT /api/tickets/{ticketId}
  • DELETE /api/tickets/{ticketId}
  • POST /api/tickets/{ticketId}/status
  • POST /api/tickets/{ticketId}/comment
  • PUT /api/tickets/{ticketId}/comment/{ticketCommentId}
  • DELETE /api/tickets/{ticketId}/comment/{ticketCommentId}
  • POST /api/tickets/{ticketId}/reference
  • DELETE /api/tickets/{ticketId}/reference/{ticketReferenceId}

Testing Notes

  • make backend to run the api and database with seed data
  • In Postman, authorize as a system administrator
  • Try each of the endpoints above to ensure they behave as expected

update and delete ticket comments

cleanup repository

cleanup

cleanup

indexes and seeds

fix tests

code smell

fix tests

linter
@mauberti-bc mauberti-bc marked this pull request as ready for review February 27, 2026 18:17
@mauberti-bc mauberti-bc added the Ready For Review PR is ready for review label Feb 27, 2026
@dwhogan dwhogan self-requested a review February 27, 2026 18:58
Copy link
Collaborator

@dwhogan dwhogan left a comment

Choose a reason for hiding this comment

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

200 instead of 201

Copy link
Collaborator

@dwhogan dwhogan left a comment

Choose a reason for hiding this comment

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

idempotent with ensure*, self-reference check constraint (source_ticket_id <> target_ticket_id) -> nice

slug generation using advisory locks, best I have seen to solve the age old id problem 👍

@dwhogan
Copy link
Collaborator

dwhogan commented Feb 27, 2026

Endpoint tests
POST /api/tickets
GET /api/tickets (supports filters such as team_id, status, and pagination parameters)
GET /api/tickets/{ticketId}
PUT /api/tickets/{ticketId}
DELETE /api/tickets/{ticketId}
POST /api/tickets/{ticketId}/status
POST /api/tickets/{ticketId}/comment
PUT /api/tickets/{ticketId}/comment/{ticketCommentId}
DELETE /api/tickets/{ticketId}/comment/{ticketCommentId}
POST /api/tickets/{ticketId}/reference
DELETE /api/tickets/{ticketId}/reference/{ticketReferenceId}

the GET /api/tickets/{ticketId} after delete returns 500 instead of 404, the handler is catching the error and re-throwing iI think

@mauberti-bc
Copy link
Collaborator Author

mauberti-bc commented Feb 27, 2026

the GET /api/tickets/{ticketId} after delete returns 500 instead of 404, the handler is catching the error and re-throwing iI think

Endpoint tests POST /api/tickets GET /api/tickets (supports filters such as team_id, status, and pagination parameters) GET /api/tickets/{ticketId} PUT /api/tickets/{ticketId} DELETE /api/tickets/{ticketId} POST /api/tickets/{ticketId}/status POST /api/tickets/{ticketId}/comment PUT /api/tickets/{ticketId}/comment/{ticketCommentId} DELETE /api/tickets/{ticketId}/comment/{ticketCommentId} POST /api/tickets/{ticketId}/reference DELETE /api/tickets/{ticketId}/reference/{ticketReferenceId}

the GET /api/tickets/{ticketId} after delete returns 500 instead of 404, the handler is catching the error and re-throwing iI think

I believe this is the pattern we have everywhere, because we throw in the repositories if row count is < 1, which would be true if the resource does not exist. We probably want to fix this everywhere at once.

Fixed here: #350

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

Copy link
Collaborator

@dwhogan dwhogan left a comment

Choose a reason for hiding this comment

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

👍

@mauberti-bc mauberti-bc merged commit d962be8 into dev Mar 4, 2026
18 checks passed
@mauberti-bc mauberti-bc deleted the SIMSBIOHUB-891 branch March 4, 2026 16:13
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.

2 participants