Skip to content

Commit 57cc35d

Browse files
authored
Announce email script and Fix Ktung sri glitch (#72)
This pull request introduces enhancements and fixes related to email notification handling and payment evidence verification. The most significant changes are the addition of a script for sending announcement emails in bulk, improvements to error/success logging, and a special case handling for a specific bank in payment verification. **Email notification and logging improvements:** * Added a new script `send.ts` to automate sending announcement emails using a template, with robust logging for both successful and failed deliveries (`test/noti-mail/send.ts`). * Updated `error.json` to include a comprehensive list of email addresses that previously failed to receive emails, improving traceability of issues (`test/mail/log/error.json`). * Added `old_emails.json` to store historical email and name pairs, likely for reference or migration (`test/mail/old_emails.json`). **Payment evidence verification fix:** * Updated the payment evidence verification logic to handle a special case for Krungsri bank (bank id "025"), where the English receiver name may be in Thai, ensuring correct validation against the configured receiver name (`application-payment-evidence.service.ts`).
2 parents d39f1d3 + eacf3e5 commit 57cc35d

7 files changed

Lines changed: 1346 additions & 2682 deletions

File tree

src/modules/application-payment-evidence/application-payment-evidence.service.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,18 @@ export class ApplicationPaymentEvidenceService {
6565
throw new NotAcceptableException(`Cannot find reciever name`);
6666
}
6767

68+
// why krungsri send me en name as thai??????? ;-;
6869
if (verifyBankResponse.data.data.rawSlip.receiver.account.name.en) {
69-
if (verifyBankResponse.data.data.rawSlip.receiver.account.name.en !== config.payment.reciever.name.en) {
70-
throw new NotAcceptableException(`Wrong reciever name en: ${verifyBankResponse.data.data.rawSlip.receiver.account.name.en}`);
70+
if (verifyBankResponse.data.data.rawSlip.sender.bank.id === "025") {
71+
// this for a fucking Krungsri
72+
if (verifyBankResponse.data.data.rawSlip.receiver.account.name.en !== config.payment.reciever.name.th) {
73+
throw new NotAcceptableException(`Wrong reciever name en: ${verifyBankResponse.data.data.rawSlip.receiver.account.name.en}`);
74+
}
75+
} else {
76+
// for normal bank
77+
if (verifyBankResponse.data.data.rawSlip.receiver.account.name.en !== config.payment.reciever.name.en) {
78+
throw new NotAcceptableException(`Wrong reciever name en: ${verifyBankResponse.data.data.rawSlip.receiver.account.name.en}`);
79+
}
7180
}
7281
}
7382

0 commit comments

Comments
 (0)