fix: mail state

This commit is contained in:
Ahmed Bouhuolia
2025-06-09 15:37:20 +02:00
parent 4366bf478a
commit 90d6bea9b9
12 changed files with 285 additions and 64 deletions

View File

@@ -116,32 +116,6 @@ export class SaleReceiptApplication {
return this.getSaleReceiptPdfService.saleReceiptPdf(saleReceiptId);
}
/**
* Notify receipt customer by SMS of the given sale receipt.
* @param {number} tenantId
* @param {number} saleReceiptId
* @returns
*/
// public saleReceiptNotifyBySms(tenantId: number, saleReceiptId: number) {
// return this.saleReceiptNotifyBySmsService.notifyBySms(
// tenantId,
// saleReceiptId,
// );
// }
/**
* Retrieves sms details of the given sale receipt.
* @param {number} tenantId
* @param {number} saleReceiptId
* @returns
*/
// public getSaleReceiptSmsDetails(tenantId: number, saleReceiptId: number) {
// return this.saleReceiptNotifyBySmsService.smsDetails(
// tenantId,
// saleReceiptId,
// );
// }
/**
* Sends the receipt mail of the given sale receipt.
* @param {number} tenantId
@@ -159,17 +133,6 @@ export class SaleReceiptApplication {
);
}
/**
* Retrieves the default mail options of the given sale receipt.
* @param {number} saleReceiptId - Sale receipt identifier.
* @returns {Promise<SaleReceiptMailOpts>}
*/
public getSaleReceiptMail(
saleReceiptId: number,
): Promise<SaleReceiptMailOpts> {
return this.saleReceiptNotifyByMailService.getMailOptions(saleReceiptId);
}
/**
* Retrieves the current state of the sale receipt.
* @returns {Promise<ISaleReceiptState>} - A promise resolving to the sale receipt state.
@@ -191,7 +154,7 @@ export class SaleReceiptApplication {
* Retrieves the mail state of the given sale receipt.
* @param {number} saleReceiptId
*/
public getSaleReceiptMailState(
public getSaleReceiptMail(
saleReceiptId: number,
): Promise<ISaleReceiptState> {
return this.getSaleReceiptMailStateService.getMailState(saleReceiptId);

View File

@@ -19,6 +19,11 @@ export class SaleReceiptTransformer extends Transformer {
'subtotalLocalFormatted',
'totalFormatted',
'totalLocalFormatted',
'discountAmountFormatted',
'discountPercentageFormatted',
'adjustmentFormatted',
'entries',
'attachments',
];
@@ -107,7 +112,6 @@ export class SaleReceiptTransformer extends Transformer {
/**
* Retrieves formatted discount amount.
* @param receipt
* @returns {string}
*/
protected discountAmountFormatted = (receipt: SaleReceipt): string => {
@@ -118,7 +122,6 @@ export class SaleReceiptTransformer extends Transformer {
/**
* Retrieves formatted discount percentage.
* @param receipt
* @returns {string}
*/
protected discountPercentageFormatted = (receipt: SaleReceipt): string => {
@@ -127,7 +130,6 @@ export class SaleReceiptTransformer extends Transformer {
/**
* Retrieves formatted adjustment amount.
* @param receipt
* @returns {string}
*/
protected adjustmentFormatted = (receipt: SaleReceipt): string => {