Adds slack order notification

This commit is contained in:
olivermrbl
2020-07-12 11:13:04 +02:00
parent d4c036c29a
commit 764778b929
19 changed files with 17364 additions and 0 deletions
@@ -0,0 +1,17 @@
class OrderSubscriber {
constructor({ economicService, eventBusService }) {
this.economicService_ = economicService
this.eventBus_ = eventBusService
this.eventBus_.subscribe("order.placed", async (order) => {
await this.economicService_.draftEconomicInvoice(order)
})
this.eventBus_.subscribe("order.completed", async (order) => {
await this.economicService_.bookEconomicInvoice(order._id)
})
}
}
export default OrderSubscriber