Skip to content

fix(promotions): include campaign.budget.type in status_display requiredFields - #16251

Open
okxint wants to merge 1 commit into
medusajs:developfrom
okxint:fix/promotion-status-campaign-budget-type
Open

fix(promotions): include campaign.budget.type in status_display requiredFields#16251
okxint wants to merge 1 commit into
medusajs:developfrom
okxint:fix/promotion-status-campaign-budget-type

Conversation

@okxint

@okxint okxint commented Jul 31, 2026

Copy link
Copy Markdown

The status_display computed column for Promotion lists requiredFields
that drive the API fields= query. It requests campaign.budget.limit and
campaign.budget.used but omits campaign.budget.type.

getPromotionStatus() checks budget.type to decide whether to skip the
exhausted-budget check for use_by_attribute / spend_by_attribute budget
types. Because type is never fetched, it receives undefined, falls
through to the overBudget branch, and marks otherwise-active promotions
as "Campaign expired".

Adding campaign.budget.type to requiredFields ensures the type is
available when getPromotionStatus() evaluates the promotion status.

@okxint
okxint requested a review from a team as a code owner July 31, 2026 06:53
@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c1cb99c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@medusa-os-bot

medusa-os-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

Thanks for the contribution! We need more information before reviewing this further.

Correctly fixes a missing field in the Promotion status_display computed column that caused promotions with per-attribute budgets to be incorrectly marked as expired. The one-line change is well-reasoned and targeted. However, the PR body replaces the required template with free-form prose — the Testing section is absent — and no changeset is included.

Triggered by: new PR opened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant