mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: wip send an invoice mail the customer email
This commit is contained in:
@@ -17,6 +17,7 @@ import { ApproveSaleEstimate } from './ApproveSaleEstimate';
|
||||
import { RejectSaleEstimate } from './RejectSaleEstimate';
|
||||
import { SaleEstimateNotifyBySms } from './SaleEstimateSmsNotify';
|
||||
import { SaleEstimatesPdf } from './SaleEstimatesPdf';
|
||||
import { SendSaleEstimateMail } from './SendSaleEstimateMail';
|
||||
|
||||
@Service()
|
||||
export class SaleEstimatesApplication {
|
||||
@@ -50,6 +51,9 @@ export class SaleEstimatesApplication {
|
||||
@Inject()
|
||||
private saleEstimatesPdfService: SaleEstimatesPdf;
|
||||
|
||||
@Inject()
|
||||
private sendEstimateMailService: SendSaleEstimateMail;
|
||||
|
||||
/**
|
||||
* Create a sale estimate.
|
||||
* @param {number} tenantId - The tenant id.
|
||||
@@ -209,4 +213,14 @@ export class SaleEstimatesApplication {
|
||||
saleEstimate
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} tenantId
|
||||
* @param {number} saleEstimateId
|
||||
* @returns
|
||||
*/
|
||||
public sendSaleEstimateMail(tenantId: number, saleEstimateId: number) {
|
||||
return this.sendEstimateMailService.sendMail(tenantId, saleEstimateId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Service } from "typedi";
|
||||
|
||||
@Service()
|
||||
export class SendSaleEstimateMail {
|
||||
sendMail(tenantId: number, saleEstimateId: number) {}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export class GetSaleInvoiceMailReminder {
|
||||
public getInvoiceMailReminder(tenantId: number, saleInvoiceId: number) {}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
ISystemUser,
|
||||
ITenantUser,
|
||||
InvoiceNotificationType,
|
||||
SendInvoiceMailDTO,
|
||||
} from '@/interfaces';
|
||||
import { Inject, Service } from 'typedi';
|
||||
import { CreateSaleInvoice } from './CreateSaleInvoice';
|
||||
@@ -24,6 +25,9 @@ import { WriteoffSaleInvoice } from './WriteoffSaleInvoice';
|
||||
import { SaleInvoicePdf } from './SaleInvoicePdf';
|
||||
import { GetInvoicePaymentsService } from './GetInvoicePaymentsService';
|
||||
import { SaleInvoiceNotifyBySms } from './SaleInvoiceNotifyBySms';
|
||||
import { SendInvoiceMailReminder } from './SendSaleInvoiceMailReminder';
|
||||
import { SendSaleInvoiceMail } from './SendSaleInvoiceMail';
|
||||
import { GetSaleInvoiceMailReminder } from './GetSaleInvoiceMailReminder';
|
||||
|
||||
@Service()
|
||||
export class SaleInvoiceApplication {
|
||||
@@ -60,6 +64,15 @@ export class SaleInvoiceApplication {
|
||||
@Inject()
|
||||
private invoiceSms: SaleInvoiceNotifyBySms;
|
||||
|
||||
@Inject()
|
||||
private sendInvoiceReminderService: SendInvoiceMailReminder;
|
||||
|
||||
@Inject()
|
||||
private sendSaleInvoiceMailService: SendSaleInvoiceMail;
|
||||
|
||||
@Inject()
|
||||
private getSaleInvoiceReminderService: GetSaleInvoiceMailReminder;
|
||||
|
||||
/**
|
||||
* Creates a new sale invoice with associated GL entries.
|
||||
* @param {number} tenantId
|
||||
@@ -279,4 +292,49 @@ export class SaleInvoiceApplication {
|
||||
invoiceSmsDetailsDTO
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the metadata of invoice mail reminder.
|
||||
* @param {number} tenantId
|
||||
* @param {number} saleInvoiceId
|
||||
* @returns {}
|
||||
*/
|
||||
public getSaleInvoiceMailReminder(tenantId: number, saleInvoiceId: number) {
|
||||
return this.getSaleInvoiceReminderService.getInvoiceMailReminder(
|
||||
tenantId,
|
||||
saleInvoiceId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends reminder of the given invoice to the invoice's customer.
|
||||
* @param {number} tenantId
|
||||
* @param {number} saleInvoiceId
|
||||
* @returns {}
|
||||
*/
|
||||
public sendSaleInvoiceMailReminder(tenantId: number, saleInvoiceId: number) {
|
||||
return this.sendInvoiceReminderService.sendInvoiceMailReminder(
|
||||
tenantId,
|
||||
saleInvoiceId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} tenantId
|
||||
* @param {number} saleInvoiceId
|
||||
* @param {SendInvoiceMailDTO} messageDTO
|
||||
* @returns
|
||||
*/
|
||||
public sendSaleInvoiceMail(
|
||||
tenantId: number,
|
||||
saleInvoiceId: number,
|
||||
messageDTO: SendInvoiceMailDTO
|
||||
) {
|
||||
return this.sendSaleInvoiceMailService.sendSaleInvoiceMail(
|
||||
tenantId,
|
||||
saleInvoiceId,
|
||||
messageDTO
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Service } from 'typedi';
|
||||
import { SendInvoiceMailDTO } from '@/interfaces';
|
||||
|
||||
|
||||
@Service()
|
||||
export class SendSaleInvoiceMail {
|
||||
public sendSaleInvoiceMail(
|
||||
tenantId: number,
|
||||
saleInvoiceId: number,
|
||||
messageDTO: SendInvoiceMailDTO
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Service } from 'typedi';
|
||||
|
||||
@Service()
|
||||
export class SendInvoiceMailReminder {
|
||||
/**
|
||||
*
|
||||
* @param {number} tenantId
|
||||
* @param {number} saleInvoiceId
|
||||
*/
|
||||
public sendInvoiceMailReminder(tenantId: number, saleInvoiceId: number) {}
|
||||
}
|
||||
Reference in New Issue
Block a user