diff --git a/assets/email-template/redesign/change-date-information.html b/assets/email-template/redesign/change-date-information.html new file mode 100644 index 0000000..586aabb --- /dev/null +++ b/assets/email-template/redesign/change-date-information.html @@ -0,0 +1,2027 @@ + + + + + Change Date Information + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+ + diff --git a/assets/email-template/redesign/invoice-bank.html b/assets/email-template/redesign/invoice-bank.html new file mode 100644 index 0000000..858a633 --- /dev/null +++ b/assets/email-template/redesign/invoice-bank.html @@ -0,0 +1,2119 @@ + + + + + Invoice Bank Transfer + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+ + diff --git a/assets/email-template/redesign/invoice-expired.html b/assets/email-template/redesign/invoice-expired.html new file mode 100644 index 0000000..88488fa --- /dev/null +++ b/assets/email-template/redesign/invoice-expired.html @@ -0,0 +1,1962 @@ + + + + + Invoice Expired + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+ + diff --git a/assets/email-template/redesign/invoice-midtrans.html b/assets/email-template/redesign/invoice-midtrans.html new file mode 100644 index 0000000..98c250d --- /dev/null +++ b/assets/email-template/redesign/invoice-midtrans.html @@ -0,0 +1,2037 @@ + + + + + Invoice Midtrans + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+ + diff --git a/assets/email-template/redesign/payment-confirmation.html b/assets/email-template/redesign/payment-confirmation.html new file mode 100644 index 0000000..bdde960 --- /dev/null +++ b/assets/email-template/redesign/payment-confirmation.html @@ -0,0 +1,2454 @@ + + + + + Payment Confirmation + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+ + diff --git a/assets/email-template/redesign/refund-confirmation.html b/assets/email-template/redesign/refund-confirmation.html new file mode 100644 index 0000000..03a6ce5 --- /dev/null +++ b/assets/email-template/redesign/refund-confirmation.html @@ -0,0 +1,2832 @@ + + + + + Refund Confirmation + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+ + diff --git a/assets/email-template/redesign/refund-request.html b/assets/email-template/redesign/refund-request.html new file mode 100644 index 0000000..579340f --- /dev/null +++ b/assets/email-template/redesign/refund-request.html @@ -0,0 +1,2414 @@ + + + + + Refund Confirmation + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+ + diff --git a/assets/image/we.png b/assets/image/we.png new file mode 100644 index 0000000..cb44d28 Binary files /dev/null and b/assets/image/we.png differ diff --git a/src/modules/configuration/mail/domain/handlers/payment-transaction.handler.ts b/src/modules/configuration/mail/domain/handlers/payment-transaction.handler.ts index 355c75b..f71341f 100644 --- a/src/modules/configuration/mail/domain/handlers/payment-transaction.handler.ts +++ b/src/modules/configuration/mail/domain/handlers/payment-transaction.handler.ts @@ -32,7 +32,6 @@ export class PaymentTransactionHandler const current_data = event.data.data; const data_id = current_data.transaction_id ?? event.data.id; const from_refund = event.data.module == TABLE_NAME.REFUND; - console.log('payment handlet', { data_id }); const payments = await this.paymentService.getManyByOptions({ where: { @@ -106,6 +105,15 @@ export class PaymentTransactionHandler `; })} `, + + refund_items_data: transaction?.['refund']?.refund_items + ?.filter((item) => Number(item.qty_refund) > 0) + .map((item) => { + return { + qty_refund: item.qty_refund, + item_name: item.transaction_item.item_name, + }; + }), }); } diff --git a/src/modules/configuration/mail/domain/helpers/send-email.helper.ts b/src/modules/configuration/mail/domain/helpers/send-email.helper.ts index ad0532a..2db8cd0 100644 --- a/src/modules/configuration/mail/domain/helpers/send-email.helper.ts +++ b/src/modules/configuration/mail/domain/helpers/send-email.helper.ts @@ -17,7 +17,7 @@ export async function sendEmail(receivers, invoiceType, attachment?) { for (const receiver of receivers) { try { const templateName = getTemplate(receiver.payment_type, invoiceType); - const templatePath = `./assets/email-template/${templateName}.html`; + const templatePath = `./assets/email-template/redesign/${templateName}.html`; const templateSource = fs.readFileSync(templatePath, 'utf8'); const template = handlebars.compile(templateSource);