mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
29 lines
772 B
TypeScript
29 lines
772 B
TypeScript
import { Container } from 'typedi';
|
|
import { On, EventSubscriber } from 'event-dispatch';
|
|
import events from '@/subscribers/events';
|
|
import SaleReceiptNotifyBySms from '@/services/Sales/SaleReceiptNotifyBySms';
|
|
import PaymentReceiveNotifyBySms from './PaymentReceiveSmsNotify';
|
|
|
|
@EventSubscriber()
|
|
export default class SendSmsNotificationPaymentReceive {
|
|
paymentReceiveNotifyBySms: PaymentReceiveNotifyBySms;
|
|
|
|
constructor() {
|
|
this.paymentReceiveNotifyBySms = Container.get(PaymentReceiveNotifyBySms);
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
@On(events.paymentReceive.onNotifySms)
|
|
async sendSmsNotificationOnceInvoiceNotify({
|
|
paymentReceive,
|
|
customer,
|
|
}) {
|
|
await this.paymentReceiveNotifyBySms.sendSmsNotification(
|
|
paymentReceive,
|
|
customer
|
|
);
|
|
}
|
|
}
|