-
-
Save 5AbhishekSaxena/61277eeb98a5c2cc7da6375450652f8d to your computer and use it in GitHub Desktop.
This file contains 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 OrderFacade( | |
private val orderNotificationSender: OrderNotificationSender, | |
private val orderInvoiceGenerator: OrderInvoiceGenerator, | |
private val orderRepository: OrderRepository | |
) { | |
fun sendNotification(order: Order) { | |
// sends notification about order updates to the user. | |
orderNotificationSender.sendNotification(order) | |
} | |
fun generateInvoice(order: Order) { | |
// generates invoice | |
orderInvoiceGenerator.generateInvoice(order) | |
} | |
fun save(order: Order) { | |
// insert/update data in the db | |
orderRepository.save(order) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment