Skip to content

feat: build promo codes and discount backend module#1144

Merged
yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
soundsng:feat/promo-codes-discount-module
Jun 26, 2026
Merged

feat: build promo codes and discount backend module#1144
yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
soundsng:feat/promo-codes-discount-module

Conversation

@soundsng

Copy link
Copy Markdown
Contributor

Summary

  • Adds a full PromoCodesModule with PromoCode and PromoCodeUsage entities, DTOs, service, and controller
  • Implements promo code validation (expiry, max uses, minimum booking amount, workspace type restrictions, per-user idempotency) and atomic usage recording via a database transaction
  • Wires the module into the payments webhook flow so usage is recorded automatically on successful charge

Changes

  • backend/src/promo-codes/ — new module (entities, DTOs, service, controller, module)
  • backend/src/bookings/entities/booking.entity.ts — added appliedPromoCodeId and promoDiscountApplied nullable columns
  • backend/src/payments/providers/handle-webhook.provider.ts — calls recordUsage on successful payment if a promo code was applied
  • backend/src/payments/payments.module.ts — imports PromoCodesModule
  • backend/src/app.module.ts — imports PromoCodesModule

closes #1084

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@soundsng is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@yusuftomilola yusuftomilola left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very unique way of approaching problems.

@yusuftomilola yusuftomilola merged commit 6e0bae8 into DistinctCodes:main Jun 26, 2026
5 of 7 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.

[GF-BE-09] Build promo codes and discount backend module

2 participants