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

Ft buyer coupon #99

Closed
wants to merge 9 commits into from
Closed

Ft buyer coupon #99

wants to merge 9 commits into from

Conversation

Calebgisa72
Copy link
Contributor

What does this PR do?

  • This PR introduces key features and enhancements related to coupon application functionality in the backend. The aim is to allow buyers to apply coupon codes to their cart, including validating the coupon, checking its expiration, and updating the cart's total price accordingly.

Description of Task Completed:

  1. Coupon Application Endpoint:
  • Implemented an endpoint for applying a coupon code to the user's cart.
  • Validates the coupon code and checks for its expiration date and usage limits.
  • Applies the discount to the appropriate product in the cart and updates the cart's total price.
  • Handles errors such as missing coupon code, invalid coupon code, expired coupon, and no matching product in the cart.
  1. Tests:
  • Added tests for the coupon application endpoint to ensure it functions correctly.
  • Added tests for error handling to ensure robustness and reliability of the coupon application functionality.
  1. Swagger Documentation:
  • Documented the new coupon application endpoint in Swagger for easy API reference and testing.
  1. How should this be manually tested?
    git clone https://github.com/atlp-rwanda/knights-ecomm-be.git
    cd knights-ecomm-be
    npm install
    npm run dev
    npm run test

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.

Buyer should be able to apply coupons during checkout
3 participants