Skip to content

docs(promotions): PROMO-869 split promotion models into Draft, Patch … #968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BC-SEven
Copy link
Contributor

@BC-SEven BC-SEven commented Jun 4, 2025

…and Saved as each state has different expectations on what props are required

What changed?

Refactor promotion models to separate them into "Draft", "Patch" and "Saved" models to be used depending on context.
Here we can correct expectations for the SavedPromotions so id is always available. And for patch payloads where no properties are required.

Release notes draft

No behaviour changes here

Anything else?

ping @bigcommerce/team-promotions

…and Saved as each state has different expectations on what props are required
@BC-SEven BC-SEven marked this pull request as ready for review June 5, 2025 07:01
@@ -1158,11 +1297,6 @@ components:
description: 'A unique code that can be used to manually apply a discount. Only letters, numbers, white spaces, underscores and hyphens are allowed.'
example: TEST-COUPON-CODE
maxLength: 50
current_uses:
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this was removed, are we no longer tracking current_uses for CouponCode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good catch. No this shouldn't be removed. 😅

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.

3 participants