From ca8ed0da628d42765adb58529cdc5d48a3f31d0a Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 28 May 2026 22:46:15 +0500 Subject: [PATCH] =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D1=8B=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/prisma/prisma/dev.db | Bin 364544 -> 364544 bytes .../__tests__/email-templates.test.js | 8 ++++++++ .../templates/email-templates.js | 1 + .../templates/telegram-templates.js | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/prisma/prisma/dev.db b/server/prisma/prisma/dev.db index 53c8aac1e511cfe3320b82f37fda59d53bcb2184..eb83ee91c6f93b97a57de7a1dc525344080c8254 100644 GIT binary patch delta 795 zcmaiwPiPZC7{zyYX48#3n`tR&S*@ilidi&qH)%{F%395#BA93+RB~u)n)aY3DQRTA zv!c2%RRt?ojo5b~?48Z6|rTz0~UjOWxK$!`N$ z4QRu|5q~)3rShmZsH&PbOh>P#h1FniL{mj#=_JG}S5J-7~_JFA*0zx?J%Icg04iE9=*#eTpTLpRUH`_4w~sF~?{ zjJ4`9?gn<6lUn0%(obqSD--i5kf)c2IBR(bq`L$Tn+*Pl&9#>N6HLr|KsdNtW$qBT z`i>L4jPZk^^@bT_%O4LpFBu^w)N-z+c_Gxl<8=4ZbtlhL)i~>Hhn#xZ>XbGjWpD8Ba@ye zW&<9JIv+s5;Wt)O3cjT$OmS|qImLCZ=OJu{iWH6zp#;xEsb31yWnT~(oQ1gEOw1`Z zv_d93VMD8U5*3e?oQ2Q0CYQ)4C=Q5FfqLs_$&dylpX5Z}(FS^iiYQKleu<{pP^gxcLqc|hR# ze<$t$K!&v}rp?+Dnzh}3TL{baGspRfZEEo=vr=wKOH H{%-eQr1$h_ delta 557 zcmZozAl9%zY=Sf+-$WT_M!t;+OXhPh@+&d$EAhE(7BsNno9wbqShO(PEHTBvz@VVO zxU$?dJ1aTEBDY|=uQQ9Jim_p0qJ?>4qApN6P1h7i>L!5*Ljxm|w3H;X#Iz)f$?fa? zvKcgrc4f2D`bP>tXFO)$f6RY$yI=w1PX6h>{4AW3*xbP+!)(tv*>Jt& zrUz^ZY}Xk0Kk{GO&f~y%m7m`|KEN^3*VQisXztQ;((NDo8MlA%XDZ|8Tzbw8Eaox& zp*^GI^!578lI;uQnYJ&CXHEuLeS?Aj2LJlaf(48Dr?2m4=1?W%M<#XVP|nF0)~jrr zzzlRo36|k@fu&DD!n@#6v zVDSTLWa6D}+RMVfJ-wG@785(~Ee3U-Ql{w~6Ikr|D|mx>^>{gXp78AFnZ;8IR4mUk zJzx%t;`V8CSX>x+__!H(8IyAh3JR0bwm+N8B6o;`iLZj0UyrW>s5X<2xzS90dqo~= Ghavzy&a3hO diff --git a/server/src/lib/notifications/templates/__tests__/email-templates.test.js b/server/src/lib/notifications/templates/__tests__/email-templates.test.js index 2c09255..e92b610 100644 --- a/server/src/lib/notifications/templates/__tests__/email-templates.test.js +++ b/server/src/lib/notifications/templates/__tests__/email-templates.test.js @@ -44,6 +44,14 @@ describe('email templates', () => { expect(email.html).toContain('href="https://shop.example.com/me/messages"') }) + it('renders paid payment status as paid in Russian', () => { + const email = renderPaymentStatusChangedEmail({ orderId, paymentStatus: 'paid' }) + + expect(email.subject).toBe('Оплата заказа — Оплачен') + expect(email.html).toContain('Оплачен') + expect(email.html).not.toContain('paid') + }) + it('adds admin orders link to admin order message emails', () => { process.env.CLIENT_PUBLIC_URL = 'https://shop.example.com' diff --git a/server/src/lib/notifications/templates/email-templates.js b/server/src/lib/notifications/templates/email-templates.js index dcfc24c..a71462a 100644 --- a/server/src/lib/notifications/templates/email-templates.js +++ b/server/src/lib/notifications/templates/email-templates.js @@ -116,6 +116,7 @@ export function renderAdminOrderMessageEmail({ orderId, preview }) { export function renderPaymentStatusChangedEmail({ orderId, paymentStatus }) { const statusLabels = { pending: 'Ожидает', + paid: 'Оплачен', confirmed: 'Подтверждён', rejected: 'Отклонён', } diff --git a/server/src/lib/notifications/templates/telegram-templates.js b/server/src/lib/notifications/templates/telegram-templates.js index 444c7f6..ba9adda 100644 --- a/server/src/lib/notifications/templates/telegram-templates.js +++ b/server/src/lib/notifications/templates/telegram-templates.js @@ -25,7 +25,7 @@ export function renderOrderMessageTg({ orderId, preview }) { } export function renderPaymentStatusChangedTg({ orderId, paymentStatus }) { - const labels = { pending: 'Ожидает', confirmed: 'Подтверждён', rejected: 'Отклонён' } + const labels = { pending: 'Ожидает', paid: 'Оплачен', confirmed: 'Подтверждён', rejected: 'Отклонён' } return `💳 Оплата заказа #${orderId.slice(0, 8)}: ${labels[paymentStatus] || paymentStatus}` }