Skip to main content

Data model

PostgreSQL, one schema: integrations. The model is defined in C# (src/Integrations.Domain), mapped in src/Integrations.Infrastructure/Persistence/Configurations, and changed only through EF Core migrations.

entities, tax_documents, tax_code_mappings, parties, certificate_requests and reconciliation_issues also carry created_by and modified_by: the caller (token client id, bus:<publisher> or system:<job>) stamped as the row is saved.

The diagram shows the key columns only. The .NET reference documents every property of the domain classes.

Tables​

TableHoldsKey constraints
entitiesLegal entities, AvaTax company, currency, GL accounts (jsonb), one features_* column per flagPK id
tax_documentsAR/AP invoices and credits, status, totals, raw AvaTax responseUnique (entity, source system, source document, direction, kind); unique provider_document_code; index (status, next_attempt_at) for the recalculation job
tax_document_linesLines: category, work type, tax code, amountsUnique (document, line number)
tax_line_jurisdictionsTax per line per jurisdiction (state/county/city/special/country)Index (country, region, level, code) for jurisdiction reports
tax_code_mappingsCategory + work type/sub-type/trade → tax code, effective datesIndex (category, work type, active)
exchange_ratesDaily rates as published, never updatedUnique (source, currency, pivot, date)
rate_locksFirst lock per pair per dayUnique (from, to, rate date, source)
partiesCustomers and vendors, sync statusUnique (entity, type, code)
certificate_requestsCertificate invites and resale requestsIndex (entity, kind, status), PO number
certificate_expiry_noticesExpiry notices already sentUnique (entity, certificate, expiry date)
provider_call_auditOne row per external call: latency, outcome, request hash, caller, entityIndex (occurred_at), (entity, subject)
admin_auditAppend-only: commits, voids, credits, entity and mapping changes, resolved issues, cancelled requests; who and whenIndex (occurred_at), (entity, subject)
reconciliation_issuesDifferences found by reconciliationIndex (entity, date), resolved
inbox_state, outbox_message, outbox_stateMassTransit transactional outbox/inboxManaged by MassTransit

Money and precision​

Amounts are numeric(19,6) (the default for every decimal, set once in ConfigureConventions) and rates are numeric(28,12) (set on each rate column). Rounding to currency minor units happens only in API responses and events.