Skip to content

app.payment_applications

TableRow level security on

How much of a payment settles which invoice. A payment applies to an invoice once and never beyond its amount, and an invoice is never paid beyond its total, so billed-to-date and paid-to-date count each payment once (invariant 16).

Primary key: id

Columns of app.payment_applications
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org, derived from app.payments on insert; never accepted from the caller and never changed.References app.organizations.id
payment_iduuidNoPayment applied.References app.payments.id
invoice_iduuidNoInvoice settled, with the same counterparty, direction and currency.References app.invoices.id
amount_minorbigintNoAmount applied in minor units.
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id