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

79 buyer should be able to checkout #87

Merged
merged 1 commit into from
May 28, 2024
Merged

Conversation

ambroisegithub
Copy link
Contributor

@ambroisegithub ambroisegithub commented May 22, 2024

Implement Buyer Checkout Functionality

Description:

This pull request addresses the user story of enabling buyers to seamlessly complete the checkout process. It ensures that orders are validated, inventory is updated, and accounts are appropriately managed. Additionally, it distinguishes between guest users and registered buyers and applies discounts and coupon codes at checkout.

Acceptance Criteria:

Checkout Request Processing:

Step 1:

  • WHEN a POST request for checkout is received, and the requesting user/token is a buyer and the request body is validated.
  • THEN the order should be processed.
  • Delivery and payment information should be saved to the buyer's account.
  • The inventory should be updated.
  • An order confirmation should be sent to the frontend to be displayed to the buyer.

Step 2:

  • WHEN the request body fails any validation checks or the token is not of the role buyer.
  • THEN the appropriate 4XX response message should be sent to the frontend describing the validation error.

Step 3:

  • WHEN user/token is not provided.
  • THEN return an error message to the frontend asking the user to log in to proceed with checkout.

Developer Notes:

Input Validation:

  • All inputs should be validated for sanity.

Order Management:

  • The order should be saved to the buyer's account for future use.

User Authentication:

  • Ensure that the user is logged in before proceeding with the checkout process.

Inventory Management:

  • Update the inventory to reflect the items ordered.

Related Issues:

#77
#54
#75
#57

@ambroisegithub ambroisegithub self-assigned this May 22, 2024
@ambroisegithub ambroisegithub added the backend Good for newcomers label May 22, 2024
@ambroisegithub ambroisegithub added this to the Order Management milestone May 22, 2024
@ambroisegithub ambroisegithub linked an issue May 22, 2024 that may be closed by this pull request
4 tasks
@ambroisegithub ambroisegithub force-pushed the ft-buyer-checkout-#79 branch 14 times, most recently from fd79aa4 to 12bfdbd Compare May 27, 2024 05:35
@ambroisegithub ambroisegithub force-pushed the ft-buyer-checkout-#79 branch 8 times, most recently from a1892bf to 7e810a9 Compare May 27, 2024 08:20
@ambroisegithub ambroisegithub force-pushed the ft-buyer-checkout-#79 branch 4 times, most recently from 2e73273 to 6c0963c Compare May 27, 2024 18:26
@codecov-commenter
Copy link

codecov-commenter commented May 27, 2024

Codecov Report

Attention: Patch coverage is 93.89313% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 89.99%. Comparing base (48b2d73) to head (e53d0ba).
Report is 1 commits behind head on develop.

Files Patch % Lines
src/utilis/couponCalculator.ts 63.63% 4 Missing ⚠️
src/controller/userController.ts 85.71% 0 Missing and 2 partials ⚠️
src/controller/cartController.ts 98.21% 0 Missing and 1 partial ⚠️
src/middlewares/errorHandler.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #87      +/-   ##
===========================================
+ Coverage    89.52%   89.99%   +0.46%     
===========================================
  Files           39       43       +4     
  Lines          983     1109     +126     
  Branches       116      126      +10     
===========================================
+ Hits           880      998     +118     
- Misses          89       94       +5     
- Partials        14       17       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

niyobern
niyobern previously approved these changes May 27, 2024
Copy link
Contributor

@bertrandshema bertrandshema left a comment

Choose a reason for hiding this comment

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

It is all good!

@ambroisegithub
Copy link
Contributor Author

ambroisegithub commented May 28, 2024

Screenshot from 2024-05-28 13-07-51

Screenshot from 2024-05-28 13-30-27

Screenshot from 2024-05-28 13-30-46

@dushimeemma dushimeemma merged commit 262e48b into develop May 28, 2024
2 checks passed
ambroisegithub added a commit that referenced this pull request May 28, 2024
Co-authored-by: IRADUKUNDA SANGWA CEDRIC <110623461+Dawaic6@users.noreply.github.com>
ambroisegithub added a commit that referenced this pull request May 28, 2024
Co-authored-by: IRADUKUNDA SANGWA CEDRIC <110623461+Dawaic6@users.noreply.github.com>

user should make chat with chatbot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buyer should be able to checkout
7 participants