feat: vylepšení objednávek
CI / Generate TypeScript types (pull_request) Successful in 20s
CI / Server unit tests (pull_request) Failing after 20s
CI / Build client (pull_request) Failing after 30s
CI / Build server (pull_request) Successful in 3m13s
CI / Playwright E2E tests (pull_request) Has been skipped
CI / Build and push Docker image (pull_request) Has been skipped
CI / Notify (pull_request) Has been skipped
CI / Build client (push) Failing after 10m5s
CI / Generate TypeScript types (push) Successful in 10s
CI / Server unit tests (push) Failing after 22s
CI / Build server (push) Successful in 41s
CI / Playwright E2E tests (push) Has been skipped
CI / Build and push Docker image (push) Has been skipped
CI / Notify (push) Successful in 4s

This commit is contained in:
2026-05-07 09:50:51 +02:00
parent 1efe2b8f7d
commit c7f78cf2c9
14 changed files with 1163 additions and 186 deletions
+6 -3
View File
@@ -3,6 +3,7 @@ import { getLogin } from "../auth";
import { parseToken, formatDate } from "../utils";
import { generateQr } from "../qr";
import { addPendingQr } from "../pizza";
import { emitToUser } from "../websocket";
import { GenerateQrData } from "../../../types";
import crypto from "crypto";
@@ -48,15 +49,17 @@ router.post("/generate", async (req: Request<{}, any, GenerateQrData["body"]>, r
const id = crypto.randomUUID();
await generateQr(recipient.login, bankAccount, bankAccountHolder, recipient.amount, recipient.purpose, id);
// Uložit jako nevyřízený QR kód
await addPendingQr(recipient.login, {
// Uložit jako nevyřízený QR kód a okamžitě doručit příjemci
const pendingQr = {
id,
date: today,
creator: login,
totalPrice: recipient.amount,
purpose: recipient.purpose,
...(groupId ? { groupId } : {}),
});
};
await addPendingQr(recipient.login, pendingQr);
emitToUser(recipient.login, 'pendingQr', pendingQr);
}
res.status(200).json({ success: true, count: recipients.length });