Created
December 16, 2020 15:40
-
-
Save radzserg/31726b41e721dd0064c837878dbd25ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class OrderManager { | |
| public createOrder(orderData) { | |
| (new OrderValidator).validateOrderInput(orderData); | |
| const total = (new OrderCalculator).calculateTotal(orderData); | |
| (new MyPaymentGateway).processPayment(total, { meta: "info" }); | |
| return (new OrderRepository()).save(orderData); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment