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

[Challenge]: feat: payment strategy (Rodrigo Antas - Software engineer position) #368

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

rodrigoantas
Copy link

  • You have read the CONTRIBUTING.md
  • For Terraform changes, you have read the Terraform Naming Conventions
  • For Terraform changes, you have already executed the Terraform plan on this branch
  • The changes inside this pull request are organization-agnostic

Why?

This pull request is for the Challenge regarding the software engineer posistion. It introduces a new approach to handling payment processing and shipping rules in the order management system.

What?

  • Implemented a strategy pattern to handle different payment processing rules based on product types.
  • Added specific strategies for Book, Digital, Membership, and Physical products.
  • Updated the Order and OrderItem class to use these strategies for payment processing.
  • Added unit tests to cover the new behavior introduced by the strategies.
  • Created a CI for the unit tests.

Jira link:

How:

  • Refactored the Order class to include a paymentStrategyMap for handling different product types.
  • Created individual strategy classes for each product type that implement the PaymentStrategy interface.
  • Updated the OrderItem class to allow quantity adjustments with validation.
  • Added unit tests to ensure that each payment strategy is invoked correctly during payment processing.

Comments:

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