Skip to content

ffl_integrations.fastbound.pos_4473_recovery

Source: apps/ffl_integrations/ffl_integrations/fastbound/pos_4473_recovery.py · 3 endpoint(s)

Generated by make api-docs — do not edit by hand.

manager_abandon_4473

POST /api/method/ffl_integrations.fastbound.pos_4473_recovery.manager_abandon_4473

Auth (derived from code): Roles: Sales Manager / System Manager

Clear an abandoned counter order: drop FastBound's pending disposition

for every gun on it, then delete the draft that has been holding them.

The counter half of the DISP-2026-02000 fix, and deliberately a BUTTON. The daily watch (ffl_core.api.pending_4473.alert_overdue_pending_4473) only ever raises a ToDo: deleting a bound-book record is an ATF-visible act and an unattended job may not decide to perform one.

Same shape as :func:manager_redo_4473 — manager gate, reason required, audit trail — with one difference that matters: the invoice does not survive, so the trail is an Error Log entry rather than a comment on a document that is about to disappear. The draft itself is deleted, not cancelled (a draft cannot be cancelled), which is how the POS closes an abandoned order anyway — ffl_core.api.pos_recycle_bin keeps it restorable for as long as its Deleted Document row lives.

FastBound goes FIRST, and is then RE-READ. A failure leaves everything as it was; doing it the other way round would release the gun while the bound book still held it, which is the state this whole change exists to end. The re-read is there because DELETE is not always the end of the hold — it can leave the item carrying a dangling dispositionId (observed 2026-07-07; see :meth:FastBoundClient.undispose_item). The draft is the only POS trace of the order, so it is given up only once FastBound itself confirms every gun is free.

arg type required default description
invoice_name string yes — The Draft POS Invoice to clear.
reason string yes — Required audit reason.

Returns: {ok, invoice, serials, deleted, skipped} — deleted lists the FastBound disposition ids removed, skipped the serials that had no pending disposition to remove.

Permissions: Sales Manager / System Manager (manager gate) + required reason.

apps/ffl_integrations/ffl_integrations/fastbound/pos_4473_recovery.py:468

manager_redo_4473

POST /api/method/ffl_integrations.fastbound.pos_4473_recovery.manager_redo_4473

Auth (derived from code): Roles: Sales Manager / System Manager

Re-open a COMPLETED 4473 — the only sanctioned way past the reset guard.

The counter path (pos_4473.start_4473_for_pos_invoice) refuses to reset a completed order, because a stale page clicking that button is exactly what broke a past invoice. A genuine redo — wrong serial on the 4473, buyer denied after the fact, the disposition voided in FastBound — comes through here instead:

  • manager-gated (Sales Manager / System Manager) and reason-required;
  • cancels this order's committed Retail Sale dispositions — the bound-book mirror of the 4473 being voided — so coverage drops to zero and refresh_4473_status has nothing left to restore Completed from;
  • clears the webhook-owned field group as a WHOLE, keeping "Pending while still carrying a fastbound_disposition_id" an impossible state. That shape is the fingerprint of the bug this change closes, so it must not be reachable through a legitimate path either. fastbound_url goes too: it is the "electronic 4473 in flight" marker that makes attest_paper_4473 refuse, and whose error message sends the cashier here;
  • marks this order's Paper / override Form 4473 Log rows Cancelled (the status the webhook gives a voided electronic 4473), so the row the redone form left behind can be told apart from the corrected one logged next.

Does NOT touch FastBound — void the disposition there first.

arg type required default description
invoice_name string yes — Draft POS Invoice whose 4473 is to be re-opened.
reason string yes — Required audit reason.

Returns: {ok, invoice, cancelled: [disposition names], n_cancelled}.

Permissions: Sales Manager / System Manager (manager gate) + required reason.

apps/ffl_integrations/ffl_integrations/fastbound/pos_4473_recovery.py:296

refresh_4473_status

POST /api/method/ffl_integrations.fastbound.pos_4473_recovery.refresh_4473_status

Auth (derived from code): Roles: Sales User / Sales Manager / System Manager

Re-read the authoritative 4473 state for a POS Invoice.

Layer 1 — the DB already says Completed/Proceed: the caller's page was just stale. Report and stop. Layer 2 — every firearm on the order has a committed Retail Sale disposition but the doc-level flags say otherwise: the flags are stale, restore them from the ledger. This is the past invoice shape. Layer 3 — coverage is incomplete: ask FastBound what it knows and REPORT it.

Never writes NICS from a FastBound probe: the API does not carry the outcome, so inferring Proceed from "the gun left the bound book" would fabricate a compliance fact.

arg type required default description
invoice_name string yes — POS Invoice name.

Returns: {state: completed|repaired|no_firearm|no_serials|, invoice, covered, missing, [dispositions], [fastbound]}.

Permissions: POS 4473 roles (_check_perm).

apps/ffl_integrations/ffl_integrations/fastbound/pos_4473_recovery.py:213