fix(qr-custom): center QR, timer berhenti, refund saat lunas, regenerate expired
All checks were successful
CI / test (push) Successful in 1m44s

- link publik: QR center, nominal/QR/timer disembunyikan saat expired
- reject/refund untuk paid
- regenerate QR expired (kode unik baru) di detail & tabel
- versi 0.6.4
This commit is contained in:
oxpoe
2026-11-06 05:05:58 +07:00
parent b72dbf3e55
commit 8fcb50e16a
8 changed files with 71 additions and 15 deletions

View File

@@ -118,6 +118,20 @@ function acceptWarning(id, actor, note) {
return getById(id);
}
function regenerate(id, actor) {
const old = getById(id);
if (!old) throw new Error('Data tidak ditemukan.');
if (old.status === 'pending' && !isExpired(old)) throw new Error('QR masih aktif. Tunggu kedaluwarsa atau gunakan QR yang ada.');
const row = create({
title: old.title,
category: old.category,
amount: old.amount,
note: old.note,
createdBy: actor
});
return row;
}
function reject(id, actor, note) {
const row = getById(id);
if (!row) throw new Error('Data tidak ditemukan.');
@@ -181,6 +195,7 @@ module.exports = {
candidatesByAmount,
markManualPaid,
acceptWarning,
regenerate,
reject,
markPaidFromWebhook,
markWarningFromWebhook,