mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
feat: send mail notifications of sale receipts
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
IPaginationMeta,
|
||||
ISaleReceipt,
|
||||
ISalesReceiptsFilter,
|
||||
SaleReceiptMailOpts,
|
||||
} from '@/interfaces';
|
||||
import { EditSaleReceipt } from './EditSaleReceipt';
|
||||
import { GetSaleReceipt } from './GetSaleReceipt';
|
||||
@@ -13,6 +14,7 @@ import { GetSaleReceipts } from './GetSaleReceipts';
|
||||
import { CloseSaleReceipt } from './CloseSaleReceipt';
|
||||
import { SaleReceiptsPdf } from './SaleReceiptsPdfService';
|
||||
import { SaleReceiptNotifyBySms } from './SaleReceiptNotifyBySms';
|
||||
import { SaleReceiptMailNotification } from './SaleReceiptMailNotification';
|
||||
|
||||
@Service()
|
||||
export class SaleReceiptApplication {
|
||||
@@ -40,6 +42,9 @@ export class SaleReceiptApplication {
|
||||
@Inject()
|
||||
private saleReceiptNotifyBySmsService: SaleReceiptNotifyBySms;
|
||||
|
||||
@Inject()
|
||||
private saleReceiptNotifyByMailService: SaleReceiptMailNotification;
|
||||
|
||||
/**
|
||||
* Creates a new sale receipt with associated entries.
|
||||
* @param {number} tenantId
|
||||
@@ -166,4 +171,21 @@ export class SaleReceiptApplication {
|
||||
saleReceiptId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the receipt mail of the given sale receipt.
|
||||
* @param {number} tenantId
|
||||
* @param {number} saleReceiptId
|
||||
*/
|
||||
public sendSaleReceiptMail(
|
||||
tenantId: number,
|
||||
saleReceiptId: number,
|
||||
messageOpts: SaleReceiptMailOpts
|
||||
) {
|
||||
return this.saleReceiptNotifyByMailService.triggerMail(
|
||||
tenantId,
|
||||
saleReceiptId,
|
||||
messageOpts
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user