: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_sources): add five inflowinventory tables (#111879)
Tom Owersc85e0f3e764b
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 39f47aa96bfc..dda9368b090d 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@@ -4273,20 +4273,20 @@ Note: Endpoint count is a wildly misleading measure of this API's size: of ~800## Inflowinventory — gaps-Today (9): `categories`, `customers`, `locations`, `manufacturing_orders`, `products`, `purchase_orders`, `sales_orders`, `stock_transfers`, `vendors`+Today (14): `categories`, `customers`, `locations`, `manufacturing_orders`, `product_cost_adjustments`, `products`, `purchase_orders`, `sales_orders`, `stock_adjustments`, `stock_counts`, `stock_transfers`, `tax_codes`, `taxing_schemes`, `vendors`Diffed against: <https://cloudapi.inflowinventory.com/docs/api/swagger.json>-- [ ] `/{companyId}/stock-adjustments` — inventory write-offs and corrections - the transaction table that explains why on-hand quantities move outside of orders (high)+- [x] `/{companyId}/stock-adjustments` — inventory write-offs and corrections - the transaction table that explains why on-hand quantities move outside of orders (high). Added as `stock_adjustments` (header rows only; per-product `lines` need `include=lines`, not requested yet).- [x] `/{companyId}/stock-transfers` — inter-location inventory movements, required for any multi-warehouse stock analysis (high)- [x] `/{companyId}/manufacturing-orders` — production/assembly orders - the third order type alongside the sales and purchase orders already synced (high)- [x] `/{companyId}/locations` — lookup resolving the locationId carried on orders, transfers and product quantities (high)- [x] `/{companyId}/categories` — lookup resolving product categoryId - the primary breakdown dimension for any sales or inventory report (high)-- [ ] `/{companyId}/stock-counts` — physical count cycles and their variances, for shrinkage and count-accuracy reporting (medium)-- [ ] `/{companyId}/product-cost-adjustments` — cost basis changes over time, needed for correct COGS and margin on historical orders (medium)+- [x] `/{companyId}/stock-counts` — physical count cycles and their variances, for shrinkage and count-accuracy reporting (medium). Added as `stock_counts` (header rows only; per-product counts and variances live in `sheets`, which needs `include=sheets`, not requested yet).+- [x] `/{companyId}/product-cost-adjustments` — cost basis changes over time, needed for correct COGS and margin on historical orders (medium)- [ ] `/{companyId}/product-groups (+ /{productGroupId}/quantities/{locationId})` — product grouping lookup plus per-location on-hand quantities, the current-stock view products alone does not give (medium)- [ ] `/{companyId}/adjustment-reasons` — lookup resolving the reason code on each stock adjustment - without it adjustments cannot be categorized (medium)-- [ ] `/{companyId}/tax-codes and /{companyId}/taxing-schemes` — lookups resolving tax IDs on order lines, needed to reconcile order totals (medium)+- [x] `/{companyId}/tax-codes and /{companyId}/taxing-schemes` — lookups resolving tax IDs on order lines, needed to reconcile order totals (medium)- [ ] `/{companyId}/currencies` — lookup with exchange rates, required to normalize multi-currency order totals (medium)- [ ] `/{companyId}/team-members` — lookup resolving the user IDs that created or own orders, for per-rep performance reporting (medium)diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/canonical_descriptions.pyindex ee0a69a716b9..f542871fa18a 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/canonical_descriptions.py@@ -147,4 +147,84 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"timestamp": "The row version timestamp used for change tracking.",},},+ "stock_adjustments": {+ "description": "A stock adjustment that corrects or writes off inventory at a location outside of an order.",+ "docs_url": _DOCS_URL,+ "columns": {+ "stockAdjustmentId": "The unique ID of the stock adjustment.",+ "adjustmentNumber": "The human-readable adjustment number shown on printed documents.",+ "adjustmentReasonId": "The ID of the reason recorded for the adjustment.",+ "date": "The effective date of the stock adjustment.",+ "locationId": "The ID of the location where inventory is adjusted.",+ "isCancelled": "Whether the adjustment is cancelled. A cancelled adjustment voids its inventory movements.",+ "remarks": "Free-text remarks recorded against the stock adjustment.",+ "customFields": "Custom field values recorded against the stock adjustment.",+ "lastModifiedById": "The ID of the team member, system process, or API key that last modified the adjustment.",+ "lastModifiedDateTime": "When the stock adjustment was last modified.",+ "timestamp": "The row version timestamp used for change tracking.",+ },+ },+ "stock_counts": {+ "description": "A physical stock count at a location, used to reconcile recorded inventory with counted inventory.",+ "docs_url": _DOCS_URL,+ "columns": {+ "stockCountId": "The unique ID of the stock count.",+ "stockCountNumber": "The human-readable stock count number.",+ "status": "The current status of the stock count.",+ "locationId": "The ID of the location where the count takes place.",+ "assignedToTeamMemberId": "The ID of the team member assigned to the count.",+ "startedDate": "The date the stock count was started.",+ "completedDate": "The date the stock count was completed.",+ "isStarted": "Whether the stock count is ready for counting.",+ "isCompleted": "Whether the stock count is completed. Inventory is adjusted when the count completes.",+ "isReviewed": "Whether the stock count has been reviewed.",+ "isCancelled": "Whether the stock count is cancelled. A cancelled count voids its inventory adjustments.",+ "remarks": "Free-text remarks recorded against the stock count.",+ "lastModifiedDateTime": "When the stock count was last modified.",+ "timestamp": "The row version timestamp used for change tracking.",+ },+ },+ "product_cost_adjustments": {+ "description": "A change to a product's inventory cost, effective from a given date.",+ "docs_url": _DOCS_URL,+ "columns": {+ "productCostAdjustmentId": "The unique ID of the product cost adjustment.",+ "productId": "The ID of the product whose cost is adjusted.",+ "dateTime": "The effective date of the cost adjustment.",+ "unitCost": "The new inventory cost per standard unit of measure.",+ "serial": "For serialized products, the serial number whose cost is adjusted.",+ "lastModifiedById": "The ID of the team member, system process, or API key that last modified the adjustment.",+ "timestamp": "The row version timestamp used for change tracking.",+ },+ },+ "tax_codes": {+ "description": "A tax code that sets the tax percentages applied to order lines under a taxing scheme.",+ "docs_url": _DOCS_URL,+ "columns": {+ "taxCodeId": "The unique ID of the tax code.",+ "name": "The tax code name.",+ "taxingSchemeId": "The ID of the taxing scheme the tax code belongs to.",+ "tax1Rate": "The percentage of the primary tax for the tax code.",+ "tax2Rate": "The percentage of the secondary tax for the tax code.",+ "isActive": "Whether the tax code is active.",+ "timestamp": "The row version timestamp used for change tracking.",+ },+ },+ "taxing_schemes": {+ "description": "A taxing scheme that defines the primary and secondary taxes and how they are calculated.",+ "docs_url": _DOCS_URL,+ "columns": {+ "taxingSchemeId": "The unique ID of the taxing scheme.",+ "name": "The taxing scheme name.",+ "tax1Name": "The short display name of the primary tax.",+ "tax2Name": "The short display name of the secondary tax.",+ "tax1OnShipping": "Whether the primary tax applies to shipping costs.",+ "tax2OnShipping": "Whether the secondary tax applies to shipping costs.",+ "calculateTax2OnTax1": "Whether the secondary tax is compounded on top of the primary tax.",+ "defaultTaxCodeId": "The ID of the default tax code for the taxing scheme.",+ "isDefault": "Whether this is the company-wide default taxing scheme.",+ "isActive": "Whether the taxing scheme is active.",+ "timestamp": "The row version timestamp used for change tracking.",+ },+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/settings.pyindex 1acdd18ea967..4386f1303e3d 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/settings.py@@ -35,6 +35,17 @@ INFLOWINVENTORY_ENDPOINTS: dict[str, InflowInventoryEndpointConfig] = {),"locations": InflowInventoryEndpointConfig(name="locations", path="locations", id_field="locationId"),"categories": InflowInventoryEndpointConfig(name="categories", path="categories", id_field="categoryId"),+ "stock_adjustments": InflowInventoryEndpointConfig(+ name="stock_adjustments", path="stock-adjustments", id_field="stockAdjustmentId"+ ),+ "stock_counts": InflowInventoryEndpointConfig(name="stock_counts", path="stock-counts", id_field="stockCountId"),+ "product_cost_adjustments": InflowInventoryEndpointConfig(+ name="product_cost_adjustments", path="product-cost-adjustments", id_field="productCostAdjustmentId"+ ),+ "tax_codes": InflowInventoryEndpointConfig(name="tax_codes", path="tax-codes", id_field="taxCodeId"),+ "taxing_schemes": InflowInventoryEndpointConfig(+ name="taxing_schemes", path="taxing-schemes", id_field="taxingSchemeId"+ ),}ENDPOINTS = tuple(INFLOWINVENTORY_ENDPOINTS.keys())