| invoice_transaction_id | string, UUID | ✅ Yes | unique; generated by gen_random_uuid() on insert | — | Public immutable identifier for this reconciliation link. Exposed on all API responses; the internal pk is never surfaced. |
| amount | string (decimal 12,2) | ✅ Yes | CHECK amount > 0; max 12 digits total, 2 decimal places | — | The portion of the invoice satisfied by this transaction link, expressed in the transaction’s original currency. Always positive — direction is implied by the invoice/transaction relationship. |
| currency | string, enum (CurrencyCodeEnum) | ✅ Yes | Must be a valid ISO 4217 code present in currency_code_enum Postgres native enum | USD, EUR, GBP, JPY, CHF, CAD, AUD, NZD, SEK, NOK, DKK, PLN, CZK, … (full ISO 4217 set defined in CurrencyCodeEnum) | ISO 4217 currency code for the amount field. Matches the transaction’s instructed currency at reconciliation time. |
| accounting_amount | string (decimal 12,2) | ⚪ No | nullable; max 12 digits total, 2 decimal places | — | Amount converted to the workspace accounting currency using the linked exchange_rate. Null when no FX conversion was required (amount currency already equals accounting currency) or when the exchange rate was not available at reconciliation time. |
| accounting_currency | string, enum (CurrencyCodeEnum) | ⚪ No | nullable; same Postgres native enum currency_code_enum | USD, EUR, GBP, JPY, CHF, CAD, AUD, NZD, SEK, NOK, DKK, PLN, CZK, … (full ISO 4217 set) | Currency code for accounting_amount. Populated only when a multi-currency FX conversion was performed. Null when accounting_amount is null. |
| is_partial | boolean | ✅ Yes | default false | true, false | Legacy flag indicating the transaction only partially covers the invoice. Superseded by allocation_type; kept for one release cycle for backward compatibility with the reconciliation persister. Will be dropped once allocation_type (W19-P13) is fully rolled out. |
| allocation_type | string, enum (AllocationTypeEnum) | ⚪ No | nullable; default ‘full’; Postgres native enum allocation_type_enum | full, partial, overpayment, fee_deduction | Structured classification of how the transaction satisfies the invoice. ‘full’ means complete payment; ‘partial’ means the transaction covers only part of the outstanding amount; ‘overpayment’ means the payment exceeds the invoice total; ‘fee_deduction’ means a service fee was deducted from the gross payment before crediting the invoice. Replaces is_partial. Null and ‘full’ are treated identically by the reconciliation P5 recompute service. |
| created_at | string, datetime, 🔒 system | ✅ Yes | set on insert via onCreate lifecycle hook; never updated | — | ISO 8601 timestamp of when this reconciliation link was created by the pipeline or connector sync. |
| updated_at | string, datetime, 🔒 system | ⚪ No | set on insert and on every update via onCreate/onUpdate lifecycle hooks | — | ISO 8601 timestamp of the last modification to this record. Updated automatically by MikroORM on every flush. |
| deleted_at | string, datetime | ⚪ No | nullable; null means active record; non-null means soft-deleted | — | Soft-delete timestamp. All active-record queries must filter deleted_at IS NULL. A partial index idx_invoice_transactions_invoice_active on (invoice_pk) WHERE deleted_at IS NULL exists specifically to support the invoice-merge UPDATE path that rewrites links without a workspace bound. |