Implemented Coupon Management with Coupon Creation and Edit Feature #894
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR introduces a new feature for creating and editing coupon codes. It includes a form that allows users to input details for new coupons or edit existing ones. The form fields include coupon code, description, value, minimum order amount, maximum discount, start and end dates, and usage limit. The feature is designed to be flexible and user-friendly, providing easy creation and management of coupon codes.
Changes:
Coupon Form Component:
CouponForm
component responsible for displaying the coupon creation/edit form.code
(text input)description
(text input)value
(text input)minOrderAmount
(text input)maxDiscount
(text input)startDate
(date input)endDate
(date input)usageLimit
(text input)Styling:
max-height
of 80vh and becomes scrollable if the content overflows.State Management:
formData
) and updates them usingonFormChange
function passed down as a prop.Buttons and Actions:
onSubmit
passing the updated coupon data.Responsive Design:
Validation:
required
to ensure the user cannot submit the form without providing necessary data.How It Works:
onSubmit
function will be called, passing the form data back to the parent component (which handles coupon creation or editing logic).Screenshots (if applicable):
coupon.mp4
Related Issues: