feat: Assign default PDF template automatically

This commit is contained in:
Ahmed Bouhuolia
2024-10-02 18:18:57 +02:00
parent cbc60b3c73
commit b23112bc92
30 changed files with 501 additions and 46 deletions

View File

@@ -20,6 +20,7 @@ import { RejectSaleEstimate } from './RejectSaleEstimate';
import { SaleEstimateNotifyBySms } from './SaleEstimateSmsNotify';
import { SaleEstimatesPdf } from './SaleEstimatesPdf';
import { SendSaleEstimateMail } from './SendSaleEstimateMail';
import { GetSaleEstimateState } from './GetSaleEstimateState';
@Service()
export class SaleEstimatesApplication {
@@ -56,6 +57,9 @@ export class SaleEstimatesApplication {
@Inject()
private sendEstimateMailService: SendSaleEstimateMail;
@Inject()
private getSaleEstimateStateService: GetSaleEstimateState;
/**
* Create a sale estimate.
* @param {number} tenantId - The tenant id.
@@ -249,4 +253,13 @@ export class SaleEstimatesApplication {
saleEstimateId
);
}
/**
* Retrieves the current state of the sale estimate.
* @param {number} tenantId - The ID of the tenant.
* @returns {Promise<ISaleEstimateState>} - A promise resolving to the sale estimate state.
*/
public getSaleEstimateStat(tenantId: number) {
return this.getSaleEstimateStateService.getSaleEstimateState(tenantId);
}
}