Base de datos: pagos y lotes Bre-B

Base de datos: pagos y lotes Bre-B Un diagrama de entidad-relación generado por Archify. tenants · Entidad tenants PK id UUID company_name TEXT UK nit TEXT contact_name TEXT contact_email TEXT contact_phone TEXT country_code TEXT currency TEXT fee_banco_per_txn INTEGER fee_breb_per_txn INTEGER provider_cost_per_txn INTEGER platform_cut_pct NUMERIC(5,2) breb_max_amount BIGINT payment_provider TEXT provider_account_id TEXT min_balance_alert BIGINT is_active BOOLEAN notes TEXT created_at TIMESTAMPTZ updated_at TIMESTAMPTZ plan_code TEXT plan_expires TIMESTAMPTZ is_trial BOOLEAN max_amount_breb BIGINT max_amount_ach BIGINT max_amount_same_bank BIGINT min_amount_breb BIGINT min_amount_ach BIGINT daily_limit_total BIGINT max_txns_per_day INTEGER max_amount_per_day BIGINT max_amount_per_beneficiary_day BIGINT clients · Entidad clients PK id UUID FK tenant_id UUID company_name TEXT nit TEXT contact_name TEXT contact_email TEXT contact_phone TEXT address TEXT country_code TEXT currency TEXT notes TEXT is_active BOOLEAN total_deposited BIGINT total_dispersed BIGINT last_activity_at TIMESTAMPTZ created_at TIMESTAMPTZ updated_at TIMESTAMPTZ logo_base64 TEXT source_accounts · Entidad source_accounts PK id UUID FK tenant_id UUID provider TEXT bank_id UUID account_type TEXT account_num TEXT label TEXT currency TEXT country_code TEXT is_active BOOLEAN balance BIGINT last_sync_at TIMESTAMPTZ total_deposited BIGINT total_dispersed BIGINT created_at TIMESTAMPTZ updated_at TIMESTAMPTZ locked_amount BIGINT beneficiaries · Entidad beneficiaries PK id UUID FK tenant_id UUID name TEXT alias TEXT document_type TEXT document_num TEXT email TEXT phone TEXT country_code TEXT key_value TEXT key_type TEXT is_active BOOLEAN last_payment_at TIMESTAMPTZ total_received BIGINT average_payment BIGINT sarlaft_status TEXT sarlaft_checked_at TIMESTAMPTZ sarlaft_expires_at TIMESTAMPTZ created_at TIMESTAMPTZ updated_at TIMESTAMPTZ FK client_id UUID breb_batches · Entidad breb_batches PK id UUID FK tenant_id UUID FK beneficiary_id UUID FK client_id UUID key_value TEXT key_type TEXT total_amount BIGINT total_fee BIGINT payments_count INTEGER completed_count INTEGER status TEXT FK source_account_id UUID created_by UUID approved_by UUID created_at TIMESTAMPTZ updated_at TIMESTAMPTZ breb_batch_payments · Entidad breb_batch_payments PK id UUID FK batch_id UUID order_index INTEGER amount BIGINT fee BIGINT status TEXT rejection_reason TEXT FK transaction_id UUID executed_at TIMESTAMPTZ created_at TIMESTAMPTZ retry_count INTEGER next_retry_at TIMESTAMPTZ last_error TEXT transactions · Entidad transactions PK id UUID FK tenant_id UUID FK client_id UUID FK beneficiary_id UUID beneficiary_account_id UUID FK source_account_id UUID payment_method_id UUID UK reference TEXT amount BIGINT currency TEXT country_code TEXT mechanism TEXT fee_charged INTEGER provider_cost INTEGER net_margin INTEGER platform_cut INTEGER status TEXT description TEXT notes TEXT rejection_reason TEXT provider_batch_id TEXT provider_raw JSONB retry_count INTEGER created_by UUID approved_by UUID cancelled_by UUID rejected_by UUID timer_started_at TIMESTAMPTZ dispatch_at TIMESTAMPTZ approved_at TIMESTAMPTZ dispatched_at TIMESTAMPTZ completed_at TIMESTAMPTZ cancelled_at TIMESTAMPTZ rejected_at TIMESTAMPTZ sarlaft_verified_at TIMESTAMPTZ ip_address TEXT created_at TIMESTAMPTZ updated_at TIMESTAMPTZ key_value TEXT key_type TEXT recipient_name TEXT recipient_bank TEXT recipient_document TEXT failed_at TIMESTAMPTZ fail_reason TEXT rail_raw JSONB rail_snapshot JSONB gmf_charged INTEGER tenant_id tenant_id tenant_id client_id tenant_id beneficiary_id client_id source_account_id batch_id transaction_id tenant_id client_id beneficiary_id source_account_id Leyenda PK Clave primaria FK Clave foránea UK Clave única Uno Muchos Opcional