Skip to content

feat(bookings): add idempotency guard to booking creation (BE-28) - #829

Merged
Qoder-Voidd merged 1 commit into
Akazajan:mainfrom
Lazaruster:feat/BE-28-idempotency-booking-creation
Oct 20, 2026
Merged

Qoder-Voidd merged 1 commit into
Akazajan:mainfrom
Lazaruster:feat/BE-28-idempotency-booking-creation

Conversation

@Lazaruster

Copy link
Copy Markdown
Contributor

closes #598

  • Add UseInterceptors to @nestjs/common imports in bookings controller
  • Remove duplicate CreateRecurringBookingDto import (modules/bookings path)
  • Apply @UseInterceptors(IdempotencyGuard) to POST /recurring endpoint
  • Fix IdempotencyKey unique index to include endpoint column

The unique index was [key, userId] but the guard scopes reservations by [key, userId, endpoint]. Without endpoint in the index, the same key on two different endpoints would hit a spurious unique constraint violation. A migration is required to drop the old index and create the new one.

- Add UseInterceptors to @nestjs/common imports in bookings controller
- Remove duplicate CreateRecurringBookingDto import (modules/bookings path)
- Apply @UseInterceptors(IdempotencyGuard) to POST /recurring endpoint
- Fix IdempotencyKey unique index to include endpoint column

The unique index was [key, userId] but the guard scopes reservations by
[key, userId, endpoint]. Without endpoint in the index, the same key on
two different endpoints would hit a spurious unique constraint violation.
A migration is required to drop the old index and create the new one.
@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@Lazaruster Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Qoder-Voidd Qoder-Voidd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Qoder-Voidd
Qoder-Voidd merged commit a5d3db7 into Akazajan:main Oct 20, 2026
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.

BE-28 — Add idempotency to booking creation

2 participants