mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor: nestjs
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { Process, Processor } from '@nestjs/bull';
|
||||
import { Job } from 'bull';
|
||||
import { SendSaleReceiptMailQueue } from '../constants';
|
||||
import { SaleReceiptMailNotification } from '../commands/SaleReceiptMailNotification';
|
||||
|
||||
@Processor(SendSaleReceiptMailQueue)
|
||||
export class SendSaleReceiptMailProcess {
|
||||
constructor(
|
||||
private readonly saleReceiptMailNotification: SaleReceiptMailNotification,
|
||||
) {}
|
||||
|
||||
@Process(SendSaleReceiptMailQueue)
|
||||
async handleSendMailJob(job: Job) {
|
||||
const { messageOpts, saleReceiptId } = job.data;
|
||||
|
||||
await this.saleReceiptMailNotification.sendMail(saleReceiptId, messageOpts);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user