mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { Process, Processor } from '@nestjs/bull';
|
||||
import { Job } from 'bull';
|
||||
import {
|
||||
SendSaleEstimateMailJob,
|
||||
SendSaleEstimateMailQueue,
|
||||
} from '../types/SaleEstimates.types';
|
||||
import { SendSaleEstimateMail } from '../commands/SendSaleEstimateMail';
|
||||
|
||||
@Processor(SendSaleEstimateMailQueue)
|
||||
export class SendSaleEstimateMailProcess {
|
||||
constructor(private readonly sendEstimateMailService: SendSaleEstimateMail) {}
|
||||
|
||||
@Process(SendSaleEstimateMailJob)
|
||||
async handleSendMail(job: Job) {
|
||||
const { saleEstimateId, messageOptions } = job.data;
|
||||
|
||||
await this.sendEstimateMailService.sendMail(saleEstimateId, messageOptions);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user