:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(warehouse): add easybill incoming-documents table (#90069)
Tom Owers9c386b602d8e
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.mdindex e5c23284e770..09c4bae7c3f2 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md@@ -2621,6 +2621,16 @@ Diffed against: <https://raw.githubusercontent.com/e2b-dev/infra/main/spec/openaNote: E2B's public API is genuinely small (~20 GET-able paths, most of them template build plumbing or admin/api-key management). The source is static: E2B_ENDPOINTS in settings.py hardcodes /v2/sandboxes, /v2/templates and /snapshots with no dynamic discovery, and correctly uses the v2 sandbox listing (all states) rather than the running-only v1.+## Easybill — gaps++Today (7): `Customers`, `CustomerGroups`, `DocumentPayments`, `Documents`, `IncomingDocuments`, `Positions`, `Projects`++Diffed against: <https://api.easybill.de/rest/v1/swagger.json>++- [x] `incoming-documents (GET /rest/v1/incoming-documents)` — received supplier invoices and credit notes with extracted amounts, supplier, status and payments; the accounts-payable side of the accounting data (medium)++Note: `/incoming-documents` is read-only and its only list filter is `created_at`, so it syncs full-refresh like `/customers` (a `created_at` cursor would miss later edits). The sub-resources `/incoming-documents/{id}/files` and `.../download` are file-download plumbing (binary/URLs), not warehouse-table material, so they were excluded rather than reported as gaps.+## Easypost — gapsToday (9): `addresses`, `batches`, `events`, `insurances`, `pickups`, `refunds`, `scan_forms`, `shipments`, `trackers`diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/canonical_descriptions.pyindex e1032f2ca6e0..70a03861fd3b 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/canonical_descriptions.py@@ -53,6 +53,29 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"is_overdue_fee": "Whether this payment covers an overdue fee rather than the document amount.",},},+ "IncomingDocuments": {+ "description": "A received supplier document: an incoming invoice or credit note, with its extracted amounts, supplier and payment status.",+ "docs_url": "https://www.easybill.de/api/",+ "columns": {+ "id": "Unique identifier for the incoming document.",+ "document_type": "Type of the received document, INVOICE or CREDIT_NOTE.",+ "document_number": "Internal sequential document number assigned by easybill.",+ "external_number": "The supplier's own document number as extracted from the document.",+ "supplier_id": "ID of the supplier the document was received from.",+ "status": "Processing status of the document, e.g. DRAFT, PROCESSING, DONE, ERROR, VIRUS.",+ "interface": "How the document was received: MANUAL, EMAIL or UPLOAD.",+ "currency_code": "Currency of the document amounts.",+ "total_gross_amount": "Total gross amount in cents (e.g. 11900 = 119.00 EUR).",+ "total_net_amount": "Total net amount in cents (e.g. 10000 = 100.00 EUR).",+ "is_paid": "Whether the document has been marked as paid.",+ "issue_date": "Date the supplier issued the document.",+ "delivery_date": "Delivery date shown on the document.",+ "due_date": "Date payment is due.",+ "login_id": "ID of the easybill login the document belongs to.",+ "created_at": "Time the document was created in easybill.",+ "updated_at": "Time the document was last updated. Not filterable via the list API, so it can't be used as an incremental cursor.",+ },+ },"Customers": {"description": "An easybill customer record.","docs_url": "https://www.easybill.de/api/",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/settings.pyindex 0f196487c2e4..ab1c1891280d 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/settings.py@@ -58,6 +58,15 @@ EASYBILL_ENDPOINTS: dict[str, EasybillEndpointConfig] = {path="/document-payments",table_name="document_payments",),+ # Received supplier invoices and credit notes. The list endpoint only filters by `created_at`,+ # so — like `/customers` — it stays full refresh: a `created_at` cursor would miss later edits+ # (status, payments, `is_paid`) that bump `updated_at` but not the creation date.+ "IncomingDocuments": EasybillEndpointConfig(+ name="IncomingDocuments",+ path="/incoming-documents",+ table_name="incoming_documents",+ partition_key="created_at",+ ),# `/customers` only filters by `created_at`, which would miss edits to existing customers, so# this stays full refresh rather than syncing on a lossy cursor."Customers": EasybillEndpointConfig(diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/tests/test_easybill.py b/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/tests/test_easybill.pyindex b38f8e584363..f13eba7f48fe 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/tests/test_easybill.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/easybill/tests/test_easybill.py@@ -136,7 +136,9 @@ class TestIncrementalParams:assert "edited_at" not in params[0]- @parameterized.expand(["DocumentPayments", "Customers", "Positions", "Projects", "CustomerGroups"])+ @parameterized.expand(+ ["DocumentPayments", "IncomingDocuments", "Customers", "Positions", "Projects", "CustomerGroups"]+ )@mock.patch(CLIENT_SESSION_PATCH)def test_non_incremental_endpoints_never_filter(self, endpoint: str, MockSession) -> None:session = MockSession.return_value@@ -214,6 +216,7 @@ class TestSourceResponseShape:@parameterized.expand([("Documents", "documents", "created_at"),+ ("IncomingDocuments", "incoming_documents", "created_at"),("Customers", "customers", "created_at"),("Positions", "positions", None),("Projects", "projects", None),