Skip to content

Add Payment Method Discounts - #21

Merged
OmarLawaty merged 1 commit into
devfrom
feat/discounts/paymentMethod
Aug 27, 2026
Merged

OmarLawaty merged 1 commit into
devfrom
feat/discounts/paymentMethod

Conversation

@OmarLawaty

Copy link
Copy Markdown
Member

No description provided.

@OmarLawaty
OmarLawaty requested a lite review from Copilot August 27, 2026 05:45
@OmarLawaty OmarLawaty self-assigned this Aug 27, 2026
@OmarLawaty OmarLawaty added enhancement New feature or request feature labels Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds support for restricting discounts to specific payment methods by extending the discount schema/types and introducing a new form section used on both the “Add Discount” and “Edit Discount” pages.

Changes:

  • Introduced a new DiscountPaymentMethods client component that toggles selected payment methods via react-hook-form.
  • Extended discount schema/type surface area to include paymentMethods (schema validation + backend Discount type).
  • Wired the new section into both add/edit discount pages and exported it from the discounts barrel.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/components/discounts/index.ts Exposes the new payment-methods section via the discounts barrel export.
src/components/discounts/DiscountPaymentMethods.tsx Adds the UI + form wiring for selecting payment methods.
src/components/discounts/DiscountForm.tsx Maps discount.paymentMethods into the form schema for edit flows.
src/app/(hydration)/(base)/discounts/add/page.tsx Renders the payment-methods section on the add discount page.
src/app/(hydration)/(base)/discounts/[id]/page.tsx Renders the payment-methods section on the edit discount page.
src/api/backend/types.ts Adds paymentMethods to the Discount response type.
src/api/backend/schemas/discounts/discountSchema.ts Adds paymentMethods to the DiscountSchema zod schema.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@OmarLawaty
OmarLawaty merged commit ba54f98 into dev Aug 27, 2026
3 checks passed
@OmarLawaty
OmarLawaty deleted the feat/discounts/paymentMethod branch August 27, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants