Implement phase 1 completion and phase 2 dynamic QR
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { getPool } from "../db/pool";
|
||||
import { createPaidLedgerPlaceholder } from "./ledgerStore";
|
||||
|
||||
export type TransactionStatus =
|
||||
| "initiated"
|
||||
@ -15,9 +16,10 @@ export type TransactionEventType =
|
||||
| "CALLBACK_RECEIVED"
|
||||
| "CALLBACK_REJECTED"
|
||||
| "CALLBACK_DUPLICATE"
|
||||
| "PUSH_QUEUED";
|
||||
| "PUSH_QUEUED"
|
||||
| "DYNAMIC_QR_CREATED";
|
||||
|
||||
export type TransactionEventSource = "webhook" | "system" | "admin";
|
||||
export type TransactionEventSource = "webhook" | "system" | "admin" | "device";
|
||||
|
||||
export interface TransactionEntity {
|
||||
id: string;
|
||||
@ -265,7 +267,12 @@ export async function updateTransactionStatus(
|
||||
}
|
||||
});
|
||||
|
||||
return mapTransaction(rows[0]);
|
||||
const updated = mapTransaction(rows[0]);
|
||||
if (to === "paid") {
|
||||
await createPaidLedgerPlaceholder(updated);
|
||||
}
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
export async function getTransactionById(id: string): Promise<TransactionEntity | null> {
|
||||
|
||||
Reference in New Issue
Block a user