challenge icon indicating copy to clipboard operation
challenge copied to clipboard

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

Open rodrigoantas opened this issue 6 months ago • 0 comments

  • [ ] 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
  • [x] 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:

rodrigoantas avatar Aug 13 '24 02:08 rodrigoantas