Skip to content

Commit bb52318

Browse files
committed
✨ server: add debt maturity reminders
1 parent 1661283 commit bb52318

8 files changed

Lines changed: 1284 additions & 1 deletion

File tree

.changeset/dull-candies-cheer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@exactly/server": patch
3+
---
4+
5+
✨ add debt maturity reminders

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
"refinanciamiento",
221221
"refinanciar",
222222
"reintentando",
223+
"repágala",
223224
"verifícate"
224225
]
225226
},

server/i18n/es.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
"Exa Card purchase rejected": "Compra con Exa Card rechazada",
99
"Fiat onramp activated": "Cuenta fiat activada",
1010
"Funds received": "Fondos recibidos",
11+
"Payment due soon": "Vencimiento próximo",
1112
"Refund processed": "Reembolso procesado",
1213
"Transaction at {{merchantName}} for {{amount}} rejected: {{reason}}": "Transacción en {{merchantName}} por {{amount}} rechazada: {{reason}}",
1314
"Withdraw completed": "Retiro completado",
1415
"Withdrawal in progress": "Retiro en curso",
16+
"Your debt is due in 1 hour. Repay now to avoid penalties.": "Tu deuda vence en 1 hora. Repágala ahora para evitar penalidades.",
17+
"Your debt is due in 24 hours. Repay now to avoid penalties.": "Tu deuda vence en 24 horas. Repágala ahora para evitar penalidades.",
1518
"Your fiat onramp account has been activated": "Tu cuenta para depositar dinero fiat ha sido activada",
1619
"Your funds are on the way to your bank": "Tus fondos están en camino a tu banco",
1720
"frozen card": "tarjeta bloqueada",

server/i18n/pt.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
"Exa Card purchase rejected": "Compra com Exa Card recusada",
99
"Fiat onramp activated": "Conta fiat ativada",
1010
"Funds received": "Fundos recebidos",
11+
"Payment due soon": "Vencimento próximo",
1112
"Refund processed": "Reembolso processado",
1213
"Transaction at {{merchantName}} for {{amount}} rejected: {{reason}}": "Transação em {{merchantName}} de {{amount}} recusada: {{reason}}",
1314
"Withdraw completed": "Saque concluído",
1415
"Withdrawal in progress": "Saque em andamento",
16+
"Your debt is due in 1 hour. Repay now to avoid penalties.": "Sua dívida vence em 1 hora. Pague agora para evitar penalidades.",
17+
"Your debt is due in 24 hours. Repay now to avoid penalties.": "Sua dívida vence em 24 horas. Pague agora para evitar penalidades.",
1518
"Your fiat onramp account has been activated": "Sua conta para depositar dinheiro fiat foi ativada",
1619
"Your funds are on the way to your bank": "Seus fundos estão a caminho do seu banco",
1720
"frozen card": "cartão bloqueado",

server/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import panda from "./hooks/panda";
2020
import persona from "./hooks/persona";
2121
import androidFingerprints from "./utils/android/fingerprints";
2222
import appOrigin from "./utils/appOrigin";
23+
import { closeQueue, reminders } from "./utils/maturity";
2324
import { close as closeRedis } from "./utils/redis";
2425
import { closeAndFlush as closeSegment } from "./utils/segment";
2526

@@ -320,7 +321,7 @@ const server = serve(app);
320321
export async function close() {
321322
return new Promise((resolve, reject) => {
322323
server.close((error) => {
323-
Promise.allSettled([closeSentry(), closeRedis(), closeSegment(), database.$client.end()])
324+
Promise.allSettled([closeSentry(), closeRedis(), closeSegment(), database.$client.end(), closeQueue()])
324325
.then((results) => {
325326
if (error) reject(error);
326327
else if (results.some((result) => result.status === "rejected")) reject(new Error("closing services failed"));
@@ -331,6 +332,10 @@ export async function close() {
331332
});
332333
}
333334

335+
reminders().catch((error: unknown) => {
336+
captureException(error, { level: "error", tags: { unhandled: true } });
337+
});
338+
334339
if (!process.env.VITEST) {
335340
["SIGINT", "SIGTERM"].map((code) => {
336341
process.on(code, () => {

0 commit comments

Comments
 (0)