function finalizeSessionIfUnresolved
finalizeSessionIfUnresolved(
sessionId: string,
attendeeId: number,
paymentReference: TaggedPaymentReference | null,
): Promise<void>

Heals a reservation ONLY while it is unresolved, so it never overwrites the attendee_id or blanks the ticket_tokens a racing delivery just finalized. The guard is UNRESOLVED_RESERVATION, so the first outcome wins.

A replayed paymentReference is stored too. After a prune, that is the only refundable id a provider-less or admin-added attendee's balance charge has.

Parameters

sessionId: string
attendeeId: number
paymentReference: TaggedPaymentReference | null

Return Type

Promise<void>

Usage

import { finalizeSessionIfUnresolved } from "docs/database.ts";