Skip to content

fix(loyalty): omit product options in denomination updates#16116

Draft
ryanngit wants to merge 1 commit into
medusajs:developfrom
ryanngit:fix/15742-loyalty-denomination-options
Draft

fix(loyalty): omit product options in denomination updates#16116
ryanngit wants to merge 1 commit into
medusajs:developfrom
ryanngit:fix/15742-loyalty-denomination-options

Conversation

@ryanngit

Copy link
Copy Markdown

Summary

What - Removes the unsupported product-level options field from gift card denomination update payloads. Variant denomination options remain unchanged. This also adds focused regression coverage and a package-local Vitest task.

Why - Product update validation rejects product-level options, so denomination edits submit an invalid payload.

How - Builds the update payload from variants only and asserts the exact mutation payload in the regression test.

Testing - No Docker or containers used.

corepack yarn workspace @medusajs/loyalty-plugin test
exit 0 - 1 test file passed, 1 test passed

corepack yarn turbo run test --filter=@medusajs/loyalty-plugin --force --no-daemon -- 'src/admin/routes/gift-cards/gift-card-products/[id]/@denominations/components/gift-card-product-edit-denominations-form.spec.tsx' --reporter=verbose
exit 0 - 1 test file passed, 1 test passed; 1 task successful, 0 cached

corepack yarn prettier --check '.changeset/fix-loyalty-denomination-update.md' 'packages/plugins/loyalty/package.json' 'packages/plugins/loyalty/src/admin/routes/gift-cards/gift-card-products/[id]/@denominations/components/gift-card-product-edit-denominations-form.spec.tsx' 'packages/plugins/loyalty/src/admin/routes/gift-cards/gift-card-products/[id]/@denominations/components/gift-card-product-edit-denominations-form.tsx' 'packages/plugins/loyalty/vitest.config.cjs'
exit 0 - all matched files use Prettier code style

corepack yarn eslint 'packages/plugins/loyalty/src/admin/routes/gift-cards/gift-card-products/[id]/@denominations/components/gift-card-product-edit-denominations-form.spec.tsx' 'packages/plugins/loyalty/src/admin/routes/gift-cards/gift-card-products/[id]/@denominations/components/gift-card-product-edit-denominations-form.tsx' 'packages/plugins/loyalty/vitest.config.cjs'
exit 0 - no output

corepack yarn changeset status
exit 0 - changeset graph valid

corepack yarn turbo run build:plugin --filter=@medusajs/loyalty-plugin --no-daemon --output-logs=errors-only
exit 0 - 72 tasks successful, 72 cached

git diff b15b8522126f094eeb435a0c479d25837a63c260 HEAD --check
exit 0 - no output

Examples

Not applicable; this corrects the submitted mutation payload shape.


Checklist

  • I have added a changeset for this PR
  • The changes are covered by relevant tests
  • I have verified the code works as intended locally
  • I have linked the related issue(s) if applicable

Additional Context

Changeset: @medusajs/loyalty-plugin patch. Existing pending changesets make the aggregate changeset status report a minor bump for this package.

Closes #15742

Keep denomination values on variants while removing the unsupported product-level options field from update payloads. Add focused regression coverage, plugin test wiring, and a patch changeset.
@ryanngit
ryanngit requested a review from a team as a code owner July 17, 2026 22:06
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 02efc6f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 79 packages
Name Type
@medusajs/loyalty-plugin Patch
@medusajs/medusa Patch
@medusajs/test-utils Patch
@medusajs/analytics Patch
@medusajs/api-key Patch
@medusajs/auth Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/caching Patch
@medusajs/cart Patch
@medusajs/currency Patch
@medusajs/customer Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
@medusajs/file Patch
@medusajs/fulfillment Patch
@medusajs/index Patch
@medusajs/inventory Patch
@medusajs/link-modules Patch
@medusajs/locking Patch
@medusajs/notification Patch
@medusajs/order Patch
@medusajs/payment Patch
@medusajs/pricing Patch
@medusajs/product Patch
@medusajs/promotion Patch
@medusajs/rbac Patch
@medusajs/region Patch
@medusajs/sales-channel Patch
@medusajs/settings Patch
@medusajs/stock-location Patch
@medusajs/store Patch
@medusajs/tax Patch
@medusajs/translation Patch
@medusajs/user Patch
@medusajs/workflow-engine-inmemory Patch
@medusajs/workflow-engine-redis Patch
@medusajs/analytics-local Patch
@medusajs/analytics-posthog Patch
@medusajs/auth-emailpass Patch
@medusajs/auth-github Patch
@medusajs/auth-google Patch
@medusajs/caching-redis Patch
@medusajs/file-local Patch
@medusajs/file-s3 Patch
@medusajs/fulfillment-manual Patch
@medusajs/locking-postgres Patch
@medusajs/locking-redis Patch
@medusajs/notification-local Patch
@medusajs/notification-sendgrid Patch
@medusajs/payment-stripe Patch
@medusajs/draft-order Patch
@medusajs/core-flows Patch
@medusajs/framework Patch
@medusajs/js-sdk Patch
@medusajs/modules-sdk Patch
@medusajs/orchestration Patch
@medusajs/query Patch
@medusajs/types Patch
@medusajs/utils Patch
@medusajs/workflows-sdk Patch
@medusajs/http-types-generator Patch
@medusajs/cli Patch
@medusajs/medusa-oas-cli Patch
@medusajs/oas-github-ci Patch
@medusajs/deps Patch
@medusajs/eslint-plugin Patch
@medusajs/telemetry Patch
@medusajs/admin-bundler Patch
@medusajs/admin-sdk Patch
@medusajs/admin-shared Patch
@medusajs/admin-vite-plugin Patch
@medusajs/dashboard Patch
@medusajs/icons Patch
@medusajs/toolbox Patch
@medusajs/ui-preset Patch
create-medusa-app Patch
integration-tests-http Patch
@medusajs/ui Patch

Not sure what this means? Click here to learn what changesets are.

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

@medusa-os-bot

medusa-os-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

Thanks for the contribution! Initial automated review looks good.

Focused fix for the linked good-first-issue bug: drops the unsupported product-level options field from the gift-card denomination update payload while keeping the per-variant options mapping. PR template is complete, change is small and scoped, and a regression test asserts the exact mutation payload. Suggest a quick manual check that adding a brand-new denomination value still succeeds now that the product-level options declaration is gone (variant options should upsert the value), though existing behavior likely handles this.

Triggered by: new PR opened

@ryanngit
ryanngit marked this pull request as draft July 17, 2026 23:25
@ryanngit

Copy link
Copy Markdown
Author

Validation of the new-denomination path found that missing option values are not upserted by the variant update. Separate option-link and product-update requests are not atomic, so the current patch should not merge yet. Maintainers, would you prefer an atomic Product Module/workflow extension in this PR or a separate core PR?

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.

[Bug]: @medusajs/loyalty-plugin — Editing gift card denominations crashes the admin dashboard (sends unsupported options field)

1 participant