Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f124a69e76 | ||
|
|
4d635cb89a |
@@ -88490,7 +88490,7 @@ var require_customer_auth_service = __commonJS({
|
||||
*/
|
||||
async deliver(mobile, code) {
|
||||
const smsText = `<#> code is ${code}
|
||||
\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u06CC\u06A9\u0628\u0627\u0631 \u0645\u0635\u0631\u0641 \u0634\u0645\u0627 \u062C\u0647\u062A \u0648\u0631\u0648\u062F \u0628\u0647 \u0627\u067E\u0644\u06CC\u06A9\u0634\u0646 \u0647\u0646\u0632\u0627 \u06AF\u0644\u062F ${code} \u0645\u06CC \u0628\u0627\u0634\u062F
|
||||
\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u06CC\u06A9\u0628\u0627\u0631 \u0645\u0635\u0631\u0641 \u0634\u0645\u0627 \u062C\u0647\u062A \u0648\u0631\u0648\u062F \u0628\u0647 \u0627\u067E\u0644\u06CC\u06A9\u06CC\u0634\u0646 \u0645\u0646\u062A\u0632\u0631 ${code} \u0645\u06CC \u0628\u0627\u0634\u062F
|
||||
aMo6iFyUQaY`;
|
||||
await this.sms.send(mobile, smsText, { persist: false });
|
||||
if (process.env.NODE_ENV !== "production" && !(0, sms_service_12.smsConfigured)()) {
|
||||
@@ -89523,10 +89523,10 @@ var require_customer_profile_service = __commonJS({
|
||||
* reference likewise queued them (SendSmsAfterCreate::dispatch, :100).
|
||||
*/
|
||||
notify(mobile, firstName, lastName) {
|
||||
const message = `\u0647\u0646\u0632\u0627 \u06AF\u0644\u062F
|
||||
const message = `\u0645\u0646\u062A\u0632\u0631
|
||||
\u0647\u0645\u06A9\u0627\u0631 \u06AF\u0631\u0627\u0645\u06CC ${firstName} ${lastName}
|
||||
\u062A\u06A9\u0645\u06CC\u0644 \u067E\u0631\u0648\u0641\u0627\u06CC\u0644 \u0634\u0645\u0627 \u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u0627\u0646\u062C\u0627\u0645 \u0634\u062F.`;
|
||||
const adminMessage = `\u0647\u0646\u0632\u0627 \u06AF\u0644\u062F
|
||||
const adminMessage = `\u0645\u0646\u062A\u0632\u0631
|
||||
\u0645\u0634\u062A\u0631\u06CC \u0628\u0627 \u0646\u0627\u0645 ${firstName} ${lastName} \u0645\u062F\u0627\u0631\u06A9 \u062E\u0648\u062F \u0631\u0627 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0631\u062F.`;
|
||||
const fire = (to, body) => {
|
||||
void this.sms.send(to, body).catch((e) => {
|
||||
@@ -95773,8 +95773,8 @@ var require_admin_customers_service = __commonJS({
|
||||
}
|
||||
/**
|
||||
* The welcome SMS the reference sends after every new customer is created
|
||||
* (AdminController.php:378-387). Byte-identical, including the line order and
|
||||
* the trailing PWA link; the commented-out Android/iOS lines are not sent
|
||||
* (AdminController.php:378-387), with the brand and the PWA link changed to
|
||||
* منتزر; same line order. The commented-out Android/iOS lines are not sent
|
||||
* there and are not sent here.
|
||||
*
|
||||
* D20 — awaiting it would let a slow or unconfigured gateway hold up the
|
||||
@@ -95784,11 +95784,11 @@ var require_admin_customers_service = __commonJS({
|
||||
* the creation.
|
||||
*/
|
||||
sendWelcomeSms(mobile, firstName, lastName) {
|
||||
const body = `\u0647\u0646\u0632\u0627 \u06AF\u0644\u062F
|
||||
const body = `\u0645\u0646\u062A\u0632\u0631
|
||||
\u0647\u0645\u06A9\u0627\u0631 \u06AF\u0631\u0627\u0645\u06CC ${firstName} ${lastName}
|
||||
\u0646\u0627\u0645 \u06A9\u0627\u0631\u0628\u0631\u06CC : ${mobile}
|
||||
\u0644\u06CC\u0646\u06A9 pwa
|
||||
https://app.henzagold.com`;
|
||||
https://bnk.montzar.ir`;
|
||||
void this.sms.send(mobile, body).catch((e) => {
|
||||
this.logger.error(`Welcome SMS to ${mobile} failed: ${String(e)}`);
|
||||
});
|
||||
@@ -98928,7 +98928,7 @@ var require_admin_documents_service = __commonJS({
|
||||
}
|
||||
// Legacy CashController::toggleConfiremCash sent an SMS on both outcomes.
|
||||
notifyDocumentConfirm(customerId, confirmed) {
|
||||
const text = confirmed ? "\u0647\u0646\u0632\u0627 \u06AF\u0644\u062F\n\u0633\u0646\u062F \u0645\u0627\u0644\u06CC \u0634\u0645\u0627 \u062A\u0648\u0633\u0637 \u0645\u062F\u06CC\u0631 \u0633\u06CC\u0633\u062A\u0645 \u062A\u0627\u06CC\u06CC\u062F \u0634\u062F." : "\u0647\u0646\u0632\u0627 \u06AF\u0644\u062F\n\u0633\u0646\u062F \u0645\u0627\u0644\u06CC \u0634\u0645\u0627 \u062A\u0648\u0633\u0637 \u0645\u062F\u06CC\u0631 \u0633\u06CC\u0633\u062A\u0645 \u0631\u062F \u0634\u062F.";
|
||||
const text = confirmed ? "\u0645\u0646\u062A\u0632\u0631\n\u0633\u0646\u062F \u0645\u0627\u0644\u06CC \u0634\u0645\u0627 \u062A\u0648\u0633\u0637 \u0645\u062F\u06CC\u0631 \u0633\u06CC\u0633\u062A\u0645 \u062A\u0627\u06CC\u06CC\u062F \u0634\u062F." : "\u0645\u0646\u062A\u0632\u0631\n\u0633\u0646\u062F \u0645\u0627\u0644\u06CC \u0634\u0645\u0627 \u062A\u0648\u0633\u0637 \u0645\u062F\u06CC\u0631 \u0633\u06CC\u0633\u062A\u0645 \u0631\u062F \u0634\u062F.";
|
||||
this.prisma.customer.findUnique({ where: { id: customerId }, select: { mobile: true } }).then((c) => {
|
||||
if (c)
|
||||
this.sms.send(c.mobile, text);
|
||||
|
||||
@@ -141,8 +141,8 @@ export class AdminCustomersService {
|
||||
|
||||
/**
|
||||
* The welcome SMS the reference sends after every new customer is created
|
||||
* (AdminController.php:378-387). Byte-identical, including the line order and
|
||||
* the trailing PWA link; the commented-out Android/iOS lines are not sent
|
||||
* (AdminController.php:378-387), with the brand and the PWA link changed to
|
||||
* منتزر; same line order. The commented-out Android/iOS lines are not sent
|
||||
* there and are not sent here.
|
||||
*
|
||||
* D20 — awaiting it would let a slow or unconfigured gateway hold up the
|
||||
@@ -153,11 +153,11 @@ export class AdminCustomersService {
|
||||
*/
|
||||
private sendWelcomeSms(mobile: string, firstName: string, lastName: string) {
|
||||
const body =
|
||||
'هنزا گلد\n' +
|
||||
'منتزر\n' +
|
||||
`همکار گرامی ${firstName} ${lastName}\n` +
|
||||
`نام کاربری : ${mobile}\n` +
|
||||
'لینک pwa \n' +
|
||||
'https://app.henzagold.com';
|
||||
'https://bnk.montzar.ir';
|
||||
|
||||
void this.sms.send(mobile, body).catch((e: unknown) => {
|
||||
// send() is documented never to throw; this is belt-and-braces so an
|
||||
|
||||
@@ -345,8 +345,8 @@ export class AdminDocumentsService {
|
||||
// Legacy CashController::toggleConfiremCash sent an SMS on both outcomes.
|
||||
private notifyDocumentConfirm(customerId: string, confirmed: boolean) {
|
||||
const text = confirmed
|
||||
? 'هنزا گلد\nسند مالی شما توسط مدیر سیستم تایید شد.'
|
||||
: 'هنزا گلد\nسند مالی شما توسط مدیر سیستم رد شد.';
|
||||
? 'منتزر\nسند مالی شما توسط مدیر سیستم تایید شد.'
|
||||
: 'منتزر\nسند مالی شما توسط مدیر سیستم رد شد.';
|
||||
|
||||
this.prisma.customer
|
||||
.findUnique({ where: { id: customerId }, select: { mobile: true } })
|
||||
|
||||
@@ -728,13 +728,13 @@ export class CustomerAuthService {
|
||||
* simply retries, and the throttle in assertSendAllowed still applies.
|
||||
*/
|
||||
private async deliver(mobile: string, code: string) {
|
||||
// BYTE-IDENTICAL to the reference (ApiMobileController.php:47). The
|
||||
// leading "<#> code is <CODE>" line and the trailing "aMo6iFyUQaY" are the
|
||||
// Android SMS Retriever app hash — change either and autofill stops
|
||||
// working on every installed client. Do not "tidy" this string.
|
||||
// The reference's text (ApiMobileController.php:47) with the brand changed
|
||||
// to منتزر. The leading "<#> code is <CODE>" line and the trailing
|
||||
// "aMo6iFyUQaY" are the Android SMS Retriever app hash — change either and
|
||||
// autofill stops working on every installed client. Do not "tidy" them.
|
||||
const smsText =
|
||||
`<#> code is ${code}\n` +
|
||||
`رمز عبور یکبار مصرف شما جهت ورود به اپلیکشن هنزا گلد ${code} می باشد\n` +
|
||||
`رمز عبور یکبار مصرف شما جهت ورود به اپلیکیشن منتزر ${code} می باشد\n` +
|
||||
`aMo6iFyUQaY`;
|
||||
|
||||
// persist:false — the real text carries the live code, and the admin SMS
|
||||
|
||||
@@ -104,15 +104,15 @@ export class CustomerProfileService {
|
||||
* reference likewise queued them (SendSmsAfterCreate::dispatch, :100).
|
||||
*/
|
||||
private notify(mobile: string, firstName: string, lastName: string) {
|
||||
// Byte-identical to Major/CustomerController::complete:97-99.
|
||||
// Major/CustomerController::complete:97-99, brand changed to منتزر.
|
||||
const message =
|
||||
'هنزا گلد\n' +
|
||||
'منتزر\n' +
|
||||
`همکار گرامی ${firstName} ${lastName}\n` +
|
||||
'تکمیل پروفایل شما با موفقیت انجام شد.';
|
||||
|
||||
// Byte-identical to :103-105.
|
||||
// :103-105, brand changed to منتزر.
|
||||
const adminMessage =
|
||||
'هنزا گلد\n' + `مشتری با نام ${firstName} ${lastName}` + ' مدارک خود را بارگذاری کرد.';
|
||||
'منتزر\n' + `مشتری با نام ${firstName} ${lastName}` + ' مدارک خود را بارگذاری کرد.';
|
||||
|
||||
const fire = (to: string, body: string) => {
|
||||
void this.sms.send(to, body).catch((e: unknown) => {
|
||||
|
||||
@@ -309,19 +309,19 @@ describe('SmsService.send', () => {
|
||||
});
|
||||
|
||||
/**
|
||||
* The OTP text must stay byte-identical to the reference
|
||||
* (ApiMobileController.php:47) — the first line and the trailing token are the
|
||||
* Android SMS Retriever hash, and autofill breaks if either changes.
|
||||
* The OTP text keeps the reference's shape (ApiMobileController.php:47) with
|
||||
* the brand منتزر — the first line and the trailing token are the Android SMS
|
||||
* Retriever hash, and autofill breaks if either changes.
|
||||
*/
|
||||
describe('OTP message template', () => {
|
||||
const build = (code: string) =>
|
||||
`<#> code is ${code}\n` +
|
||||
`رمز عبور یکبار مصرف شما جهت ورود به اپلیکشن هنزا گلد ${code} می باشد\n` +
|
||||
`رمز عبور یکبار مصرف شما جهت ورود به اپلیکیشن منتزر ${code} می باشد\n` +
|
||||
`aMo6iFyUQaY`;
|
||||
|
||||
it('matches the reference byte for byte', () => {
|
||||
it('matches the expected text byte for byte', () => {
|
||||
expect(build('1234')).toBe(
|
||||
'<#> code is 1234\nرمز عبور یکبار مصرف شما جهت ورود به اپلیکشن هنزا گلد 1234 می باشد\naMo6iFyUQaY',
|
||||
'<#> code is 1234\nرمز عبور یکبار مصرف شما جهت ورود به اپلیکیشن منتزر 1234 می باشد\naMo6iFyUQaY',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user