mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
19 lines
621 B
TypeScript
19 lines
621 B
TypeScript
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);
|
|
}
|
|
}
|