Skip to content

[GF-FE-13] Add promo and discount code input field to the booking payment flow #1108

Description

@yusuftomilola

Problem

The booking flow has no promo or discount code input. Members who have been given a promotional code (e.g. for a corporate rate or referral reward) have no way to apply it at checkout. This makes promo codes backend-only with no member-facing surface.

Proposed Solution

Extend the booking wizard in frontend/app/bookings/new/page.tsx to include a promo code field in the payment step.

Changes:

  1. Add a "Have a promo code?" collapsible section before the payment button
  2. Inside: text input for the code + an Apply button
  3. On clicking Apply, call POST /promo-codes/validate with { code, workspaceId, bookingAmount }
  4. On success: show a green confirmation banner — "₦X discount applied" or "X% off" — and update the displayed total
  5. On error: show inline error message ("Code expired", "Code not valid for this workspace type", etc.)
  6. Show a Remove link to clear the applied code and restore the original total
  7. Pass the validated promo code to the booking creation/payment request

Acceptance Criteria

  • Promo code input and Apply button added to the payment step of the booking flow
  • POST /promo-codes/validate is called when Apply is clicked
  • Discount and updated total are shown on valid code
  • Inline error is shown for invalid, expired, or already-used codes
  • Remove clears the code and restores the original total
  • The promo code is included in the payment initialisation request

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions