schema
athena_reconcile_general filters documents & transactions from documents_v2 transactions
it matches documents to transactions with company_id and at least one key: date, invoice_number, order_number, merchant_id, amount_total, currency
it uses reconciliations_weight_registry to build a confidence rating for each matching key — these keys can be mapped to have their own weight value based on company_id and/or merchant_id
successful reconciliation matches are then stored in reconciliations and reconciliations_match_scores
then the sql function stage_reconciliations_v2 inserts the reconciliations records from reconciliations table into reconciliations_staging where they can be booked, flagged, archived, or verified
using v2/reconciliation/verify api you can verify a reconciliation record and it automatically reconciles the document & transaction marking them to not be used in further reconciliations scans