Skip to content

#3936 delete guest definition#4081

Open
chrisdicono wants to merge 6 commits intodevelopfrom
#3936-delete-guest-definition
Open

#3936 delete guest definition#4081
chrisdicono wants to merge 6 commits intodevelopfrom
#3936-delete-guest-definition

Conversation

@chrisdicono
Copy link
Contributor

Changes

  • Created deleteGuestDefinition route, controller, and service method
  • Added 'Guest Definition' as an ExceptionObjectName
  • Created test util function createTestGuestDefinition
  • Added an example Guest Definition in the Prisma seed

Test Cases

  • Fails if user is not an admin
  • Fails if definition does not exist
  • Fails if definition is already deleted
  • Successfully deletes a guest definition

Screenshots

Screenshot 2026-03-23 174335 Screenshot 2026-03-23 174347 Screenshot 2026-03-23 174413 Screenshot 2026-03-23 174428

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #3936

@chrisdicono chrisdicono requested a review from staysgt March 23, 2026 21:49
@chrisdicono chrisdicono self-assigned this Mar 23, 2026
staysgt
staysgt previously approved these changes Mar 24, 2026
Copy link
Contributor

@staysgt staysgt left a comment

Choose a reason for hiding this comment

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

Looks good, great job!

@staysgt staysgt requested a review from chpy04 March 24, 2026 02:42
Copy link
Contributor

@chpy04 chpy04 left a comment

Choose a reason for hiding this comment

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

Ik there is existing code that doesn't follow what im requesting but it is a good practice im trying to implement going forward

data: { dateDeleted: new Date(), userDeletedId: deleter.userId }
});

return def;
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't return because its not actually used

* @param deleter the user requesting to delete the guestDefinition
* @param organizationId the organization ID of the deleter
*/
static async deleteGuestDefinition(deleter: User, definitionId: string, organization: Organization) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a promise return type just so its clear this returns nothing?

RecruitmentController.createGuestDefinition
);

recruitmentRouter.delete('/guestDefinition/:definitionId/delete', RecruitmentController.deleteGuestDefinition);
Copy link
Contributor

Choose a reason for hiding this comment

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

We generally want to avoid caps in route names, so lets change guestDefinition to guestdefinition. Just messaged in slack about the other ones in this file

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.

[Guest Page Improvements] - Delete Guest Definition

3 participants