You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two-phase transfers in TigerBeetle are done by first creating a "pending" transfer, then a new, subsequent void-ing or post-ing transfer. This is different than what we do in the PSQL accounting, where we just update the state of the original PENDING transfer to either POSTED or VOIDED.
While this does not cause any differences functionally, this difference is visible in our AccountingTransfers Admin API: whenever we are looking up transfers for an account (e.g. outgoing payment) with TB as the ledger, we will get two transfers (one PENDING and one POSTED or VOIDED), but if we do the same query with PSQL as the ledger, we will just see a single POSTED transfer. (We actually filter out VOIDED transfers in our PSQL query).
We should standardize the behaviour of this query, so you get back the same results no matter which accounting ledger is used.
This requires a few changes:
Todos
In TigerBeetle account lookup, filter out initial PENDING transfers if a transfer was voided or posted by a corresponding transfer. (You can use pending_idflag to find transfers which POSTED or VOIDED the initial transfer)
Show VOIDED and EXPIRED transfers in PSQL accounting by updating the filter in transfer query in PSQL's getAccountTransfers
Add EXPIRED enum value to the LedgerTransferState in backend/src/accounting/service.ts, do the correct mapping to this enum for TB & PSQL transfers (EXPIRED transfers are pending transfers with an expiry date in the past)
The text was updated successfully, but these errors were encountered:
Context
Two-phase transfers in TigerBeetle are done by first creating a "pending" transfer, then a new, subsequent void-ing or post-ing transfer. This is different than what we do in the PSQL accounting, where we just update the state of the original PENDING transfer to either POSTED or VOIDED.
While this does not cause any differences functionally, this difference is visible in our
AccountingTransfers
Admin API: whenever we are looking up transfers for an account (e.g. outgoing payment) with TB as the ledger, we will get two transfers (one PENDING and one POSTED or VOIDED), but if we do the same query with PSQL as the ledger, we will just see a single POSTED transfer. (We actually filter out VOIDED transfers in our PSQL query).We should standardize the behaviour of this query, so you get back the same results no matter which accounting ledger is used.
This requires a few changes:
Todos
pending_id
flag to find transfers which POSTED or VOIDED the initial transfer)getAccountTransfers
EXPIRED
enum value to theLedgerTransferState
inbackend/src/accounting/service.ts
, do the correct mapping to this enum for TB & PSQL transfers (EXPIRED
transfers are pending transfers with an expiry date in the past)The text was updated successfully, but these errors were encountered: