Skip to content
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

Feat/create #5

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

Conversation

MDelarosa1993
Copy link

Show a Coupon: Retrieves a specific coupon by ID and returns its details in JSON format.
Index Coupons: Lists all coupons for a specific merchant, returning an array of coupon objects.
Create a Coupon: Allows the creation of a new coupon linked to a merchant. Validations ensure unique codes and required attributes.
Model Updates:

Coupon Model: Added validations for uniqueness of coupon codes scoped to merchants, along with necessary associations.
Invoice Model: Updated to optionally associate with a coupon.
Merchant Model: Established a relationship with coupons.
Serializer: A CouponSerializer has been added to format coupon data for API responses.

Database Migrations:

Created a coupons table with necessary fields and validations.
Added a reference to coupons in the invoices table.
Tests: Comprehensive request specs ensure the functionality works as intended, covering all CRUD operations for coupons and handling edge cases.

This update enhances the functionality of the merchant management system by allowing the creation and retrieval of coupons, facilitating promotional offers for merchants.

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.

1 participant