Skip to content

fix(core,dashboard): make coupon code validation case-insensitive#4438

Open
Jeffrey-manzl wants to merge 1 commit intomajorfrom
fix/oss-371-case-insensitive-coupon-codes
Open

fix(core,dashboard): make coupon code validation case-insensitive#4438
Jeffrey-manzl wants to merge 1 commit intomajorfrom
fix/oss-371-case-insensitive-coupon-codes

Conversation

@Jeffrey-manzl
Copy link
Collaborator

@Jeffrey-manzl Jeffrey-manzl commented Feb 27, 2026

Description

Coupon codes are now validated case-insensitively across the entire backend. Previously, a customer entering abc10 when the coupon code was ABC10 would get an "invalid coupon" error. This aligns Vendure with the behavior of other major e-commerce platforms (Shopify, WooCommerce).

Additionally, the Dashboard now auto-uppercases coupon code input for consistency.

Closes OSS-371

Changes:

  • promotion.service.ts: Use LOWER() in DB query for case-insensitive coupon lookup
  • promotion.entity.ts: Case-insensitive comparison in test() method
  • order.service.ts: Case-insensitive applyCouponCode and removeCouponCode
  • order-modifier.ts: Case-insensitive coupon code checks in order modification
  • promotions_.$id.tsx: Auto-uppercase coupon code input in Dashboard
  • order-promotion.e2e-spec.ts: Updated test to verify case-insensitive behavior

Breaking changes

No breaking changes. Coupon codes that previously required exact case matching will now match case-insensitively.

Screenshots

Screenshot 2026-02-27 at 14 44 04 Screenshot 2026-02-27 at 14 44 11

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

Coupon codes are now validated case-insensitively across the backend.
The Dashboard also auto-uppercases coupon codes on input for consistency.

Closes OSS-371
@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vendure-storybook Building Building Preview, Comment Feb 27, 2026 1:42pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/oss-371-case-insensitive-coupon-codes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant