feat(phase3): ERPNext connector (dbt adapter + Airbyte source)
Open-source Excel-native EPM and consolidation for SAP & Dynamics
Brought to you by:
konsolid-at
Originally created by: pyy3
First Phase 3 (Multi-ERP) connector, per docs/prd/PRD-ERPNEXT-CONNECTOR.md. Lands the ERPNext GL-entry-family doctypes via the Frappe REST API and transforms them through the existing canonical staging interface — no changes to canonical/bronze/silver/gold.
models/staging/erpnext/stg_erpnext__* models → exact canonical column sets:gl_entries, accounts, legal_entities, exchange_rates, budget_entries, fiscal_periodstrial_balance derived by aggregating GL Entry (ERPNext has no TB snapshot doctype, unlike D365).record_id is a deterministic Int64 surrogate (reinterpretAsInt64(cityHash64(name))) because ERPNext's GL Entry.name is a string but the canonical record_id is numeric (bronze casts it via toInt64) — keeps it UNION-compatible with the D365 adapter.amount = debit - credit with sign-derived is_credit (silver abs()es and splits by is_credit).erpnext in dbt_project.yml erp_sources; canonical models now UNION ALL both adapters. 'erpnext' was already in the canonical accepted_values / test_erp_source_valid, so no canonical edits.source-erpnext/ (mirrors source-d365-fno)Authorization: token <key>:<secret>), limit_start/limit_page_length paging, modified incremental filter.budget flattens its Budget Account child rows via per-document detail fetch (the list endpoint omits child tables).Runtime-verified against ClickHouse with seeded epm_raw data:
erp_sources: [d365_fo, erpnext]) of stg_gl_entries resolves types correctly and returns rows from both sources.not_null / unique / accepted_values schema tests + the test_erp_source_valid singular test pass.spec/check work and check fails cleanly on invalid credentials.Not in scope (separate Phase 3 PRDs): Connector Registry, Dimension Harmonization, sub-ledger facts, ClickHouse sharding.
🤖 Generated with Claude Code
Ticket changed by: grynn-in