Adds order subscriber for slack
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
class OrderSubscriber {
|
||||
constructor({ economicService, eventBusService }) {
|
||||
this.economicService_ = economicService
|
||||
constructor({ slackService, eventBusService }) {
|
||||
this.slackService_ = slackService
|
||||
|
||||
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)
|
||||
await this.slackService_.orderNotification(order._id)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user