Base de datos: accesos y API pública

Base de datos: accesos y API pública 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 users · Entidad users PK id UUID FK tenant_id UUID UK email TEXT password_hash TEXT full_name TEXT phone TEXT role TEXT is_active BOOLEAN last_login_at TIMESTAMPTZ failed_login_attempts INTEGER locked_until TIMESTAMPTZ created_at TIMESTAMPTZ updated_at TIMESTAMPTZ country_code TEXT FK client_id UUID totp_secret TEXT totp_enabled BOOLEAN totp_verified_at TIMESTAMPTZ totp_backup_codes TEXT[] totp_required_at TIMESTAMPTZ deleted_at TIMESTAMPTZ deleted_by UUID email_original TEXT session_logs · Entidad session_logs PK id UUID FK user_id UUID FK tenant_id UUID action TEXT ip_address TEXT user_agent TEXT created_at TIMESTAMPTZ user_invitations · Entidad user_invitations PK id UUID tenant_id UUID FK user_id UUID purpose TEXT token_hash TEXT totp_secret TEXT failed_attempts INTEGER expires_at TIMESTAMPTZ used_at TIMESTAMPTZ revoked_at TIMESTAMPTZ created_by UUID created_at TIMESTAMPTZ user_permissions · Entidad user_permissions PK user_id UUID FK tenant_id UUID PK permission TEXT FK granted_by UUID granted_at TIMESTAMPTZ client_wallets · Entidad client_wallets PK client_id UUID PK source_account_id UUID FK tenant_id UUID FK created_by UUID created_at TIMESTAMPTZ user_wallet_grants · Entidad user_wallet_grants PK user_id UUID client_id UUID PK source_account_id UUID FK tenant_id UUID can_recharge BOOLEAN can_disburse BOOLEAN FK granted_by UUID granted_at TIMESTAMPTZ updated_at TIMESTAMPTZ api_keys · Entidad api_keys PK id UUID FK tenant_id UUID FK client_id UUID key_id TEXT environment TEXT label TEXT public_key_pem TEXT fingerprint TEXT allowed_ips TEXT[] status TEXT expires_at TIMESTAMPTZ last_used_at TIMESTAMPTZ FK created_by UUID created_at TIMESTAMPTZ revoked_at TIMESTAMPTZ FK revoked_by UUID scopes TEXT[] api_key_events · Entidad api_key_events PK id UUID FK api_key_id UUID key_id TEXT event TEXT ip_address TEXT detail TEXT created_at TIMESTAMPTZ tenant_id tenant_id client_id user_id tenant_id user_id tenant_id granted_by tenant_id created_by tenant_id granted_by tenant_id client_id created_by revoked_by api_key_id Leyenda PK Clave primaria FK Clave foránea UK Clave única Uno Muchos Opcional