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-Buyer-coupon-discount-management #100

Merged
merged 1 commit into from
May 27, 2024
Merged

Conversation

Calebgisa72
Copy link
Contributor

  1. 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.
  1. Description of Task Completed:

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.

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.

Swagger Documentation:

  • Documented the new coupon application endpoint in Swagger for easy API reference and testing.
  1. How should this be manually tested?

@Calebgisa72 Calebgisa72 self-assigned this May 26, 2024
@Calebgisa72 Calebgisa72 added backend Good for newcomers Ready for reviews Pull request is ready for review coupon this feature enables VENDOR to manage discount labels May 26, 2024
@Calebgisa72 Calebgisa72 added this to the Purchase process milestone May 26, 2024
@faid-terence faid-terence added the Highest priority Has more priority label May 26, 2024
@faid-terence
Copy link
Collaborator

@Calebgisa72
Please rebase with develop !

@coveralls
Copy link

Pull Request Test Coverage Report for Build 9251675253

Details

  • 50 of 51 (98.04%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 76.733%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/services/couponServices/buyerApplyCoupon.ts 40 41 97.56%
Totals Coverage Status
Change from base Build 9251196321: 0.5%
Covered Lines: 1622
Relevant Lines: 2000

💛 - Coveralls

Copy link
Collaborator

@faid-terence faid-terence left a comment

Choose a reason for hiding this comment

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

Nice Work @Calebgisa72 !

@faid-terence faid-terence merged commit 66c5d2c into develop May 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Good for newcomers coupon this feature enables VENDOR to manage discount Highest priority Has more priority Ready for reviews Pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants