diff --git a/js/packages/ui/src/api/cll.ts b/js/packages/ui/src/api/cll.ts index 1682dc537..4e2f64c64 100644 --- a/js/packages/ui/src/api/cll.ts +++ b/js/packages/ui/src/api/cll.ts @@ -18,6 +18,7 @@ export interface CllInput { no_cll?: boolean; no_upstream?: boolean; no_downstream?: boolean; + full_map?: boolean; } export interface ImpactRadiusParams { diff --git a/js/packages/ui/src/components/lineage/LineageViewOss.tsx b/js/packages/ui/src/components/lineage/LineageViewOss.tsx index b9230783a..05f572959 100644 --- a/js/packages/ui/src/components/lineage/LineageViewOss.tsx +++ b/js/packages/ui/src/components/lineage/LineageViewOss.tsx @@ -49,6 +49,7 @@ import { trackCopyToClipboard, trackMultiNodesAction, } from "../../lib/api/track"; +import { sliceCllMap } from "./sliceCllMap"; import "../../styles"; import Box from "@mui/material/Box"; import Divider from "@mui/material/Divider"; @@ -175,6 +176,10 @@ export function PrivateLineageView( const actionGetCll = useMutation({ mutationFn: (input: CllInput) => getCll(input, apiClient), }); + // Cached full CLL map fetched once on Impact click with full_map=true. + // All subsequent column/node navigation slices this client-side via sliceCllMap(). + // Cleared when lineageGraph changes (re-fetch needed) or CLL is exited. + const fullCllMapRef = useRef(undefined); // Guard against useLayoutEffect re-entry after cache patching. // When setQueryData patches lineage.diff, queryServerInfo.data changes, // lineageGraph recomputes via useMemo, and the effect re-fires. This ref @@ -186,6 +191,36 @@ export function PrivateLineageView( }>({ pending: false }); const [nodeColumnSetMap, setNodeColumSetMap] = useState({}); + // Fetch the full CLL map (one-time), cache it, slice for the given params, + // and patch the lineage diff cache with change data. + async function fetchAndCacheFullMap( + cllApiInput: CllInput, + ): Promise { + const fullMap = await actionGetCll.mutateAsync({ + change_analysis: cllApiInput.change_analysis, + full_map: true, + }); + fullCllMapRef.current = fullMap; + const cll = sliceCllMap(fullMap, cllApiInput); + if (cllApiInput.change_analysis && fullMap) { + cllCachePatchRef.current = { pending: true, cllData: cll }; + queryClient.setQueryData( + cacheKeys.lineage(), + (old: ServerInfoResult | undefined) => { + if (!old) return old; + return { + ...old, + lineage: { + ...old.lineage, + diff: patchLineageDiffFromCll(old.lineage.diff, fullMap), + }, + }; + }, + ); + } + return cll; + } + const findNodeByName = useCallback( (name: string) => { return nodes.filter(isLineageGraphNode).find((n) => n.data.name === name); @@ -415,6 +450,8 @@ export function PrivateLineageView( cll = cllCachePatchRef.current.cllData; cllCachePatchRef.current = { pending: false }; } else { + // lineageGraph changed externally — invalidate cached full CLL map + fullCllMapRef.current = undefined; const cllApiInput: CllInput = { ...viewOptions.column_level_lineage, change_analysis: @@ -422,28 +459,7 @@ export function PrivateLineageView( changeAnalysisModeRef.current, }; try { - cll = await actionGetCll.mutateAsync(cllApiInput); - // Patch the lineage diff cache with change data from CLL - const cllResult = cll; - if (cllApiInput.change_analysis && cllResult) { - cllCachePatchRef.current = { pending: true, cllData: cllResult }; - queryClient.setQueryData( - cacheKeys.lineage(), - (old: ServerInfoResult | undefined) => { - if (!old) return old; - return { - ...old, - lineage: { - ...old.lineage, - diff: patchLineageDiffFromCll( - old.lineage.diff, - cllResult, - ), - }, - }; - }, - ); - } + cll = await fetchAndCacheFullMap(cllApiInput); } catch (e) { if (e instanceof AxiosError) { const e2 = e as AxiosError<{ detail?: string }>; @@ -694,26 +710,12 @@ export function PrivateLineageView( changeAnalysisMode, }; try { - cll = await actionGetCll.mutateAsync(cllApiInput); - // Patch the lineage diff cache with change data from CLL. - // Also set the guard ref so the useLayoutEffect that re-fires - // (due to lineageGraph recomputing) skips the redundant CLL call. - const cllResult = cll; - if (cllApiInput.change_analysis && cllResult) { - cllCachePatchRef.current = { pending: true, cllData: cllResult }; - queryClient.setQueryData( - cacheKeys.lineage(), - (old: ServerInfoResult | undefined) => { - if (!old) return old; - return { - ...old, - lineage: { - ...old.lineage, - diff: patchLineageDiffFromCll(old.lineage.diff, cllResult), - }, - }; - }, - ); + // If we have the full CLL map cached, slice client-side (instant). + // Otherwise fetch with full_map=true and cache it (one-time cost). + if (fullCllMapRef.current) { + cll = sliceCllMap(fullCllMapRef.current, cllApiInput); + } else { + cll = await fetchAndCacheFullMap(cllApiInput); } } catch (e) { if (e instanceof AxiosError) { @@ -731,6 +733,8 @@ export function PrivateLineageView( // Clear change analysis mode when CLL is cleared by any path // (reselect, selectParentNodes, selectChildNodes, etc.) setChangeAnalysisMode(false); + // Clear cached full map when CLL is exited + fullCllMapRef.current = undefined; } // Capture positions if preservePositions is true diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/capture_diff_fixtures.py b/js/packages/ui/src/components/lineage/__tests__/fixtures/capture_diff_fixtures.py new file mode 100644 index 000000000..eae528042 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/capture_diff_fixtures.py @@ -0,0 +1,116 @@ +""" +Capture CLL fixtures from a running recce server that has actual dbt changes. + +Usage: + python capture_diff_fixtures.py [--port 8000] [--output-dir ./diff] + +Prerequisites: + - recce server running with jaffle_shop_duckdb (with base vs current diff) + - Changes should include: added column, modified column def, WHERE clause added +""" + +import argparse +import json +import os +import sys +from urllib.request import urlopen, Request + + +def fetch_cll(base_url: str, params: dict) -> dict: + """Fetch CLL data from the server via POST.""" + url = f"{base_url}/api/cll" + body = json.dumps(params).encode() + req = Request(url, data=body, headers={"Content-Type": "application/json"}) + with urlopen(req) as resp: + return json.loads(resp.read().decode()) + + +def save_fixture(output_dir: str, name: str, data: dict): + path = os.path.join(output_dir, f"{name}.json") + with open(path, "w") as f: + json.dump(data, f, indent=2) + print(f" saved: {name}.json") + + +def main(): + parser = argparse.ArgumentParser(description="Capture CLL diff fixtures") + parser.add_argument("--port", type=int, default=8000) + parser.add_argument("--output-dir", default=os.path.join(os.path.dirname(__file__), "diff")) + args = parser.parse_args() + + base_url = f"http://localhost:{args.port}" + output_dir = args.output_dir + os.makedirs(output_dir, exist_ok=True) + + # 1. Impact overview (no node_id = all changed nodes + their lineage) + print("Fetching impact overview (full map with change_analysis)...") + full_map = fetch_cll(base_url, {"change_analysis": True}) + save_fixture(output_dir, "cll-diff-full-map", full_map) + + # Find nodes with changes + nodes_with_changes = {} + for nid, node in full_map["current"]["nodes"].items(): + if node.get("change_status"): + nodes_with_changes[nid] = node + print(f" changed node: {nid} (status={node['change_status']}, category={node.get('change_category', 'n/a')})") + + if not nodes_with_changes: + print("ERROR: No nodes with change_status found. Is the server running with a diff?") + sys.exit(1) + + # Find columns with changes + cols_with_changes = {} + for cid, col in full_map["current"]["columns"].items(): + if col.get("change_status"): + cols_with_changes[cid] = col + print(f" changed column: {cid} ({col['change_status']})") + + # 2. Node-level queries for changed nodes + print("\nFetching node-level fixtures for changed nodes...") + for nid in nodes_with_changes: + safe_name = nid.replace(".", "_") + + data = fetch_cll(base_url, {"node_id": nid, "change_analysis": True}) + save_fixture(output_dir, f"cll-diff-node-{safe_name}", data) + + data = fetch_cll(base_url, {"node_id": nid, "change_analysis": True, "no_upstream": True}) + save_fixture(output_dir, f"cll-diff-node-{safe_name}-no-upstream", data) + + data = fetch_cll(base_url, {"node_id": nid, "change_analysis": True, "no_downstream": True}) + save_fixture(output_dir, f"cll-diff-node-{safe_name}-no-downstream", data) + + # 3. Column-level queries for changed columns + print("\nFetching column-level fixtures for changed columns...") + for cid, col in cols_with_changes.items(): + node_id = None + col_name = None + for nid in full_map["current"]["nodes"]: + if cid.startswith(f"{nid}_"): + node_id = nid + col_name = cid[len(nid) + 1:] + break + + if not node_id or not col_name: + print(f" WARNING: could not parse node_id/column from {cid}, skipping") + continue + + safe_name = cid.replace(".", "_") + data = fetch_cll(base_url, {"node_id": node_id, "column": col_name, "change_analysis": True}) + save_fixture(output_dir, f"cll-diff-col-{safe_name}", data) + + # 4. A few impacted (downstream, not directly changed) nodes + print("\nFetching impacted (not directly changed) node fixtures...") + impacted_nodes = [ + nid for nid, node in full_map["current"]["nodes"].items() + if node.get("impacted") and not node.get("change_status") + ] + for nid in impacted_nodes[:3]: + safe_name = nid.replace(".", "_") + data = fetch_cll(base_url, {"node_id": nid, "change_analysis": True}) + save_fixture(output_dir, f"cll-diff-node-{safe_name}", data) + + print(f"\nDone! {len(os.listdir(output_dir))} fixtures in {output_dir}") + + +if __name__ == "__main__": + main() diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_int_store_revenue-order_count.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_int_store_revenue-order_count.json new file mode 100644 index 000000000..6296a3fd0 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_int_store_revenue-order_count.json @@ -0,0 +1,167 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.int_store_revenue_order_count": { + "id": "model.jaffle_shop.int_store_revenue_order_count", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count": { + "id": "model.jaffle_shop.store_rankings_order_count", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count_rank": { + "id": "model.jaffle_shop.store_rankings_order_count_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_order_count": { + "id": "model.jaffle_shop.store_performance_order_count", + "table_id": "model.jaffle_shop.store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_orders_per_employee": { + "id": "model.jaffle_shop.store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_order_count": { + "id": "model.jaffle_shop.int_store_performance_order_count", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_orders_per_employee": { + "id": "model.jaffle_shop.int_store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_order_count": { + "id": "model.jaffle_shop.rpt_store_dashboard_order_count", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.store_rankings_order_count_rank": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.int_store_performance_order_count" + ], + "model.jaffle_shop.store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.rpt_store_dashboard_order_count": [ + "model.jaffle_shop.store_rankings_order_count" + ] + }, + "child_map": { + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.store_rankings_order_count_rank", + "model.jaffle_shop.store_rankings_order_count" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.store_performance_orders_per_employee" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_performance_order_count", + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.rpt_store_dashboard_order_count" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_int_store_revenue-store_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_int_store_revenue-store_id.json new file mode 100644 index 000000000..ce35297a8 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_int_store_revenue-store_id.json @@ -0,0 +1,139 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.int_store_revenue_store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue_store_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_id": [] + }, + "child_map": { + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.int_store_revenue_store_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_order_discounts-customer_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_order_discounts-customer_id.json new file mode 100644 index 000000000..803fef07f --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_order_discounts-customer_id.json @@ -0,0 +1,81 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.order_discounts_customer_id": { + "id": "model.jaffle_shop.order_discounts_customer_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_customer_id": { + "id": "model.jaffle_shop.int_order_enriched_customer_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_customer_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_customer_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.order_discounts_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "seed.jaffle_shop.raw_orders_user_id" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.int_orders_with_promotions_customer_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.order_discounts_customer_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "model.jaffle_shop.int_orders_with_promotions_customer_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_order_discounts-order_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_order_discounts-order_id.json new file mode 100644 index 000000000..6fdcfadd5 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_order_discounts-order_id.json @@ -0,0 +1,81 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.order_discounts_order_id": { + "id": "model.jaffle_shop.order_discounts_order_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.order_discounts_order_id": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.order_discounts_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_revenue_summary-order_date.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_revenue_summary-order_date.json new file mode 100644 index 000000000..dbc23799e --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_revenue_summary-order_date.json @@ -0,0 +1,111 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.revenue_summary_order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.revenue_summary_order_date" + ], + "seed.jaffle_shop.raw_orders_order_date": [], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.rpt_store_dashboard_active_days": [ + "model.jaffle_shop.metric_store_daily_order_date" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.revenue_summary_order_date" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.rpt_store_dashboard_active_days" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_revenue_summary-order_week.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_revenue_summary-order_week.json new file mode 100644 index 000000000..1ad88d06e --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_revenue_summary-order_week.json @@ -0,0 +1,81 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.revenue_summary_order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.revenue_summary_order_week": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "seed.jaffle_shop.raw_orders_order_date": [], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.revenue_summary_order_week" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_stg_employees-employee_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_stg_employees-employee_id.json new file mode 100644 index 000000000..28d7d12e6 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_stg_employees-employee_id.json @@ -0,0 +1,51 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.stg_employees_employee_id": { + "id": "model.jaffle_shop.stg_employees_employee_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_id": { + "id": "seed.jaffle_shop.raw_employees_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_employee_id": { + "id": "model.jaffle_shop.store_staffing_employee_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.stg_employees_employee_id": [ + "seed.jaffle_shop.raw_employees_id" + ], + "seed.jaffle_shop.raw_employees_id": [], + "model.jaffle_shop.store_staffing_employee_id": [ + "model.jaffle_shop.stg_employees_employee_id" + ] + }, + "child_map": { + "seed.jaffle_shop.raw_employees_id": [ + "model.jaffle_shop.stg_employees_employee_id" + ], + "model.jaffle_shop.stg_employees_employee_id": [ + "model.jaffle_shop.store_staffing_employee_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_stg_employees-store_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_stg_employees-store_id.json new file mode 100644 index 000000000..d7a42cd4e --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-model_jaffle_shop_stg_employees-store_id.json @@ -0,0 +1,216 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_staffing": { + "id": "model.jaffle_shop.store_staffing", + "name": "store_staffing", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstaffing as (\n select\n e.employee_id,\n e.first_name,\n e.last_name,\n e.role,\n e.hired_at,\n e.store_id,\n s.store_name,\n s.city,\n s.state\n from employees e\n left join stores s on e.store_id = s.store_id\n)\n\nselect * from staffing", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_staffing_store_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.stg_employees_store_id": { + "id": "model.jaffle_shop.stg_employees_store_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_store_id": { + "id": "seed.jaffle_shop.raw_employees_store_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_store_id": { + "id": "model.jaffle_shop.store_staffing_store_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_employees_store_id" + ], + "model.jaffle_shop.store_staffing": [ + "model.jaffle_shop.stg_employees_store_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.metric_store_daily": ["model.jaffle_shop.stores"], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_employees_store_id": [ + "seed.jaffle_shop.raw_employees_store_id" + ], + "seed.jaffle_shop.raw_employees_store_id": [], + "model.jaffle_shop.store_staffing_store_id": [ + "model.jaffle_shop.stg_employees_store_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_employees_store_id": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing", + "model.jaffle_shop.store_staffing_store_id" + ], + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "seed.jaffle_shop.raw_employees_store_id": [ + "model.jaffle_shop.stg_employees_store_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-seed_jaffle_shop_raw_stores-id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-seed_jaffle_shop_raw_stores-id.json new file mode 100644 index 000000000..8c67accc5 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-seed_jaffle_shop_raw_stores-id.json @@ -0,0 +1,437 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.product_inventory": { + "id": "model.jaffle_shop.product_inventory", + "name": "product_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('int_product_stock_levels') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nproducts as (\n select * from {{ ref('stg_products') }}\n),\n\nfinal as (\n select\n s.product_store_key,\n s.product_id,\n p.product_name,\n s.store_id,\n st.store_name,\n s.total_received,\n s.total_sold,\n s.current_stock,\n s.last_restock_date,\n s.last_sale_date,\n case\n when s.current_stock <= 0 then 'out_of_stock'\n when s.current_stock < 10 then 'low_stock'\n when s.current_stock < 50 then 'adequate'\n else 'well_stocked'\n end as stock_status\n from stock s\n left join products p on s.product_id = p.product_id\n left join stores st on s.store_id = st.store_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_staffing": { + "id": "model.jaffle_shop.store_staffing", + "name": "store_staffing", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstaffing as (\n select\n e.employee_id,\n e.first_name,\n e.last_name,\n e.role,\n e.hired_at,\n e.store_id,\n s.store_name,\n s.city,\n s.state\n from employees e\n left join stores s on e.store_id = s.store_id\n)\n\nselect * from staffing", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_rankings_store_id", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_id", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.reorder_recommendations": { + "id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_recommendations", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('product_inventory') }}\n),\n\nperformance as (\n select * from {{ ref('product_performance') }}\n),\n\nrecommendations as (\n select\n s.product_id,\n s.product_name,\n s.store_id,\n s.store_name,\n s.current_stock,\n s.stock_status,\n s.last_restock_date,\n p.total_quantity_sold,\n p.times_ordered,\n case\n when s.stock_status = 'out_of_stock' then 'urgent'\n when s.stock_status = 'low_stock' then 'soon'\n when s.stock_status = 'adequate' and p.times_ordered > 5 then 'monitor'\n else 'ok'\n end as reorder_priority,\n greatest(50 - s.current_stock, 0) as suggested_reorder_qty\n from stock s\n left join performance p on s.product_id = p.product_id\n)\n\nselect * from recommendations", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_inventory_daily": { + "id": "model.jaffle_shop.metric_inventory_daily", + "name": "metric_inventory_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nsnapshot as (\n select\n current_date as snapshot_date,\n count(distinct product_id) as total_products_tracked,\n count(distinct store_id) as total_stores,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_count,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_count,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_count,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_count,\n round(avg(current_stock), 1) as avg_stock_per_product_store\n from inventory\n)\n\nselect * from snapshot", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.stores_store_id", + "table_id": "model.jaffle_shop.stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_performance_store_id", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.inventory_health": { + "id": "model.jaffle_shop.inventory_health", + "name": "inventory_health", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nmovements as (\n select\n product_id,\n store_id,\n sum(quantity_in) as total_inbound,\n sum(quantity_out) as total_outbound,\n count(case when movement_type = 'supply' then 1 end) as restock_events,\n count(case when movement_type = 'sale' then 1 end) as sale_events\n from {{ ref('int_inventory_movements') }}\n group by product_id, store_id\n),\n\nhealth as (\n select\n i.product_store_key,\n i.product_id,\n i.product_name,\n i.store_id,\n i.store_name,\n i.current_stock,\n i.stock_status,\n m.total_inbound,\n m.total_outbound,\n m.restock_events,\n m.sale_events,\n case\n when m.total_outbound > m.total_inbound then 'deficit'\n when i.current_stock > m.total_outbound * 2 then 'overstocked'\n else 'balanced'\n end as inventory_balance,\n case when m.sale_events > 0\n then round(cast(m.total_outbound as decimal) / m.sale_events, 1)\n else 0\n end as avg_units_per_sale\n from inventory i\n left join movements m on i.product_id = m.product_id and i.store_id = m.store_id\n)\n\nselect * from health", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_performance_store_id", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_inventory": { + "id": "model.jaffle_shop.store_inventory", + "name": "store_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nstore_level as (\n select\n store_id,\n store_name,\n count(distinct product_id) as unique_products,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_products,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_products,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_stock_products,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_products\n from inventory\n group by store_id, store_name\n)\n\nselect * from store_level", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.stg_stores_store_id": { + "id": "model.jaffle_shop.stg_stores_store_id", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_store_id": { + "id": "model.jaffle_shop.store_rankings_store_id", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_store_id": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_id", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_id": { + "id": "seed.jaffle_shop.raw_stores_id", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_store_id": { + "id": "model.jaffle_shop.stores_store_id", + "table_id": "model.jaffle_shop.stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_store_id": { + "id": "model.jaffle_shop.store_performance_store_id", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_store_id": { + "id": "model.jaffle_shop.int_store_performance_store_id", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.store_staffing": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.stores_store_id", + "model.jaffle_shop.stores" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings", + "model.jaffle_shop.store_rankings_store_id", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_inventory" + ], + "model.jaffle_shop.reorder_recommendations": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.metric_inventory_daily": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.inventory_health": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_stores_store_id": [ + "seed.jaffle_shop.raw_stores_id" + ], + "model.jaffle_shop.store_rankings_store_id": [ + "model.jaffle_shop.store_performance_store_id" + ], + "model.jaffle_shop.rpt_store_dashboard_store_id": [ + "model.jaffle_shop.store_rankings_store_id" + ], + "seed.jaffle_shop.raw_stores_id": [], + "model.jaffle_shop.stores_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id" + ], + "model.jaffle_shop.store_performance_store_id": [ + "model.jaffle_shop.int_store_performance_store_id" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.int_store_performance_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id" + ] + }, + "child_map": { + "model.jaffle_shop.stg_stores_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.store_staffing" + ], + "model.jaffle_shop.stores_store_id": [ + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.store_rankings_store_id": [ + "model.jaffle_shop.rpt_store_dashboard", + "model.jaffle_shop.rpt_store_dashboard_store_id" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.metric_inventory_daily", + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.stores_store_id", + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.int_store_performance_store_id", + "model.jaffle_shop.order_fulfillment" + ], + "seed.jaffle_shop.raw_stores_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.store_performance_store_id": [ + "model.jaffle_shop.store_rankings_store_id" + ], + "model.jaffle_shop.int_store_performance_store_id": [ + "model.jaffle_shop.store_performance_store_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-seed_jaffle_shop_raw_stores-name.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-seed_jaffle_shop_raw_stores-name.json new file mode 100644 index 000000000..fc9b1a58b --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-col-seed_jaffle_shop_raw_stores-name.json @@ -0,0 +1,468 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.metric_store_daily_store_name", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.store_rankings_store_name", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_name", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.stores_store_name", + "table_id": "model.jaffle_shop.stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.store_performance_store_name", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.int_store_employees_active_store_name", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.int_store_performance_store_name", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_inventory": { + "id": "model.jaffle_shop.store_inventory", + "name": "store_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nstore_level as (\n select\n store_id,\n store_name,\n count(distinct product_id) as unique_products,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_products,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_products,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_stock_products,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_products\n from inventory\n group by store_id, store_name\n)\n\nselect * from store_level", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.store_inventory_store_name", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_name": { + "id": "model.jaffle_shop.order_fulfillment_store_name", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.stg_stores_store_name": { + "id": "model.jaffle_shop.stg_stores_store_name", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_store_name": { + "id": "model.jaffle_shop.product_inventory_store_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_store_name": { + "id": "model.jaffle_shop.store_staffing_store_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_store_name": { + "id": "model.jaffle_shop.metric_store_daily_store_name", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_store_name": { + "id": "model.jaffle_shop.store_rankings_store_name", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_store_name": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_name", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_store_name": { + "id": "model.jaffle_shop.reorder_recommendations_store_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_name": { + "id": "seed.jaffle_shop.raw_stores_name", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_store_name": { + "id": "model.jaffle_shop.stores_store_name", + "table_id": "model.jaffle_shop.stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_store_name": { + "id": "model.jaffle_shop.store_performance_store_name", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_name": { + "id": "model.jaffle_shop.int_store_employees_active_store_name", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_store_name": { + "id": "model.jaffle_shop.inventory_health_store_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_store_name": { + "id": "model.jaffle_shop.int_store_performance_store_name", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_store_name": { + "id": "model.jaffle_shop.store_inventory_store_name", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_store_name": { + "id": "model.jaffle_shop.order_fulfillment_store_name", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.metric_store_daily": ["model.jaffle_shop.stores"], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_inventory" + ], + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "seed.jaffle_shop.raw_stores_name" + ], + "model.jaffle_shop.product_inventory_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.store_staffing_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.metric_store_daily_store_name": [ + "model.jaffle_shop.stores_store_name" + ], + "model.jaffle_shop.store_rankings_store_name": [ + "model.jaffle_shop.store_performance_store_name" + ], + "model.jaffle_shop.rpt_store_dashboard_store_name": [ + "model.jaffle_shop.store_rankings_store_name" + ], + "model.jaffle_shop.reorder_recommendations_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "seed.jaffle_shop.raw_stores_name": [], + "model.jaffle_shop.stores_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.store_performance_store_name": [ + "model.jaffle_shop.int_store_performance_store_name" + ], + "model.jaffle_shop.int_store_employees_active_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.inventory_health_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.int_store_performance_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.store_inventory_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.order_fulfillment_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ] + }, + "child_map": { + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "model.jaffle_shop.product_inventory_store_name", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_employees_active_store_name", + "model.jaffle_shop.store_staffing_store_name" + ], + "model.jaffle_shop.product_inventory_store_name": [ + "model.jaffle_shop.reorder_recommendations_store_name", + "model.jaffle_shop.store_inventory_store_name", + "model.jaffle_shop.inventory_health_store_name", + "model.jaffle_shop.store_inventory" + ], + "seed.jaffle_shop.raw_stores_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.stores_store_name": [ + "model.jaffle_shop.metric_store_daily_store_name" + ], + "model.jaffle_shop.store_performance_store_name": [ + "model.jaffle_shop.store_rankings_store_name" + ], + "model.jaffle_shop.store_rankings_store_name": [ + "model.jaffle_shop.rpt_store_dashboard_store_name" + ], + "model.jaffle_shop.int_store_employees_active_store_name": [ + "model.jaffle_shop.int_store_performance_store_name", + "model.jaffle_shop.stores_store_name", + "model.jaffle_shop.order_fulfillment_store_name" + ], + "model.jaffle_shop.int_store_performance_store_name": [ + "model.jaffle_shop.store_performance_store_name" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-full-map.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-full-map.json new file mode 100644 index 000000000..ffe1491e8 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-full-map.json @@ -0,0 +1,20573 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.order_discounts": { + "id": "model.jaffle_shop.order_discounts", + "name": "order_discounts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndiscounts as (\n select\n order_id,\n customer_id,\n order_date,\n subtotal,\n has_promotion,\n promotion_name,\n discount_type,\n discount_value,\n discount_amount,\n case when subtotal > 0\n then round(discount_amount / subtotal * 100, 1)\n else 0\n end as discount_pct_of_order,\n subtotal - discount_amount as net_revenue\n from orders\n where has_promotion = true\n)\n\nselect * from discounts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_discounts_order_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.order_discounts_customer_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.order_discounts_order_date", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "subtotal": { + "id": "model.jaffle_shop.order_discounts_subtotal", + "table_id": "model.jaffle_shop.order_discounts", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "has_promotion": { + "id": "model.jaffle_shop.order_discounts_has_promotion", + "table_id": "model.jaffle_shop.order_discounts", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.order_discounts_promotion_name", + "table_id": "model.jaffle_shop.order_discounts", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.order_discounts_discount_type", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "model.jaffle_shop.order_discounts_discount_value", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_amount": { + "id": "model.jaffle_shop.order_discounts_discount_amount", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_amount", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_pct_of_order": { + "id": "model.jaffle_shop.order_discounts_discount_pct_of_order", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_pct_of_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.order_discounts_net_revenue", + "table_id": "model.jaffle_shop.order_discounts", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_employees": { + "id": "model.jaffle_shop.stg_employees", + "name": "stg_employees", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_employees') }}\n),\n\nrenamed as (\n select\n id as employee_id,\n store_id,\n first_name,\n last_name,\n role,\n cast(hired_at as date) as hired_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "employee_id": { + "id": "model.jaffle_shop.stg_employees_employee_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.stg_employees_store_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.stg_employees_first_name", + "table_id": "model.jaffle_shop.stg_employees", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.stg_employees_last_name", + "table_id": "model.jaffle_shop.stg_employees", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "role": { + "id": "model.jaffle_shop.stg_employees_role", + "table_id": "model.jaffle_shop.stg_employees", + "name": "role", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "hired_at": { + "id": "model.jaffle_shop.stg_employees_hired_at", + "table_id": "model.jaffle_shop.stg_employees", + "name": "hired_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_month": { + "id": "model.jaffle_shop.revenue_summary_order_month", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.revenue_summary_store_id", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.revenue_summary_order_count", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "revenue": { + "id": "model.jaffle_shop.revenue_summary_revenue", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.revenue_summary_cost", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.revenue_summary_margin", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "discounts": { + "id": "model.jaffle_shop.revenue_summary_discounts", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.revenue_summary_net_revenue", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_stores_id", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_stores_name", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "seed.jaffle_shop.raw_stores_city", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "seed.jaffle_shop.raw_stores_state", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "opened_at": { + "id": "seed.jaffle_shop.raw_stores_opened_at", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "opened_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_store_revenue_order_count", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.int_store_revenue_unique_customers", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.int_store_revenue_total_revenue", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_store_revenue_total_cost", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_store_revenue_total_margin", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_store_revenue_avg_order_value", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_subtotal": { + "id": "model.jaffle_shop.int_order_payments_matched_order_subtotal", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_subtotal", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "total_paid": { + "id": "model.jaffle_shop.int_order_payments_matched_total_paid", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "payment_count": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_count", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "payment_method_count": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_method_count", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_method_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "payment_status": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_status", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_inventory_daily": { + "id": "model.jaffle_shop.metric_inventory_daily", + "name": "metric_inventory_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nsnapshot as (\n select\n current_date as snapshot_date,\n count(distinct product_id) as total_products_tracked,\n count(distinct store_id) as total_stores,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_count,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_count,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_count,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_count,\n round(avg(current_stock), 1) as avg_stock_per_product_store\n from inventory\n)\n\nselect * from snapshot", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "snapshot_date": { + "id": "model.jaffle_shop.metric_inventory_daily_snapshot_date", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "snapshot_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_products_tracked": { + "id": "model.jaffle_shop.metric_inventory_daily_total_products_tracked", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_products_tracked", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_stores": { + "id": "model.jaffle_shop.metric_inventory_daily_total_stores", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_stores", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_stock_units": { + "id": "model.jaffle_shop.metric_inventory_daily_total_stock_units", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "out_of_stock_count": { + "id": "model.jaffle_shop.metric_inventory_daily_out_of_stock_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "out_of_stock_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "low_stock_count": { + "id": "model.jaffle_shop.metric_inventory_daily_low_stock_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "low_stock_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "adequate_count": { + "id": "model.jaffle_shop.metric_inventory_daily_adequate_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "adequate_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "well_stocked_count": { + "id": "model.jaffle_shop.metric_inventory_daily_well_stocked_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "well_stocked_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_stock_per_product_store": { + "id": "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "avg_stock_per_product_store", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_customer_acquisition_monthly": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "metric_customer_acquisition_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with cohorts as (\n select * from {{ ref('customer_cohorts') }}\n),\n\nfinal as (\n select\n cohort_month,\n cohort_size as new_customers,\n avg_lifetime_orders,\n avg_tenure_days,\n sum(cohort_size) over (order by cohort_month) as cumulative_customers\n from cohorts\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "new_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "new_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "avg_lifetime_orders": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_lifetime_orders", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_tenure_days": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cumulative_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cumulative_customers", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.int_store_employees_active_store_name", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.int_store_employees_active_city", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.int_store_employees_active_state", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_employees": { + "id": "model.jaffle_shop.int_store_employees_active_total_employees", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "manager_count": { + "id": "model.jaffle_shop.int_store_employees_active_manager_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "manager_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "barista_count": { + "id": "model.jaffle_shop.int_store_employees_active_barista_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "barista_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cashier_count": { + "id": "model.jaffle_shop.int_store_employees_active_cashier_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "cashier_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cook_count": { + "id": "model.jaffle_shop.int_store_employees_active_cook_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "cook_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "earliest_hire": { + "id": "model.jaffle_shop.int_store_employees_active_earliest_hire", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "earliest_hire", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "latest_hire": { + "id": "model.jaffle_shop.int_store_employees_active_latest_hire", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "latest_hire", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_reviews": { + "id": "model.jaffle_shop.stg_reviews", + "name": "stg_reviews", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_reviews') }}\n),\n\nrenamed as (\n select\n id as review_id,\n order_id,\n product_id,\n customer_id,\n rating,\n cast(review_date as date) as review_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "review_id": { + "id": "model.jaffle_shop.stg_reviews_review_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "review_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.stg_reviews_order_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_reviews_product_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.stg_reviews_customer_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rating": { + "id": "model.jaffle_shop.stg_reviews_rating", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "rating", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_date": { + "id": "model.jaffle_shop.stg_reviews_review_date", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_360_customer_id", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.customer_360_first_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.customer_360_last_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_order": { + "id": "model.jaffle_shop.customer_360_first_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "most_recent_order": { + "id": "model.jaffle_shop.customer_360_most_recent_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "number_of_orders": { + "id": "model.jaffle_shop.customer_360_number_of_orders", + "table_id": "model.jaffle_shop.customer_360", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_lifetime_value": { + "id": "model.jaffle_shop.customer_360_customer_lifetime_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_lifetime_value", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "monthly_value": { + "id": "model.jaffle_shop.customer_360_monthly_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.customer_360_avg_order_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_tenure_days": { + "id": "model.jaffle_shop.customer_360_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.customer_360_days_since_last_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.customer_360_review_count", + "table_id": "model.jaffle_shop.customer_360", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_review_rating": { + "id": "model.jaffle_shop.customer_360_avg_review_rating", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_review_rating", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "months_active": { + "id": "model.jaffle_shop.customer_360_months_active", + "table_id": "model.jaffle_shop.customer_360", + "name": "months_active", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_products_with_categories_product_name", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.int_products_with_categories_category_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_products_with_categories_category_name", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_products_with_categories_root_category", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.int_products_with_categories_category_path", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_depth": { + "id": "model.jaffle_shop.int_products_with_categories_category_depth", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_depth", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.int_products_with_categories_price", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.int_products_with_categories_cost", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "created_at": { + "id": "model.jaffle_shop.int_products_with_categories_created_at", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "created_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_monthly_sales": { + "id": "model.jaffle_shop.metric_monthly_sales", + "name": "metric_monthly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nmonthly as (\n select\n {{ dbt.date_trunc('month', 'order_date') }} as month_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold,\n count(distinct order_date) as active_days\n from daily\n group by {{ dbt.date_trunc('month', 'order_date') }}\n)\n\nselect * from monthly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "month_start": { + "id": "model.jaffle_shop.metric_monthly_sales_month_start", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "month_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.metric_monthly_sales_total_orders", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.metric_monthly_sales_total_revenue", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.metric_monthly_sales_net_revenue", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.metric_monthly_sales_total_margin", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.metric_monthly_sales_total_discounts", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_daily_order_value": { + "id": "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.metric_monthly_sales_total_items_sold", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.metric_monthly_sales_active_days", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_category_hierarchy_category_name", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_parent_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_category_hierarchy_root_category", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "full_path": { + "id": "model.jaffle_shop.int_category_hierarchy_full_path", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "full_path", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "depth": { + "id": "model.jaffle_shop.int_category_hierarchy_depth", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "depth", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_employees": { + "id": "seed.jaffle_shop.raw_employees", + "name": "raw_employees", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_employees_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "seed.jaffle_shop.raw_employees_store_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "seed.jaffle_shop.raw_employees_first_name", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "seed.jaffle_shop.raw_employees_last_name", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "role": { + "id": "seed.jaffle_shop.raw_employees_role", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "role", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "hired_at": { + "id": "seed.jaffle_shop.raw_employees_hired_at", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "hired_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_items": { + "id": "model.jaffle_shop.order_items", + "name": "order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_order_items_enriched') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_item_id": { + "id": "model.jaffle_shop.order_items_order_item_id", + "table_id": "model.jaffle_shop.order_items", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.order_items_order_id", + "table_id": "model.jaffle_shop.order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.order_items_product_id", + "table_id": "model.jaffle_shop.order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.order_items_product_name", + "table_id": "model.jaffle_shop.order_items", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.order_items_category_name", + "table_id": "model.jaffle_shop.order_items", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.order_items_root_category", + "table_id": "model.jaffle_shop.order_items", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.order_items_category_path", + "table_id": "model.jaffle_shop.order_items", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.order_items_quantity", + "table_id": "model.jaffle_shop.order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "model.jaffle_shop.order_items_unit_price", + "table_id": "model.jaffle_shop.order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_total": { + "id": "model.jaffle_shop.order_items_line_total", + "table_id": "model.jaffle_shop.order_items", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.order_items_cost", + "table_id": "model.jaffle_shop.order_items", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.order_items_margin_pct", + "table_id": "model.jaffle_shop.order_items", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_cost": { + "id": "model.jaffle_shop.order_items_line_cost", + "table_id": "model.jaffle_shop.order_items", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_margin": { + "id": "model.jaffle_shop.order_items_line_margin", + "table_id": "model.jaffle_shop.order_items", + "name": "line_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.reorder_recommendations": { + "id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_recommendations", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('product_inventory') }}\n),\n\nperformance as (\n select * from {{ ref('product_performance') }}\n),\n\nrecommendations as (\n select\n s.product_id,\n s.product_name,\n s.store_id,\n s.store_name,\n s.current_stock,\n s.stock_status,\n s.last_restock_date,\n p.total_quantity_sold,\n p.times_ordered,\n case\n when s.stock_status = 'out_of_stock' then 'urgent'\n when s.stock_status = 'low_stock' then 'soon'\n when s.stock_status = 'adequate' and p.times_ordered > 5 then 'monitor'\n else 'ok'\n end as reorder_priority,\n greatest(50 - s.current_stock, 0) as suggested_reorder_qty\n from stock s\n left join performance p on s.product_id = p.product_id\n)\n\nselect * from recommendations", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.reorder_recommendations_product_id", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.reorder_recommendations_product_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.reorder_recommendations_store_id", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.reorder_recommendations_store_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "current_stock": { + "id": "model.jaffle_shop.reorder_recommendations_current_stock", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "stock_status": { + "id": "model.jaffle_shop.reorder_recommendations_stock_status", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_restock_date": { + "id": "model.jaffle_shop.reorder_recommendations_last_restock_date", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_quantity_sold": { + "id": "model.jaffle_shop.reorder_recommendations_total_quantity_sold", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "times_ordered": { + "id": "model.jaffle_shop.reorder_recommendations_times_ordered", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "times_ordered", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "reorder_priority": { + "id": "model.jaffle_shop.reorder_recommendations_reorder_priority", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_priority", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "suggested_reorder_qty": { + "id": "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "suggested_reorder_qty", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_categories_name", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.int_order_enriched_customer_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "item_count": { + "id": "model.jaffle_shop.int_order_enriched_item_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_quantity": { + "id": "model.jaffle_shop.int_order_enriched_total_quantity", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "subtotal": { + "id": "model.jaffle_shop.int_order_enriched_subtotal", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_order_enriched_total_cost", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_order_enriched_total_margin", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_count": { + "id": "model.jaffle_shop.int_order_enriched_category_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "category_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "has_promotion": { + "id": "model.jaffle_shop.int_order_enriched_has_promotion", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.int_order_enriched_promotion_name", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.int_order_enriched_discount_type", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "model.jaffle_shop.int_order_enriched_discount_value", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_paid": { + "id": "model.jaffle_shop.int_order_enriched_total_paid", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_count": { + "id": "model.jaffle_shop.int_order_enriched_payment_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_status": { + "id": "model.jaffle_shop.int_order_enriched_payment_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_amount": { + "id": "model.jaffle_shop.int_order_enriched_discount_amount", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_amount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.int_store_order_assignments_customer_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_store_order_assignments_order_date", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_product_dashboard": { + "id": "model.jaffle_shop.rpt_product_dashboard", + "name": "rpt_product_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('product_performance') }}\n),\n\nsummary as (\n select\n count(*) as total_products,\n sum(total_revenue) as total_product_revenue,\n avg(avg_rating) as overall_avg_rating,\n sum(total_quantity_sold) as total_units_sold,\n count(case when times_ordered = 0 then 1 end) as never_ordered_products,\n max(total_revenue) as top_product_revenue,\n (select product_name from performance order by total_revenue desc limit 1) as top_product_name\n from performance\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "total_products": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_products", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_products", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_product_revenue": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_product_revenue", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_product_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "overall_avg_rating": { + "id": "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "overall_avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_units_sold": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_units_sold", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_units_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "never_ordered_products": { + "id": "model.jaffle_shop.rpt_product_dashboard_never_ordered_products", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "never_ordered_products", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "top_product_revenue": { + "id": "model.jaffle_shop.rpt_product_dashboard_top_product_revenue", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "top_product_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "top_product_name": { + "id": "model.jaffle_shop.rpt_product_dashboard_top_product_name", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "top_product_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "total_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_total_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "total_customers", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "active_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "active_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_clv": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_clv", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_clv", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_orders_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_orders_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_reviews_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_reviews_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_acquisition": { + "id": "model.jaffle_shop.customer_acquisition", + "name": "customer_acquisition", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_order_details as (\n select\n fl.customer_id,\n fl.first_order_date,\n o.has_promotion as acquired_via_promotion,\n o.promotion_name as acquisition_promotion,\n o.subtotal as first_order_value,\n o.item_count as first_order_items,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as acquisition_month\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n and fl.first_order_date = o.order_date\n)\n\nselect * from first_order_details", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_acquisition_customer_id", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_order_date": { + "id": "model.jaffle_shop.customer_acquisition_first_order_date", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "acquired_via_promotion": { + "id": "model.jaffle_shop.customer_acquisition_acquired_via_promotion", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquired_via_promotion", + "type": "BOOLEAN", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "acquisition_promotion": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_promotion", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_promotion", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "first_order_value": { + "id": "model.jaffle_shop.customer_acquisition_first_order_value", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_value", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "first_order_items": { + "id": "model.jaffle_shop.customer_acquisition_first_order_items", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_items", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "acquisition_month": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_month", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_performance": { + "id": "model.jaffle_shop.product_performance", + "name": "product_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('products') }}\n),\n\nitems as (\n select\n product_id,\n count(*) as times_ordered,\n sum(quantity) as total_quantity_sold,\n sum(line_total) as total_revenue,\n sum(line_margin) as total_margin\n from {{ ref('order_items') }}\n group by product_id\n),\n\nratings as (\n select * from {{ ref('int_product_ratings') }}\n),\n\nperformance as (\n select\n p.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.price,\n p.cost,\n p.margin_pct,\n coalesce(i.times_ordered, 0) as times_ordered,\n coalesce(i.total_quantity_sold, 0) as total_quantity_sold,\n coalesce(i.total_revenue, 0) as total_revenue,\n coalesce(i.total_margin, 0) as total_margin,\n r.review_count,\n r.avg_rating,\n r.positive_reviews,\n r.negative_reviews\n from products p\n left join items i on p.product_id = i.product_id\n left join ratings r on p.product_id = r.product_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.product_performance_product_id", + "table_id": "model.jaffle_shop.product_performance", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.product_performance_product_name", + "table_id": "model.jaffle_shop.product_performance", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.product_performance_category_name", + "table_id": "model.jaffle_shop.product_performance", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.product_performance_root_category", + "table_id": "model.jaffle_shop.product_performance", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.product_performance_price", + "table_id": "model.jaffle_shop.product_performance", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.product_performance_cost", + "table_id": "model.jaffle_shop.product_performance", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.product_performance_margin_pct", + "table_id": "model.jaffle_shop.product_performance", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "times_ordered": { + "id": "model.jaffle_shop.product_performance_times_ordered", + "table_id": "model.jaffle_shop.product_performance", + "name": "times_ordered", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_quantity_sold": { + "id": "model.jaffle_shop.product_performance_total_quantity_sold", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.product_performance_total_revenue", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.product_performance_total_margin", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.product_performance_review_count", + "table_id": "model.jaffle_shop.product_performance", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.product_performance_avg_rating", + "table_id": "model.jaffle_shop.product_performance", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "positive_reviews": { + "id": "model.jaffle_shop.product_performance_positive_reviews", + "table_id": "model.jaffle_shop.product_performance", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "negative_reviews": { + "id": "model.jaffle_shop.product_performance_negative_reviews", + "table_id": "model.jaffle_shop.product_performance", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.supplier_lead_times": { + "id": "model.jaffle_shop.supplier_lead_times", + "name": "supplier_lead_times", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply as (\n select * from {{ ref('int_supply_order_costs') }}\n),\n\nlead_times as (\n select\n product_id,\n product_name,\n store_id,\n count(*) as order_count,\n avg(lead_time_days) as avg_lead_time,\n min(lead_time_days) as min_lead_time,\n max(lead_time_days) as max_lead_time,\n sum(quantity) as total_quantity,\n sum(total_cost) as total_spend\n from supply\n group by product_id, product_name, store_id\n)\n\nselect * from lead_times", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.supplier_lead_times_product_id", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.supplier_lead_times_product_name", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.supplier_lead_times_store_id", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.supplier_lead_times_order_count", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_avg_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "avg_lead_time", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "min_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_min_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "min_lead_time", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "max_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_max_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "max_lead_time", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_quantity": { + "id": "model.jaffle_shop.supplier_lead_times_total_quantity", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_spend": { + "id": "model.jaffle_shop.supplier_lead_times_total_spend", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "total_spend", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_promotion_effectiveness": { + "id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "int_promotion_effectiveness", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders_with_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\neffectiveness as (\n select\n owp.has_promotion,\n owp.promotion_name,\n owp.discount_type,\n count(*) as order_count,\n avg(ot.subtotal) as avg_order_value,\n sum(ot.subtotal) as total_revenue,\n avg(ot.item_count) as avg_items_per_order,\n avg(ot.total_margin) as avg_margin\n from orders_with_promos owp\n left join order_totals ot on owp.order_id = ot.order_id\n group by owp.has_promotion, owp.promotion_name, owp.discount_type\n)\n\nselect * from effectiveness", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "has_promotion": { + "id": "model.jaffle_shop.int_promotion_effectiveness_has_promotion", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.int_promotion_effectiveness_promotion_name", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.int_promotion_effectiveness_discount_type", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_promotion_effectiveness_order_count", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_order_value", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.int_promotion_effectiveness_total_revenue", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_items_per_order": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_margin": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_margin", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.payments_fact": { + "id": "model.jaffle_shop.payments_fact", + "name": "payments_fact", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('orders') }}\n),\n\nfinal as (\n select\n p.payment_id,\n p.order_id,\n o.customer_id,\n o.order_date,\n p.payment_method,\n p.amount,\n o.status as order_status\n from payments p\n left join orders o on p.order_id = o.order_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "payment_id": { + "id": "model.jaffle_shop.payments_fact_payment_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "payment_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.payments_fact_order_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.payments_fact_customer_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.payments_fact_order_date", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_method": { + "id": "model.jaffle_shop.payments_fact_payment_method", + "table_id": "model.jaffle_shop.payments_fact", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.payments_fact_amount", + "table_id": "model.jaffle_shop.payments_fact", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_status": { + "id": "model.jaffle_shop.payments_fact_order_status", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_status", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_order_items_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "seed.jaffle_shop.raw_order_items_quantity", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "seed.jaffle_shop.raw_order_items_unit_price", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "unit_price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_review_summary": { + "id": "model.jaffle_shop.customer_review_summary", + "name": "customer_review_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with reviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nratings as (\n select * from {{ ref('int_product_ratings') }}\n),\n\nsummary as (\n select\n r.customer_id,\n r.review_count,\n r.avg_rating as customer_avg_rating,\n r.products_reviewed,\n r.first_review_date,\n r.last_review_date,\n avg(pr.avg_rating) as avg_product_rating_of_reviewed,\n case when r.avg_rating > avg(pr.avg_rating) then 'above_average'\n when r.avg_rating < avg(pr.avg_rating) then 'below_average'\n else 'average'\n end as rating_tendency\n from reviews r\n left join {{ ref('stg_reviews') }} sr on r.customer_id = sr.customer_id\n left join ratings pr on sr.product_id = pr.product_id\n group by r.customer_id, r.review_count, r.avg_rating, r.products_reviewed,\n r.first_review_date, r.last_review_date\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_review_summary_customer_id", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.customer_review_summary_review_count", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_avg_rating": { + "id": "model.jaffle_shop.customer_review_summary_customer_avg_rating", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "customer_avg_rating", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "products_reviewed": { + "id": "model.jaffle_shop.customer_review_summary_products_reviewed", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "products_reviewed", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_review_date": { + "id": "model.jaffle_shop.customer_review_summary_first_review_date", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "first_review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_review_date": { + "id": "model.jaffle_shop.customer_review_summary_last_review_date", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "last_review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_product_rating_of_reviewed": { + "id": "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "avg_product_rating_of_reviewed", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "rating_tendency": { + "id": "model.jaffle_shop.customer_review_summary_rating_tendency", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "rating_tendency", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.metric_store_daily_store_id", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.metric_store_daily_store_name", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.metric_store_daily_city", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.metric_store_daily_order_count", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue": { + "id": "model.jaffle_shop.metric_store_daily_revenue", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.metric_store_daily_cost", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.metric_store_daily_margin", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discounts": { + "id": "model.jaffle_shop.metric_store_daily_discounts", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.metric_store_daily_net_revenue", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_rankings_store_id", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.store_rankings_store_name", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.store_rankings_city", + "table_id": "model.jaffle_shop.store_rankings", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.store_rankings_state", + "table_id": "model.jaffle_shop.store_rankings", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.store_rankings_total_revenue", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.store_rankings_total_margin", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.store_rankings_order_count", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.store_rankings_unique_customers", + "table_id": "model.jaffle_shop.store_rankings", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_per_employee": { + "id": "model.jaffle_shop.store_rankings_revenue_per_employee", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_rank": { + "id": "model.jaffle_shop.store_rankings_revenue_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "margin_rank": { + "id": "model.jaffle_shop.store_rankings_margin_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "margin_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_count_rank": { + "id": "model.jaffle_shop.store_rankings_order_count_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "efficiency_rank": { + "id": "model.jaffle_shop.store_rankings_efficiency_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_reach_rank": { + "id": "model.jaffle_shop.store_rankings_customer_reach_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "customer_reach_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.supply_orders_fact": { + "id": "model.jaffle_shop.supply_orders_fact", + "name": "supply_orders_fact", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_supply_order_costs') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "supply_order_id": { + "id": "model.jaffle_shop.supply_orders_fact_supply_order_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.supply_orders_fact_product_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.supply_orders_fact_product_name", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.supply_orders_fact_store_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.supply_orders_fact_quantity", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_cost": { + "id": "model.jaffle_shop.supply_orders_fact_unit_cost", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "unit_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.supply_orders_fact_total_cost", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.supply_orders_fact_order_date", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "delivered_date": { + "id": "model.jaffle_shop.supply_orders_fact_delivered_date", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "lead_time_days": { + "id": "model.jaffle_shop.supply_orders_fact_lead_time_days", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "lead_time_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_first_last_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "int_customer_first_last_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_last as (\n select\n customer_id,\n min(order_date) as first_order_date,\n max(order_date) as last_order_date,\n {{ dbt.datediff('min(order_date)', 'max(order_date)', 'day') }} as customer_tenure_days,\n count(*) as lifetime_orders,\n {{ dbt.datediff('max(order_date)', '(select max(order_date) from orders)', 'day') }} as days_since_last_order\n from orders\n group by customer_id\n)\n\nselect * from first_last", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "last_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_tenure_days": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "lifetime_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "lifetime_orders", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_supply_orders": { + "id": "seed.jaffle_shop.raw_supply_orders", + "name": "raw_supply_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_supply_orders_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_supply_orders_product_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "seed.jaffle_shop.raw_supply_orders_store_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "seed.jaffle_shop.raw_supply_orders_quantity", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "seed.jaffle_shop.raw_supply_orders_order_date", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "delivered_date": { + "id": "seed.jaffle_shop.raw_supply_orders_delivered_date", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_retention": { + "id": "model.jaffle_shop.customer_retention", + "name": "customer_retention", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ncohort_orders as (\n select\n fl.customer_id,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as cohort_month,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n {{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }} as months_since_first\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n),\n\nretention as (\n select\n cohort_month,\n months_since_first,\n count(distinct customer_id) as customers\n from cohort_orders\n group by cohort_month, months_since_first\n)\n\nselect * from retention", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.customer_retention_cohort_month", + "table_id": "model.jaffle_shop.customer_retention", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "months_since_first": { + "id": "model.jaffle_shop.customer_retention_months_since_first", + "table_id": "model.jaffle_shop.customer_retention", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customers": { + "id": "model.jaffle_shop.customer_retention_customers", + "table_id": "model.jaffle_shop.customer_retention", + "name": "customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_performance_store_id", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.store_performance_store_name", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.store_performance_city", + "table_id": "model.jaffle_shop.store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.store_performance_state", + "table_id": "model.jaffle_shop.store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_employees": { + "id": "model.jaffle_shop.store_performance_total_employees", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.store_performance_order_count", + "table_id": "model.jaffle_shop.store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.store_performance_unique_customers", + "table_id": "model.jaffle_shop.store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.store_performance_total_revenue", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.store_performance_total_margin", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.store_performance_avg_order_value", + "table_id": "model.jaffle_shop.store_performance", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_per_employee": { + "id": "model.jaffle_shop.store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "orders_per_employee": { + "id": "model.jaffle_shop.store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customers": { + "id": "model.jaffle_shop.customers", + "name": "customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\ncustomer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n),\n\ncustomer_payments as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders on\n payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders\n on customers.customer_id = customer_orders.customer_id\n\n left join customer_payments\n on customers.customer_id = customer_payments.customer_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customers_customer_id", + "table_id": "model.jaffle_shop.customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.customers_first_name", + "table_id": "model.jaffle_shop.customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.customers_last_name", + "table_id": "model.jaffle_shop.customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_order": { + "id": "model.jaffle_shop.customers_first_order", + "table_id": "model.jaffle_shop.customers", + "name": "first_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "most_recent_order": { + "id": "model.jaffle_shop.customers_most_recent_order", + "table_id": "model.jaffle_shop.customers", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "number_of_orders": { + "id": "model.jaffle_shop.customers_number_of_orders", + "table_id": "model.jaffle_shop.customers", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_lifetime_value": { + "id": "model.jaffle_shop.customers_customer_lifetime_value", + "table_id": "model.jaffle_shop.customers", + "name": "customer_lifetime_value", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_payments_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "payment_method": { + "id": "seed.jaffle_shop.raw_payments_payment_method", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.promotion_roi": { + "id": "model.jaffle_shop.promotion_roi", + "name": "promotion_roi", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with effectiveness as (\n select * from {{ ref('int_promotion_effectiveness') }}\n),\n\ndiscounts as (\n select\n promotion_name,\n count(*) as usage_count,\n sum(discount_amount) as total_discount_given,\n sum(net_revenue) as total_net_revenue\n from {{ ref('order_discounts') }}\n group by promotion_name\n),\n\nroi as (\n select\n e.promotion_name,\n e.discount_type,\n e.order_count,\n e.avg_order_value,\n e.total_revenue,\n e.avg_margin,\n coalesce(d.total_discount_given, 0) as total_discount_given,\n coalesce(d.total_net_revenue, 0) as net_revenue_after_discount,\n case when coalesce(d.total_discount_given, 0) > 0\n then round(coalesce(d.total_net_revenue, 0) / d.total_discount_given, 2)\n else 0\n end as revenue_per_discount_dollar\n from effectiveness e\n left join discounts d on e.promotion_name = d.promotion_name\n where e.has_promotion = true\n)\n\nselect * from roi", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_name": { + "id": "model.jaffle_shop.promotion_roi_promotion_name", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.promotion_roi_discount_type", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.promotion_roi_order_count", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.promotion_roi_avg_order_value", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.promotion_roi_total_revenue", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_margin": { + "id": "model.jaffle_shop.promotion_roi_avg_margin", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "avg_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_discount_given": { + "id": "model.jaffle_shop.promotion_roi_total_discount_given", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "total_discount_given", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue_after_discount": { + "id": "model.jaffle_shop.promotion_roi_net_revenue_after_discount", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "net_revenue_after_discount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "revenue_per_discount_dollar": { + "id": "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "revenue_per_discount_dollar", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_month": { + "id": "model.jaffle_shop.gross_margin_order_month", + "table_id": "model.jaffle_shop.gross_margin", + "name": "order_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.gross_margin_store_id", + "table_id": "model.jaffle_shop.gross_margin", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.gross_margin_total_revenue", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.gross_margin_total_cost", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.gross_margin_total_margin", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.gross_margin_total_discounts", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_net_revenue": { + "id": "model.jaffle_shop.gross_margin_total_net_revenue", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "gross_margin_pct": { + "id": "model.jaffle_shop.gross_margin_gross_margin_pct", + "table_id": "model.jaffle_shop.gross_margin", + "name": "gross_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.gross_margin_total_orders", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_fulfillment_order_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.order_fulfillment_customer_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.order_fulfillment_order_date", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.order_fulfillment_status", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.order_fulfillment_amount", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.order_fulfillment_store_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.order_fulfillment_store_name", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.order_fulfillment_city", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.order_fulfillment_state", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_employee_count": { + "id": "model.jaffle_shop.order_fulfillment_store_employee_count", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_employee_count", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_inventory_movements": { + "id": "model.jaffle_shop.int_inventory_movements", + "name": "int_inventory_movements", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_in as (\n select\n product_id,\n store_id,\n delivered_date as movement_date,\n quantity as quantity_in,\n 0 as quantity_out,\n 'supply' as movement_type\n from {{ ref('stg_supply_orders') }}\n),\n\norder_items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nstore_assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsales_out as (\n select\n oi.product_id,\n sa.store_id,\n sa.order_date as movement_date,\n 0 as quantity_in,\n oi.quantity as quantity_out,\n 'sale' as movement_type\n from order_items oi\n inner join store_assignments sa on oi.order_id = sa.order_id\n),\n\ncombined as (\n select * from supply_in\n union all\n select * from sales_out\n)\n\nselect * from combined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_inventory_movements_product_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_inventory_movements_store_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "movement_date": { + "id": "model.jaffle_shop.int_inventory_movements_movement_date", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "quantity_in": { + "id": "model.jaffle_shop.int_inventory_movements_quantity_in", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "quantity_in", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "quantity_out": { + "id": "model.jaffle_shop.int_inventory_movements_quantity_out", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "quantity_out", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "movement_type": { + "id": "model.jaffle_shop.int_inventory_movements_movement_type", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_type", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.stg_stores_store_id", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.stg_stores_store_name", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.stg_stores_city", + "table_id": "model.jaffle_shop.stg_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.stg_stores_state", + "table_id": "model.jaffle_shop.stg_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "opened_at": { + "id": "model.jaffle_shop.stg_stores_opened_at", + "table_id": "model.jaffle_shop.stg_stores", + "name": "opened_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_promotions_name", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "seed.jaffle_shop.raw_promotions_discount_type", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "seed.jaffle_shop.raw_promotions_discount_value", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "discount_value", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "start_date": { + "id": "seed.jaffle_shop.raw_promotions_start_date", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "start_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "end_date": { + "id": "seed.jaffle_shop.raw_promotions_end_date", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "end_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "item_count": { + "id": "model.jaffle_shop.int_order_totals_item_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_quantity": { + "id": "model.jaffle_shop.int_order_totals_total_quantity", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "subtotal": { + "id": "model.jaffle_shop.int_order_totals_subtotal", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_order_totals_total_cost", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_order_totals_total_margin", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "category_count": { + "id": "model.jaffle_shop.int_order_totals_category_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "category_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_product_sales_daily": { + "id": "model.jaffle_shop.metric_product_sales_daily", + "name": "metric_product_sales_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('order_items') }}\n),\n\norders as (\n select order_id, order_date from {{ ref('int_order_enriched') }}\n),\n\ndaily_product as (\n select\n o.order_date,\n i.product_id,\n i.product_name,\n i.category_name,\n sum(i.quantity) as units_sold,\n sum(i.line_total) as revenue,\n sum(i.line_margin) as margin,\n count(distinct o.order_id) as order_count\n from items i\n inner join orders o on i.order_id = o.order_id\n group by o.order_date, i.product_id, i.product_name, i.category_name\n)\n\nselect * from daily_product", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_date", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.metric_product_sales_daily_product_id", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.metric_product_sales_daily_product_name", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.metric_product_sales_daily_category_name", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "units_sold": { + "id": "model.jaffle_shop.metric_product_sales_daily_units_sold", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "units_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "revenue": { + "id": "model.jaffle_shop.metric_product_sales_daily_revenue", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.metric_product_sales_daily_margin", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_count", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_product_stock_levels": { + "id": "model.jaffle_shop.int_product_stock_levels", + "name": "int_product_stock_levels", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='product_store_key'\n )\n}}\n\nwith movements as (\n select * from {{ ref('int_inventory_movements') }}\n),\n\nstock as (\n select\n product_id || '-' || store_id as product_store_key,\n product_id,\n store_id,\n sum(quantity_in) as total_received,\n sum(quantity_out) as total_sold,\n sum(quantity_in) - sum(quantity_out) as current_stock,\n max(case when movement_type = 'supply' then movement_date end) as last_restock_date,\n max(case when movement_type = 'sale' then movement_date end) as last_sale_date\n from movements\n\n {% if is_incremental() %}\n where movement_date > (select max(coalesce(last_restock_date, last_sale_date)) from {{ this }})\n {% endif %}\n\n group by product_id, store_id\n)\n\nselect * from stock", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_store_key": { + "id": "model.jaffle_shop.int_product_stock_levels_product_store_key", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_product_stock_levels_product_id", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_product_stock_levels_store_id", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_received": { + "id": "model.jaffle_shop.int_product_stock_levels_total_received", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "total_received", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_sold": { + "id": "model.jaffle_shop.int_product_stock_levels_total_sold", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "total_sold", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "current_stock": { + "id": "model.jaffle_shop.int_product_stock_levels_current_stock", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "last_restock_date": { + "id": "model.jaffle_shop.int_product_stock_levels_last_restock_date", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "last_sale_date": { + "id": "model.jaffle_shop.int_product_stock_levels_last_sale_date", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "last_sale_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "month_start": { + "id": "model.jaffle_shop.rpt_executive_dashboard_month_start", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "month_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_orders", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.rpt_executive_dashboard_net_revenue", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "overall_margin_pct": { + "id": "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "overall_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_items_sold", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.rpt_executive_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_returns_order_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.order_returns_customer_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.order_returns_order_date", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "credit_card_amount": { + "id": "model.jaffle_shop.order_returns_credit_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "coupon_amount": { + "id": "model.jaffle_shop.order_returns_coupon_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "coupon_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "bank_transfer_amount": { + "id": "model.jaffle_shop.order_returns_bank_transfer_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "bank_transfer_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "gift_card_amount": { + "id": "model.jaffle_shop.order_returns_gift_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.order_returns_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_profitability": { + "id": "model.jaffle_shop.product_profitability", + "name": "product_profitability", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('product_performance') }}\n),\n\nsupply_costs as (\n select\n product_id,\n sum(total_cost) as total_supply_cost,\n sum(quantity) as total_supplied\n from {{ ref('int_supply_order_costs') }}\n group by product_id\n),\n\nprofitability as (\n select\n p.product_id,\n p.product_name,\n p.category_name,\n p.total_revenue,\n p.total_margin as gross_margin,\n coalesce(sc.total_supply_cost, 0) as total_supply_cost,\n p.total_revenue - coalesce(sc.total_supply_cost, 0) as net_margin,\n case when p.total_revenue > 0\n then round(p.total_margin / p.total_revenue * 100, 1)\n else 0\n end as gross_margin_pct,\n p.total_quantity_sold,\n coalesce(sc.total_supplied, 0) as total_supplied,\n p.avg_rating\n from performance p\n left join supply_costs sc on p.product_id = sc.product_id\n)\n\nselect * from profitability", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.product_profitability_product_id", + "table_id": "model.jaffle_shop.product_profitability", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.product_profitability_product_name", + "table_id": "model.jaffle_shop.product_profitability", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.product_profitability_category_name", + "table_id": "model.jaffle_shop.product_profitability", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.product_profitability_total_revenue", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "gross_margin": { + "id": "model.jaffle_shop.product_profitability_gross_margin", + "table_id": "model.jaffle_shop.product_profitability", + "name": "gross_margin", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "total_supply_cost": { + "id": "model.jaffle_shop.product_profitability_total_supply_cost", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_supply_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_margin": { + "id": "model.jaffle_shop.product_profitability_net_margin", + "table_id": "model.jaffle_shop.product_profitability", + "name": "net_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "gross_margin_pct": { + "id": "model.jaffle_shop.product_profitability_gross_margin_pct", + "table_id": "model.jaffle_shop.product_profitability", + "name": "gross_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_quantity_sold": { + "id": "model.jaffle_shop.product_profitability_total_quantity_sold", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_supplied": { + "id": "model.jaffle_shop.product_profitability_total_supplied", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_supplied", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.product_profitability_avg_rating", + "table_id": "model.jaffle_shop.product_profitability", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_sales_dashboard": { + "id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "rpt_sales_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with weekly as (\n select * from {{ ref('metric_weekly_sales') }}\n),\n\nfinal as (\n select\n w.week_start,\n w.total_orders,\n w.total_revenue,\n w.net_revenue,\n w.total_margin,\n w.total_discounts,\n w.total_items_sold,\n w.avg_daily_order_value,\n lag(w.total_revenue) over (order by w.week_start) as prev_week_revenue,\n case when lag(w.total_revenue) over (order by w.week_start) > 0\n then round((w.total_revenue - lag(w.total_revenue) over (order by w.week_start))\n / lag(w.total_revenue) over (order by w.week_start) * 100, 1)\n else null\n end as revenue_wow_growth_pct\n from weekly w\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "week_start": { + "id": "model.jaffle_shop.rpt_sales_dashboard_week_start", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "week_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_orders", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_net_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_discounts", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_items_sold", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_daily_order_value": { + "id": "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "prev_week_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "prev_week_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "revenue_wow_growth_pct": { + "id": "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "revenue_wow_growth_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.cost_analysis": { + "id": "model.jaffle_shop.cost_analysis", + "name": "cost_analysis", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_costs as (\n select\n product_id,\n product_name,\n count(*) as supply_order_count,\n sum(quantity) as total_units_ordered,\n sum(total_cost) as total_supply_spend,\n avg(unit_cost) as avg_unit_cost,\n avg(lead_time_days) as avg_lead_time\n from {{ ref('int_supply_order_costs') }}\n group by product_id, product_name\n),\n\nproduct_prof as (\n select * from {{ ref('product_profitability') }}\n),\n\nanalysis as (\n select\n pp.product_id,\n pp.product_name,\n pp.category_name,\n pp.total_revenue,\n pp.gross_margin,\n sc.total_supply_spend,\n sc.avg_unit_cost,\n sc.avg_lead_time,\n sc.supply_order_count,\n pp.total_quantity_sold,\n case when pp.total_quantity_sold > 0\n then round(sc.total_supply_spend / pp.total_quantity_sold, 2)\n else 0\n end as supply_cost_per_unit_sold\n from product_prof pp\n left join supply_costs sc on pp.product_id = sc.product_id\n)\n\nselect * from analysis", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.cost_analysis_product_id", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.cost_analysis_product_name", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.cost_analysis_category_name", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.cost_analysis_total_revenue", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "gross_margin": { + "id": "model.jaffle_shop.cost_analysis_gross_margin", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "gross_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_supply_spend": { + "id": "model.jaffle_shop.cost_analysis_total_supply_spend", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_supply_spend", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_unit_cost": { + "id": "model.jaffle_shop.cost_analysis_avg_unit_cost", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "avg_unit_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_lead_time": { + "id": "model.jaffle_shop.cost_analysis_avg_lead_time", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "avg_lead_time", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "supply_order_count": { + "id": "model.jaffle_shop.cost_analysis_supply_order_count", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "supply_order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_quantity_sold": { + "id": "model.jaffle_shop.cost_analysis_total_quantity_sold", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "supply_cost_per_unit_sold": { + "id": "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "supply_cost_per_unit_sold", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_customer_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_promotion_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.int_orders_with_promotions_promotion_name", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.int_orders_with_promotions_discount_type", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "model.jaffle_shop.int_orders_with_promotions_discount_value", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "has_promotion": { + "id": "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_supply_orders": { + "id": "model.jaffle_shop.stg_supply_orders", + "name": "stg_supply_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_supply_orders') }}\n),\n\nrenamed as (\n select\n id as supply_order_id,\n product_id,\n store_id,\n quantity,\n cast(order_date as date) as order_date,\n cast(delivered_date as date) as delivered_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "supply_order_id": { + "id": "model.jaffle_shop.stg_supply_orders_supply_order_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_supply_orders_product_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.stg_supply_orders_store_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.stg_supply_orders_quantity", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.stg_supply_orders_order_date", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "delivered_date": { + "id": "model.jaffle_shop.stg_supply_orders_delivered_date", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_categories": { + "id": "model.jaffle_shop.product_categories", + "name": "product_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with hierarchy as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\nproduct_counts as (\n select\n category_id,\n count(*) as product_count\n from {{ ref('stg_products') }}\n group by category_id\n),\n\nfinal as (\n select\n h.category_id,\n h.category_name,\n h.parent_category_id,\n h.root_category,\n h.full_path,\n h.depth,\n coalesce(pc.product_count, 0) as product_count\n from hierarchy h\n left join product_counts pc on h.category_id = pc.category_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.product_categories_category_id", + "table_id": "model.jaffle_shop.product_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.product_categories_category_name", + "table_id": "model.jaffle_shop.product_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.product_categories_parent_category_id", + "table_id": "model.jaffle_shop.product_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.product_categories_root_category", + "table_id": "model.jaffle_shop.product_categories", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "full_path": { + "id": "model.jaffle_shop.product_categories_full_path", + "table_id": "model.jaffle_shop.product_categories", + "name": "full_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "depth": { + "id": "model.jaffle_shop.product_categories_depth", + "table_id": "model.jaffle_shop.product_categories", + "name": "depth", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_count": { + "id": "model.jaffle_shop.product_categories_product_count", + "table_id": "model.jaffle_shop.product_categories", + "name": "product_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.store_staffing": { + "id": "model.jaffle_shop.store_staffing", + "name": "store_staffing", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstaffing as (\n select\n e.employee_id,\n e.first_name,\n e.last_name,\n e.role,\n e.hired_at,\n e.store_id,\n s.store_name,\n s.city,\n s.state\n from employees e\n left join stores s on e.store_id = s.store_id\n)\n\nselect * from staffing", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "employee_id": { + "id": "model.jaffle_shop.store_staffing_employee_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.store_staffing_first_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.store_staffing_last_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "role": { + "id": "model.jaffle_shop.store_staffing_role", + "table_id": "model.jaffle_shop.store_staffing", + "name": "role", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "hired_at": { + "id": "model.jaffle_shop.store_staffing_hired_at", + "table_id": "model.jaffle_shop.store_staffing", + "name": "hired_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.store_staffing_store_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.store_staffing_store_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.store_staffing_city", + "table_id": "model.jaffle_shop.store_staffing", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.store_staffing_state", + "table_id": "model.jaffle_shop.store_staffing", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_payment_status": { + "id": "model.jaffle_shop.order_payment_status", + "name": "order_payment_status", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with matched as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nfinal as (\n select\n order_id,\n order_subtotal,\n total_paid,\n payment_count,\n payment_method_count,\n payment_status,\n coalesce(total_paid, 0) - coalesce(order_subtotal, 0) as payment_difference\n from matched\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_payment_status_order_id", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_subtotal": { + "id": "model.jaffle_shop.order_payment_status_order_subtotal", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "order_subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_paid": { + "id": "model.jaffle_shop.order_payment_status_total_paid", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_count": { + "id": "model.jaffle_shop.order_payment_status_payment_count", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_method_count": { + "id": "model.jaffle_shop.order_payment_status_payment_method_count", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_method_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_status": { + "id": "model.jaffle_shop.order_payment_status_payment_status", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_difference": { + "id": "model.jaffle_shop.order_payment_status_payment_difference", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_difference", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_weekly_sales": { + "id": "model.jaffle_shop.metric_weekly_sales", + "name": "metric_weekly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nweekly as (\n select\n {{ dbt.date_trunc('week', 'order_date') }} as week_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n sum(unique_customers) as total_customer_visits,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold\n from daily\n group by {{ dbt.date_trunc('week', 'order_date') }}\n)\n\nselect * from weekly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "week_start": { + "id": "model.jaffle_shop.metric_weekly_sales_week_start", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "week_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.metric_weekly_sales_total_orders", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.metric_weekly_sales_total_revenue", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.metric_weekly_sales_net_revenue", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.metric_weekly_sales_total_margin", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.metric_weekly_sales_total_discounts", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_customer_visits": { + "id": "model.jaffle_shop.metric_weekly_sales_total_customer_visits", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_customer_visits", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_daily_order_value": { + "id": "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.metric_weekly_sales_total_items_sold", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_cohorts": { + "id": "model.jaffle_shop.customer_cohorts", + "name": "customer_cohorts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\ncohorts as (\n select\n {{ dbt.date_trunc('month', 'first_order_date') }} as cohort_month,\n count(*) as cohort_size,\n avg(lifetime_orders) as avg_lifetime_orders,\n avg(customer_tenure_days) as avg_tenure_days\n from first_last\n group by {{ dbt.date_trunc('month', 'first_order_date') }}\n)\n\nselect * from cohorts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.customer_cohorts_cohort_month", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cohort_size": { + "id": "model.jaffle_shop.customer_cohorts_cohort_size", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_lifetime_orders": { + "id": "model.jaffle_shop.customer_cohorts_avg_lifetime_orders", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_lifetime_orders", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_tenure_days": { + "id": "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_item_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_item_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_enriched_product_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_order_items_enriched_product_name", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_order_items_enriched_category_name", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_order_items_enriched_root_category", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.int_order_items_enriched_category_path", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.int_order_items_enriched_quantity", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "model.jaffle_shop.int_order_items_enriched_unit_price", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_total": { + "id": "model.jaffle_shop.int_order_items_enriched_line_total", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.int_order_items_enriched_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.int_order_items_enriched_margin_pct", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_cost": { + "id": "model.jaffle_shop.int_order_items_enriched_line_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "line_margin": { + "id": "model.jaffle_shop.int_order_items_enriched_line_margin", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.stores_store_id", + "table_id": "model.jaffle_shop.stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.stores_store_name", + "table_id": "model.jaffle_shop.stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.stores_city", + "table_id": "model.jaffle_shop.stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.stores_state", + "table_id": "model.jaffle_shop.stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_employees": { + "id": "model.jaffle_shop.stores_total_employees", + "table_id": "model.jaffle_shop.stores", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "manager_count": { + "id": "model.jaffle_shop.stores_manager_count", + "table_id": "model.jaffle_shop.stores", + "name": "manager_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "barista_count": { + "id": "model.jaffle_shop.stores_barista_count", + "table_id": "model.jaffle_shop.stores", + "name": "barista_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cashier_count": { + "id": "model.jaffle_shop.stores_cashier_count", + "table_id": "model.jaffle_shop.stores", + "name": "cashier_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cook_count": { + "id": "model.jaffle_shop.stores_cook_count", + "table_id": "model.jaffle_shop.stores", + "name": "cook_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "earliest_hire": { + "id": "model.jaffle_shop.stores_earliest_hire", + "table_id": "model.jaffle_shop.stores", + "name": "earliest_hire", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "latest_hire": { + "id": "model.jaffle_shop.stores_latest_hire", + "table_id": "model.jaffle_shop.stores", + "name": "latest_hire", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.new_orders": { + "id": "model.jaffle_shop.new_orders", + "name": "new_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select *\n from orders\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.new_orders_order_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.new_orders_customer_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.new_orders_order_date", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.new_orders_status", + "table_id": "model.jaffle_shop.new_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_customers": { + "id": "model.jaffle_shop.stg_customers", + "name": "stg_customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_customers') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.stg_customers_customer_id", + "table_id": "model.jaffle_shop.stg_customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.stg_customers_first_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.stg_customers_last_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.orders": { + "id": "model.jaffle_shop.orders", + "name": "orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norder_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(case when payment_method = '{{ payment_method }}' then amount else 0 end) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n),\n\nfinal as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n\n left join order_payments\n on orders.order_id = order_payments.order_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.orders_order_id", + "table_id": "model.jaffle_shop.orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.orders_customer_id", + "table_id": "model.jaffle_shop.orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.orders_order_date", + "table_id": "model.jaffle_shop.orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "credit_card_amount": { + "id": "model.jaffle_shop.orders_credit_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "coupon_amount": { + "id": "model.jaffle_shop.orders_coupon_amount", + "table_id": "model.jaffle_shop.orders", + "name": "coupon_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "bank_transfer_amount": { + "id": "model.jaffle_shop.orders_bank_transfer_amount", + "table_id": "model.jaffle_shop.orders", + "name": "bank_transfer_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "gift_card_amount": { + "id": "model.jaffle_shop.orders_gift_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.orders_amount", + "table_id": "model.jaffle_shop.orders", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.products": { + "id": "model.jaffle_shop.products", + "name": "products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nfinal as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n p.category_name,\n p.root_category,\n p.category_path,\n p.price,\n p.cost,\n m.margin,\n m.margin_pct,\n p.created_at\n from products p\n left join margins m on p.product_id = m.product_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.products_product_id", + "table_id": "model.jaffle_shop.products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.products_product_name", + "table_id": "model.jaffle_shop.products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.products_category_id", + "table_id": "model.jaffle_shop.products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.products_category_name", + "table_id": "model.jaffle_shop.products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.products_root_category", + "table_id": "model.jaffle_shop.products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.products_category_path", + "table_id": "model.jaffle_shop.products", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.products_price", + "table_id": "model.jaffle_shop.products", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.products_cost", + "table_id": "model.jaffle_shop.products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.products_margin", + "table_id": "model.jaffle_shop.products", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.products_margin_pct", + "table_id": "model.jaffle_shop.products", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "created_at": { + "id": "model.jaffle_shop.products_created_at", + "table_id": "model.jaffle_shop.products", + "name": "created_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.stg_promotions_promotion_name", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.stg_promotions_discount_type", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "model.jaffle_shop.stg_promotions_discount_value", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "start_date": { + "id": "model.jaffle_shop.stg_promotions_start_date", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "start_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "end_date": { + "id": "model.jaffle_shop.stg_promotions_end_date", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "end_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_inventory": { + "id": "model.jaffle_shop.product_inventory", + "name": "product_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('int_product_stock_levels') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nproducts as (\n select * from {{ ref('stg_products') }}\n),\n\nfinal as (\n select\n s.product_store_key,\n s.product_id,\n p.product_name,\n s.store_id,\n st.store_name,\n s.total_received,\n s.total_sold,\n s.current_stock,\n s.last_restock_date,\n s.last_sale_date,\n case\n when s.current_stock <= 0 then 'out_of_stock'\n when s.current_stock < 10 then 'low_stock'\n when s.current_stock < 50 then 'adequate'\n else 'well_stocked'\n end as stock_status\n from stock s\n left join products p on s.product_id = p.product_id\n left join stores st on s.store_id = st.store_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_store_key": { + "id": "model.jaffle_shop.product_inventory_product_store_key", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.product_inventory_product_id", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.product_inventory_product_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.product_inventory_store_id", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.product_inventory_store_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_received": { + "id": "model.jaffle_shop.product_inventory_total_received", + "table_id": "model.jaffle_shop.product_inventory", + "name": "total_received", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_sold": { + "id": "model.jaffle_shop.product_inventory_total_sold", + "table_id": "model.jaffle_shop.product_inventory", + "name": "total_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "current_stock": { + "id": "model.jaffle_shop.product_inventory_current_stock", + "table_id": "model.jaffle_shop.product_inventory", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_restock_date": { + "id": "model.jaffle_shop.product_inventory_last_restock_date", + "table_id": "model.jaffle_shop.product_inventory", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_sale_date": { + "id": "model.jaffle_shop.product_inventory_last_sale_date", + "table_id": "model.jaffle_shop.product_inventory", + "name": "last_sale_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "stock_status": { + "id": "model.jaffle_shop.product_inventory_stock_status", + "table_id": "model.jaffle_shop.product_inventory", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_daily_orders": { + "id": "model.jaffle_shop.metric_daily_orders", + "name": "metric_daily_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as total_orders,\n sum(case when status in ('completed', 'Scompleted') then 1 else 0 end) as completed_orders,\n sum(case when status in ('returned', 'Sreturned', 'return_pending', 'Sreturn_pending') then 1 else 0 end) as returned_orders,\n sum(case when status in ('shipped', 'Sshipped') then 1 else 0 end) as shipped_orders,\n sum(case when status in ('placed', 'Splaced') then 1 else 0 end) as placed_orders,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n avg(item_count) as avg_items_per_order\n from orders\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_daily_orders_order_date", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.metric_daily_orders_total_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "completed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_completed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "completed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "returned_orders": { + "id": "model.jaffle_shop.metric_daily_orders_returned_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "returned_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "shipped_orders": { + "id": "model.jaffle_shop.metric_daily_orders_shipped_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "shipped_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "placed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_placed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "placed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "promoted_orders": { + "id": "model.jaffle_shop.metric_daily_orders_promoted_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "promoted_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_items_per_order": { + "id": "model.jaffle_shop.metric_daily_orders_avg_items_per_order", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_reviews": { + "id": "model.jaffle_shop.product_reviews", + "name": "product_reviews", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with ratings as (\n select * from {{ ref('int_product_ratings') }}\n),\n\nfinal as (\n select\n product_id,\n product_name,\n category_name,\n root_category,\n review_count,\n avg_rating,\n positive_reviews,\n negative_reviews,\n case\n when avg_rating >= 4.5 then 'excellent'\n when avg_rating >= 3.5 then 'good'\n when avg_rating >= 2.5 then 'average'\n when avg_rating >= 1.5 then 'poor'\n else 'terrible'\n end as rating_tier,\n case when review_count > 0\n then round(cast(positive_reviews as decimal) / review_count * 100, 1)\n else 0\n end as positive_pct\n from ratings\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.product_reviews_product_id", + "table_id": "model.jaffle_shop.product_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.product_reviews_product_name", + "table_id": "model.jaffle_shop.product_reviews", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.product_reviews_category_name", + "table_id": "model.jaffle_shop.product_reviews", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.product_reviews_root_category", + "table_id": "model.jaffle_shop.product_reviews", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.product_reviews_review_count", + "table_id": "model.jaffle_shop.product_reviews", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.product_reviews_avg_rating", + "table_id": "model.jaffle_shop.product_reviews", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "positive_reviews": { + "id": "model.jaffle_shop.product_reviews_positive_reviews", + "table_id": "model.jaffle_shop.product_reviews", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "negative_reviews": { + "id": "model.jaffle_shop.product_reviews_negative_reviews", + "table_id": "model.jaffle_shop.product_reviews", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rating_tier": { + "id": "model.jaffle_shop.product_reviews_rating_tier", + "table_id": "model.jaffle_shop.product_reviews", + "name": "rating_tier", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "positive_pct": { + "id": "model.jaffle_shop.product_reviews_positive_pct", + "table_id": "model.jaffle_shop.product_reviews", + "name": "positive_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.inventory_health": { + "id": "model.jaffle_shop.inventory_health", + "name": "inventory_health", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nmovements as (\n select\n product_id,\n store_id,\n sum(quantity_in) as total_inbound,\n sum(quantity_out) as total_outbound,\n count(case when movement_type = 'supply' then 1 end) as restock_events,\n count(case when movement_type = 'sale' then 1 end) as sale_events\n from {{ ref('int_inventory_movements') }}\n group by product_id, store_id\n),\n\nhealth as (\n select\n i.product_store_key,\n i.product_id,\n i.product_name,\n i.store_id,\n i.store_name,\n i.current_stock,\n i.stock_status,\n m.total_inbound,\n m.total_outbound,\n m.restock_events,\n m.sale_events,\n case\n when m.total_outbound > m.total_inbound then 'deficit'\n when i.current_stock > m.total_outbound * 2 then 'overstocked'\n else 'balanced'\n end as inventory_balance,\n case when m.sale_events > 0\n then round(cast(m.total_outbound as decimal) / m.sale_events, 1)\n else 0\n end as avg_units_per_sale\n from inventory i\n left join movements m on i.product_id = m.product_id and i.store_id = m.store_id\n)\n\nselect * from health", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_store_key": { + "id": "model.jaffle_shop.inventory_health_product_store_key", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.inventory_health_product_id", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.inventory_health_product_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.inventory_health_store_id", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.inventory_health_store_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "current_stock": { + "id": "model.jaffle_shop.inventory_health_current_stock", + "table_id": "model.jaffle_shop.inventory_health", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "stock_status": { + "id": "model.jaffle_shop.inventory_health_stock_status", + "table_id": "model.jaffle_shop.inventory_health", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_inbound": { + "id": "model.jaffle_shop.inventory_health_total_inbound", + "table_id": "model.jaffle_shop.inventory_health", + "name": "total_inbound", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_outbound": { + "id": "model.jaffle_shop.inventory_health_total_outbound", + "table_id": "model.jaffle_shop.inventory_health", + "name": "total_outbound", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "restock_events": { + "id": "model.jaffle_shop.inventory_health_restock_events", + "table_id": "model.jaffle_shop.inventory_health", + "name": "restock_events", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "sale_events": { + "id": "model.jaffle_shop.inventory_health_sale_events", + "table_id": "model.jaffle_shop.inventory_health", + "name": "sale_events", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "inventory_balance": { + "id": "model.jaffle_shop.inventory_health_inventory_balance", + "table_id": "model.jaffle_shop.inventory_health", + "name": "inventory_balance", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_units_per_sale": { + "id": "model.jaffle_shop.inventory_health_avg_units_per_sale", + "table_id": "model.jaffle_shop.inventory_health", + "name": "avg_units_per_sale", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_reviews": { + "id": "seed.jaffle_shop.raw_reviews", + "name": "raw_reviews", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_reviews_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "seed.jaffle_shop.raw_reviews_order_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_reviews_product_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "seed.jaffle_shop.raw_reviews_customer_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "rating": { + "id": "seed.jaffle_shop.raw_reviews_rating", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "rating", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "review_date": { + "id": "seed.jaffle_shop.raw_reviews_review_date", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "review_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.stg_categories_category_name", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_review_activity": { + "id": "model.jaffle_shop.int_customer_review_activity", + "name": "int_customer_review_activity", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with reviews as (\n select * from {{ ref('stg_reviews') }}\n),\n\ncustomer_reviews as (\n select\n customer_id,\n count(*) as review_count,\n avg(rating) as avg_rating,\n min(rating) as min_rating,\n max(rating) as max_rating,\n min(review_date) as first_review_date,\n max(review_date) as last_review_date,\n count(distinct product_id) as products_reviewed\n from reviews\n group by customer_id\n)\n\nselect * from customer_reviews", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_review_activity_customer_id", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.int_customer_review_activity_review_count", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_avg_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "min_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_min_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "min_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "max_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_max_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "max_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "first_review_date": { + "id": "model.jaffle_shop.int_customer_review_activity_first_review_date", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "first_review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "last_review_date": { + "id": "model.jaffle_shop.int_customer_review_activity_last_review_date", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "last_review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "products_reviewed": { + "id": "model.jaffle_shop.int_customer_review_activity_products_reviewed", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "products_reviewed", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_item_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_item_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_order_items_with_products_product_name", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_order_items_with_products_category_name", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_order_items_with_products_root_category", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.int_order_items_with_products_category_path", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.int_order_items_with_products_quantity", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "model.jaffle_shop.int_order_items_with_products_unit_price", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_total": { + "id": "model.jaffle_shop.int_order_items_with_products_line_total", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_segments_final_customer_id", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.customer_segments_final_first_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.customer_segments_final_last_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "recency_score": { + "id": "model.jaffle_shop.customer_segments_final_recency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "frequency_score": { + "id": "model.jaffle_shop.customer_segments_final_frequency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "monetary_score": { + "id": "model.jaffle_shop.customer_segments_final_monetary_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "monetary_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.customer_segments_final_total_orders", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_spent": { + "id": "model.jaffle_shop.customer_segments_final_total_spent", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.customer_segments_final_days_since_last_order", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_order_history_customer_id", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.int_customer_order_history_first_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.int_customer_order_history_last_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.int_customer_order_history_total_orders", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_spent": { + "id": "model.jaffle_shop.int_customer_order_history_total_spent", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin_generated": { + "id": "model.jaffle_shop.int_customer_order_history_total_margin_generated", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_margin_generated", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_customer_order_history_avg_order_value", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_purchased": { + "id": "model.jaffle_shop.int_customer_order_history_total_items_purchased", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_items_purchased", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "distinct_order_days": { + "id": "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "distinct_order_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_products_name", + "table_id": "seed.jaffle_shop.raw_products", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "seed.jaffle_shop.raw_products_price", + "table_id": "seed.jaffle_shop.raw_products", + "name": "price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "seed.jaffle_shop.raw_products_cost", + "table_id": "seed.jaffle_shop.raw_products", + "name": "cost", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "created_at": { + "id": "seed.jaffle_shop.raw_products_created_at", + "table_id": "seed.jaffle_shop.raw_products", + "name": "created_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_product_ratings": { + "id": "model.jaffle_shop.int_product_ratings", + "name": "int_product_ratings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with reviews as (\n select * from {{ ref('int_reviews_with_products') }}\n),\n\nratings as (\n select\n product_id,\n product_name,\n category_name,\n root_category,\n count(*) as review_count,\n round(avg(rating), 2) as avg_rating,\n sum(case when rating >= 4 then 1 else 0 end) as positive_reviews,\n sum(case when rating <= 2 then 1 else 0 end) as negative_reviews,\n min(rating) as min_rating,\n max(rating) as max_rating\n from reviews\n group by product_id, product_name, category_name, root_category\n)\n\nselect * from ratings", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_ratings_product_id", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_product_ratings_product_name", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_product_ratings_category_name", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_product_ratings_root_category", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.int_product_ratings_review_count", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.int_product_ratings_avg_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "positive_reviews": { + "id": "model.jaffle_shop.int_product_ratings_positive_reviews", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "negative_reviews": { + "id": "model.jaffle_shop.int_product_ratings_negative_reviews", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "min_rating": { + "id": "model.jaffle_shop.int_product_ratings_min_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "min_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "max_rating": { + "id": "model.jaffle_shop.int_product_ratings_max_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "max_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_reviews_with_products": { + "id": "model.jaffle_shop.int_reviews_with_products", + "name": "int_reviews_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with reviews as (\n select * from {{ ref('stg_reviews') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\nenriched as (\n select\n r.review_id,\n r.order_id,\n r.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n r.customer_id,\n r.rating,\n r.review_date\n from reviews r\n left join products p on r.product_id = p.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "review_id": { + "id": "model.jaffle_shop.int_reviews_with_products_review_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "review_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.int_reviews_with_products_order_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_reviews_with_products_product_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_reviews_with_products_product_name", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_reviews_with_products_category_name", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_reviews_with_products_root_category", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.int_reviews_with_products_customer_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rating": { + "id": "model.jaffle_shop.int_reviews_with_products_rating", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "rating", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_date": { + "id": "model.jaffle_shop.int_reviews_with_products_review_date", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_segments_customer_id", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.int_customer_segments_first_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.int_customer_segments_last_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.int_customer_segments_total_orders", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_spent": { + "id": "model.jaffle_shop.int_customer_segments_total_spent", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.int_customer_segments_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "recency_score": { + "id": "model.jaffle_shop.int_customer_segments_recency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "frequency_score": { + "id": "model.jaffle_shop.int_customer_segments_frequency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "monetary_score": { + "id": "model.jaffle_shop.int_customer_segments_monetary_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "monetary_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_customer_retention_monthly": { + "id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "metric_customer_retention_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with retention as (\n select * from {{ ref('customer_retention') }}\n),\n\ncohort_sizes as (\n select\n cohort_month,\n customers as cohort_size\n from retention\n where months_since_first = 0\n),\n\nrates as (\n select\n r.cohort_month,\n r.months_since_first,\n r.customers as retained_customers,\n cs.cohort_size,\n round(cast(r.customers as decimal) / cs.cohort_size * 100, 1) as retention_rate\n from retention r\n inner join cohort_sizes cs on r.cohort_month = cs.cohort_month\n)\n\nselect * from rates", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "months_since_first": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_months_since_first", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "retained_customers": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retained_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "cohort_size": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "retention_rate": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retention_rate", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_performance_store_id", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.int_store_performance_store_name", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.int_store_performance_city", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.int_store_performance_state", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_employees": { + "id": "model.jaffle_shop.int_store_performance_total_employees", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_store_performance_order_count", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.int_store_performance_unique_customers", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.int_store_performance_total_revenue", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_store_performance_total_margin", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_store_performance_avg_order_value", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_per_employee": { + "id": "model.jaffle_shop.int_store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "orders_per_employee": { + "id": "model.jaffle_shop.int_store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.stg_products_product_name", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "price_cents": { + "id": "model.jaffle_shop.stg_products_price_cents", + "table_id": "model.jaffle_shop.stg_products", + "name": "price_cents", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "cost_cents": { + "id": "model.jaffle_shop.stg_products_cost_cents", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost_cents", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.stg_products_price", + "table_id": "model.jaffle_shop.stg_products", + "name": "price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.stg_products_cost", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "created_at": { + "id": "model.jaffle_shop.stg_products_created_at", + "table_id": "model.jaffle_shop.stg_products", + "name": "created_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_id", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_name", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.rpt_store_dashboard_city", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.rpt_store_dashboard_state", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.rpt_store_dashboard_order_count", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.rpt_store_dashboard_unique_customers", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_per_employee": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "efficiency_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_efficiency_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_stock_units": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_stock_units", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "out_of_stock_products": { + "id": "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "out_of_stock_products", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "low_stock_products": { + "id": "model.jaffle_shop.rpt_store_dashboard_low_stock_products", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "low_stock_products", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_daily_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "avg_daily_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_daily_order_summary": { + "id": "model.jaffle_shop.int_daily_order_summary", + "name": "int_daily_order_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='order_date'\n )\n}}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as order_count,\n count(distinct customer_id) as unique_customers,\n sum(subtotal) as total_revenue,\n sum(total_cost) as total_cost,\n sum(total_margin) as total_margin,\n sum(total_quantity) as total_items_sold,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n sum(discount_amount) as total_discounts,\n avg(subtotal) as avg_order_value\n from orders\n\n {% if is_incremental() %}\n where order_date > (select max(order_date) from {{ this }})\n {% endif %}\n\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.int_daily_order_summary_order_date", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_daily_order_summary_order_count", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.int_daily_order_summary_unique_customers", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.int_daily_order_summary_total_revenue", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_daily_order_summary_total_cost", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_daily_order_summary_total_margin", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.int_daily_order_summary_total_items_sold", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "promoted_orders": { + "id": "model.jaffle_shop.int_daily_order_summary_promoted_orders", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "promoted_orders", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.int_daily_order_summary_total_discounts", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_daily_order_summary_avg_order_value", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_payment_methods": { + "id": "model.jaffle_shop.int_customer_payment_methods", + "name": "int_customer_payment_methods", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('stg_orders') }}\n),\n\ncustomer_payments as (\n select\n o.customer_id,\n p.payment_method,\n count(*) as usage_count,\n sum(p.amount) as total_amount\n from payments p\n inner join orders o on p.order_id = o.order_id\n group by o.customer_id, p.payment_method\n),\n\npreferred as (\n select\n customer_id,\n payment_method as preferred_payment_method,\n row_number() over (partition by customer_id order by usage_count desc) as rn\n from customer_payments\n),\n\npivoted as (\n select\n cp.customer_id,\n sum(case when cp.payment_method = 'credit_card' then cp.total_amount else 0 end) as credit_card_total,\n sum(case when cp.payment_method = 'bank_transfer' then cp.total_amount else 0 end) as bank_transfer_total,\n sum(case when cp.payment_method = 'coupon' then cp.total_amount else 0 end) as coupon_total,\n sum(case when cp.payment_method = 'gift_card' then cp.total_amount else 0 end) as gift_card_total,\n max(pref.preferred_payment_method) as preferred_payment_method\n from customer_payments cp\n left join preferred pref on cp.customer_id = pref.customer_id and pref.rn = 1\n group by cp.customer_id\n)\n\nselect * from pivoted", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_payment_methods_customer_id", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "credit_card_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_credit_card_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "credit_card_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "bank_transfer_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "bank_transfer_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "coupon_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_coupon_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "coupon_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "gift_card_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_gift_card_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "gift_card_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "preferred_payment_method": { + "id": "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "preferred_payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "payment_id": { + "id": "model.jaffle_shop.stg_payments_payment_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_method": { + "id": "model.jaffle_shop.stg_payments_payment_method", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.stg_payments_amount", + "table_id": "model.jaffle_shop.stg_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_item_id": { + "id": "model.jaffle_shop.stg_order_items_order_item_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.stg_order_items_quantity", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "model.jaffle_shop.stg_order_items_unit_price", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_promotion_daily": { + "id": "model.jaffle_shop.metric_promotion_daily", + "name": "metric_promotion_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with discounts as (\n select * from {{ ref('order_discounts') }}\n),\n\ndaily as (\n select\n order_date,\n promotion_name,\n discount_type,\n count(*) as usage_count,\n sum(discount_amount) as total_discount,\n sum(subtotal) as total_order_value,\n sum(net_revenue) as total_net_revenue,\n avg(discount_pct_of_order) as avg_discount_pct\n from discounts\n group by order_date, promotion_name, discount_type\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_promotion_daily_order_date", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.metric_promotion_daily_promotion_name", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.metric_promotion_daily_discount_type", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "usage_count": { + "id": "model.jaffle_shop.metric_promotion_daily_usage_count", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "usage_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_discount": { + "id": "model.jaffle_shop.metric_promotion_daily_total_discount", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_discount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_order_value": { + "id": "model.jaffle_shop.metric_promotion_daily_total_order_value", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_net_revenue": { + "id": "model.jaffle_shop.metric_promotion_daily_total_net_revenue", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_discount_pct": { + "id": "model.jaffle_shop.metric_promotion_daily_avg_discount_pct", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "avg_discount_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_supply_order_costs": { + "id": "model.jaffle_shop.int_supply_order_costs", + "name": "int_supply_order_costs", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_orders as (\n select * from {{ ref('stg_supply_orders') }}\n),\n\nproducts as (\n select * from {{ ref('stg_products') }}\n),\n\ncosted as (\n select\n so.supply_order_id,\n so.product_id,\n p.product_name,\n so.store_id,\n so.quantity,\n p.cost as unit_cost,\n so.quantity * p.cost as total_cost,\n so.order_date,\n so.delivered_date,\n {{ dbt.datediff('so.order_date', 'so.delivered_date', 'day') }} as lead_time_days\n from supply_orders so\n left join products p on so.product_id = p.product_id\n)\n\nselect * from costed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "supply_order_id": { + "id": "model.jaffle_shop.int_supply_order_costs_supply_order_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_supply_order_costs_product_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_supply_order_costs_product_name", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_supply_order_costs_store_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.int_supply_order_costs_quantity", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_cost": { + "id": "model.jaffle_shop.int_supply_order_costs_unit_cost", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "unit_cost", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_supply_order_costs_total_cost", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_supply_order_costs_order_date", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "delivered_date": { + "id": "model.jaffle_shop.int_supply_order_costs_delivered_date", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "lead_time_days": { + "id": "model.jaffle_shop.int_supply_order_costs_lead_time_days", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "lead_time_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_daily_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue", + "name": "metric_daily_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('int_daily_order_summary') }}\n),\n\nfinal as (\n select\n order_date,\n order_count,\n total_revenue,\n total_cost,\n total_margin,\n total_discounts,\n total_revenue - total_discounts as net_revenue,\n avg_order_value,\n unique_customers,\n total_items_sold\n from daily\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_daily_revenue_order_date", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.metric_daily_revenue_order_count", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue_total_revenue", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.metric_daily_revenue_total_cost", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.metric_daily_revenue_total_margin", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.metric_daily_revenue_total_discounts", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue_net_revenue", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.metric_daily_revenue_avg_order_value", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.metric_daily_revenue_unique_customers", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.metric_daily_revenue_total_items_sold", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_lifetime_value": { + "id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_lifetime_value", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nclv as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.number_of_orders,\n c.customer_lifetime_value as total_revenue,\n fl.first_order_date,\n fl.last_order_date,\n fl.customer_tenure_days,\n fl.days_since_last_order,\n case when fl.customer_tenure_days > 0\n then round(c.customer_lifetime_value / (fl.customer_tenure_days / 30.0), 2)\n else c.customer_lifetime_value\n end as monthly_value,\n case when c.number_of_orders > 0\n then round(c.customer_lifetime_value / c.number_of_orders, 2)\n else 0\n end as avg_order_value\n from customers c\n left join first_last fl on c.customer_id = fl.customer_id\n)\n\nselect * from clv", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_id", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.customer_lifetime_value_first_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.customer_lifetime_value_last_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "number_of_orders": { + "id": "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.customer_lifetime_value_total_revenue", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "total_revenue", + "type": "HUGEINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "first_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_first_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_last_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_tenure_days": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "monthly_value": { + "id": "model.jaffle_shop.customer_lifetime_value_monthly_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.customer_lifetime_value_avg_order_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.int_product_margins_price", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.int_product_margins_cost", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.int_product_margins_margin", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.int_product_margins_margin_pct", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.store_inventory": { + "id": "model.jaffle_shop.store_inventory", + "name": "store_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nstore_level as (\n select\n store_id,\n store_name,\n count(distinct product_id) as unique_products,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_products,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_products,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_stock_products,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_products\n from inventory\n group by store_id, store_name\n)\n\nselect * from store_level", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_inventory_store_id", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.store_inventory_store_name", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_products": { + "id": "model.jaffle_shop.store_inventory_unique_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "unique_products", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_stock_units": { + "id": "model.jaffle_shop.store_inventory_total_stock_units", + "table_id": "model.jaffle_shop.store_inventory", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "out_of_stock_products": { + "id": "model.jaffle_shop.store_inventory_out_of_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "out_of_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "low_stock_products": { + "id": "model.jaffle_shop.store_inventory_low_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "low_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "adequate_stock_products": { + "id": "model.jaffle_shop.store_inventory_adequate_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "adequate_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "well_stocked_products": { + "id": "model.jaffle_shop.store_inventory_well_stocked_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "well_stocked_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_customers": { + "id": "seed.jaffle_shop.raw_customers", + "name": "raw_customers", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_customers_id", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "seed.jaffle_shop.raw_customers_first_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "seed.jaffle_shop.raw_customers_last_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + } + }, + "columns": { + "model.jaffle_shop.order_discounts_order_id": { + "id": "model.jaffle_shop.order_discounts_order_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_customer_id": { + "id": "model.jaffle_shop.order_discounts_customer_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_order_date": { + "id": "model.jaffle_shop.order_discounts_order_date", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_subtotal": { + "id": "model.jaffle_shop.order_discounts_subtotal", + "table_id": "model.jaffle_shop.order_discounts", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_has_promotion": { + "id": "model.jaffle_shop.order_discounts_has_promotion", + "table_id": "model.jaffle_shop.order_discounts", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_promotion_name": { + "id": "model.jaffle_shop.order_discounts_promotion_name", + "table_id": "model.jaffle_shop.order_discounts", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_discount_type": { + "id": "model.jaffle_shop.order_discounts_discount_type", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_discount_value": { + "id": "model.jaffle_shop.order_discounts_discount_value", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_discount_amount": { + "id": "model.jaffle_shop.order_discounts_discount_amount", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_amount", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_discount_pct_of_order": { + "id": "model.jaffle_shop.order_discounts_discount_pct_of_order", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_pct_of_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_net_revenue": { + "id": "model.jaffle_shop.order_discounts_net_revenue", + "table_id": "model.jaffle_shop.order_discounts", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_employee_id": { + "id": "model.jaffle_shop.stg_employees_employee_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_store_id": { + "id": "model.jaffle_shop.stg_employees_store_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_first_name": { + "id": "model.jaffle_shop.stg_employees_first_name", + "table_id": "model.jaffle_shop.stg_employees", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_last_name": { + "id": "model.jaffle_shop.stg_employees_last_name", + "table_id": "model.jaffle_shop.stg_employees", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_role": { + "id": "model.jaffle_shop.stg_employees_role", + "table_id": "model.jaffle_shop.stg_employees", + "name": "role", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_hired_at": { + "id": "model.jaffle_shop.stg_employees_hired_at", + "table_id": "model.jaffle_shop.stg_employees", + "name": "hired_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_month": { + "id": "model.jaffle_shop.revenue_summary_order_month", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_store_id": { + "id": "model.jaffle_shop.revenue_summary_store_id", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_count": { + "id": "model.jaffle_shop.revenue_summary_order_count", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_revenue": { + "id": "model.jaffle_shop.revenue_summary_revenue", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_cost": { + "id": "model.jaffle_shop.revenue_summary_cost", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_margin": { + "id": "model.jaffle_shop.revenue_summary_margin", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_discounts": { + "id": "model.jaffle_shop.revenue_summary_discounts", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_net_revenue": { + "id": "model.jaffle_shop.revenue_summary_net_revenue", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_id": { + "id": "seed.jaffle_shop.raw_stores_id", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_name": { + "id": "seed.jaffle_shop.raw_stores_name", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_city": { + "id": "seed.jaffle_shop.raw_stores_city", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_state": { + "id": "seed.jaffle_shop.raw_stores_state", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_opened_at": { + "id": "seed.jaffle_shop.raw_stores_opened_at", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "opened_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_order_count": { + "id": "model.jaffle_shop.int_store_revenue_order_count", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_unique_customers": { + "id": "model.jaffle_shop.int_store_revenue_unique_customers", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_revenue": { + "id": "model.jaffle_shop.int_store_revenue_total_revenue", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_cost": { + "id": "model.jaffle_shop.int_store_revenue_total_cost", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_margin": { + "id": "model.jaffle_shop.int_store_revenue_total_margin", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_avg_order_value": { + "id": "model.jaffle_shop.int_store_revenue_avg_order_value", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_subtotal": { + "id": "model.jaffle_shop.int_order_payments_matched_order_subtotal", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_subtotal", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_total_paid": { + "id": "model.jaffle_shop.int_order_payments_matched_total_paid", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_payment_count": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_count", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_payment_method_count": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_method_count", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_method_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_payment_status": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_status", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_snapshot_date": { + "id": "model.jaffle_shop.metric_inventory_daily_snapshot_date", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "snapshot_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_total_products_tracked": { + "id": "model.jaffle_shop.metric_inventory_daily_total_products_tracked", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_products_tracked", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_total_stores": { + "id": "model.jaffle_shop.metric_inventory_daily_total_stores", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_stores", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_total_stock_units": { + "id": "model.jaffle_shop.metric_inventory_daily_total_stock_units", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_out_of_stock_count": { + "id": "model.jaffle_shop.metric_inventory_daily_out_of_stock_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "out_of_stock_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_low_stock_count": { + "id": "model.jaffle_shop.metric_inventory_daily_low_stock_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "low_stock_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_adequate_count": { + "id": "model.jaffle_shop.metric_inventory_daily_adequate_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "adequate_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_well_stocked_count": { + "id": "model.jaffle_shop.metric_inventory_daily_well_stocked_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "well_stocked_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store": { + "id": "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "avg_stock_per_product_store", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "new_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_lifetime_orders", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cumulative_customers", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_name": { + "id": "model.jaffle_shop.int_store_employees_active_store_name", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_city": { + "id": "model.jaffle_shop.int_store_employees_active_city", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_state": { + "id": "model.jaffle_shop.int_store_employees_active_state", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_total_employees": { + "id": "model.jaffle_shop.int_store_employees_active_total_employees", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_manager_count": { + "id": "model.jaffle_shop.int_store_employees_active_manager_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "manager_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_barista_count": { + "id": "model.jaffle_shop.int_store_employees_active_barista_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "barista_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_cashier_count": { + "id": "model.jaffle_shop.int_store_employees_active_cashier_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "cashier_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_cook_count": { + "id": "model.jaffle_shop.int_store_employees_active_cook_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "cook_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_earliest_hire": { + "id": "model.jaffle_shop.int_store_employees_active_earliest_hire", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "earliest_hire", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_latest_hire": { + "id": "model.jaffle_shop.int_store_employees_active_latest_hire", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "latest_hire", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_review_id": { + "id": "model.jaffle_shop.stg_reviews_review_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "review_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_order_id": { + "id": "model.jaffle_shop.stg_reviews_order_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_product_id": { + "id": "model.jaffle_shop.stg_reviews_product_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_customer_id": { + "id": "model.jaffle_shop.stg_reviews_customer_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_rating": { + "id": "model.jaffle_shop.stg_reviews_rating", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "rating", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_review_date": { + "id": "model.jaffle_shop.stg_reviews_review_date", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_id": { + "id": "model.jaffle_shop.customer_360_customer_id", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_first_name": { + "id": "model.jaffle_shop.customer_360_first_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_last_name": { + "id": "model.jaffle_shop.customer_360_last_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_first_order": { + "id": "model.jaffle_shop.customer_360_first_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_most_recent_order": { + "id": "model.jaffle_shop.customer_360_most_recent_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_number_of_orders": { + "id": "model.jaffle_shop.customer_360_number_of_orders", + "table_id": "model.jaffle_shop.customer_360", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_lifetime_value": { + "id": "model.jaffle_shop.customer_360_customer_lifetime_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_lifetime_value", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_monthly_value": { + "id": "model.jaffle_shop.customer_360_monthly_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_avg_order_value": { + "id": "model.jaffle_shop.customer_360_avg_order_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_tenure_days": { + "id": "model.jaffle_shop.customer_360_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_days_since_last_order": { + "id": "model.jaffle_shop.customer_360_days_since_last_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_review_count": { + "id": "model.jaffle_shop.customer_360_review_count", + "table_id": "model.jaffle_shop.customer_360", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_avg_review_rating": { + "id": "model.jaffle_shop.customer_360_avg_review_rating", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_review_rating", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_months_active": { + "id": "model.jaffle_shop.customer_360_months_active", + "table_id": "model.jaffle_shop.customer_360", + "name": "months_active", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_name": { + "id": "model.jaffle_shop.int_products_with_categories_product_name", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_category_id": { + "id": "model.jaffle_shop.int_products_with_categories_category_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_category_name": { + "id": "model.jaffle_shop.int_products_with_categories_category_name", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_root_category": { + "id": "model.jaffle_shop.int_products_with_categories_root_category", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_category_path": { + "id": "model.jaffle_shop.int_products_with_categories_category_path", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_category_depth": { + "id": "model.jaffle_shop.int_products_with_categories_category_depth", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_depth", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_price": { + "id": "model.jaffle_shop.int_products_with_categories_price", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_cost": { + "id": "model.jaffle_shop.int_products_with_categories_cost", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_created_at": { + "id": "model.jaffle_shop.int_products_with_categories_created_at", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "created_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_month_start": { + "id": "model.jaffle_shop.metric_monthly_sales_month_start", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "month_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_orders": { + "id": "model.jaffle_shop.metric_monthly_sales_total_orders", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_revenue": { + "id": "model.jaffle_shop.metric_monthly_sales_total_revenue", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_net_revenue": { + "id": "model.jaffle_shop.metric_monthly_sales_net_revenue", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_margin": { + "id": "model.jaffle_shop.metric_monthly_sales_total_margin", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_discounts": { + "id": "model.jaffle_shop.metric_monthly_sales_total_discounts", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value": { + "id": "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_items_sold": { + "id": "model.jaffle_shop.metric_monthly_sales_total_items_sold", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_active_days": { + "id": "model.jaffle_shop.metric_monthly_sales_active_days", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_name": { + "id": "model.jaffle_shop.int_category_hierarchy_category_name", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_parent_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_parent_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_root_category": { + "id": "model.jaffle_shop.int_category_hierarchy_root_category", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_full_path": { + "id": "model.jaffle_shop.int_category_hierarchy_full_path", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "full_path", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_depth": { + "id": "model.jaffle_shop.int_category_hierarchy_depth", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "depth", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_id": { + "id": "seed.jaffle_shop.raw_employees_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_store_id": { + "id": "seed.jaffle_shop.raw_employees_store_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_first_name": { + "id": "seed.jaffle_shop.raw_employees_first_name", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_last_name": { + "id": "seed.jaffle_shop.raw_employees_last_name", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_role": { + "id": "seed.jaffle_shop.raw_employees_role", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "role", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_hired_at": { + "id": "seed.jaffle_shop.raw_employees_hired_at", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "hired_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_order_item_id": { + "id": "model.jaffle_shop.order_items_order_item_id", + "table_id": "model.jaffle_shop.order_items", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_order_id": { + "id": "model.jaffle_shop.order_items_order_id", + "table_id": "model.jaffle_shop.order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_product_id": { + "id": "model.jaffle_shop.order_items_product_id", + "table_id": "model.jaffle_shop.order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_product_name": { + "id": "model.jaffle_shop.order_items_product_name", + "table_id": "model.jaffle_shop.order_items", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_category_name": { + "id": "model.jaffle_shop.order_items_category_name", + "table_id": "model.jaffle_shop.order_items", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_root_category": { + "id": "model.jaffle_shop.order_items_root_category", + "table_id": "model.jaffle_shop.order_items", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_category_path": { + "id": "model.jaffle_shop.order_items_category_path", + "table_id": "model.jaffle_shop.order_items", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_quantity": { + "id": "model.jaffle_shop.order_items_quantity", + "table_id": "model.jaffle_shop.order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_unit_price": { + "id": "model.jaffle_shop.order_items_unit_price", + "table_id": "model.jaffle_shop.order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_line_total": { + "id": "model.jaffle_shop.order_items_line_total", + "table_id": "model.jaffle_shop.order_items", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_cost": { + "id": "model.jaffle_shop.order_items_cost", + "table_id": "model.jaffle_shop.order_items", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_margin_pct": { + "id": "model.jaffle_shop.order_items_margin_pct", + "table_id": "model.jaffle_shop.order_items", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_line_cost": { + "id": "model.jaffle_shop.order_items_line_cost", + "table_id": "model.jaffle_shop.order_items", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_line_margin": { + "id": "model.jaffle_shop.order_items_line_margin", + "table_id": "model.jaffle_shop.order_items", + "name": "line_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_product_id": { + "id": "model.jaffle_shop.reorder_recommendations_product_id", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_product_name": { + "id": "model.jaffle_shop.reorder_recommendations_product_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_store_id": { + "id": "model.jaffle_shop.reorder_recommendations_store_id", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_store_name": { + "id": "model.jaffle_shop.reorder_recommendations_store_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_current_stock": { + "id": "model.jaffle_shop.reorder_recommendations_current_stock", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_stock_status": { + "id": "model.jaffle_shop.reorder_recommendations_stock_status", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_last_restock_date": { + "id": "model.jaffle_shop.reorder_recommendations_last_restock_date", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_total_quantity_sold": { + "id": "model.jaffle_shop.reorder_recommendations_total_quantity_sold", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_times_ordered": { + "id": "model.jaffle_shop.reorder_recommendations_times_ordered", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "times_ordered", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_reorder_priority": { + "id": "model.jaffle_shop.reorder_recommendations_reorder_priority", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_priority", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty": { + "id": "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "suggested_reorder_qty", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_name": { + "id": "seed.jaffle_shop.raw_categories_name", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_customer_id": { + "id": "model.jaffle_shop.int_order_enriched_customer_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_item_count": { + "id": "model.jaffle_shop.int_order_enriched_item_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_quantity": { + "id": "model.jaffle_shop.int_order_enriched_total_quantity", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_subtotal": { + "id": "model.jaffle_shop.int_order_enriched_subtotal", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_cost": { + "id": "model.jaffle_shop.int_order_enriched_total_cost", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_margin": { + "id": "model.jaffle_shop.int_order_enriched_total_margin", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_category_count": { + "id": "model.jaffle_shop.int_order_enriched_category_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "category_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_has_promotion": { + "id": "model.jaffle_shop.int_order_enriched_has_promotion", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_promotion_name": { + "id": "model.jaffle_shop.int_order_enriched_promotion_name", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_discount_type": { + "id": "model.jaffle_shop.int_order_enriched_discount_type", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_discount_value": { + "id": "model.jaffle_shop.int_order_enriched_discount_value", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_paid": { + "id": "model.jaffle_shop.int_order_enriched_total_paid", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_payment_count": { + "id": "model.jaffle_shop.int_order_enriched_payment_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_payment_status": { + "id": "model.jaffle_shop.int_order_enriched_payment_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_discount_amount": { + "id": "model.jaffle_shop.int_order_enriched_discount_amount", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_amount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_customer_id": { + "id": "model.jaffle_shop.int_store_order_assignments_customer_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_date": { + "id": "model.jaffle_shop.int_store_order_assignments_order_date", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_total_products": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_products", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_products", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_total_product_revenue": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_product_revenue", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_product_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating": { + "id": "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "overall_avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_total_units_sold": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_units_sold", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_units_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_never_ordered_products": { + "id": "model.jaffle_shop.rpt_product_dashboard_never_ordered_products", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "never_ordered_products", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_top_product_revenue": { + "id": "model.jaffle_shop.rpt_product_dashboard_top_product_revenue", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "top_product_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_top_product_name": { + "id": "model.jaffle_shop.rpt_product_dashboard_top_product_name", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "top_product_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_total_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_total_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "total_customers", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_active_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "active_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_avg_clv": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_clv", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_clv", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_orders_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_reviews_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_customer_id": { + "id": "model.jaffle_shop.customer_acquisition_customer_id", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_date": { + "id": "model.jaffle_shop.customer_acquisition_first_order_date", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_acquired_via_promotion": { + "id": "model.jaffle_shop.customer_acquisition_acquired_via_promotion", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquired_via_promotion", + "type": "BOOLEAN", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_acquisition_promotion": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_promotion", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_promotion", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_value": { + "id": "model.jaffle_shop.customer_acquisition_first_order_value", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_value", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_items": { + "id": "model.jaffle_shop.customer_acquisition_first_order_items", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_items", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_acquisition_month": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_month", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_product_id": { + "id": "model.jaffle_shop.product_performance_product_id", + "table_id": "model.jaffle_shop.product_performance", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_product_name": { + "id": "model.jaffle_shop.product_performance_product_name", + "table_id": "model.jaffle_shop.product_performance", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_category_name": { + "id": "model.jaffle_shop.product_performance_category_name", + "table_id": "model.jaffle_shop.product_performance", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_root_category": { + "id": "model.jaffle_shop.product_performance_root_category", + "table_id": "model.jaffle_shop.product_performance", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_price": { + "id": "model.jaffle_shop.product_performance_price", + "table_id": "model.jaffle_shop.product_performance", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_cost": { + "id": "model.jaffle_shop.product_performance_cost", + "table_id": "model.jaffle_shop.product_performance", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_margin_pct": { + "id": "model.jaffle_shop.product_performance_margin_pct", + "table_id": "model.jaffle_shop.product_performance", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_times_ordered": { + "id": "model.jaffle_shop.product_performance_times_ordered", + "table_id": "model.jaffle_shop.product_performance", + "name": "times_ordered", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_total_quantity_sold": { + "id": "model.jaffle_shop.product_performance_total_quantity_sold", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_total_revenue": { + "id": "model.jaffle_shop.product_performance_total_revenue", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_total_margin": { + "id": "model.jaffle_shop.product_performance_total_margin", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_review_count": { + "id": "model.jaffle_shop.product_performance_review_count", + "table_id": "model.jaffle_shop.product_performance", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_avg_rating": { + "id": "model.jaffle_shop.product_performance_avg_rating", + "table_id": "model.jaffle_shop.product_performance", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_positive_reviews": { + "id": "model.jaffle_shop.product_performance_positive_reviews", + "table_id": "model.jaffle_shop.product_performance", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_negative_reviews": { + "id": "model.jaffle_shop.product_performance_negative_reviews", + "table_id": "model.jaffle_shop.product_performance", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_product_id": { + "id": "model.jaffle_shop.supplier_lead_times_product_id", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_product_name": { + "id": "model.jaffle_shop.supplier_lead_times_product_name", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_store_id": { + "id": "model.jaffle_shop.supplier_lead_times_store_id", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_order_count": { + "id": "model.jaffle_shop.supplier_lead_times_order_count", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_avg_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_avg_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "avg_lead_time", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_min_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_min_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "min_lead_time", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_max_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_max_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "max_lead_time", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_total_quantity": { + "id": "model.jaffle_shop.supplier_lead_times_total_quantity", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_total_spend": { + "id": "model.jaffle_shop.supplier_lead_times_total_spend", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "total_spend", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_has_promotion": { + "id": "model.jaffle_shop.int_promotion_effectiveness_has_promotion", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_promotion_name": { + "id": "model.jaffle_shop.int_promotion_effectiveness_promotion_name", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_discount_type": { + "id": "model.jaffle_shop.int_promotion_effectiveness_discount_type", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_order_count": { + "id": "model.jaffle_shop.int_promotion_effectiveness_order_count", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_order_value", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_total_revenue": { + "id": "model.jaffle_shop.int_promotion_effectiveness_total_revenue", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_avg_margin": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_margin", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_payment_id": { + "id": "model.jaffle_shop.payments_fact_payment_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "payment_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_id": { + "id": "model.jaffle_shop.payments_fact_order_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_customer_id": { + "id": "model.jaffle_shop.payments_fact_customer_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_date": { + "id": "model.jaffle_shop.payments_fact_order_date", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_payment_method": { + "id": "model.jaffle_shop.payments_fact_payment_method", + "table_id": "model.jaffle_shop.payments_fact", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_amount": { + "id": "model.jaffle_shop.payments_fact_amount", + "table_id": "model.jaffle_shop.payments_fact", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_status": { + "id": "model.jaffle_shop.payments_fact_order_status", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_status", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_id": { + "id": "seed.jaffle_shop.raw_order_items_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_quantity": { + "id": "seed.jaffle_shop.raw_order_items_quantity", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_unit_price": { + "id": "seed.jaffle_shop.raw_order_items_unit_price", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "unit_price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_customer_id": { + "id": "model.jaffle_shop.customer_review_summary_customer_id", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_review_count": { + "id": "model.jaffle_shop.customer_review_summary_review_count", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_customer_avg_rating": { + "id": "model.jaffle_shop.customer_review_summary_customer_avg_rating", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "customer_avg_rating", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_products_reviewed": { + "id": "model.jaffle_shop.customer_review_summary_products_reviewed", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "products_reviewed", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_first_review_date": { + "id": "model.jaffle_shop.customer_review_summary_first_review_date", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "first_review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_last_review_date": { + "id": "model.jaffle_shop.customer_review_summary_last_review_date", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "last_review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed": { + "id": "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "avg_product_rating_of_reviewed", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_rating_tendency": { + "id": "model.jaffle_shop.customer_review_summary_rating_tendency", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "rating_tendency", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_store_id": { + "id": "model.jaffle_shop.metric_store_daily_store_id", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_store_name": { + "id": "model.jaffle_shop.metric_store_daily_store_name", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_city": { + "id": "model.jaffle_shop.metric_store_daily_city", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_order_count": { + "id": "model.jaffle_shop.metric_store_daily_order_count", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_revenue": { + "id": "model.jaffle_shop.metric_store_daily_revenue", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_cost": { + "id": "model.jaffle_shop.metric_store_daily_cost", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_margin": { + "id": "model.jaffle_shop.metric_store_daily_margin", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_discounts": { + "id": "model.jaffle_shop.metric_store_daily_discounts", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_net_revenue": { + "id": "model.jaffle_shop.metric_store_daily_net_revenue", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_store_id": { + "id": "model.jaffle_shop.store_rankings_store_id", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_store_name": { + "id": "model.jaffle_shop.store_rankings_store_name", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_city": { + "id": "model.jaffle_shop.store_rankings_city", + "table_id": "model.jaffle_shop.store_rankings", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_state": { + "id": "model.jaffle_shop.store_rankings_state", + "table_id": "model.jaffle_shop.store_rankings", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_total_revenue": { + "id": "model.jaffle_shop.store_rankings_total_revenue", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_total_margin": { + "id": "model.jaffle_shop.store_rankings_total_margin", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count": { + "id": "model.jaffle_shop.store_rankings_order_count", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_unique_customers": { + "id": "model.jaffle_shop.store_rankings_unique_customers", + "table_id": "model.jaffle_shop.store_rankings", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_revenue_per_employee": { + "id": "model.jaffle_shop.store_rankings_revenue_per_employee", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_revenue_rank": { + "id": "model.jaffle_shop.store_rankings_revenue_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_margin_rank": { + "id": "model.jaffle_shop.store_rankings_margin_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "margin_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count_rank": { + "id": "model.jaffle_shop.store_rankings_order_count_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_efficiency_rank": { + "id": "model.jaffle_shop.store_rankings_efficiency_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_customer_reach_rank": { + "id": "model.jaffle_shop.store_rankings_customer_reach_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "customer_reach_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_supply_order_id": { + "id": "model.jaffle_shop.supply_orders_fact_supply_order_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_product_id": { + "id": "model.jaffle_shop.supply_orders_fact_product_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_product_name": { + "id": "model.jaffle_shop.supply_orders_fact_product_name", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_store_id": { + "id": "model.jaffle_shop.supply_orders_fact_store_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_quantity": { + "id": "model.jaffle_shop.supply_orders_fact_quantity", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_unit_cost": { + "id": "model.jaffle_shop.supply_orders_fact_unit_cost", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "unit_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_total_cost": { + "id": "model.jaffle_shop.supply_orders_fact_total_cost", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_order_date": { + "id": "model.jaffle_shop.supply_orders_fact_order_date", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_delivered_date": { + "id": "model.jaffle_shop.supply_orders_fact_delivered_date", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_lead_time_days": { + "id": "model.jaffle_shop.supply_orders_fact_lead_time_days", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "lead_time_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_customer_id": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "lifetime_orders", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": { + "id": "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_id": { + "id": "seed.jaffle_shop.raw_supply_orders_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_product_id": { + "id": "seed.jaffle_shop.raw_supply_orders_product_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_store_id": { + "id": "seed.jaffle_shop.raw_supply_orders_store_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_quantity": { + "id": "seed.jaffle_shop.raw_supply_orders_quantity", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_order_date": { + "id": "seed.jaffle_shop.raw_supply_orders_order_date", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_delivered_date": { + "id": "seed.jaffle_shop.raw_supply_orders_delivered_date", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_cohort_month": { + "id": "model.jaffle_shop.customer_retention_cohort_month", + "table_id": "model.jaffle_shop.customer_retention", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_months_since_first": { + "id": "model.jaffle_shop.customer_retention_months_since_first", + "table_id": "model.jaffle_shop.customer_retention", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_customers": { + "id": "model.jaffle_shop.customer_retention_customers", + "table_id": "model.jaffle_shop.customer_retention", + "name": "customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_store_id": { + "id": "model.jaffle_shop.store_performance_store_id", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_store_name": { + "id": "model.jaffle_shop.store_performance_store_name", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_city": { + "id": "model.jaffle_shop.store_performance_city", + "table_id": "model.jaffle_shop.store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_state": { + "id": "model.jaffle_shop.store_performance_state", + "table_id": "model.jaffle_shop.store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_total_employees": { + "id": "model.jaffle_shop.store_performance_total_employees", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_order_count": { + "id": "model.jaffle_shop.store_performance_order_count", + "table_id": "model.jaffle_shop.store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_unique_customers": { + "id": "model.jaffle_shop.store_performance_unique_customers", + "table_id": "model.jaffle_shop.store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_total_revenue": { + "id": "model.jaffle_shop.store_performance_total_revenue", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_total_margin": { + "id": "model.jaffle_shop.store_performance_total_margin", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_avg_order_value": { + "id": "model.jaffle_shop.store_performance_avg_order_value", + "table_id": "model.jaffle_shop.store_performance", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_revenue_per_employee": { + "id": "model.jaffle_shop.store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_orders_per_employee": { + "id": "model.jaffle_shop.store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_customer_id": { + "id": "model.jaffle_shop.customers_customer_id", + "table_id": "model.jaffle_shop.customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_first_name": { + "id": "model.jaffle_shop.customers_first_name", + "table_id": "model.jaffle_shop.customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_last_name": { + "id": "model.jaffle_shop.customers_last_name", + "table_id": "model.jaffle_shop.customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_first_order": { + "id": "model.jaffle_shop.customers_first_order", + "table_id": "model.jaffle_shop.customers", + "name": "first_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_most_recent_order": { + "id": "model.jaffle_shop.customers_most_recent_order", + "table_id": "model.jaffle_shop.customers", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_number_of_orders": { + "id": "model.jaffle_shop.customers_number_of_orders", + "table_id": "model.jaffle_shop.customers", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_customer_lifetime_value": { + "id": "model.jaffle_shop.customers_customer_lifetime_value", + "table_id": "model.jaffle_shop.customers", + "name": "customer_lifetime_value", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_id": { + "id": "seed.jaffle_shop.raw_payments_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_payment_method": { + "id": "seed.jaffle_shop.raw_payments_payment_method", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_promotion_name": { + "id": "model.jaffle_shop.promotion_roi_promotion_name", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_discount_type": { + "id": "model.jaffle_shop.promotion_roi_discount_type", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_order_count": { + "id": "model.jaffle_shop.promotion_roi_order_count", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_avg_order_value": { + "id": "model.jaffle_shop.promotion_roi_avg_order_value", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_total_revenue": { + "id": "model.jaffle_shop.promotion_roi_total_revenue", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_avg_margin": { + "id": "model.jaffle_shop.promotion_roi_avg_margin", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "avg_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_total_discount_given": { + "id": "model.jaffle_shop.promotion_roi_total_discount_given", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "total_discount_given", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_net_revenue_after_discount": { + "id": "model.jaffle_shop.promotion_roi_net_revenue_after_discount", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "net_revenue_after_discount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar": { + "id": "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "revenue_per_discount_dollar", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_order_month": { + "id": "model.jaffle_shop.gross_margin_order_month", + "table_id": "model.jaffle_shop.gross_margin", + "name": "order_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_store_id": { + "id": "model.jaffle_shop.gross_margin_store_id", + "table_id": "model.jaffle_shop.gross_margin", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_revenue": { + "id": "model.jaffle_shop.gross_margin_total_revenue", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_cost": { + "id": "model.jaffle_shop.gross_margin_total_cost", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_margin": { + "id": "model.jaffle_shop.gross_margin_total_margin", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_discounts": { + "id": "model.jaffle_shop.gross_margin_total_discounts", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_net_revenue": { + "id": "model.jaffle_shop.gross_margin_total_net_revenue", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_gross_margin_pct": { + "id": "model.jaffle_shop.gross_margin_gross_margin_pct", + "table_id": "model.jaffle_shop.gross_margin", + "name": "gross_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_orders": { + "id": "model.jaffle_shop.gross_margin_total_orders", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_order_id": { + "id": "model.jaffle_shop.order_fulfillment_order_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_customer_id": { + "id": "model.jaffle_shop.order_fulfillment_customer_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_order_date": { + "id": "model.jaffle_shop.order_fulfillment_order_date", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_status": { + "id": "model.jaffle_shop.order_fulfillment_status", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_amount": { + "id": "model.jaffle_shop.order_fulfillment_amount", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_store_id": { + "id": "model.jaffle_shop.order_fulfillment_store_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_store_name": { + "id": "model.jaffle_shop.order_fulfillment_store_name", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_city": { + "id": "model.jaffle_shop.order_fulfillment_city", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_state": { + "id": "model.jaffle_shop.order_fulfillment_state", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_store_employee_count": { + "id": "model.jaffle_shop.order_fulfillment_store_employee_count", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_employee_count", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_product_id": { + "id": "model.jaffle_shop.int_inventory_movements_product_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_store_id": { + "id": "model.jaffle_shop.int_inventory_movements_store_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_movement_date": { + "id": "model.jaffle_shop.int_inventory_movements_movement_date", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_quantity_in": { + "id": "model.jaffle_shop.int_inventory_movements_quantity_in", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "quantity_in", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_quantity_out": { + "id": "model.jaffle_shop.int_inventory_movements_quantity_out", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "quantity_out", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_movement_type": { + "id": "model.jaffle_shop.int_inventory_movements_movement_type", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_type", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_store_id": { + "id": "model.jaffle_shop.stg_stores_store_id", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_store_name": { + "id": "model.jaffle_shop.stg_stores_store_name", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_city": { + "id": "model.jaffle_shop.stg_stores_city", + "table_id": "model.jaffle_shop.stg_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_state": { + "id": "model.jaffle_shop.stg_stores_state", + "table_id": "model.jaffle_shop.stg_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_opened_at": { + "id": "model.jaffle_shop.stg_stores_opened_at", + "table_id": "model.jaffle_shop.stg_stores", + "name": "opened_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_name": { + "id": "seed.jaffle_shop.raw_promotions_name", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_discount_type": { + "id": "seed.jaffle_shop.raw_promotions_discount_type", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_discount_value": { + "id": "seed.jaffle_shop.raw_promotions_discount_value", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "discount_value", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_start_date": { + "id": "seed.jaffle_shop.raw_promotions_start_date", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "start_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_end_date": { + "id": "seed.jaffle_shop.raw_promotions_end_date", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "end_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_item_count": { + "id": "model.jaffle_shop.int_order_totals_item_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_total_quantity": { + "id": "model.jaffle_shop.int_order_totals_total_quantity", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_subtotal": { + "id": "model.jaffle_shop.int_order_totals_subtotal", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_total_cost": { + "id": "model.jaffle_shop.int_order_totals_total_cost", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_total_margin": { + "id": "model.jaffle_shop.int_order_totals_total_margin", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_category_count": { + "id": "model.jaffle_shop.int_order_totals_category_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "category_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_order_date": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_date", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_product_id": { + "id": "model.jaffle_shop.metric_product_sales_daily_product_id", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_product_name": { + "id": "model.jaffle_shop.metric_product_sales_daily_product_name", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_category_name": { + "id": "model.jaffle_shop.metric_product_sales_daily_category_name", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_units_sold": { + "id": "model.jaffle_shop.metric_product_sales_daily_units_sold", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "units_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_revenue": { + "id": "model.jaffle_shop.metric_product_sales_daily_revenue", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_margin": { + "id": "model.jaffle_shop.metric_product_sales_daily_margin", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_order_count": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_count", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_product_store_key": { + "id": "model.jaffle_shop.int_product_stock_levels_product_store_key", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_product_id": { + "id": "model.jaffle_shop.int_product_stock_levels_product_id", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_store_id": { + "id": "model.jaffle_shop.int_product_stock_levels_store_id", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_total_received": { + "id": "model.jaffle_shop.int_product_stock_levels_total_received", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "total_received", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_total_sold": { + "id": "model.jaffle_shop.int_product_stock_levels_total_sold", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "total_sold", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_current_stock": { + "id": "model.jaffle_shop.int_product_stock_levels_current_stock", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_last_restock_date": { + "id": "model.jaffle_shop.int_product_stock_levels_last_restock_date", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_last_sale_date": { + "id": "model.jaffle_shop.int_product_stock_levels_last_sale_date", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "last_sale_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_month_start": { + "id": "model.jaffle_shop.rpt_executive_dashboard_month_start", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "month_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_total_orders": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_orders", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_total_revenue": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_net_revenue": { + "id": "model.jaffle_shop.rpt_executive_dashboard_net_revenue", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_total_margin": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct": { + "id": "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "overall_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_total_items_sold": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_items_sold", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_executive_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_id": { + "id": "model.jaffle_shop.order_returns_order_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_customer_id": { + "id": "model.jaffle_shop.order_returns_customer_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_date": { + "id": "model.jaffle_shop.order_returns_order_date", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_credit_card_amount": { + "id": "model.jaffle_shop.order_returns_credit_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_coupon_amount": { + "id": "model.jaffle_shop.order_returns_coupon_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "coupon_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_bank_transfer_amount": { + "id": "model.jaffle_shop.order_returns_bank_transfer_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "bank_transfer_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_gift_card_amount": { + "id": "model.jaffle_shop.order_returns_gift_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_amount": { + "id": "model.jaffle_shop.order_returns_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_product_id": { + "id": "model.jaffle_shop.product_profitability_product_id", + "table_id": "model.jaffle_shop.product_profitability", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_product_name": { + "id": "model.jaffle_shop.product_profitability_product_name", + "table_id": "model.jaffle_shop.product_profitability", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_category_name": { + "id": "model.jaffle_shop.product_profitability_category_name", + "table_id": "model.jaffle_shop.product_profitability", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_total_revenue": { + "id": "model.jaffle_shop.product_profitability_total_revenue", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_gross_margin": { + "id": "model.jaffle_shop.product_profitability_gross_margin", + "table_id": "model.jaffle_shop.product_profitability", + "name": "gross_margin", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_total_supply_cost": { + "id": "model.jaffle_shop.product_profitability_total_supply_cost", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_supply_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_net_margin": { + "id": "model.jaffle_shop.product_profitability_net_margin", + "table_id": "model.jaffle_shop.product_profitability", + "name": "net_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_gross_margin_pct": { + "id": "model.jaffle_shop.product_profitability_gross_margin_pct", + "table_id": "model.jaffle_shop.product_profitability", + "name": "gross_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_total_quantity_sold": { + "id": "model.jaffle_shop.product_profitability_total_quantity_sold", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_total_supplied": { + "id": "model.jaffle_shop.product_profitability_total_supplied", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_supplied", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_avg_rating": { + "id": "model.jaffle_shop.product_profitability_avg_rating", + "table_id": "model.jaffle_shop.product_profitability", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_week_start": { + "id": "model.jaffle_shop.rpt_sales_dashboard_week_start", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "week_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_orders": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_orders", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_net_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_net_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_margin": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_discounts": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_discounts", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_items_sold": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_items_sold", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value": { + "id": "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "prev_week_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct": { + "id": "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "revenue_wow_growth_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_product_id": { + "id": "model.jaffle_shop.cost_analysis_product_id", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_product_name": { + "id": "model.jaffle_shop.cost_analysis_product_name", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_category_name": { + "id": "model.jaffle_shop.cost_analysis_category_name", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_total_revenue": { + "id": "model.jaffle_shop.cost_analysis_total_revenue", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_gross_margin": { + "id": "model.jaffle_shop.cost_analysis_gross_margin", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "gross_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_total_supply_spend": { + "id": "model.jaffle_shop.cost_analysis_total_supply_spend", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_supply_spend", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_avg_unit_cost": { + "id": "model.jaffle_shop.cost_analysis_avg_unit_cost", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "avg_unit_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_avg_lead_time": { + "id": "model.jaffle_shop.cost_analysis_avg_lead_time", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "avg_lead_time", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_supply_order_count": { + "id": "model.jaffle_shop.cost_analysis_supply_order_count", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "supply_order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_total_quantity_sold": { + "id": "model.jaffle_shop.cost_analysis_total_quantity_sold", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold": { + "id": "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "supply_cost_per_unit_sold", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_customer_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_customer_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_promotion_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_promotion_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_promotion_name": { + "id": "model.jaffle_shop.int_orders_with_promotions_promotion_name", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_discount_type": { + "id": "model.jaffle_shop.int_orders_with_promotions_discount_type", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_discount_value": { + "id": "model.jaffle_shop.int_orders_with_promotions_discount_value", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_has_promotion": { + "id": "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_supply_order_id": { + "id": "model.jaffle_shop.stg_supply_orders_supply_order_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_product_id": { + "id": "model.jaffle_shop.stg_supply_orders_product_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_store_id": { + "id": "model.jaffle_shop.stg_supply_orders_store_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_quantity": { + "id": "model.jaffle_shop.stg_supply_orders_quantity", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_order_date": { + "id": "model.jaffle_shop.stg_supply_orders_order_date", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_delivered_date": { + "id": "model.jaffle_shop.stg_supply_orders_delivered_date", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_category_id": { + "id": "model.jaffle_shop.product_categories_category_id", + "table_id": "model.jaffle_shop.product_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_category_name": { + "id": "model.jaffle_shop.product_categories_category_name", + "table_id": "model.jaffle_shop.product_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_parent_category_id": { + "id": "model.jaffle_shop.product_categories_parent_category_id", + "table_id": "model.jaffle_shop.product_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_root_category": { + "id": "model.jaffle_shop.product_categories_root_category", + "table_id": "model.jaffle_shop.product_categories", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_full_path": { + "id": "model.jaffle_shop.product_categories_full_path", + "table_id": "model.jaffle_shop.product_categories", + "name": "full_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_depth": { + "id": "model.jaffle_shop.product_categories_depth", + "table_id": "model.jaffle_shop.product_categories", + "name": "depth", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_product_count": { + "id": "model.jaffle_shop.product_categories_product_count", + "table_id": "model.jaffle_shop.product_categories", + "name": "product_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_employee_id": { + "id": "model.jaffle_shop.store_staffing_employee_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_first_name": { + "id": "model.jaffle_shop.store_staffing_first_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_last_name": { + "id": "model.jaffle_shop.store_staffing_last_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_role": { + "id": "model.jaffle_shop.store_staffing_role", + "table_id": "model.jaffle_shop.store_staffing", + "name": "role", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_hired_at": { + "id": "model.jaffle_shop.store_staffing_hired_at", + "table_id": "model.jaffle_shop.store_staffing", + "name": "hired_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_store_id": { + "id": "model.jaffle_shop.store_staffing_store_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_store_name": { + "id": "model.jaffle_shop.store_staffing_store_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_city": { + "id": "model.jaffle_shop.store_staffing_city", + "table_id": "model.jaffle_shop.store_staffing", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_state": { + "id": "model.jaffle_shop.store_staffing_state", + "table_id": "model.jaffle_shop.store_staffing", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_order_id": { + "id": "model.jaffle_shop.order_payment_status_order_id", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_order_subtotal": { + "id": "model.jaffle_shop.order_payment_status_order_subtotal", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "order_subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_total_paid": { + "id": "model.jaffle_shop.order_payment_status_total_paid", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_payment_count": { + "id": "model.jaffle_shop.order_payment_status_payment_count", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_payment_method_count": { + "id": "model.jaffle_shop.order_payment_status_payment_method_count", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_method_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_payment_status": { + "id": "model.jaffle_shop.order_payment_status_payment_status", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_payment_difference": { + "id": "model.jaffle_shop.order_payment_status_payment_difference", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_difference", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_week_start": { + "id": "model.jaffle_shop.metric_weekly_sales_week_start", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "week_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_orders": { + "id": "model.jaffle_shop.metric_weekly_sales_total_orders", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_revenue": { + "id": "model.jaffle_shop.metric_weekly_sales_total_revenue", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_net_revenue": { + "id": "model.jaffle_shop.metric_weekly_sales_net_revenue", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_margin": { + "id": "model.jaffle_shop.metric_weekly_sales_total_margin", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_discounts": { + "id": "model.jaffle_shop.metric_weekly_sales_total_discounts", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_customer_visits": { + "id": "model.jaffle_shop.metric_weekly_sales_total_customer_visits", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_customer_visits", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value": { + "id": "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_items_sold": { + "id": "model.jaffle_shop.metric_weekly_sales_total_items_sold", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_cohort_month": { + "id": "model.jaffle_shop.customer_cohorts_cohort_month", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_cohort_size": { + "id": "model.jaffle_shop.customer_cohorts_cohort_size", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders": { + "id": "model.jaffle_shop.customer_cohorts_avg_lifetime_orders", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_lifetime_orders", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_avg_tenure_days": { + "id": "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_item_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_item_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_product_id": { + "id": "model.jaffle_shop.int_order_items_enriched_product_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_product_name": { + "id": "model.jaffle_shop.int_order_items_enriched_product_name", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_category_name": { + "id": "model.jaffle_shop.int_order_items_enriched_category_name", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_root_category": { + "id": "model.jaffle_shop.int_order_items_enriched_root_category", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_category_path": { + "id": "model.jaffle_shop.int_order_items_enriched_category_path", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_quantity": { + "id": "model.jaffle_shop.int_order_items_enriched_quantity", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_unit_price": { + "id": "model.jaffle_shop.int_order_items_enriched_unit_price", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_total": { + "id": "model.jaffle_shop.int_order_items_enriched_line_total", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_cost": { + "id": "model.jaffle_shop.int_order_items_enriched_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_margin_pct": { + "id": "model.jaffle_shop.int_order_items_enriched_margin_pct", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_cost": { + "id": "model.jaffle_shop.int_order_items_enriched_line_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_margin": { + "id": "model.jaffle_shop.int_order_items_enriched_line_margin", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_store_id": { + "id": "model.jaffle_shop.stores_store_id", + "table_id": "model.jaffle_shop.stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_store_name": { + "id": "model.jaffle_shop.stores_store_name", + "table_id": "model.jaffle_shop.stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_city": { + "id": "model.jaffle_shop.stores_city", + "table_id": "model.jaffle_shop.stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_state": { + "id": "model.jaffle_shop.stores_state", + "table_id": "model.jaffle_shop.stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_total_employees": { + "id": "model.jaffle_shop.stores_total_employees", + "table_id": "model.jaffle_shop.stores", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_manager_count": { + "id": "model.jaffle_shop.stores_manager_count", + "table_id": "model.jaffle_shop.stores", + "name": "manager_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_barista_count": { + "id": "model.jaffle_shop.stores_barista_count", + "table_id": "model.jaffle_shop.stores", + "name": "barista_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_cashier_count": { + "id": "model.jaffle_shop.stores_cashier_count", + "table_id": "model.jaffle_shop.stores", + "name": "cashier_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_cook_count": { + "id": "model.jaffle_shop.stores_cook_count", + "table_id": "model.jaffle_shop.stores", + "name": "cook_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_earliest_hire": { + "id": "model.jaffle_shop.stores_earliest_hire", + "table_id": "model.jaffle_shop.stores", + "name": "earliest_hire", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_latest_hire": { + "id": "model.jaffle_shop.stores_latest_hire", + "table_id": "model.jaffle_shop.stores", + "name": "latest_hire", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_order_id": { + "id": "model.jaffle_shop.new_orders_order_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_customer_id": { + "id": "model.jaffle_shop.new_orders_customer_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_order_date": { + "id": "model.jaffle_shop.new_orders_order_date", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_status": { + "id": "model.jaffle_shop.new_orders_status", + "table_id": "model.jaffle_shop.new_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_customer_id": { + "id": "model.jaffle_shop.stg_customers_customer_id", + "table_id": "model.jaffle_shop.stg_customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_first_name": { + "id": "model.jaffle_shop.stg_customers_first_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_last_name": { + "id": "model.jaffle_shop.stg_customers_last_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_id": { + "id": "model.jaffle_shop.orders_order_id", + "table_id": "model.jaffle_shop.orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_customer_id": { + "id": "model.jaffle_shop.orders_customer_id", + "table_id": "model.jaffle_shop.orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_date": { + "id": "model.jaffle_shop.orders_order_date", + "table_id": "model.jaffle_shop.orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_credit_card_amount": { + "id": "model.jaffle_shop.orders_credit_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_coupon_amount": { + "id": "model.jaffle_shop.orders_coupon_amount", + "table_id": "model.jaffle_shop.orders", + "name": "coupon_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_bank_transfer_amount": { + "id": "model.jaffle_shop.orders_bank_transfer_amount", + "table_id": "model.jaffle_shop.orders", + "name": "bank_transfer_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_gift_card_amount": { + "id": "model.jaffle_shop.orders_gift_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_amount": { + "id": "model.jaffle_shop.orders_amount", + "table_id": "model.jaffle_shop.orders", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_product_id": { + "id": "model.jaffle_shop.products_product_id", + "table_id": "model.jaffle_shop.products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_product_name": { + "id": "model.jaffle_shop.products_product_name", + "table_id": "model.jaffle_shop.products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_category_id": { + "id": "model.jaffle_shop.products_category_id", + "table_id": "model.jaffle_shop.products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_category_name": { + "id": "model.jaffle_shop.products_category_name", + "table_id": "model.jaffle_shop.products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_root_category": { + "id": "model.jaffle_shop.products_root_category", + "table_id": "model.jaffle_shop.products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_category_path": { + "id": "model.jaffle_shop.products_category_path", + "table_id": "model.jaffle_shop.products", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_price": { + "id": "model.jaffle_shop.products_price", + "table_id": "model.jaffle_shop.products", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_cost": { + "id": "model.jaffle_shop.products_cost", + "table_id": "model.jaffle_shop.products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_margin": { + "id": "model.jaffle_shop.products_margin", + "table_id": "model.jaffle_shop.products", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_margin_pct": { + "id": "model.jaffle_shop.products_margin_pct", + "table_id": "model.jaffle_shop.products", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_created_at": { + "id": "model.jaffle_shop.products_created_at", + "table_id": "model.jaffle_shop.products", + "name": "created_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_name": { + "id": "model.jaffle_shop.stg_promotions_promotion_name", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_discount_type": { + "id": "model.jaffle_shop.stg_promotions_discount_type", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_discount_value": { + "id": "model.jaffle_shop.stg_promotions_discount_value", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_start_date": { + "id": "model.jaffle_shop.stg_promotions_start_date", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "start_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_end_date": { + "id": "model.jaffle_shop.stg_promotions_end_date", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "end_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_product_store_key": { + "id": "model.jaffle_shop.product_inventory_product_store_key", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_product_id": { + "id": "model.jaffle_shop.product_inventory_product_id", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_product_name": { + "id": "model.jaffle_shop.product_inventory_product_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_store_id": { + "id": "model.jaffle_shop.product_inventory_store_id", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_store_name": { + "id": "model.jaffle_shop.product_inventory_store_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_total_received": { + "id": "model.jaffle_shop.product_inventory_total_received", + "table_id": "model.jaffle_shop.product_inventory", + "name": "total_received", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_total_sold": { + "id": "model.jaffle_shop.product_inventory_total_sold", + "table_id": "model.jaffle_shop.product_inventory", + "name": "total_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_current_stock": { + "id": "model.jaffle_shop.product_inventory_current_stock", + "table_id": "model.jaffle_shop.product_inventory", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_last_restock_date": { + "id": "model.jaffle_shop.product_inventory_last_restock_date", + "table_id": "model.jaffle_shop.product_inventory", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_last_sale_date": { + "id": "model.jaffle_shop.product_inventory_last_sale_date", + "table_id": "model.jaffle_shop.product_inventory", + "name": "last_sale_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_stock_status": { + "id": "model.jaffle_shop.product_inventory_stock_status", + "table_id": "model.jaffle_shop.product_inventory", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_order_date": { + "id": "model.jaffle_shop.metric_daily_orders_order_date", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_total_orders": { + "id": "model.jaffle_shop.metric_daily_orders_total_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_completed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_completed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "completed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_returned_orders": { + "id": "model.jaffle_shop.metric_daily_orders_returned_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "returned_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_shipped_orders": { + "id": "model.jaffle_shop.metric_daily_orders_shipped_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "shipped_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_placed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_placed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "placed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_promoted_orders": { + "id": "model.jaffle_shop.metric_daily_orders_promoted_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "promoted_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_avg_items_per_order": { + "id": "model.jaffle_shop.metric_daily_orders_avg_items_per_order", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_product_id": { + "id": "model.jaffle_shop.product_reviews_product_id", + "table_id": "model.jaffle_shop.product_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_product_name": { + "id": "model.jaffle_shop.product_reviews_product_name", + "table_id": "model.jaffle_shop.product_reviews", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_category_name": { + "id": "model.jaffle_shop.product_reviews_category_name", + "table_id": "model.jaffle_shop.product_reviews", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_root_category": { + "id": "model.jaffle_shop.product_reviews_root_category", + "table_id": "model.jaffle_shop.product_reviews", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_review_count": { + "id": "model.jaffle_shop.product_reviews_review_count", + "table_id": "model.jaffle_shop.product_reviews", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_avg_rating": { + "id": "model.jaffle_shop.product_reviews_avg_rating", + "table_id": "model.jaffle_shop.product_reviews", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_positive_reviews": { + "id": "model.jaffle_shop.product_reviews_positive_reviews", + "table_id": "model.jaffle_shop.product_reviews", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_negative_reviews": { + "id": "model.jaffle_shop.product_reviews_negative_reviews", + "table_id": "model.jaffle_shop.product_reviews", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_rating_tier": { + "id": "model.jaffle_shop.product_reviews_rating_tier", + "table_id": "model.jaffle_shop.product_reviews", + "name": "rating_tier", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_positive_pct": { + "id": "model.jaffle_shop.product_reviews_positive_pct", + "table_id": "model.jaffle_shop.product_reviews", + "name": "positive_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_product_store_key": { + "id": "model.jaffle_shop.inventory_health_product_store_key", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_product_id": { + "id": "model.jaffle_shop.inventory_health_product_id", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_product_name": { + "id": "model.jaffle_shop.inventory_health_product_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_store_id": { + "id": "model.jaffle_shop.inventory_health_store_id", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_store_name": { + "id": "model.jaffle_shop.inventory_health_store_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_current_stock": { + "id": "model.jaffle_shop.inventory_health_current_stock", + "table_id": "model.jaffle_shop.inventory_health", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_stock_status": { + "id": "model.jaffle_shop.inventory_health_stock_status", + "table_id": "model.jaffle_shop.inventory_health", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_total_inbound": { + "id": "model.jaffle_shop.inventory_health_total_inbound", + "table_id": "model.jaffle_shop.inventory_health", + "name": "total_inbound", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_total_outbound": { + "id": "model.jaffle_shop.inventory_health_total_outbound", + "table_id": "model.jaffle_shop.inventory_health", + "name": "total_outbound", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_restock_events": { + "id": "model.jaffle_shop.inventory_health_restock_events", + "table_id": "model.jaffle_shop.inventory_health", + "name": "restock_events", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_sale_events": { + "id": "model.jaffle_shop.inventory_health_sale_events", + "table_id": "model.jaffle_shop.inventory_health", + "name": "sale_events", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_inventory_balance": { + "id": "model.jaffle_shop.inventory_health_inventory_balance", + "table_id": "model.jaffle_shop.inventory_health", + "name": "inventory_balance", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_avg_units_per_sale": { + "id": "model.jaffle_shop.inventory_health_avg_units_per_sale", + "table_id": "model.jaffle_shop.inventory_health", + "name": "avg_units_per_sale", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_id": { + "id": "seed.jaffle_shop.raw_reviews_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_order_id": { + "id": "seed.jaffle_shop.raw_reviews_order_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_product_id": { + "id": "seed.jaffle_shop.raw_reviews_product_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_customer_id": { + "id": "seed.jaffle_shop.raw_reviews_customer_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_rating": { + "id": "seed.jaffle_shop.raw_reviews_rating", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "rating", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_review_date": { + "id": "seed.jaffle_shop.raw_reviews_review_date", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "review_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_name": { + "id": "model.jaffle_shop.stg_categories_category_name", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_customer_id": { + "id": "model.jaffle_shop.int_customer_review_activity_customer_id", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_review_count": { + "id": "model.jaffle_shop.int_customer_review_activity_review_count", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_avg_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_avg_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_min_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_min_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "min_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_max_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_max_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "max_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_first_review_date": { + "id": "model.jaffle_shop.int_customer_review_activity_first_review_date", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "first_review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_last_review_date": { + "id": "model.jaffle_shop.int_customer_review_activity_last_review_date", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "last_review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_products_reviewed": { + "id": "model.jaffle_shop.int_customer_review_activity_products_reviewed", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "products_reviewed", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_item_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_item_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_name": { + "id": "model.jaffle_shop.int_order_items_with_products_product_name", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_category_name": { + "id": "model.jaffle_shop.int_order_items_with_products_category_name", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_root_category": { + "id": "model.jaffle_shop.int_order_items_with_products_root_category", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_category_path": { + "id": "model.jaffle_shop.int_order_items_with_products_category_path", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_quantity": { + "id": "model.jaffle_shop.int_order_items_with_products_quantity", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_unit_price": { + "id": "model.jaffle_shop.int_order_items_with_products_unit_price", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_line_total": { + "id": "model.jaffle_shop.int_order_items_with_products_line_total", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_id": { + "id": "model.jaffle_shop.customer_segments_final_customer_id", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_first_name": { + "id": "model.jaffle_shop.customer_segments_final_first_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_last_name": { + "id": "model.jaffle_shop.customer_segments_final_last_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_recency_score": { + "id": "model.jaffle_shop.customer_segments_final_recency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_frequency_score": { + "id": "model.jaffle_shop.customer_segments_final_frequency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_monetary_score": { + "id": "model.jaffle_shop.customer_segments_final_monetary_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "monetary_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_total_orders": { + "id": "model.jaffle_shop.customer_segments_final_total_orders", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_total_spent": { + "id": "model.jaffle_shop.customer_segments_final_total_spent", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_days_since_last_order": { + "id": "model.jaffle_shop.customer_segments_final_days_since_last_order", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_customer_id": { + "id": "model.jaffle_shop.int_customer_order_history_customer_id", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_first_name": { + "id": "model.jaffle_shop.int_customer_order_history_first_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_last_name": { + "id": "model.jaffle_shop.int_customer_order_history_last_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_orders": { + "id": "model.jaffle_shop.int_customer_order_history_total_orders", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_spent": { + "id": "model.jaffle_shop.int_customer_order_history_total_spent", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_margin_generated": { + "id": "model.jaffle_shop.int_customer_order_history_total_margin_generated", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_margin_generated", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_avg_order_value": { + "id": "model.jaffle_shop.int_customer_order_history_avg_order_value", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_items_purchased": { + "id": "model.jaffle_shop.int_customer_order_history_total_items_purchased", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_items_purchased", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_distinct_order_days": { + "id": "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "distinct_order_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_name": { + "id": "seed.jaffle_shop.raw_products_name", + "table_id": "seed.jaffle_shop.raw_products", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_price": { + "id": "seed.jaffle_shop.raw_products_price", + "table_id": "seed.jaffle_shop.raw_products", + "name": "price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_cost": { + "id": "seed.jaffle_shop.raw_products_cost", + "table_id": "seed.jaffle_shop.raw_products", + "name": "cost", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_created_at": { + "id": "seed.jaffle_shop.raw_products_created_at", + "table_id": "seed.jaffle_shop.raw_products", + "name": "created_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_product_id": { + "id": "model.jaffle_shop.int_product_ratings_product_id", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_product_name": { + "id": "model.jaffle_shop.int_product_ratings_product_name", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_category_name": { + "id": "model.jaffle_shop.int_product_ratings_category_name", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_root_category": { + "id": "model.jaffle_shop.int_product_ratings_root_category", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_review_count": { + "id": "model.jaffle_shop.int_product_ratings_review_count", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_avg_rating": { + "id": "model.jaffle_shop.int_product_ratings_avg_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_positive_reviews": { + "id": "model.jaffle_shop.int_product_ratings_positive_reviews", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_negative_reviews": { + "id": "model.jaffle_shop.int_product_ratings_negative_reviews", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_min_rating": { + "id": "model.jaffle_shop.int_product_ratings_min_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "min_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_max_rating": { + "id": "model.jaffle_shop.int_product_ratings_max_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "max_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_review_id": { + "id": "model.jaffle_shop.int_reviews_with_products_review_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "review_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_order_id": { + "id": "model.jaffle_shop.int_reviews_with_products_order_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_product_id": { + "id": "model.jaffle_shop.int_reviews_with_products_product_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_product_name": { + "id": "model.jaffle_shop.int_reviews_with_products_product_name", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_category_name": { + "id": "model.jaffle_shop.int_reviews_with_products_category_name", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_root_category": { + "id": "model.jaffle_shop.int_reviews_with_products_root_category", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_customer_id": { + "id": "model.jaffle_shop.int_reviews_with_products_customer_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_rating": { + "id": "model.jaffle_shop.int_reviews_with_products_rating", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "rating", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_review_date": { + "id": "model.jaffle_shop.int_reviews_with_products_review_date", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_id": { + "id": "model.jaffle_shop.int_customer_segments_customer_id", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_first_name": { + "id": "model.jaffle_shop.int_customer_segments_first_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_last_name": { + "id": "model.jaffle_shop.int_customer_segments_last_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_total_orders": { + "id": "model.jaffle_shop.int_customer_segments_total_orders", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_total_spent": { + "id": "model.jaffle_shop.int_customer_segments_total_spent", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_days_since_last_order": { + "id": "model.jaffle_shop.int_customer_segments_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_recency_score": { + "id": "model.jaffle_shop.int_customer_segments_recency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_frequency_score": { + "id": "model.jaffle_shop.int_customer_segments_frequency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_monetary_score": { + "id": "model.jaffle_shop.int_customer_segments_monetary_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "monetary_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_months_since_first", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retained_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retention_rate", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_store_id": { + "id": "model.jaffle_shop.int_store_performance_store_id", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_store_name": { + "id": "model.jaffle_shop.int_store_performance_store_name", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_city": { + "id": "model.jaffle_shop.int_store_performance_city", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_state": { + "id": "model.jaffle_shop.int_store_performance_state", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_total_employees": { + "id": "model.jaffle_shop.int_store_performance_total_employees", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_order_count": { + "id": "model.jaffle_shop.int_store_performance_order_count", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_unique_customers": { + "id": "model.jaffle_shop.int_store_performance_unique_customers", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_total_revenue": { + "id": "model.jaffle_shop.int_store_performance_total_revenue", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_total_margin": { + "id": "model.jaffle_shop.int_store_performance_total_margin", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_avg_order_value": { + "id": "model.jaffle_shop.int_store_performance_avg_order_value", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_revenue_per_employee": { + "id": "model.jaffle_shop.int_store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_orders_per_employee": { + "id": "model.jaffle_shop.int_store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_name": { + "id": "model.jaffle_shop.stg_products_product_name", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_price_cents": { + "id": "model.jaffle_shop.stg_products_price_cents", + "table_id": "model.jaffle_shop.stg_products", + "name": "price_cents", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_cost_cents": { + "id": "model.jaffle_shop.stg_products_cost_cents", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost_cents", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_price": { + "id": "model.jaffle_shop.stg_products_price", + "table_id": "model.jaffle_shop.stg_products", + "name": "price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_cost": { + "id": "model.jaffle_shop.stg_products_cost", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_created_at": { + "id": "model.jaffle_shop.stg_products_created_at", + "table_id": "model.jaffle_shop.stg_products", + "name": "created_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_store_id": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_id", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_store_name": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_name", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_city": { + "id": "model.jaffle_shop.rpt_store_dashboard_city", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_state": { + "id": "model.jaffle_shop.rpt_store_dashboard_state", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_total_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_total_margin": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_order_count": { + "id": "model.jaffle_shop.rpt_store_dashboard_order_count", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_unique_customers": { + "id": "model.jaffle_shop.rpt_store_dashboard_unique_customers", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_revenue_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_efficiency_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_total_stock_units": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_stock_units", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products": { + "id": "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "out_of_stock_products", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_low_stock_products": { + "id": "model.jaffle_shop.rpt_store_dashboard_low_stock_products", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "low_stock_products", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "avg_daily_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_order_date": { + "id": "model.jaffle_shop.int_daily_order_summary_order_date", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_order_count": { + "id": "model.jaffle_shop.int_daily_order_summary_order_count", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_unique_customers": { + "id": "model.jaffle_shop.int_daily_order_summary_unique_customers", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_revenue": { + "id": "model.jaffle_shop.int_daily_order_summary_total_revenue", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_cost": { + "id": "model.jaffle_shop.int_daily_order_summary_total_cost", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_margin": { + "id": "model.jaffle_shop.int_daily_order_summary_total_margin", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_items_sold": { + "id": "model.jaffle_shop.int_daily_order_summary_total_items_sold", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_promoted_orders": { + "id": "model.jaffle_shop.int_daily_order_summary_promoted_orders", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "promoted_orders", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_discounts": { + "id": "model.jaffle_shop.int_daily_order_summary_total_discounts", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_avg_order_value": { + "id": "model.jaffle_shop.int_daily_order_summary_avg_order_value", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_customer_id": { + "id": "model.jaffle_shop.int_customer_payment_methods_customer_id", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_credit_card_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_credit_card_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "credit_card_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "bank_transfer_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_coupon_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_coupon_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "coupon_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_gift_card_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_gift_card_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "gift_card_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method": { + "id": "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "preferred_payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_payment_id": { + "id": "model.jaffle_shop.stg_payments_payment_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_payment_method": { + "id": "model.jaffle_shop.stg_payments_payment_method", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_amount": { + "id": "model.jaffle_shop.stg_payments_amount", + "table_id": "model.jaffle_shop.stg_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_item_id": { + "id": "model.jaffle_shop.stg_order_items_order_item_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_quantity": { + "id": "model.jaffle_shop.stg_order_items_quantity", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_unit_price": { + "id": "model.jaffle_shop.stg_order_items_unit_price", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_order_date": { + "id": "model.jaffle_shop.metric_promotion_daily_order_date", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_promotion_name": { + "id": "model.jaffle_shop.metric_promotion_daily_promotion_name", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_discount_type": { + "id": "model.jaffle_shop.metric_promotion_daily_discount_type", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_usage_count": { + "id": "model.jaffle_shop.metric_promotion_daily_usage_count", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "usage_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_total_discount": { + "id": "model.jaffle_shop.metric_promotion_daily_total_discount", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_discount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_total_order_value": { + "id": "model.jaffle_shop.metric_promotion_daily_total_order_value", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_total_net_revenue": { + "id": "model.jaffle_shop.metric_promotion_daily_total_net_revenue", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_avg_discount_pct": { + "id": "model.jaffle_shop.metric_promotion_daily_avg_discount_pct", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "avg_discount_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_supply_order_id": { + "id": "model.jaffle_shop.int_supply_order_costs_supply_order_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_product_id": { + "id": "model.jaffle_shop.int_supply_order_costs_product_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_product_name": { + "id": "model.jaffle_shop.int_supply_order_costs_product_name", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_store_id": { + "id": "model.jaffle_shop.int_supply_order_costs_store_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_quantity": { + "id": "model.jaffle_shop.int_supply_order_costs_quantity", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_unit_cost": { + "id": "model.jaffle_shop.int_supply_order_costs_unit_cost", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "unit_cost", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_total_cost": { + "id": "model.jaffle_shop.int_supply_order_costs_total_cost", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_order_date": { + "id": "model.jaffle_shop.int_supply_order_costs_order_date", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_delivered_date": { + "id": "model.jaffle_shop.int_supply_order_costs_delivered_date", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_lead_time_days": { + "id": "model.jaffle_shop.int_supply_order_costs_lead_time_days", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "lead_time_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_order_date": { + "id": "model.jaffle_shop.metric_daily_revenue_order_date", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_order_count": { + "id": "model.jaffle_shop.metric_daily_revenue_order_count", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue_total_revenue", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_cost": { + "id": "model.jaffle_shop.metric_daily_revenue_total_cost", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_margin": { + "id": "model.jaffle_shop.metric_daily_revenue_total_margin", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_discounts": { + "id": "model.jaffle_shop.metric_daily_revenue_total_discounts", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_net_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue_net_revenue", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_avg_order_value": { + "id": "model.jaffle_shop.metric_daily_revenue_avg_order_value", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_unique_customers": { + "id": "model.jaffle_shop.metric_daily_revenue_unique_customers", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_items_sold": { + "id": "model.jaffle_shop.metric_daily_revenue_total_items_sold", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_customer_id": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_id", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_first_name": { + "id": "model.jaffle_shop.customer_lifetime_value_first_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_last_name": { + "id": "model.jaffle_shop.customer_lifetime_value_last_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_number_of_orders": { + "id": "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_total_revenue": { + "id": "model.jaffle_shop.customer_lifetime_value_total_revenue", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "total_revenue", + "type": "HUGEINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_first_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_first_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_last_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_last_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": { + "id": "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_monthly_value": { + "id": "model.jaffle_shop.customer_lifetime_value_monthly_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_avg_order_value": { + "id": "model.jaffle_shop.customer_lifetime_value_avg_order_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_price": { + "id": "model.jaffle_shop.int_product_margins_price", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_cost": { + "id": "model.jaffle_shop.int_product_margins_cost", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_margin": { + "id": "model.jaffle_shop.int_product_margins_margin", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_margin_pct": { + "id": "model.jaffle_shop.int_product_margins_margin_pct", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_store_id": { + "id": "model.jaffle_shop.store_inventory_store_id", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_store_name": { + "id": "model.jaffle_shop.store_inventory_store_name", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_unique_products": { + "id": "model.jaffle_shop.store_inventory_unique_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "unique_products", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_total_stock_units": { + "id": "model.jaffle_shop.store_inventory_total_stock_units", + "table_id": "model.jaffle_shop.store_inventory", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_out_of_stock_products": { + "id": "model.jaffle_shop.store_inventory_out_of_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "out_of_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_low_stock_products": { + "id": "model.jaffle_shop.store_inventory_low_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "low_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_adequate_stock_products": { + "id": "model.jaffle_shop.store_inventory_adequate_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "adequate_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_well_stocked_products": { + "id": "model.jaffle_shop.store_inventory_well_stocked_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "well_stocked_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_id": { + "id": "seed.jaffle_shop.raw_customers_id", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_first_name": { + "id": "seed.jaffle_shop.raw_customers_first_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_last_name": { + "id": "seed.jaffle_shop.raw_customers_last_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.order_discounts_order_id": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.order_discounts_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.order_discounts_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.order_discounts_subtotal": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.order_discounts_has_promotion": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.order_discounts_promotion_name": [ + "model.jaffle_shop.int_order_enriched_promotion_name" + ], + "model.jaffle_shop.order_discounts_discount_type": [ + "model.jaffle_shop.int_order_enriched_discount_type" + ], + "model.jaffle_shop.order_discounts_discount_value": [ + "model.jaffle_shop.int_order_enriched_discount_value" + ], + "model.jaffle_shop.order_discounts_discount_amount": [ + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.order_discounts_discount_pct_of_order": [ + "model.jaffle_shop.int_order_enriched_subtotal", + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.order_discounts_net_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal", + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.stg_employees": ["seed.jaffle_shop.raw_employees"], + "model.jaffle_shop.stg_employees_employee_id": [ + "seed.jaffle_shop.raw_employees_id" + ], + "model.jaffle_shop.stg_employees_store_id": [ + "seed.jaffle_shop.raw_employees_store_id" + ], + "model.jaffle_shop.stg_employees_first_name": [ + "seed.jaffle_shop.raw_employees_first_name" + ], + "model.jaffle_shop.stg_employees_last_name": [ + "seed.jaffle_shop.raw_employees_last_name" + ], + "model.jaffle_shop.stg_employees_role": [ + "seed.jaffle_shop.raw_employees_role" + ], + "model.jaffle_shop.stg_employees_hired_at": [ + "seed.jaffle_shop.raw_employees_hired_at" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_week": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_month": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.revenue_summary_order_count": [], + "model.jaffle_shop.revenue_summary_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.revenue_summary_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "model.jaffle_shop.revenue_summary_margin": [ + "model.jaffle_shop.int_order_enriched_total_margin" + ], + "model.jaffle_shop.revenue_summary_discounts": [ + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.revenue_summary_net_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal", + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "seed.jaffle_shop.raw_stores": [], + "seed.jaffle_shop.raw_stores_id": [], + "seed.jaffle_shop.raw_stores_name": [], + "seed.jaffle_shop.raw_stores_city": [], + "seed.jaffle_shop.raw_stores_state": [], + "seed.jaffle_shop.raw_stores_opened_at": [], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "model.jaffle_shop.int_store_revenue_unique_customers": [ + "model.jaffle_shop.int_store_order_assignments_customer_id" + ], + "model.jaffle_shop.int_store_revenue_total_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_store_revenue_total_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "model.jaffle_shop.int_store_revenue_total_margin": [ + "model.jaffle_shop.int_order_enriched_total_margin" + ], + "model.jaffle_shop.int_store_revenue_avg_order_value": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_subtotal": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_order_payments_matched_total_paid": [ + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.int_order_payments_matched_payment_count": [], + "model.jaffle_shop.int_order_payments_matched_payment_method_count": [ + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.int_order_payments_matched_payment_status": [ + "model.jaffle_shop.int_order_totals_subtotal", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.metric_inventory_daily": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.metric_inventory_daily_snapshot_date": [], + "model.jaffle_shop.metric_inventory_daily_total_products_tracked": [ + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.metric_inventory_daily_total_stores": [ + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.metric_inventory_daily_total_stock_units": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.metric_inventory_daily_out_of_stock_count": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.metric_inventory_daily_low_stock_count": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.metric_inventory_daily_adequate_count": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.metric_inventory_daily_well_stocked_count": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly": [ + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month": [ + "model.jaffle_shop.customer_cohorts_cohort_month" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers": [ + "model.jaffle_shop.customer_cohorts_cohort_size" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders": [ + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days": [ + "model.jaffle_shop.customer_cohorts_avg_tenure_days" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers": [ + "model.jaffle_shop.customer_cohorts_cohort_size", + "model.jaffle_shop.customer_cohorts_cohort_month" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_employees_store_id", + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_employees", + "model.jaffle_shop.stg_stores_state", + "model.jaffle_shop.stg_stores_city", + "model.jaffle_shop.stg_stores_store_name", + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.int_store_employees_active_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.int_store_employees_active_city": [ + "model.jaffle_shop.stg_stores_city" + ], + "model.jaffle_shop.int_store_employees_active_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "model.jaffle_shop.int_store_employees_active_total_employees": [], + "model.jaffle_shop.int_store_employees_active_manager_count": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.int_store_employees_active_barista_count": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.int_store_employees_active_cashier_count": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.int_store_employees_active_cook_count": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.int_store_employees_active_earliest_hire": [ + "model.jaffle_shop.stg_employees_hired_at" + ], + "model.jaffle_shop.int_store_employees_active_latest_hire": [ + "model.jaffle_shop.stg_employees_hired_at" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "seed.jaffle_shop.raw_orders_user_id" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.stg_reviews": ["seed.jaffle_shop.raw_reviews"], + "model.jaffle_shop.stg_reviews_review_id": [ + "seed.jaffle_shop.raw_reviews_id" + ], + "model.jaffle_shop.stg_reviews_order_id": [ + "seed.jaffle_shop.raw_reviews_order_id" + ], + "model.jaffle_shop.stg_reviews_product_id": [ + "seed.jaffle_shop.raw_reviews_product_id" + ], + "model.jaffle_shop.stg_reviews_customer_id": [ + "seed.jaffle_shop.raw_reviews_customer_id" + ], + "model.jaffle_shop.stg_reviews_rating": [ + "seed.jaffle_shop.raw_reviews_rating" + ], + "model.jaffle_shop.stg_reviews_review_date": [ + "seed.jaffle_shop.raw_reviews_review_date" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_customer_review_activity", + "model.jaffle_shop.customer_lifetime_value_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customer_segments_final_customer_id", + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_review_activity_customer_id", + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.customer_360_customer_id": [ + "model.jaffle_shop.customers_customer_id" + ], + "model.jaffle_shop.customer_360_first_name": [ + "model.jaffle_shop.customers_first_name" + ], + "model.jaffle_shop.customer_360_last_name": [ + "model.jaffle_shop.customers_last_name" + ], + "model.jaffle_shop.customer_360_first_order": [ + "model.jaffle_shop.customers_first_order" + ], + "model.jaffle_shop.customer_360_most_recent_order": [ + "model.jaffle_shop.customers_most_recent_order" + ], + "model.jaffle_shop.customer_360_number_of_orders": [ + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.customer_360_customer_lifetime_value": [ + "model.jaffle_shop.customers_customer_lifetime_value" + ], + "model.jaffle_shop.customer_360_monthly_value": [ + "model.jaffle_shop.customer_lifetime_value_monthly_value" + ], + "model.jaffle_shop.customer_360_avg_order_value": [ + "model.jaffle_shop.customer_lifetime_value_avg_order_value" + ], + "model.jaffle_shop.customer_360_customer_tenure_days": [ + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days" + ], + "model.jaffle_shop.customer_360_days_since_last_order": [ + "model.jaffle_shop.customer_lifetime_value_days_since_last_order" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.customer_360_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.customer_360_review_count": [ + "model.jaffle_shop.int_customer_review_activity_review_count" + ], + "model.jaffle_shop.customer_360_avg_review_rating": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating" + ], + "model.jaffle_shop.customer_360_months_active": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products_category_id", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_products_with_categories_product_name": [ + "model.jaffle_shop.stg_products_product_name" + ], + "model.jaffle_shop.int_products_with_categories_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_category_name": [ + "model.jaffle_shop.int_category_hierarchy_category_name" + ], + "model.jaffle_shop.int_products_with_categories_root_category": [ + "model.jaffle_shop.int_category_hierarchy_root_category" + ], + "model.jaffle_shop.int_products_with_categories_category_path": [ + "model.jaffle_shop.int_category_hierarchy_full_path" + ], + "model.jaffle_shop.int_products_with_categories_category_depth": [ + "model.jaffle_shop.int_category_hierarchy_depth" + ], + "model.jaffle_shop.int_products_with_categories_price": [ + "model.jaffle_shop.stg_products_price" + ], + "model.jaffle_shop.int_products_with_categories_cost": [ + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_products_with_categories_created_at": [ + "model.jaffle_shop.stg_products_created_at" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.metric_daily_revenue", + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.metric_monthly_sales_month_start": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.metric_monthly_sales_total_orders": [ + "model.jaffle_shop.metric_daily_revenue_order_count" + ], + "model.jaffle_shop.metric_monthly_sales_total_revenue": [ + "model.jaffle_shop.metric_daily_revenue_total_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_net_revenue": [ + "model.jaffle_shop.metric_daily_revenue_net_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_total_margin": [ + "model.jaffle_shop.metric_daily_revenue_total_margin" + ], + "model.jaffle_shop.metric_monthly_sales_total_discounts": [ + "model.jaffle_shop.metric_daily_revenue_total_discounts" + ], + "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value": [ + "model.jaffle_shop.metric_daily_revenue_avg_order_value" + ], + "model.jaffle_shop.metric_monthly_sales_total_items_sold": [ + "model.jaffle_shop.metric_daily_revenue_total_items_sold" + ], + "model.jaffle_shop.metric_monthly_sales_active_days": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories_category_id", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_name": [ + "model.jaffle_shop.stg_categories_category_name" + ], + "model.jaffle_shop.int_category_hierarchy_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_root_category": [ + "model.jaffle_shop.stg_categories_category_name" + ], + "model.jaffle_shop.int_category_hierarchy_full_path": [ + "model.jaffle_shop.stg_categories_category_name" + ], + "model.jaffle_shop.int_category_hierarchy_depth": [], + "seed.jaffle_shop.raw_employees": [], + "seed.jaffle_shop.raw_employees_id": [], + "seed.jaffle_shop.raw_employees_store_id": [], + "seed.jaffle_shop.raw_employees_first_name": [], + "seed.jaffle_shop.raw_employees_last_name": [], + "seed.jaffle_shop.raw_employees_role": [], + "seed.jaffle_shop.raw_employees_hired_at": [], + "model.jaffle_shop.order_items": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.order_items_order_item_id": [ + "model.jaffle_shop.int_order_items_enriched_order_item_id" + ], + "model.jaffle_shop.order_items_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.order_items_product_id": [ + "model.jaffle_shop.int_order_items_enriched_product_id" + ], + "model.jaffle_shop.order_items_product_name": [ + "model.jaffle_shop.int_order_items_enriched_product_name" + ], + "model.jaffle_shop.order_items_category_name": [ + "model.jaffle_shop.int_order_items_enriched_category_name" + ], + "model.jaffle_shop.order_items_root_category": [ + "model.jaffle_shop.int_order_items_enriched_root_category" + ], + "model.jaffle_shop.order_items_category_path": [ + "model.jaffle_shop.int_order_items_enriched_category_path" + ], + "model.jaffle_shop.order_items_quantity": [ + "model.jaffle_shop.int_order_items_enriched_quantity" + ], + "model.jaffle_shop.order_items_unit_price": [ + "model.jaffle_shop.int_order_items_enriched_unit_price" + ], + "model.jaffle_shop.order_items_line_total": [ + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.order_items_cost": [ + "model.jaffle_shop.int_order_items_enriched_cost" + ], + "model.jaffle_shop.order_items_margin_pct": [ + "model.jaffle_shop.int_order_items_enriched_margin_pct" + ], + "model.jaffle_shop.order_items_line_cost": [ + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.order_items_line_margin": [ + "model.jaffle_shop.int_order_items_enriched_line_margin" + ], + "model.jaffle_shop.reorder_recommendations": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.product_inventory_product_id", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.product_performance_product_id" + ], + "model.jaffle_shop.reorder_recommendations_product_id": [ + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.reorder_recommendations_product_name": [ + "model.jaffle_shop.product_inventory_product_name" + ], + "model.jaffle_shop.reorder_recommendations_store_id": [ + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.reorder_recommendations_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.reorder_recommendations_current_stock": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.reorder_recommendations_stock_status": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.reorder_recommendations_last_restock_date": [ + "model.jaffle_shop.product_inventory_last_restock_date" + ], + "model.jaffle_shop.reorder_recommendations_total_quantity_sold": [ + "model.jaffle_shop.product_performance_total_quantity_sold" + ], + "model.jaffle_shop.reorder_recommendations_times_ordered": [ + "model.jaffle_shop.product_performance_times_ordered" + ], + "model.jaffle_shop.reorder_recommendations_reorder_priority": [ + "model.jaffle_shop.product_inventory_stock_status", + "model.jaffle_shop.product_performance_times_ordered" + ], + "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "seed.jaffle_shop.raw_categories": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_name": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.int_orders_with_promotions_customer_id" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.int_order_enriched_item_count": [ + "model.jaffle_shop.int_order_totals_item_count" + ], + "model.jaffle_shop.int_order_enriched_total_quantity": [ + "model.jaffle_shop.int_order_totals_total_quantity" + ], + "model.jaffle_shop.int_order_enriched_subtotal": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_order_enriched_total_cost": [ + "model.jaffle_shop.int_order_totals_total_cost" + ], + "model.jaffle_shop.int_order_enriched_total_margin": [ + "model.jaffle_shop.int_order_totals_total_margin" + ], + "model.jaffle_shop.int_order_enriched_category_count": [ + "model.jaffle_shop.int_order_totals_category_count" + ], + "model.jaffle_shop.int_order_enriched_has_promotion": [ + "model.jaffle_shop.int_orders_with_promotions_has_promotion" + ], + "model.jaffle_shop.int_order_enriched_promotion_name": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_name" + ], + "model.jaffle_shop.int_order_enriched_discount_type": [ + "model.jaffle_shop.int_orders_with_promotions_discount_type" + ], + "model.jaffle_shop.int_order_enriched_discount_value": [ + "model.jaffle_shop.int_orders_with_promotions_discount_value" + ], + "model.jaffle_shop.int_order_enriched_total_paid": [ + "model.jaffle_shop.int_order_payments_matched_total_paid" + ], + "model.jaffle_shop.int_order_enriched_payment_count": [ + "model.jaffle_shop.int_order_payments_matched_payment_count" + ], + "model.jaffle_shop.int_order_enriched_payment_status": [ + "model.jaffle_shop.int_order_payments_matched_payment_status" + ], + "model.jaffle_shop.int_order_enriched_discount_amount": [ + "model.jaffle_shop.int_order_totals_subtotal", + "model.jaffle_shop.int_orders_with_promotions_discount_value", + "model.jaffle_shop.int_orders_with_promotions_discount_type" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.rpt_product_dashboard": [ + "model.jaffle_shop.product_performance" + ], + "model.jaffle_shop.rpt_product_dashboard_total_products": [], + "model.jaffle_shop.rpt_product_dashboard_total_product_revenue": [ + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating": [ + "model.jaffle_shop.product_performance_avg_rating" + ], + "model.jaffle_shop.rpt_product_dashboard_total_units_sold": [ + "model.jaffle_shop.product_performance_total_quantity_sold" + ], + "model.jaffle_shop.rpt_product_dashboard_never_ordered_products": [ + "model.jaffle_shop.product_performance_times_ordered" + ], + "model.jaffle_shop.rpt_product_dashboard_top_product_revenue": [ + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.rpt_product_dashboard_top_product_name": [ + "model.jaffle_shop.product_performance_total_revenue", + "model.jaffle_shop.product_performance_product_name" + ], + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.rpt_customer_dashboard_total_customers": [], + "model.jaffle_shop.rpt_customer_dashboard_active_customers": [ + "model.jaffle_shop.customer_360_number_of_orders" + ], + "model.jaffle_shop.rpt_customer_dashboard_avg_clv": [ + "model.jaffle_shop.customer_360_customer_lifetime_value" + ], + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer": [ + "model.jaffle_shop.customer_360_number_of_orders" + ], + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer": [ + "model.jaffle_shop.customer_360_review_count" + ], + "model.jaffle_shop.customer_acquisition": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.customer_acquisition_customer_id": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_acquisition_first_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_acquisition_acquired_via_promotion": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.customer_acquisition_acquisition_promotion": [ + "model.jaffle_shop.int_order_enriched_promotion_name" + ], + "model.jaffle_shop.customer_acquisition_first_order_value": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.customer_acquisition_first_order_items": [ + "model.jaffle_shop.int_order_enriched_item_count" + ], + "model.jaffle_shop.customer_acquisition_acquisition_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.product_performance": [ + "model.jaffle_shop.products_product_id", + "model.jaffle_shop.products", + "model.jaffle_shop.int_product_ratings", + "model.jaffle_shop.int_product_ratings_product_id", + "model.jaffle_shop.order_items", + "model.jaffle_shop.order_items_product_id" + ], + "model.jaffle_shop.product_performance_product_id": [ + "model.jaffle_shop.products_product_id" + ], + "model.jaffle_shop.product_performance_product_name": [ + "model.jaffle_shop.products_product_name" + ], + "model.jaffle_shop.product_performance_category_name": [ + "model.jaffle_shop.products_category_name" + ], + "model.jaffle_shop.product_performance_root_category": [ + "model.jaffle_shop.products_root_category" + ], + "model.jaffle_shop.product_performance_price": [ + "model.jaffle_shop.products_price" + ], + "model.jaffle_shop.product_performance_cost": [ + "model.jaffle_shop.products_cost" + ], + "model.jaffle_shop.product_performance_margin_pct": [ + "model.jaffle_shop.products_margin_pct" + ], + "model.jaffle_shop.product_performance_times_ordered": [], + "model.jaffle_shop.product_performance_total_quantity_sold": [ + "model.jaffle_shop.order_items_quantity" + ], + "model.jaffle_shop.product_performance_total_revenue": [ + "model.jaffle_shop.order_items_line_total" + ], + "model.jaffle_shop.product_performance_total_margin": [ + "model.jaffle_shop.order_items_line_margin" + ], + "model.jaffle_shop.product_performance_review_count": [ + "model.jaffle_shop.int_product_ratings_review_count" + ], + "model.jaffle_shop.product_performance_avg_rating": [ + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.product_performance_positive_reviews": [ + "model.jaffle_shop.int_product_ratings_positive_reviews" + ], + "model.jaffle_shop.product_performance_negative_reviews": [ + "model.jaffle_shop.int_product_ratings_negative_reviews" + ], + "model.jaffle_shop.supplier_lead_times": [ + "model.jaffle_shop.int_supply_order_costs_product_id", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.int_supply_order_costs_store_id", + "model.jaffle_shop.int_supply_order_costs_product_name" + ], + "model.jaffle_shop.supplier_lead_times_product_id": [ + "model.jaffle_shop.int_supply_order_costs_product_id" + ], + "model.jaffle_shop.supplier_lead_times_product_name": [ + "model.jaffle_shop.int_supply_order_costs_product_name" + ], + "model.jaffle_shop.supplier_lead_times_store_id": [ + "model.jaffle_shop.int_supply_order_costs_store_id" + ], + "model.jaffle_shop.supplier_lead_times_order_count": [], + "model.jaffle_shop.supplier_lead_times_avg_lead_time": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.supplier_lead_times_min_lead_time": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.supplier_lead_times_max_lead_time": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.supplier_lead_times_total_quantity": [ + "model.jaffle_shop.int_supply_order_costs_quantity" + ], + "model.jaffle_shop.supplier_lead_times_total_spend": [ + "model.jaffle_shop.int_supply_order_costs_total_cost" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_promotion_effectiveness": [ + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_orders_with_promotions_discount_type", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "model.jaffle_shop.int_orders_with_promotions_promotion_name" + ], + "model.jaffle_shop.int_promotion_effectiveness_has_promotion": [ + "model.jaffle_shop.int_orders_with_promotions_has_promotion" + ], + "model.jaffle_shop.int_promotion_effectiveness_promotion_name": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_name" + ], + "model.jaffle_shop.int_promotion_effectiveness_discount_type": [ + "model.jaffle_shop.int_orders_with_promotions_discount_type" + ], + "model.jaffle_shop.int_promotion_effectiveness_order_count": [], + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_promotion_effectiveness_total_revenue": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order": [ + "model.jaffle_shop.int_order_totals_item_count" + ], + "model.jaffle_shop.int_promotion_effectiveness_avg_margin": [ + "model.jaffle_shop.int_order_totals_total_margin" + ], + "model.jaffle_shop.payments_fact": [ + "model.jaffle_shop.orders_order_id", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.orders" + ], + "model.jaffle_shop.payments_fact_payment_id": [ + "model.jaffle_shop.stg_payments_payment_id" + ], + "model.jaffle_shop.payments_fact_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "model.jaffle_shop.payments_fact_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.payments_fact_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.payments_fact_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.payments_fact_amount": [ + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.payments_fact_order_status": [ + "model.jaffle_shop.orders_status" + ], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_order_items_id": [], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "seed.jaffle_shop.raw_order_items_quantity": [], + "seed.jaffle_shop.raw_order_items_unit_price": [], + "model.jaffle_shop.customer_review_summary": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating", + "model.jaffle_shop.int_customer_review_activity", + "model.jaffle_shop.int_product_ratings", + "model.jaffle_shop.int_product_ratings_product_id", + "model.jaffle_shop.stg_reviews", + "model.jaffle_shop.int_customer_review_activity_review_count", + "model.jaffle_shop.int_customer_review_activity_customer_id", + "model.jaffle_shop.stg_reviews_product_id", + "model.jaffle_shop.stg_reviews_customer_id", + "model.jaffle_shop.int_customer_review_activity_first_review_date", + "model.jaffle_shop.int_customer_review_activity_last_review_date", + "model.jaffle_shop.int_customer_review_activity_products_reviewed" + ], + "model.jaffle_shop.customer_review_summary_customer_id": [ + "model.jaffle_shop.int_customer_review_activity_customer_id" + ], + "model.jaffle_shop.customer_review_summary_review_count": [ + "model.jaffle_shop.int_customer_review_activity_review_count" + ], + "model.jaffle_shop.customer_review_summary_customer_avg_rating": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating" + ], + "model.jaffle_shop.customer_review_summary_products_reviewed": [ + "model.jaffle_shop.int_customer_review_activity_products_reviewed" + ], + "model.jaffle_shop.customer_review_summary_first_review_date": [ + "model.jaffle_shop.int_customer_review_activity_first_review_date" + ], + "model.jaffle_shop.customer_review_summary_last_review_date": [ + "model.jaffle_shop.int_customer_review_activity_last_review_date" + ], + "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed": [ + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.customer_review_summary_rating_tendency": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating", + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.stores_store_id", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.stores", + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.revenue_summary_order_date" + ], + "model.jaffle_shop.metric_store_daily_store_id": [ + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.metric_store_daily_store_name": [ + "model.jaffle_shop.stores_store_name" + ], + "model.jaffle_shop.metric_store_daily_city": [ + "model.jaffle_shop.stores_city" + ], + "model.jaffle_shop.metric_store_daily_order_count": [ + "model.jaffle_shop.revenue_summary_order_count" + ], + "model.jaffle_shop.metric_store_daily_revenue": [ + "model.jaffle_shop.revenue_summary_revenue" + ], + "model.jaffle_shop.metric_store_daily_cost": [ + "model.jaffle_shop.revenue_summary_cost" + ], + "model.jaffle_shop.metric_store_daily_margin": [ + "model.jaffle_shop.revenue_summary_margin" + ], + "model.jaffle_shop.metric_store_daily_discounts": [ + "model.jaffle_shop.revenue_summary_discounts" + ], + "model.jaffle_shop.metric_store_daily_net_revenue": [ + "model.jaffle_shop.revenue_summary_net_revenue" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.store_rankings_store_id": [ + "model.jaffle_shop.store_performance_store_id" + ], + "model.jaffle_shop.store_rankings_store_name": [ + "model.jaffle_shop.store_performance_store_name" + ], + "model.jaffle_shop.store_rankings_city": [ + "model.jaffle_shop.store_performance_city" + ], + "model.jaffle_shop.store_rankings_state": [ + "model.jaffle_shop.store_performance_state" + ], + "model.jaffle_shop.store_rankings_total_revenue": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.store_rankings_total_margin": [ + "model.jaffle_shop.store_performance_total_margin" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.store_rankings_unique_customers": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.store_rankings_revenue_per_employee": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_revenue_rank": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.store_rankings_margin_rank": [ + "model.jaffle_shop.store_performance_total_margin" + ], + "model.jaffle_shop.store_rankings_order_count_rank": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.store_rankings_efficiency_rank": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_customer_reach_rank": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.supply_orders_fact": [ + "model.jaffle_shop.int_supply_order_costs" + ], + "model.jaffle_shop.supply_orders_fact_supply_order_id": [ + "model.jaffle_shop.int_supply_order_costs_supply_order_id" + ], + "model.jaffle_shop.supply_orders_fact_product_id": [ + "model.jaffle_shop.int_supply_order_costs_product_id" + ], + "model.jaffle_shop.supply_orders_fact_product_name": [ + "model.jaffle_shop.int_supply_order_costs_product_name" + ], + "model.jaffle_shop.supply_orders_fact_store_id": [ + "model.jaffle_shop.int_supply_order_costs_store_id" + ], + "model.jaffle_shop.supply_orders_fact_quantity": [ + "model.jaffle_shop.int_supply_order_costs_quantity" + ], + "model.jaffle_shop.supply_orders_fact_unit_cost": [ + "model.jaffle_shop.int_supply_order_costs_unit_cost" + ], + "model.jaffle_shop.supply_orders_fact_total_cost": [ + "model.jaffle_shop.int_supply_order_costs_total_cost" + ], + "model.jaffle_shop.supply_orders_fact_order_date": [ + "model.jaffle_shop.int_supply_order_costs_order_date" + ], + "model.jaffle_shop.supply_orders_fact_delivered_date": [ + "model.jaffle_shop.int_supply_order_costs_delivered_date" + ], + "model.jaffle_shop.supply_orders_fact_lead_time_days": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders": [], + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "seed.jaffle_shop.raw_supply_orders": [], + "seed.jaffle_shop.raw_supply_orders_id": [], + "seed.jaffle_shop.raw_supply_orders_product_id": [], + "seed.jaffle_shop.raw_supply_orders_store_id": [], + "seed.jaffle_shop.raw_supply_orders_quantity": [], + "seed.jaffle_shop.raw_supply_orders_order_date": [], + "seed.jaffle_shop.raw_supply_orders_delivered_date": [], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.customer_retention_cohort_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_months_since_first": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_customers": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.store_performance_store_id": [ + "model.jaffle_shop.int_store_performance_store_id" + ], + "model.jaffle_shop.store_performance_store_name": [ + "model.jaffle_shop.int_store_performance_store_name" + ], + "model.jaffle_shop.store_performance_city": [ + "model.jaffle_shop.int_store_performance_city" + ], + "model.jaffle_shop.store_performance_state": [ + "model.jaffle_shop.int_store_performance_state" + ], + "model.jaffle_shop.store_performance_total_employees": [ + "model.jaffle_shop.int_store_performance_total_employees" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.int_store_performance_order_count" + ], + "model.jaffle_shop.store_performance_unique_customers": [ + "model.jaffle_shop.int_store_performance_unique_customers" + ], + "model.jaffle_shop.store_performance_total_revenue": [ + "model.jaffle_shop.int_store_performance_total_revenue" + ], + "model.jaffle_shop.store_performance_total_margin": [ + "model.jaffle_shop.int_store_performance_total_margin" + ], + "model.jaffle_shop.store_performance_avg_order_value": [ + "model.jaffle_shop.int_store_performance_avg_order_value" + ], + "model.jaffle_shop.store_performance_revenue_per_employee": [ + "model.jaffle_shop.int_store_performance_revenue_per_employee" + ], + "model.jaffle_shop.store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_orders_customer_id", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_customers", + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.customers_customer_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.customers_first_name": [ + "model.jaffle_shop.stg_customers_first_name" + ], + "model.jaffle_shop.customers_last_name": [ + "model.jaffle_shop.stg_customers_last_name" + ], + "model.jaffle_shop.customers_first_order": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.customers_most_recent_order": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.customers_number_of_orders": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.customers_customer_lifetime_value": [ + "model.jaffle_shop.stg_payments_amount" + ], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_payments_id": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_payment_method": [], + "seed.jaffle_shop.raw_payments_amount": [], + "model.jaffle_shop.promotion_roi": [ + "model.jaffle_shop.order_discounts", + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_promotion_effectiveness_promotion_name", + "model.jaffle_shop.int_promotion_effectiveness_has_promotion", + "model.jaffle_shop.order_discounts_promotion_name" + ], + "model.jaffle_shop.promotion_roi_promotion_name": [ + "model.jaffle_shop.int_promotion_effectiveness_promotion_name" + ], + "model.jaffle_shop.promotion_roi_discount_type": [ + "model.jaffle_shop.int_promotion_effectiveness_discount_type" + ], + "model.jaffle_shop.promotion_roi_order_count": [ + "model.jaffle_shop.int_promotion_effectiveness_order_count" + ], + "model.jaffle_shop.promotion_roi_avg_order_value": [ + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value" + ], + "model.jaffle_shop.promotion_roi_total_revenue": [ + "model.jaffle_shop.int_promotion_effectiveness_total_revenue" + ], + "model.jaffle_shop.promotion_roi_avg_margin": [ + "model.jaffle_shop.int_promotion_effectiveness_avg_margin" + ], + "model.jaffle_shop.promotion_roi_total_discount_given": [ + "model.jaffle_shop.order_discounts_discount_amount" + ], + "model.jaffle_shop.promotion_roi_net_revenue_after_discount": [ + "model.jaffle_shop.order_discounts_net_revenue" + ], + "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar": [ + "model.jaffle_shop.order_discounts_discount_amount", + "model.jaffle_shop.order_discounts_net_revenue" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.revenue_summary_order_month", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.gross_margin_order_month": [ + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.gross_margin_store_id": [ + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.gross_margin_total_revenue": [ + "model.jaffle_shop.revenue_summary_revenue" + ], + "model.jaffle_shop.gross_margin_total_cost": [ + "model.jaffle_shop.revenue_summary_cost" + ], + "model.jaffle_shop.gross_margin_total_margin": [ + "model.jaffle_shop.revenue_summary_margin" + ], + "model.jaffle_shop.gross_margin_total_discounts": [ + "model.jaffle_shop.revenue_summary_discounts" + ], + "model.jaffle_shop.gross_margin_total_net_revenue": [ + "model.jaffle_shop.revenue_summary_net_revenue" + ], + "model.jaffle_shop.gross_margin_gross_margin_pct": [ + "model.jaffle_shop.revenue_summary_margin", + "model.jaffle_shop.revenue_summary_revenue" + ], + "model.jaffle_shop.gross_margin_total_orders": [ + "model.jaffle_shop.revenue_summary_order_count" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.orders_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.orders", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.order_fulfillment_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.order_fulfillment_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.order_fulfillment_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.order_fulfillment_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_fulfillment_amount": [ + "model.jaffle_shop.orders_amount" + ], + "model.jaffle_shop.order_fulfillment_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.order_fulfillment_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.order_fulfillment_city": [ + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.order_fulfillment_state": [ + "model.jaffle_shop.int_store_employees_active_state" + ], + "model.jaffle_shop.order_fulfillment_store_employee_count": [ + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.stg_supply_orders", + "model.jaffle_shop.int_order_items_with_products_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "model.jaffle_shop.int_inventory_movements_product_id": [ + "model.jaffle_shop.stg_supply_orders_product_id", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_inventory_movements_store_id": [ + "model.jaffle_shop.stg_supply_orders_store_id", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_inventory_movements_movement_date": [ + "model.jaffle_shop.stg_supply_orders_delivered_date", + "model.jaffle_shop.int_store_order_assignments_order_date" + ], + "model.jaffle_shop.int_inventory_movements_quantity_in": [ + "model.jaffle_shop.stg_supply_orders_quantity" + ], + "model.jaffle_shop.int_inventory_movements_quantity_out": [ + "model.jaffle_shop.int_order_items_with_products_quantity" + ], + "model.jaffle_shop.int_inventory_movements_movement_type": [], + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "model.jaffle_shop.stg_stores_store_id": [ + "seed.jaffle_shop.raw_stores_id" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "seed.jaffle_shop.raw_stores_name" + ], + "model.jaffle_shop.stg_stores_city": ["seed.jaffle_shop.raw_stores_city"], + "model.jaffle_shop.stg_stores_state": [ + "seed.jaffle_shop.raw_stores_state" + ], + "model.jaffle_shop.stg_stores_opened_at": [ + "seed.jaffle_shop.raw_stores_opened_at" + ], + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_orders_user_id": [], + "seed.jaffle_shop.raw_orders_order_date": [], + "seed.jaffle_shop.raw_orders_status": [], + "seed.jaffle_shop.raw_promotions": [], + "seed.jaffle_shop.raw_promotions_id": [], + "seed.jaffle_shop.raw_promotions_name": [], + "seed.jaffle_shop.raw_promotions_discount_type": [], + "seed.jaffle_shop.raw_promotions_discount_value": [], + "seed.jaffle_shop.raw_promotions_start_date": [], + "seed.jaffle_shop.raw_promotions_end_date": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_totals_item_count": [], + "model.jaffle_shop.int_order_totals_total_quantity": [ + "model.jaffle_shop.int_order_items_enriched_quantity" + ], + "model.jaffle_shop.int_order_totals_subtotal": [ + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.int_order_totals_total_cost": [ + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.int_order_totals_total_margin": [ + "model.jaffle_shop.int_order_items_enriched_line_margin" + ], + "model.jaffle_shop.int_order_totals_category_count": [ + "model.jaffle_shop.int_order_items_enriched_root_category" + ], + "model.jaffle_shop.metric_product_sales_daily": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.order_items_product_name", + "model.jaffle_shop.order_items_category_name", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.order_items_order_id", + "model.jaffle_shop.order_items", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.order_items_product_id" + ], + "model.jaffle_shop.metric_product_sales_daily_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_product_sales_daily_product_id": [ + "model.jaffle_shop.order_items_product_id" + ], + "model.jaffle_shop.metric_product_sales_daily_product_name": [ + "model.jaffle_shop.order_items_product_name" + ], + "model.jaffle_shop.metric_product_sales_daily_category_name": [ + "model.jaffle_shop.order_items_category_name" + ], + "model.jaffle_shop.metric_product_sales_daily_units_sold": [ + "model.jaffle_shop.order_items_quantity" + ], + "model.jaffle_shop.metric_product_sales_daily_revenue": [ + "model.jaffle_shop.order_items_line_total" + ], + "model.jaffle_shop.metric_product_sales_daily_margin": [ + "model.jaffle_shop.order_items_line_margin" + ], + "model.jaffle_shop.metric_product_sales_daily_order_count": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.int_product_stock_levels_product_store_key": [], + "model.jaffle_shop.int_product_stock_levels_product_id": [], + "model.jaffle_shop.int_product_stock_levels_store_id": [], + "model.jaffle_shop.int_product_stock_levels_total_received": [], + "model.jaffle_shop.int_product_stock_levels_total_sold": [], + "model.jaffle_shop.int_product_stock_levels_current_stock": [], + "model.jaffle_shop.int_product_stock_levels_last_restock_date": [], + "model.jaffle_shop.int_product_stock_levels_last_sale_date": [], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.customer_segments_final_customer_segment", + "model.jaffle_shop.gross_margin" + ], + "model.jaffle_shop.rpt_executive_dashboard_month_start": [ + "model.jaffle_shop.metric_monthly_sales_month_start" + ], + "model.jaffle_shop.rpt_executive_dashboard_total_orders": [ + "model.jaffle_shop.metric_monthly_sales_total_orders" + ], + "model.jaffle_shop.rpt_executive_dashboard_total_revenue": [ + "model.jaffle_shop.metric_monthly_sales_total_revenue" + ], + "model.jaffle_shop.rpt_executive_dashboard_net_revenue": [ + "model.jaffle_shop.metric_monthly_sales_net_revenue" + ], + "model.jaffle_shop.rpt_executive_dashboard_total_margin": [ + "model.jaffle_shop.metric_monthly_sales_total_margin" + ], + "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct": [ + "model.jaffle_shop.gross_margin_total_margin", + "model.jaffle_shop.gross_margin_total_revenue" + ], + "model.jaffle_shop.rpt_executive_dashboard_total_items_sold": [ + "model.jaffle_shop.metric_monthly_sales_total_items_sold" + ], + "model.jaffle_shop.rpt_executive_dashboard_active_days": [ + "model.jaffle_shop.metric_monthly_sales_active_days" + ], + "model.jaffle_shop.order_returns": [ + "model.jaffle_shop.orders_status", + "model.jaffle_shop.orders" + ], + "model.jaffle_shop.order_returns_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.order_returns_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.order_returns_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.order_returns_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_returns_credit_card_amount": [ + "model.jaffle_shop.orders_credit_card_amount" + ], + "model.jaffle_shop.order_returns_coupon_amount": [ + "model.jaffle_shop.orders_coupon_amount" + ], + "model.jaffle_shop.order_returns_bank_transfer_amount": [ + "model.jaffle_shop.orders_bank_transfer_amount" + ], + "model.jaffle_shop.order_returns_gift_card_amount": [ + "model.jaffle_shop.orders_gift_card_amount" + ], + "model.jaffle_shop.order_returns_amount": [ + "model.jaffle_shop.orders_amount" + ], + "model.jaffle_shop.order_returns_return_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.product_profitability": [ + "model.jaffle_shop.int_supply_order_costs_product_id", + "model.jaffle_shop.product_performance", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.product_performance_product_id" + ], + "model.jaffle_shop.product_profitability_product_id": [ + "model.jaffle_shop.product_performance_product_id" + ], + "model.jaffle_shop.product_profitability_product_name": [ + "model.jaffle_shop.product_performance_product_name" + ], + "model.jaffle_shop.product_profitability_category_name": [ + "model.jaffle_shop.product_performance_category_name" + ], + "model.jaffle_shop.product_profitability_total_revenue": [ + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.product_profitability_gross_margin": [ + "model.jaffle_shop.product_performance_total_margin" + ], + "model.jaffle_shop.product_profitability_total_supply_cost": [ + "model.jaffle_shop.int_supply_order_costs_total_cost" + ], + "model.jaffle_shop.product_profitability_net_margin": [ + "model.jaffle_shop.int_supply_order_costs_total_cost", + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.product_profitability_gross_margin_pct": [ + "model.jaffle_shop.product_performance_total_margin", + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.product_profitability_total_quantity_sold": [ + "model.jaffle_shop.product_performance_total_quantity_sold" + ], + "model.jaffle_shop.product_profitability_total_supplied": [ + "model.jaffle_shop.int_supply_order_costs_quantity" + ], + "model.jaffle_shop.product_profitability_avg_rating": [ + "model.jaffle_shop.product_performance_avg_rating" + ], + "model.jaffle_shop.rpt_sales_dashboard": [ + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.rpt_sales_dashboard_week_start": [ + "model.jaffle_shop.metric_weekly_sales_week_start" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_orders": [ + "model.jaffle_shop.metric_weekly_sales_total_orders" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_revenue": [ + "model.jaffle_shop.metric_weekly_sales_total_revenue" + ], + "model.jaffle_shop.rpt_sales_dashboard_net_revenue": [ + "model.jaffle_shop.metric_weekly_sales_net_revenue" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_margin": [ + "model.jaffle_shop.metric_weekly_sales_total_margin" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_discounts": [ + "model.jaffle_shop.metric_weekly_sales_total_discounts" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_items_sold": [ + "model.jaffle_shop.metric_weekly_sales_total_items_sold" + ], + "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value": [ + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value" + ], + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue": [ + "model.jaffle_shop.metric_weekly_sales_week_start", + "model.jaffle_shop.metric_weekly_sales_total_revenue" + ], + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct": [ + "model.jaffle_shop.metric_weekly_sales_week_start", + "model.jaffle_shop.metric_weekly_sales_total_revenue" + ], + "model.jaffle_shop.cost_analysis": [ + "model.jaffle_shop.int_supply_order_costs_product_name", + "model.jaffle_shop.int_supply_order_costs_product_id", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.product_profitability_product_id", + "model.jaffle_shop.product_profitability" + ], + "model.jaffle_shop.cost_analysis_product_id": [ + "model.jaffle_shop.product_profitability_product_id" + ], + "model.jaffle_shop.cost_analysis_product_name": [ + "model.jaffle_shop.product_profitability_product_name" + ], + "model.jaffle_shop.cost_analysis_category_name": [ + "model.jaffle_shop.product_profitability_category_name" + ], + "model.jaffle_shop.cost_analysis_total_revenue": [ + "model.jaffle_shop.product_profitability_total_revenue" + ], + "model.jaffle_shop.cost_analysis_gross_margin": [ + "model.jaffle_shop.product_profitability_gross_margin" + ], + "model.jaffle_shop.cost_analysis_total_supply_spend": [ + "model.jaffle_shop.int_supply_order_costs_total_cost" + ], + "model.jaffle_shop.cost_analysis_avg_unit_cost": [ + "model.jaffle_shop.int_supply_order_costs_unit_cost" + ], + "model.jaffle_shop.cost_analysis_avg_lead_time": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.cost_analysis_supply_order_count": [], + "model.jaffle_shop.cost_analysis_total_quantity_sold": [ + "model.jaffle_shop.product_profitability_total_quantity_sold" + ], + "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold": [ + "model.jaffle_shop.int_supply_order_costs_total_cost", + "model.jaffle_shop.product_profitability_total_quantity_sold" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.int_orders_with_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_orders_with_promotions_promotion_name": [ + "model.jaffle_shop.stg_promotions_promotion_name" + ], + "model.jaffle_shop.int_orders_with_promotions_discount_type": [ + "model.jaffle_shop.stg_promotions_discount_type" + ], + "model.jaffle_shop.int_orders_with_promotions_discount_value": [ + "model.jaffle_shop.stg_promotions_discount_value" + ], + "model.jaffle_shop.int_orders_with_promotions_has_promotion": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_supply_orders": [ + "seed.jaffle_shop.raw_supply_orders" + ], + "model.jaffle_shop.stg_supply_orders_supply_order_id": [ + "seed.jaffle_shop.raw_supply_orders_id" + ], + "model.jaffle_shop.stg_supply_orders_product_id": [ + "seed.jaffle_shop.raw_supply_orders_product_id" + ], + "model.jaffle_shop.stg_supply_orders_store_id": [ + "seed.jaffle_shop.raw_supply_orders_store_id" + ], + "model.jaffle_shop.stg_supply_orders_quantity": [ + "seed.jaffle_shop.raw_supply_orders_quantity" + ], + "model.jaffle_shop.stg_supply_orders_order_date": [ + "seed.jaffle_shop.raw_supply_orders_order_date" + ], + "model.jaffle_shop.stg_supply_orders_delivered_date": [ + "seed.jaffle_shop.raw_supply_orders_delivered_date" + ], + "model.jaffle_shop.product_categories": [ + "model.jaffle_shop.stg_products_category_id", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.product_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id" + ], + "model.jaffle_shop.product_categories_category_name": [ + "model.jaffle_shop.int_category_hierarchy_category_name" + ], + "model.jaffle_shop.product_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy_parent_category_id" + ], + "model.jaffle_shop.product_categories_root_category": [ + "model.jaffle_shop.int_category_hierarchy_root_category" + ], + "model.jaffle_shop.product_categories_full_path": [ + "model.jaffle_shop.int_category_hierarchy_full_path" + ], + "model.jaffle_shop.product_categories_depth": [ + "model.jaffle_shop.int_category_hierarchy_depth" + ], + "model.jaffle_shop.product_categories_product_count": [], + "model.jaffle_shop.store_staffing": [ + "model.jaffle_shop.stg_employees_store_id", + "model.jaffle_shop.stg_stores_store_id", + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_employees" + ], + "model.jaffle_shop.store_staffing_employee_id": [ + "model.jaffle_shop.stg_employees_employee_id" + ], + "model.jaffle_shop.store_staffing_first_name": [ + "model.jaffle_shop.stg_employees_first_name" + ], + "model.jaffle_shop.store_staffing_last_name": [ + "model.jaffle_shop.stg_employees_last_name" + ], + "model.jaffle_shop.store_staffing_role": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.store_staffing_hired_at": [ + "model.jaffle_shop.stg_employees_hired_at" + ], + "model.jaffle_shop.store_staffing_store_id": [ + "model.jaffle_shop.stg_employees_store_id" + ], + "model.jaffle_shop.store_staffing_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.store_staffing_city": [ + "model.jaffle_shop.stg_stores_city" + ], + "model.jaffle_shop.store_staffing_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "model.jaffle_shop.order_payment_status": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.order_payment_status_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.order_payment_status_order_subtotal": [ + "model.jaffle_shop.int_order_payments_matched_order_subtotal" + ], + "model.jaffle_shop.order_payment_status_total_paid": [ + "model.jaffle_shop.int_order_payments_matched_total_paid" + ], + "model.jaffle_shop.order_payment_status_payment_count": [ + "model.jaffle_shop.int_order_payments_matched_payment_count" + ], + "model.jaffle_shop.order_payment_status_payment_method_count": [ + "model.jaffle_shop.int_order_payments_matched_payment_method_count" + ], + "model.jaffle_shop.order_payment_status_payment_status": [ + "model.jaffle_shop.int_order_payments_matched_payment_status" + ], + "model.jaffle_shop.order_payment_status_payment_difference": [ + "model.jaffle_shop.int_order_payments_matched_total_paid", + "model.jaffle_shop.int_order_payments_matched_order_subtotal" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.metric_daily_revenue", + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.metric_weekly_sales_week_start": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.metric_weekly_sales_total_orders": [ + "model.jaffle_shop.metric_daily_revenue_order_count" + ], + "model.jaffle_shop.metric_weekly_sales_total_revenue": [ + "model.jaffle_shop.metric_daily_revenue_total_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_net_revenue": [ + "model.jaffle_shop.metric_daily_revenue_net_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_total_margin": [ + "model.jaffle_shop.metric_daily_revenue_total_margin" + ], + "model.jaffle_shop.metric_weekly_sales_total_discounts": [ + "model.jaffle_shop.metric_daily_revenue_total_discounts" + ], + "model.jaffle_shop.metric_weekly_sales_total_customer_visits": [ + "model.jaffle_shop.metric_daily_revenue_unique_customers" + ], + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value": [ + "model.jaffle_shop.metric_daily_revenue_avg_order_value" + ], + "model.jaffle_shop.metric_weekly_sales_total_items_sold": [ + "model.jaffle_shop.metric_daily_revenue_total_items_sold" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_cohorts_cohort_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_cohorts_cohort_size": [], + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders": [ + "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders" + ], + "model.jaffle_shop.customer_cohorts_avg_tenure_days": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_item_id": [ + "model.jaffle_shop.int_order_items_with_products_order_item_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_order_items_enriched_product_id": [ + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_product_name": [ + "model.jaffle_shop.int_order_items_with_products_product_name" + ], + "model.jaffle_shop.int_order_items_enriched_category_name": [ + "model.jaffle_shop.int_order_items_with_products_category_name" + ], + "model.jaffle_shop.int_order_items_enriched_root_category": [ + "model.jaffle_shop.int_order_items_with_products_root_category" + ], + "model.jaffle_shop.int_order_items_enriched_category_path": [ + "model.jaffle_shop.int_order_items_with_products_category_path" + ], + "model.jaffle_shop.int_order_items_enriched_quantity": [ + "model.jaffle_shop.int_order_items_with_products_quantity" + ], + "model.jaffle_shop.int_order_items_enriched_unit_price": [ + "model.jaffle_shop.int_order_items_with_products_unit_price" + ], + "model.jaffle_shop.int_order_items_enriched_line_total": [ + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_order_items_enriched_cost": [ + "model.jaffle_shop.int_product_margins_cost" + ], + "model.jaffle_shop.int_order_items_enriched_margin_pct": [ + "model.jaffle_shop.int_product_margins_margin_pct" + ], + "model.jaffle_shop.int_order_items_enriched_line_cost": [ + "model.jaffle_shop.int_product_margins_cost", + "model.jaffle_shop.int_order_items_with_products_quantity" + ], + "model.jaffle_shop.int_order_items_enriched_line_margin": [ + "model.jaffle_shop.int_product_margins_cost", + "model.jaffle_shop.int_order_items_with_products_line_total", + "model.jaffle_shop.int_order_items_with_products_quantity" + ], + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stores_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id" + ], + "model.jaffle_shop.stores_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.stores_city": [ + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.stores_state": [ + "model.jaffle_shop.int_store_employees_active_state" + ], + "model.jaffle_shop.stores_total_employees": [ + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "model.jaffle_shop.stores_manager_count": [ + "model.jaffle_shop.int_store_employees_active_manager_count" + ], + "model.jaffle_shop.stores_barista_count": [ + "model.jaffle_shop.int_store_employees_active_barista_count" + ], + "model.jaffle_shop.stores_cashier_count": [ + "model.jaffle_shop.int_store_employees_active_cashier_count" + ], + "model.jaffle_shop.stores_cook_count": [ + "model.jaffle_shop.int_store_employees_active_cook_count" + ], + "model.jaffle_shop.stores_earliest_hire": [ + "model.jaffle_shop.int_store_employees_active_earliest_hire" + ], + "model.jaffle_shop.stores_latest_hire": [ + "model.jaffle_shop.int_store_employees_active_latest_hire" + ], + "model.jaffle_shop.new_orders": ["model.jaffle_shop.stg_orders"], + "model.jaffle_shop.new_orders_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.new_orders_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.new_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.new_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "model.jaffle_shop.stg_customers": ["seed.jaffle_shop.raw_customers"], + "model.jaffle_shop.stg_customers_customer_id": [ + "seed.jaffle_shop.raw_customers_id" + ], + "model.jaffle_shop.stg_customers_first_name": [ + "seed.jaffle_shop.raw_customers_first_name" + ], + "model.jaffle_shop.stg_customers_last_name": [ + "seed.jaffle_shop.raw_customers_last_name" + ], + "model.jaffle_shop.orders": [ + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_payments" + ], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.orders_credit_card_amount": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.orders_coupon_amount": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.orders_bank_transfer_amount": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.orders_gift_card_amount": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.orders_amount": [ + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.products": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.products_product_id": [ + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.products_product_name": [ + "model.jaffle_shop.int_products_with_categories_product_name" + ], + "model.jaffle_shop.products_category_id": [ + "model.jaffle_shop.int_products_with_categories_category_id" + ], + "model.jaffle_shop.products_category_name": [ + "model.jaffle_shop.int_products_with_categories_category_name" + ], + "model.jaffle_shop.products_root_category": [ + "model.jaffle_shop.int_products_with_categories_root_category" + ], + "model.jaffle_shop.products_category_path": [ + "model.jaffle_shop.int_products_with_categories_category_path" + ], + "model.jaffle_shop.products_price": [ + "model.jaffle_shop.int_products_with_categories_price" + ], + "model.jaffle_shop.products_cost": [ + "model.jaffle_shop.int_products_with_categories_cost" + ], + "model.jaffle_shop.products_margin": [ + "model.jaffle_shop.int_product_margins_margin" + ], + "model.jaffle_shop.products_margin_pct": [ + "model.jaffle_shop.int_product_margins_margin_pct" + ], + "model.jaffle_shop.products_created_at": [ + "model.jaffle_shop.int_products_with_categories_created_at" + ], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.stg_promotions_promotion_name": [ + "seed.jaffle_shop.raw_promotions_name" + ], + "model.jaffle_shop.stg_promotions_discount_type": [ + "seed.jaffle_shop.raw_promotions_discount_type" + ], + "model.jaffle_shop.stg_promotions_discount_value": [ + "seed.jaffle_shop.raw_promotions_discount_value" + ], + "model.jaffle_shop.stg_promotions_start_date": [ + "seed.jaffle_shop.raw_promotions_start_date" + ], + "model.jaffle_shop.stg_promotions_end_date": [ + "seed.jaffle_shop.raw_promotions_end_date" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.int_product_stock_levels", + "model.jaffle_shop.stg_products_product_id", + "model.jaffle_shop.int_product_stock_levels_store_id", + "model.jaffle_shop.stg_products", + "model.jaffle_shop.stg_stores_store_id", + "model.jaffle_shop.int_product_stock_levels_product_id" + ], + "model.jaffle_shop.product_inventory_product_store_key": [ + "model.jaffle_shop.int_product_stock_levels_product_store_key" + ], + "model.jaffle_shop.product_inventory_product_id": [ + "model.jaffle_shop.int_product_stock_levels_product_id" + ], + "model.jaffle_shop.product_inventory_product_name": [ + "model.jaffle_shop.stg_products_product_name" + ], + "model.jaffle_shop.product_inventory_store_id": [ + "model.jaffle_shop.int_product_stock_levels_store_id" + ], + "model.jaffle_shop.product_inventory_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.product_inventory_total_received": [ + "model.jaffle_shop.int_product_stock_levels_total_received" + ], + "model.jaffle_shop.product_inventory_total_sold": [ + "model.jaffle_shop.int_product_stock_levels_total_sold" + ], + "model.jaffle_shop.product_inventory_current_stock": [ + "model.jaffle_shop.int_product_stock_levels_current_stock" + ], + "model.jaffle_shop.product_inventory_last_restock_date": [ + "model.jaffle_shop.int_product_stock_levels_last_restock_date" + ], + "model.jaffle_shop.product_inventory_last_sale_date": [ + "model.jaffle_shop.int_product_stock_levels_last_sale_date" + ], + "model.jaffle_shop.product_inventory_stock_status": [ + "model.jaffle_shop.int_product_stock_levels_current_stock" + ], + "model.jaffle_shop.metric_daily_orders": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_daily_orders_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_daily_orders_total_orders": [], + "model.jaffle_shop.metric_daily_orders_completed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_returned_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_shipped_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_placed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_promoted_orders": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.metric_daily_orders_avg_items_per_order": [ + "model.jaffle_shop.int_order_enriched_item_count" + ], + "model.jaffle_shop.product_reviews": [ + "model.jaffle_shop.int_product_ratings" + ], + "model.jaffle_shop.product_reviews_product_id": [ + "model.jaffle_shop.int_product_ratings_product_id" + ], + "model.jaffle_shop.product_reviews_product_name": [ + "model.jaffle_shop.int_product_ratings_product_name" + ], + "model.jaffle_shop.product_reviews_category_name": [ + "model.jaffle_shop.int_product_ratings_category_name" + ], + "model.jaffle_shop.product_reviews_root_category": [ + "model.jaffle_shop.int_product_ratings_root_category" + ], + "model.jaffle_shop.product_reviews_review_count": [ + "model.jaffle_shop.int_product_ratings_review_count" + ], + "model.jaffle_shop.product_reviews_avg_rating": [ + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.product_reviews_positive_reviews": [ + "model.jaffle_shop.int_product_ratings_positive_reviews" + ], + "model.jaffle_shop.product_reviews_negative_reviews": [ + "model.jaffle_shop.int_product_ratings_negative_reviews" + ], + "model.jaffle_shop.product_reviews_rating_tier": [ + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.product_reviews_positive_pct": [ + "model.jaffle_shop.int_product_ratings_positive_reviews", + "model.jaffle_shop.int_product_ratings_review_count" + ], + "model.jaffle_shop.inventory_health": [ + "model.jaffle_shop.product_inventory_store_id", + "model.jaffle_shop.product_inventory_product_id", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_inventory_movements_product_id", + "model.jaffle_shop.int_inventory_movements_store_id", + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.inventory_health_product_store_key": [ + "model.jaffle_shop.product_inventory_product_store_key" + ], + "model.jaffle_shop.inventory_health_product_id": [ + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.inventory_health_product_name": [ + "model.jaffle_shop.product_inventory_product_name" + ], + "model.jaffle_shop.inventory_health_store_id": [ + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.inventory_health_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.inventory_health_current_stock": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.inventory_health_stock_status": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.inventory_health_total_inbound": [ + "model.jaffle_shop.int_inventory_movements_quantity_in" + ], + "model.jaffle_shop.inventory_health_total_outbound": [ + "model.jaffle_shop.int_inventory_movements_quantity_out" + ], + "model.jaffle_shop.inventory_health_restock_events": [ + "model.jaffle_shop.int_inventory_movements_movement_type" + ], + "model.jaffle_shop.inventory_health_sale_events": [ + "model.jaffle_shop.int_inventory_movements_movement_type" + ], + "model.jaffle_shop.inventory_health_inventory_balance": [ + "model.jaffle_shop.int_inventory_movements_quantity_out", + "model.jaffle_shop.int_inventory_movements_quantity_in", + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.inventory_health_avg_units_per_sale": [ + "model.jaffle_shop.int_inventory_movements_quantity_out", + "model.jaffle_shop.int_inventory_movements_movement_type" + ], + "seed.jaffle_shop.raw_reviews": [], + "seed.jaffle_shop.raw_reviews_id": [], + "seed.jaffle_shop.raw_reviews_order_id": [], + "seed.jaffle_shop.raw_reviews_product_id": [], + "seed.jaffle_shop.raw_reviews_customer_id": [], + "seed.jaffle_shop.raw_reviews_rating": [], + "seed.jaffle_shop.raw_reviews_review_date": [], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_category_name": [ + "seed.jaffle_shop.raw_categories_name" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.int_customer_review_activity": [ + "model.jaffle_shop.stg_reviews_customer_id", + "model.jaffle_shop.stg_reviews" + ], + "model.jaffle_shop.int_customer_review_activity_customer_id": [ + "model.jaffle_shop.stg_reviews_customer_id" + ], + "model.jaffle_shop.int_customer_review_activity_review_count": [], + "model.jaffle_shop.int_customer_review_activity_avg_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "model.jaffle_shop.int_customer_review_activity_min_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "model.jaffle_shop.int_customer_review_activity_max_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "model.jaffle_shop.int_customer_review_activity_first_review_date": [ + "model.jaffle_shop.stg_reviews_review_date" + ], + "model.jaffle_shop.int_customer_review_activity_last_review_date": [ + "model.jaffle_shop.stg_reviews_review_date" + ], + "model.jaffle_shop.int_customer_review_activity_products_reviewed": [ + "model.jaffle_shop.stg_reviews_product_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_order_items_with_products_order_item_id": [ + "model.jaffle_shop.stg_order_items_order_item_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_name": [ + "model.jaffle_shop.int_products_with_categories_product_name" + ], + "model.jaffle_shop.int_order_items_with_products_category_name": [ + "model.jaffle_shop.int_products_with_categories_category_name" + ], + "model.jaffle_shop.int_order_items_with_products_root_category": [ + "model.jaffle_shop.int_products_with_categories_root_category" + ], + "model.jaffle_shop.int_order_items_with_products_category_path": [ + "model.jaffle_shop.int_products_with_categories_category_path" + ], + "model.jaffle_shop.int_order_items_with_products_quantity": [ + "model.jaffle_shop.stg_order_items_quantity" + ], + "model.jaffle_shop.int_order_items_with_products_unit_price": [ + "model.jaffle_shop.stg_order_items_unit_price" + ], + "model.jaffle_shop.int_order_items_with_products_line_total": [ + "model.jaffle_shop.stg_order_items_quantity", + "model.jaffle_shop.stg_order_items_unit_price" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.customer_segments_final_customer_id": [ + "model.jaffle_shop.int_customer_segments_customer_id" + ], + "model.jaffle_shop.customer_segments_final_first_name": [ + "model.jaffle_shop.int_customer_segments_first_name" + ], + "model.jaffle_shop.customer_segments_final_last_name": [ + "model.jaffle_shop.int_customer_segments_last_name" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_segments_final_recency_score": [ + "model.jaffle_shop.int_customer_segments_recency_score" + ], + "model.jaffle_shop.customer_segments_final_frequency_score": [ + "model.jaffle_shop.int_customer_segments_frequency_score" + ], + "model.jaffle_shop.customer_segments_final_monetary_score": [ + "model.jaffle_shop.int_customer_segments_monetary_score" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.int_customer_segments_rfm_total" + ], + "model.jaffle_shop.customer_segments_final_total_orders": [ + "model.jaffle_shop.int_customer_segments_total_orders" + ], + "model.jaffle_shop.customer_segments_final_total_spent": [ + "model.jaffle_shop.int_customer_segments_total_spent" + ], + "model.jaffle_shop.customer_segments_final_days_since_last_order": [ + "model.jaffle_shop.int_customer_segments_days_since_last_order" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.stg_customers_first_name", + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.stg_customers_last_name", + "model.jaffle_shop.stg_customers", + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.int_customer_order_history_customer_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.int_customer_order_history_first_name": [ + "model.jaffle_shop.stg_customers_first_name" + ], + "model.jaffle_shop.int_customer_order_history_last_name": [ + "model.jaffle_shop.stg_customers_last_name" + ], + "model.jaffle_shop.int_customer_order_history_total_orders": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_customer_order_history_total_spent": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_customer_order_history_total_margin_generated": [ + "model.jaffle_shop.int_order_enriched_total_margin" + ], + "model.jaffle_shop.int_customer_order_history_avg_order_value": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_customer_order_history_total_items_purchased": [ + "model.jaffle_shop.int_order_enriched_total_quantity" + ], + "model.jaffle_shop.int_customer_order_history_distinct_order_days": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "seed.jaffle_shop.raw_products": [], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_name": [], + "seed.jaffle_shop.raw_products_category_id": [], + "seed.jaffle_shop.raw_products_price": [], + "seed.jaffle_shop.raw_products_cost": [], + "seed.jaffle_shop.raw_products_created_at": [], + "model.jaffle_shop.int_product_ratings": [ + "model.jaffle_shop.int_reviews_with_products_product_name", + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.int_reviews_with_products_root_category", + "model.jaffle_shop.int_reviews_with_products_category_name", + "model.jaffle_shop.int_reviews_with_products_product_id" + ], + "model.jaffle_shop.int_product_ratings_product_id": [ + "model.jaffle_shop.int_reviews_with_products_product_id" + ], + "model.jaffle_shop.int_product_ratings_product_name": [ + "model.jaffle_shop.int_reviews_with_products_product_name" + ], + "model.jaffle_shop.int_product_ratings_category_name": [ + "model.jaffle_shop.int_reviews_with_products_category_name" + ], + "model.jaffle_shop.int_product_ratings_root_category": [ + "model.jaffle_shop.int_reviews_with_products_root_category" + ], + "model.jaffle_shop.int_product_ratings_review_count": [], + "model.jaffle_shop.int_product_ratings_avg_rating": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_product_ratings_positive_reviews": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_product_ratings_negative_reviews": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_product_ratings_min_rating": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_product_ratings_max_rating": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_reviews_with_products": [ + "model.jaffle_shop.stg_reviews_product_id", + "model.jaffle_shop.stg_reviews", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_reviews_with_products_review_id": [ + "model.jaffle_shop.stg_reviews_review_id" + ], + "model.jaffle_shop.int_reviews_with_products_order_id": [ + "model.jaffle_shop.stg_reviews_order_id" + ], + "model.jaffle_shop.int_reviews_with_products_product_id": [ + "model.jaffle_shop.stg_reviews_product_id" + ], + "model.jaffle_shop.int_reviews_with_products_product_name": [ + "model.jaffle_shop.int_products_with_categories_product_name" + ], + "model.jaffle_shop.int_reviews_with_products_category_name": [ + "model.jaffle_shop.int_products_with_categories_category_name" + ], + "model.jaffle_shop.int_reviews_with_products_root_category": [ + "model.jaffle_shop.int_products_with_categories_root_category" + ], + "model.jaffle_shop.int_reviews_with_products_customer_id": [ + "model.jaffle_shop.stg_reviews_customer_id" + ], + "model.jaffle_shop.int_reviews_with_products_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "model.jaffle_shop.int_reviews_with_products_review_date": [ + "model.jaffle_shop.stg_reviews_review_date" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_customer_order_history_customer_id", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_order_history" + ], + "model.jaffle_shop.int_customer_segments_customer_id": [ + "model.jaffle_shop.int_customer_order_history_customer_id" + ], + "model.jaffle_shop.int_customer_segments_first_name": [ + "model.jaffle_shop.int_customer_order_history_first_name" + ], + "model.jaffle_shop.int_customer_segments_last_name": [ + "model.jaffle_shop.int_customer_order_history_last_name" + ], + "model.jaffle_shop.int_customer_segments_total_orders": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_total_spent": [ + "model.jaffle_shop.int_customer_order_history_total_spent" + ], + "model.jaffle_shop.int_customer_segments_days_since_last_order": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_recency_score": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_frequency_score": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_monetary_score": [ + "model.jaffle_shop.int_customer_order_history_total_spent" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_customer_order_history_total_spent", + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_customer_order_history_total_spent", + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.metric_customer_retention_monthly": [ + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_retention_months_since_first", + "model.jaffle_shop.customer_retention_cohort_month" + ], + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month": [ + "model.jaffle_shop.customer_retention_cohort_month" + ], + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first": [ + "model.jaffle_shop.customer_retention_months_since_first" + ], + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_revenue_store_id", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_performance_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id" + ], + "model.jaffle_shop.int_store_performance_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.int_store_performance_city": [ + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.int_store_performance_state": [ + "model.jaffle_shop.int_store_employees_active_state" + ], + "model.jaffle_shop.int_store_performance_total_employees": [ + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.int_store_performance_unique_customers": [ + "model.jaffle_shop.int_store_revenue_unique_customers" + ], + "model.jaffle_shop.int_store_performance_total_revenue": [ + "model.jaffle_shop.int_store_revenue_total_revenue" + ], + "model.jaffle_shop.int_store_performance_total_margin": [ + "model.jaffle_shop.int_store_revenue_total_margin" + ], + "model.jaffle_shop.int_store_performance_avg_order_value": [ + "model.jaffle_shop.int_store_revenue_avg_order_value" + ], + "model.jaffle_shop.int_store_performance_revenue_per_employee": [ + "model.jaffle_shop.int_store_employees_active_total_employees", + "model.jaffle_shop.int_store_revenue_total_revenue" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_revenue_order_count", + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_product_name": [ + "seed.jaffle_shop.raw_products_name" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.stg_products_price_cents": [ + "seed.jaffle_shop.raw_products_price" + ], + "model.jaffle_shop.stg_products_cost_cents": [ + "seed.jaffle_shop.raw_products_cost" + ], + "model.jaffle_shop.stg_products_price": [ + "seed.jaffle_shop.raw_products_price" + ], + "model.jaffle_shop.stg_products_cost": [ + "seed.jaffle_shop.raw_products_cost" + ], + "model.jaffle_shop.stg_products_created_at": [ + "seed.jaffle_shop.raw_products_created_at" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.metric_store_daily_store_id", + "model.jaffle_shop.store_rankings_store_id", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_inventory_store_id", + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.rpt_store_dashboard_store_id": [ + "model.jaffle_shop.store_rankings_store_id" + ], + "model.jaffle_shop.rpt_store_dashboard_store_name": [ + "model.jaffle_shop.store_rankings_store_name" + ], + "model.jaffle_shop.rpt_store_dashboard_city": [ + "model.jaffle_shop.store_rankings_city" + ], + "model.jaffle_shop.rpt_store_dashboard_state": [ + "model.jaffle_shop.store_rankings_state" + ], + "model.jaffle_shop.rpt_store_dashboard_total_revenue": [ + "model.jaffle_shop.store_rankings_total_revenue" + ], + "model.jaffle_shop.rpt_store_dashboard_total_margin": [ + "model.jaffle_shop.store_rankings_total_margin" + ], + "model.jaffle_shop.rpt_store_dashboard_order_count": [ + "model.jaffle_shop.store_rankings_order_count" + ], + "model.jaffle_shop.rpt_store_dashboard_unique_customers": [ + "model.jaffle_shop.store_rankings_unique_customers" + ], + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee": [ + "model.jaffle_shop.store_rankings_revenue_per_employee" + ], + "model.jaffle_shop.rpt_store_dashboard_revenue_rank": [ + "model.jaffle_shop.store_rankings_revenue_rank" + ], + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank": [ + "model.jaffle_shop.store_rankings_efficiency_rank" + ], + "model.jaffle_shop.rpt_store_dashboard_total_stock_units": [ + "model.jaffle_shop.store_inventory_total_stock_units" + ], + "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products": [ + "model.jaffle_shop.store_inventory_out_of_stock_products" + ], + "model.jaffle_shop.rpt_store_dashboard_low_stock_products": [ + "model.jaffle_shop.store_inventory_low_stock_products" + ], + "model.jaffle_shop.rpt_store_dashboard_active_days": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue": [ + "model.jaffle_shop.metric_store_daily_revenue" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_daily_order_summary_order_date": [], + "model.jaffle_shop.int_daily_order_summary_order_count": [], + "model.jaffle_shop.int_daily_order_summary_unique_customers": [], + "model.jaffle_shop.int_daily_order_summary_total_revenue": [], + "model.jaffle_shop.int_daily_order_summary_total_cost": [], + "model.jaffle_shop.int_daily_order_summary_total_margin": [], + "model.jaffle_shop.int_daily_order_summary_total_items_sold": [], + "model.jaffle_shop.int_daily_order_summary_promoted_orders": [], + "model.jaffle_shop.int_daily_order_summary_total_discounts": [], + "model.jaffle_shop.int_daily_order_summary_avg_order_value": [], + "model.jaffle_shop.int_customer_payment_methods": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_orders_customer_id", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_customer_payment_methods_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_customer_payment_methods_credit_card_total": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.int_customer_payment_methods_coupon_total": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.int_customer_payment_methods_gift_card_total": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_payments_payment_id": [ + "seed.jaffle_shop.raw_payments_id" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "seed.jaffle_shop.raw_payments_payment_method" + ], + "model.jaffle_shop.stg_payments_amount": [ + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_order_items_order_item_id": [ + "seed.jaffle_shop.raw_order_items_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.stg_order_items_quantity": [ + "seed.jaffle_shop.raw_order_items_quantity" + ], + "model.jaffle_shop.stg_order_items_unit_price": [ + "seed.jaffle_shop.raw_order_items_unit_price" + ], + "model.jaffle_shop.metric_promotion_daily": [ + "model.jaffle_shop.order_discounts_order_date", + "model.jaffle_shop.order_discounts", + "model.jaffle_shop.order_discounts_discount_type", + "model.jaffle_shop.order_discounts_promotion_name" + ], + "model.jaffle_shop.metric_promotion_daily_order_date": [ + "model.jaffle_shop.order_discounts_order_date" + ], + "model.jaffle_shop.metric_promotion_daily_promotion_name": [ + "model.jaffle_shop.order_discounts_promotion_name" + ], + "model.jaffle_shop.metric_promotion_daily_discount_type": [ + "model.jaffle_shop.order_discounts_discount_type" + ], + "model.jaffle_shop.metric_promotion_daily_usage_count": [], + "model.jaffle_shop.metric_promotion_daily_total_discount": [ + "model.jaffle_shop.order_discounts_discount_amount" + ], + "model.jaffle_shop.metric_promotion_daily_total_order_value": [ + "model.jaffle_shop.order_discounts_subtotal" + ], + "model.jaffle_shop.metric_promotion_daily_total_net_revenue": [ + "model.jaffle_shop.order_discounts_net_revenue" + ], + "model.jaffle_shop.metric_promotion_daily_avg_discount_pct": [ + "model.jaffle_shop.order_discounts_discount_pct_of_order" + ], + "model.jaffle_shop.int_supply_order_costs": [ + "model.jaffle_shop.stg_products_product_id", + "model.jaffle_shop.stg_supply_orders_product_id", + "model.jaffle_shop.stg_products", + "model.jaffle_shop.stg_supply_orders" + ], + "model.jaffle_shop.int_supply_order_costs_supply_order_id": [ + "model.jaffle_shop.stg_supply_orders_supply_order_id" + ], + "model.jaffle_shop.int_supply_order_costs_product_id": [ + "model.jaffle_shop.stg_supply_orders_product_id" + ], + "model.jaffle_shop.int_supply_order_costs_product_name": [ + "model.jaffle_shop.stg_products_product_name" + ], + "model.jaffle_shop.int_supply_order_costs_store_id": [ + "model.jaffle_shop.stg_supply_orders_store_id" + ], + "model.jaffle_shop.int_supply_order_costs_quantity": [ + "model.jaffle_shop.stg_supply_orders_quantity" + ], + "model.jaffle_shop.int_supply_order_costs_unit_cost": [ + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_supply_order_costs_total_cost": [ + "model.jaffle_shop.stg_supply_orders_quantity", + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_supply_order_costs_order_date": [ + "model.jaffle_shop.stg_supply_orders_order_date" + ], + "model.jaffle_shop.int_supply_order_costs_delivered_date": [ + "model.jaffle_shop.stg_supply_orders_delivered_date" + ], + "model.jaffle_shop.int_supply_order_costs_lead_time_days": [ + "model.jaffle_shop.stg_supply_orders_order_date", + "model.jaffle_shop.stg_supply_orders_delivered_date" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.metric_daily_revenue_order_date": [ + "model.jaffle_shop.int_daily_order_summary_order_date" + ], + "model.jaffle_shop.metric_daily_revenue_order_count": [ + "model.jaffle_shop.int_daily_order_summary_order_count" + ], + "model.jaffle_shop.metric_daily_revenue_total_revenue": [ + "model.jaffle_shop.int_daily_order_summary_total_revenue" + ], + "model.jaffle_shop.metric_daily_revenue_total_cost": [ + "model.jaffle_shop.int_daily_order_summary_total_cost" + ], + "model.jaffle_shop.metric_daily_revenue_total_margin": [ + "model.jaffle_shop.int_daily_order_summary_total_margin" + ], + "model.jaffle_shop.metric_daily_revenue_total_discounts": [ + "model.jaffle_shop.int_daily_order_summary_total_discounts" + ], + "model.jaffle_shop.metric_daily_revenue_net_revenue": [ + "model.jaffle_shop.int_daily_order_summary_total_discounts", + "model.jaffle_shop.int_daily_order_summary_total_revenue" + ], + "model.jaffle_shop.metric_daily_revenue_avg_order_value": [ + "model.jaffle_shop.int_daily_order_summary_avg_order_value" + ], + "model.jaffle_shop.metric_daily_revenue_unique_customers": [ + "model.jaffle_shop.int_daily_order_summary_unique_customers" + ], + "model.jaffle_shop.metric_daily_revenue_total_items_sold": [ + "model.jaffle_shop.int_daily_order_summary_total_items_sold" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.customer_lifetime_value_customer_id": [ + "model.jaffle_shop.customers_customer_id" + ], + "model.jaffle_shop.customer_lifetime_value_first_name": [ + "model.jaffle_shop.customers_first_name" + ], + "model.jaffle_shop.customer_lifetime_value_last_name": [ + "model.jaffle_shop.customers_last_name" + ], + "model.jaffle_shop.customer_lifetime_value_number_of_orders": [ + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.customer_lifetime_value_total_revenue": [ + "model.jaffle_shop.customers_customer_lifetime_value" + ], + "model.jaffle_shop.customer_lifetime_value_first_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_last_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_last_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.customer_lifetime_value_monthly_value": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "model.jaffle_shop.customers_customer_lifetime_value" + ], + "model.jaffle_shop.customer_lifetime_value_avg_order_value": [ + "model.jaffle_shop.customers_customer_lifetime_value", + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_product_margins_price": [ + "model.jaffle_shop.stg_products_price" + ], + "model.jaffle_shop.int_product_margins_cost": [ + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_product_margins_margin": [ + "model.jaffle_shop.stg_products_price", + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_product_margins_margin_pct": [ + "model.jaffle_shop.stg_products_price", + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.product_inventory_store_id", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.store_inventory_store_id": [ + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.store_inventory_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.store_inventory_unique_products": [ + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.store_inventory_total_stock_units": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.store_inventory_out_of_stock_products": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.store_inventory_low_stock_products": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.store_inventory_adequate_stock_products": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.store_inventory_well_stocked_products": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "seed.jaffle_shop.raw_customers": [], + "seed.jaffle_shop.raw_customers_id": [], + "seed.jaffle_shop.raw_customers_first_name": [], + "seed.jaffle_shop.raw_customers_last_name": [] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.order_discounts", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.metric_daily_orders", + "model.jaffle_shop.int_daily_order_summary", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_has_promotion": [ + "model.jaffle_shop.order_discounts", + "model.jaffle_shop.customer_acquisition_acquired_via_promotion", + "model.jaffle_shop.metric_daily_orders_promoted_orders", + "model.jaffle_shop.order_discounts_has_promotion" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.order_discounts_order_id", + "model.jaffle_shop.metric_product_sales_daily_order_count", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.order_discounts_customer_id", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_order_history" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.order_discounts_order_date", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.revenue_summary_order_week", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "model.jaffle_shop.metric_product_sales_daily_order_date", + "model.jaffle_shop.revenue_summary_order_month", + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.metric_daily_orders_order_date", + "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "model.jaffle_shop.revenue_summary_order_date", + "model.jaffle_shop.customer_360_months_active", + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "model.jaffle_shop.metric_daily_orders", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.customer_retention_months_since_first" + ], + "model.jaffle_shop.int_order_enriched_subtotal": [ + "model.jaffle_shop.order_discounts_subtotal", + "model.jaffle_shop.customer_acquisition_first_order_value", + "model.jaffle_shop.order_discounts_discount_pct_of_order", + "model.jaffle_shop.int_store_revenue_total_revenue", + "model.jaffle_shop.int_customer_order_history_total_spent", + "model.jaffle_shop.revenue_summary_revenue", + "model.jaffle_shop.order_discounts_net_revenue", + "model.jaffle_shop.revenue_summary_net_revenue", + "model.jaffle_shop.int_customer_order_history_avg_order_value", + "model.jaffle_shop.int_store_revenue_avg_order_value" + ], + "model.jaffle_shop.int_order_enriched_promotion_name": [ + "model.jaffle_shop.order_discounts_promotion_name", + "model.jaffle_shop.customer_acquisition_acquisition_promotion" + ], + "model.jaffle_shop.int_order_enriched_discount_type": [ + "model.jaffle_shop.order_discounts_discount_type" + ], + "model.jaffle_shop.int_order_enriched_discount_value": [ + "model.jaffle_shop.order_discounts_discount_value" + ], + "model.jaffle_shop.int_order_enriched_discount_amount": [ + "model.jaffle_shop.order_discounts_discount_pct_of_order", + "model.jaffle_shop.order_discounts_discount_amount", + "model.jaffle_shop.order_discounts_net_revenue", + "model.jaffle_shop.revenue_summary_net_revenue", + "model.jaffle_shop.revenue_summary_discounts" + ], + "seed.jaffle_shop.raw_employees": ["model.jaffle_shop.stg_employees"], + "seed.jaffle_shop.raw_employees_id": [ + "model.jaffle_shop.stg_employees_employee_id" + ], + "seed.jaffle_shop.raw_employees_store_id": [ + "model.jaffle_shop.stg_employees_store_id" + ], + "seed.jaffle_shop.raw_employees_first_name": [ + "model.jaffle_shop.stg_employees_first_name" + ], + "seed.jaffle_shop.raw_employees_last_name": [ + "model.jaffle_shop.stg_employees_last_name" + ], + "seed.jaffle_shop.raw_employees_role": [ + "model.jaffle_shop.stg_employees_role" + ], + "seed.jaffle_shop.raw_employees_hired_at": [ + "model.jaffle_shop.stg_employees_hired_at" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.int_store_revenue_order_count", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.int_store_revenue_store_id", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.order_fulfillment_store_id", + "model.jaffle_shop.revenue_summary_store_id", + "model.jaffle_shop.int_inventory_movements_store_id", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_total_cost": [ + "model.jaffle_shop.int_store_revenue_total_cost", + "model.jaffle_shop.revenue_summary_cost" + ], + "model.jaffle_shop.int_order_enriched_total_margin": [ + "model.jaffle_shop.revenue_summary_margin", + "model.jaffle_shop.int_customer_order_history_total_margin_generated", + "model.jaffle_shop.int_store_revenue_total_margin" + ], + "model.jaffle_shop.int_store_order_assignments_customer_id": [ + "model.jaffle_shop.int_store_revenue_unique_customers" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_promotion_effectiveness" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.customers", + "model.jaffle_shop.payments_fact_order_id", + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.orders" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.customers", + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.orders" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.int_order_totals_subtotal": [ + "model.jaffle_shop.int_order_enriched_subtotal", + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value", + "model.jaffle_shop.int_order_payments_matched_order_subtotal", + "model.jaffle_shop.int_order_payments_matched_payment_status", + "model.jaffle_shop.int_order_enriched_discount_amount", + "model.jaffle_shop.int_promotion_effectiveness_total_revenue" + ], + "model.jaffle_shop.stg_payments_amount": [ + "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total", + "model.jaffle_shop.int_customer_payment_methods_coupon_total", + "model.jaffle_shop.orders_bank_transfer_amount", + "model.jaffle_shop.int_customer_payment_methods_credit_card_total", + "model.jaffle_shop.orders_gift_card_amount", + "model.jaffle_shop.int_order_payments_matched_payment_status", + "model.jaffle_shop.int_customer_payment_methods_gift_card_total", + "model.jaffle_shop.orders_coupon_amount", + "model.jaffle_shop.customers_customer_lifetime_value", + "model.jaffle_shop.orders_amount", + "model.jaffle_shop.int_order_payments_matched_total_paid", + "model.jaffle_shop.orders_credit_card_amount", + "model.jaffle_shop.payments_fact_amount" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method", + "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total", + "model.jaffle_shop.int_customer_payment_methods_coupon_total", + "model.jaffle_shop.orders_bank_transfer_amount", + "model.jaffle_shop.payments_fact_payment_method", + "model.jaffle_shop.int_customer_payment_methods_credit_card_total", + "model.jaffle_shop.orders_gift_card_amount", + "model.jaffle_shop.int_order_payments_matched_payment_method_count", + "model.jaffle_shop.orders_coupon_amount", + "model.jaffle_shop.int_customer_payment_methods_gift_card_total", + "model.jaffle_shop.orders_credit_card_amount", + "model.jaffle_shop.int_customer_payment_methods" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.metric_inventory_daily", + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.product_inventory_product_id": [ + "model.jaffle_shop.metric_inventory_daily_total_products_tracked", + "model.jaffle_shop.inventory_health_product_id", + "model.jaffle_shop.store_inventory_unique_products", + "model.jaffle_shop.reorder_recommendations_product_id", + "model.jaffle_shop.inventory_health", + "model.jaffle_shop.reorder_recommendations" + ], + "model.jaffle_shop.product_inventory_store_id": [ + "model.jaffle_shop.reorder_recommendations_store_id", + "model.jaffle_shop.inventory_health", + "model.jaffle_shop.metric_inventory_daily_total_stores", + "model.jaffle_shop.inventory_health_store_id", + "model.jaffle_shop.store_inventory_store_id", + "model.jaffle_shop.store_inventory" + ], + "model.jaffle_shop.product_inventory_current_stock": [ + "model.jaffle_shop.store_inventory_total_stock_units", + "model.jaffle_shop.inventory_health_inventory_balance", + "model.jaffle_shop.reorder_recommendations_current_stock", + "model.jaffle_shop.inventory_health_current_stock", + "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store", + "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty", + "model.jaffle_shop.metric_inventory_daily_total_stock_units" + ], + "model.jaffle_shop.product_inventory_stock_status": [ + "model.jaffle_shop.metric_inventory_daily_low_stock_count", + "model.jaffle_shop.metric_inventory_daily_well_stocked_count", + "model.jaffle_shop.store_inventory_out_of_stock_products", + "model.jaffle_shop.metric_inventory_daily_adequate_count", + "model.jaffle_shop.reorder_recommendations_stock_status", + "model.jaffle_shop.inventory_health_stock_status", + "model.jaffle_shop.reorder_recommendations_reorder_priority", + "model.jaffle_shop.store_inventory_adequate_stock_products", + "model.jaffle_shop.store_inventory_low_stock_products", + "model.jaffle_shop.metric_inventory_daily_out_of_stock_count", + "model.jaffle_shop.store_inventory_well_stocked_products" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.metric_customer_acquisition_monthly" + ], + "model.jaffle_shop.customer_cohorts_cohort_month": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month" + ], + "model.jaffle_shop.customer_cohorts_cohort_size": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers" + ], + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders" + ], + "model.jaffle_shop.customer_cohorts_avg_tenure_days": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days" + ], + "model.jaffle_shop.stg_employees_store_id": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing", + "model.jaffle_shop.store_staffing_store_id" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.store_staffing" + ], + "model.jaffle_shop.stg_employees": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing" + ], + "model.jaffle_shop.stg_stores_state": [ + "model.jaffle_shop.int_store_employees_active_state", + "model.jaffle_shop.store_staffing_state", + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_stores_city": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing_city", + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "model.jaffle_shop.product_inventory_store_name", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_employees_active_store_name", + "model.jaffle_shop.store_staffing_store_name" + ], + "model.jaffle_shop.stg_stores_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.store_staffing" + ], + "model.jaffle_shop.stg_employees_role": [ + "model.jaffle_shop.int_store_employees_active_manager_count", + "model.jaffle_shop.int_store_employees_active_cashier_count", + "model.jaffle_shop.int_store_employees_active_barista_count", + "model.jaffle_shop.store_staffing_role", + "model.jaffle_shop.int_store_employees_active_cook_count" + ], + "model.jaffle_shop.stg_employees_hired_at": [ + "model.jaffle_shop.int_store_employees_active_latest_hire", + "model.jaffle_shop.int_store_employees_active_earliest_hire", + "model.jaffle_shop.store_staffing_hired_at" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "seed.jaffle_shop.raw_reviews": ["model.jaffle_shop.stg_reviews"], + "seed.jaffle_shop.raw_reviews_id": [ + "model.jaffle_shop.stg_reviews_review_id" + ], + "seed.jaffle_shop.raw_reviews_order_id": [ + "model.jaffle_shop.stg_reviews_order_id" + ], + "seed.jaffle_shop.raw_reviews_product_id": [ + "model.jaffle_shop.stg_reviews_product_id" + ], + "seed.jaffle_shop.raw_reviews_customer_id": [ + "model.jaffle_shop.stg_reviews_customer_id" + ], + "seed.jaffle_shop.raw_reviews_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "seed.jaffle_shop.raw_reviews_review_date": [ + "model.jaffle_shop.stg_reviews_review_date" + ], + "model.jaffle_shop.int_customer_review_activity": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.customer_review_summary" + ], + "model.jaffle_shop.customer_lifetime_value_customer_id": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_id": [ + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.customer_retention_customers", + "model.jaffle_shop.customer_acquisition_customer_id" + ], + "model.jaffle_shop.customers_customer_id": [ + "model.jaffle_shop.customer_360_customer_id", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.customer_lifetime_value_customer_id" + ], + "model.jaffle_shop.customer_segments_final_customer_id": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.int_customer_review_activity_customer_id": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_customer_id" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.rpt_executive_dashboard", + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.customers_first_name": [ + "model.jaffle_shop.customer_360_first_name", + "model.jaffle_shop.customer_lifetime_value_first_name" + ], + "model.jaffle_shop.customers_last_name": [ + "model.jaffle_shop.customer_360_last_name", + "model.jaffle_shop.customer_lifetime_value_last_name" + ], + "model.jaffle_shop.customers_first_order": [ + "model.jaffle_shop.customer_360_first_order" + ], + "model.jaffle_shop.customers_most_recent_order": [ + "model.jaffle_shop.customer_360_most_recent_order" + ], + "model.jaffle_shop.customers_number_of_orders": [ + "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "model.jaffle_shop.customer_lifetime_value_avg_order_value", + "model.jaffle_shop.customer_360_number_of_orders" + ], + "model.jaffle_shop.customers_customer_lifetime_value": [ + "model.jaffle_shop.customer_lifetime_value_monthly_value", + "model.jaffle_shop.customer_lifetime_value_total_revenue", + "model.jaffle_shop.customer_lifetime_value_avg_order_value", + "model.jaffle_shop.customer_360_customer_lifetime_value" + ], + "model.jaffle_shop.customer_lifetime_value_monthly_value": [ + "model.jaffle_shop.customer_360_monthly_value" + ], + "model.jaffle_shop.customer_lifetime_value_avg_order_value": [ + "model.jaffle_shop.customer_360_avg_order_value" + ], + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": [ + "model.jaffle_shop.customer_360_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": [ + "model.jaffle_shop.customer_360_days_since_last_order" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.rpt_executive_dashboard", + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.customer_360_rfm_total" + ], + "model.jaffle_shop.int_customer_review_activity_review_count": [ + "model.jaffle_shop.customer_review_summary_review_count", + "model.jaffle_shop.customer_360_review_count", + "model.jaffle_shop.customer_review_summary" + ], + "model.jaffle_shop.int_customer_review_activity_avg_rating": [ + "model.jaffle_shop.customer_360_avg_review_rating", + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_customer_avg_rating", + "model.jaffle_shop.customer_review_summary_rating_tendency" + ], + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": [ + "model.jaffle_shop.customer_lifetime_value_first_order_date", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_cohorts_cohort_month", + "model.jaffle_shop.customer_retention_cohort_month", + "model.jaffle_shop.customer_acquisition_first_order_date", + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_360_months_active", + "model.jaffle_shop.customer_acquisition_acquisition_month", + "model.jaffle_shop.customer_retention_months_since_first", + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories_category_id", + "model.jaffle_shop.product_categories", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.product_categories", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.product_categories_category_id", + "model.jaffle_shop.product_categories", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.product_categories", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.stg_products_product_name": [ + "model.jaffle_shop.int_products_with_categories_product_name", + "model.jaffle_shop.product_inventory_product_name", + "model.jaffle_shop.int_supply_order_costs_product_name" + ], + "model.jaffle_shop.int_category_hierarchy_category_name": [ + "model.jaffle_shop.product_categories_category_name", + "model.jaffle_shop.int_products_with_categories_category_name" + ], + "model.jaffle_shop.int_category_hierarchy_root_category": [ + "model.jaffle_shop.int_products_with_categories_root_category", + "model.jaffle_shop.product_categories_root_category" + ], + "model.jaffle_shop.int_category_hierarchy_full_path": [ + "model.jaffle_shop.int_products_with_categories_category_path", + "model.jaffle_shop.product_categories_full_path" + ], + "model.jaffle_shop.int_category_hierarchy_depth": [ + "model.jaffle_shop.product_categories_depth", + "model.jaffle_shop.int_products_with_categories_category_depth" + ], + "model.jaffle_shop.stg_products_price": [ + "model.jaffle_shop.int_product_margins_margin", + "model.jaffle_shop.int_products_with_categories_price", + "model.jaffle_shop.int_product_margins_price", + "model.jaffle_shop.int_product_margins_margin_pct" + ], + "model.jaffle_shop.stg_products_cost": [ + "model.jaffle_shop.int_supply_order_costs_total_cost", + "model.jaffle_shop.int_product_margins_margin_pct", + "model.jaffle_shop.int_product_margins_margin", + "model.jaffle_shop.int_supply_order_costs_unit_cost", + "model.jaffle_shop.int_product_margins_cost", + "model.jaffle_shop.int_products_with_categories_cost" + ], + "model.jaffle_shop.stg_products_created_at": [ + "model.jaffle_shop.int_products_with_categories_created_at" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.metric_daily_revenue_order_date": [ + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.metric_monthly_sales_month_start", + "model.jaffle_shop.metric_monthly_sales_active_days", + "model.jaffle_shop.metric_weekly_sales_week_start", + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.metric_daily_revenue_order_count": [ + "model.jaffle_shop.metric_monthly_sales_total_orders", + "model.jaffle_shop.metric_weekly_sales_total_orders" + ], + "model.jaffle_shop.metric_daily_revenue_total_revenue": [ + "model.jaffle_shop.metric_monthly_sales_total_revenue", + "model.jaffle_shop.metric_weekly_sales_total_revenue" + ], + "model.jaffle_shop.metric_daily_revenue_net_revenue": [ + "model.jaffle_shop.metric_monthly_sales_net_revenue", + "model.jaffle_shop.metric_weekly_sales_net_revenue" + ], + "model.jaffle_shop.metric_daily_revenue_total_margin": [ + "model.jaffle_shop.metric_monthly_sales_total_margin", + "model.jaffle_shop.metric_weekly_sales_total_margin" + ], + "model.jaffle_shop.metric_daily_revenue_total_discounts": [ + "model.jaffle_shop.metric_weekly_sales_total_discounts", + "model.jaffle_shop.metric_monthly_sales_total_discounts" + ], + "model.jaffle_shop.metric_daily_revenue_avg_order_value": [ + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value", + "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value" + ], + "model.jaffle_shop.metric_daily_revenue_total_items_sold": [ + "model.jaffle_shop.metric_weekly_sales_total_items_sold", + "model.jaffle_shop.metric_monthly_sales_total_items_sold" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_parent_category_id" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_category_name": [ + "model.jaffle_shop.int_category_hierarchy_full_path", + "model.jaffle_shop.int_category_hierarchy_root_category", + "model.jaffle_shop.int_category_hierarchy_category_name" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.order_items" + ], + "model.jaffle_shop.int_order_items_enriched_order_item_id": [ + "model.jaffle_shop.order_items_order_item_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.order_items_order_id", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched_product_id": [ + "model.jaffle_shop.order_items_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_product_name": [ + "model.jaffle_shop.order_items_product_name" + ], + "model.jaffle_shop.int_order_items_enriched_category_name": [ + "model.jaffle_shop.order_items_category_name" + ], + "model.jaffle_shop.int_order_items_enriched_root_category": [ + "model.jaffle_shop.int_order_totals_category_count", + "model.jaffle_shop.order_items_root_category" + ], + "model.jaffle_shop.int_order_items_enriched_category_path": [ + "model.jaffle_shop.order_items_category_path" + ], + "model.jaffle_shop.int_order_items_enriched_quantity": [ + "model.jaffle_shop.order_items_quantity", + "model.jaffle_shop.int_order_totals_total_quantity" + ], + "model.jaffle_shop.int_order_items_enriched_unit_price": [ + "model.jaffle_shop.order_items_unit_price" + ], + "model.jaffle_shop.int_order_items_enriched_line_total": [ + "model.jaffle_shop.int_order_totals_subtotal", + "model.jaffle_shop.order_items_line_total" + ], + "model.jaffle_shop.int_order_items_enriched_cost": [ + "model.jaffle_shop.order_items_cost" + ], + "model.jaffle_shop.int_order_items_enriched_margin_pct": [ + "model.jaffle_shop.order_items_margin_pct" + ], + "model.jaffle_shop.int_order_items_enriched_line_cost": [ + "model.jaffle_shop.order_items_line_cost", + "model.jaffle_shop.int_order_totals_total_cost" + ], + "model.jaffle_shop.int_order_items_enriched_line_margin": [ + "model.jaffle_shop.int_order_totals_total_margin", + "model.jaffle_shop.order_items_line_margin" + ], + "model.jaffle_shop.product_performance": [ + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.product_profitability", + "model.jaffle_shop.rpt_product_dashboard" + ], + "model.jaffle_shop.product_performance_product_id": [ + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.product_profitability", + "model.jaffle_shop.product_profitability_product_id" + ], + "model.jaffle_shop.product_inventory_product_name": [ + "model.jaffle_shop.reorder_recommendations_product_name", + "model.jaffle_shop.inventory_health_product_name" + ], + "model.jaffle_shop.product_inventory_store_name": [ + "model.jaffle_shop.reorder_recommendations_store_name", + "model.jaffle_shop.store_inventory_store_name", + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.inventory_health_store_name" + ], + "model.jaffle_shop.product_inventory_last_restock_date": [ + "model.jaffle_shop.reorder_recommendations_last_restock_date" + ], + "model.jaffle_shop.product_performance_total_quantity_sold": [ + "model.jaffle_shop.product_profitability_total_quantity_sold", + "model.jaffle_shop.reorder_recommendations_total_quantity_sold", + "model.jaffle_shop.rpt_product_dashboard_total_units_sold" + ], + "model.jaffle_shop.product_performance_times_ordered": [ + "model.jaffle_shop.reorder_recommendations_reorder_priority", + "model.jaffle_shop.rpt_product_dashboard_never_ordered_products", + "model.jaffle_shop.reorder_recommendations_times_ordered" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.order_payment_status", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_promotion_effectiveness" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_promotion_effectiveness" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.order_payment_status_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.int_order_totals_item_count": [ + "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order", + "model.jaffle_shop.int_order_enriched_item_count" + ], + "model.jaffle_shop.int_order_totals_total_quantity": [ + "model.jaffle_shop.int_order_enriched_total_quantity" + ], + "model.jaffle_shop.int_order_totals_total_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "model.jaffle_shop.int_order_totals_total_margin": [ + "model.jaffle_shop.int_promotion_effectiveness_avg_margin", + "model.jaffle_shop.int_order_enriched_total_margin" + ], + "model.jaffle_shop.int_order_totals_category_count": [ + "model.jaffle_shop.int_order_enriched_category_count" + ], + "model.jaffle_shop.int_orders_with_promotions_has_promotion": [ + "model.jaffle_shop.int_promotion_effectiveness_has_promotion", + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.int_orders_with_promotions_promotion_name": [ + "model.jaffle_shop.int_order_enriched_promotion_name", + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_promotion_effectiveness_promotion_name" + ], + "model.jaffle_shop.int_orders_with_promotions_discount_type": [ + "model.jaffle_shop.int_order_enriched_discount_type", + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_promotion_effectiveness_discount_type", + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.int_orders_with_promotions_discount_value": [ + "model.jaffle_shop.int_order_enriched_discount_value", + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.int_order_payments_matched_total_paid": [ + "model.jaffle_shop.order_payment_status_payment_difference", + "model.jaffle_shop.order_payment_status_total_paid", + "model.jaffle_shop.int_order_enriched_total_paid" + ], + "model.jaffle_shop.int_order_payments_matched_payment_count": [ + "model.jaffle_shop.order_payment_status_payment_count", + "model.jaffle_shop.int_order_enriched_payment_count" + ], + "model.jaffle_shop.int_order_payments_matched_payment_status": [ + "model.jaffle_shop.int_order_enriched_payment_status", + "model.jaffle_shop.order_payment_status_payment_status" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.customers", + "model.jaffle_shop.new_orders", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.orders" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.customers_number_of_orders", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.new_orders_order_id", + "model.jaffle_shop.orders_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.orders", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "model.jaffle_shop.int_customer_payment_methods_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.orders_customer_id", + "model.jaffle_shop.int_store_order_assignments_customer_id", + "model.jaffle_shop.new_orders_customer_id", + "model.jaffle_shop.int_orders_with_promotions_customer_id", + "model.jaffle_shop.int_customer_payment_methods" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date", + "model.jaffle_shop.customers_first_order", + "model.jaffle_shop.new_orders_order_date", + "model.jaffle_shop.orders_order_date", + "model.jaffle_shop.int_store_order_assignments_order_date", + "model.jaffle_shop.customers_most_recent_order" + ], + "model.jaffle_shop.product_performance_total_revenue": [ + "model.jaffle_shop.product_profitability_total_revenue", + "model.jaffle_shop.rpt_product_dashboard_top_product_name", + "model.jaffle_shop.rpt_product_dashboard_total_product_revenue", + "model.jaffle_shop.product_profitability_net_margin", + "model.jaffle_shop.product_profitability_gross_margin_pct", + "model.jaffle_shop.rpt_product_dashboard_top_product_revenue" + ], + "model.jaffle_shop.product_performance_avg_rating": [ + "model.jaffle_shop.product_profitability_avg_rating", + "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating" + ], + "model.jaffle_shop.product_performance_product_name": [ + "model.jaffle_shop.rpt_product_dashboard_top_product_name", + "model.jaffle_shop.product_profitability_product_name" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.customer_360_number_of_orders": [ + "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer" + ], + "model.jaffle_shop.customer_360_customer_lifetime_value": [ + "model.jaffle_shop.rpt_customer_dashboard_avg_clv" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers" + ], + "model.jaffle_shop.customer_360_review_count": [ + "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer" + ], + "model.jaffle_shop.int_order_enriched_item_count": [ + "model.jaffle_shop.customer_acquisition_first_order_items", + "model.jaffle_shop.metric_daily_orders_avg_items_per_order" + ], + "model.jaffle_shop.products_product_id": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.product_performance_product_id" + ], + "model.jaffle_shop.products": ["model.jaffle_shop.product_performance"], + "model.jaffle_shop.int_product_ratings": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.product_reviews", + "model.jaffle_shop.customer_review_summary" + ], + "model.jaffle_shop.int_product_ratings_product_id": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.product_reviews_product_id", + "model.jaffle_shop.customer_review_summary" + ], + "model.jaffle_shop.order_items": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.metric_product_sales_daily" + ], + "model.jaffle_shop.order_items_product_id": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.metric_product_sales_daily_product_id" + ], + "model.jaffle_shop.products_product_name": [ + "model.jaffle_shop.product_performance_product_name" + ], + "model.jaffle_shop.products_category_name": [ + "model.jaffle_shop.product_performance_category_name" + ], + "model.jaffle_shop.products_root_category": [ + "model.jaffle_shop.product_performance_root_category" + ], + "model.jaffle_shop.products_price": [ + "model.jaffle_shop.product_performance_price" + ], + "model.jaffle_shop.products_cost": [ + "model.jaffle_shop.product_performance_cost" + ], + "model.jaffle_shop.products_margin_pct": [ + "model.jaffle_shop.product_performance_margin_pct" + ], + "model.jaffle_shop.order_items_quantity": [ + "model.jaffle_shop.product_performance_total_quantity_sold", + "model.jaffle_shop.metric_product_sales_daily_units_sold" + ], + "model.jaffle_shop.order_items_line_total": [ + "model.jaffle_shop.product_performance_total_revenue", + "model.jaffle_shop.metric_product_sales_daily_revenue" + ], + "model.jaffle_shop.order_items_line_margin": [ + "model.jaffle_shop.product_performance_total_margin", + "model.jaffle_shop.metric_product_sales_daily_margin" + ], + "model.jaffle_shop.int_product_ratings_review_count": [ + "model.jaffle_shop.product_reviews_positive_pct", + "model.jaffle_shop.product_reviews_review_count", + "model.jaffle_shop.product_performance_review_count" + ], + "model.jaffle_shop.int_product_ratings_avg_rating": [ + "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed", + "model.jaffle_shop.product_performance_avg_rating", + "model.jaffle_shop.customer_review_summary_rating_tendency", + "model.jaffle_shop.product_reviews_avg_rating", + "model.jaffle_shop.product_reviews_rating_tier" + ], + "model.jaffle_shop.int_product_ratings_positive_reviews": [ + "model.jaffle_shop.product_performance_positive_reviews", + "model.jaffle_shop.product_reviews_positive_pct", + "model.jaffle_shop.product_reviews_positive_reviews" + ], + "model.jaffle_shop.int_product_ratings_negative_reviews": [ + "model.jaffle_shop.product_reviews_negative_reviews", + "model.jaffle_shop.product_performance_negative_reviews" + ], + "model.jaffle_shop.int_supply_order_costs_product_id": [ + "model.jaffle_shop.supply_orders_fact_product_id", + "model.jaffle_shop.cost_analysis", + "model.jaffle_shop.supplier_lead_times", + "model.jaffle_shop.supplier_lead_times_product_id", + "model.jaffle_shop.product_profitability" + ], + "model.jaffle_shop.int_supply_order_costs": [ + "model.jaffle_shop.product_profitability", + "model.jaffle_shop.supply_orders_fact", + "model.jaffle_shop.supplier_lead_times", + "model.jaffle_shop.cost_analysis" + ], + "model.jaffle_shop.int_supply_order_costs_store_id": [ + "model.jaffle_shop.supplier_lead_times_store_id", + "model.jaffle_shop.supply_orders_fact_store_id", + "model.jaffle_shop.supplier_lead_times" + ], + "model.jaffle_shop.int_supply_order_costs_product_name": [ + "model.jaffle_shop.supplier_lead_times_product_name", + "model.jaffle_shop.supply_orders_fact_product_name", + "model.jaffle_shop.supplier_lead_times", + "model.jaffle_shop.cost_analysis" + ], + "model.jaffle_shop.int_supply_order_costs_lead_time_days": [ + "model.jaffle_shop.supply_orders_fact_lead_time_days", + "model.jaffle_shop.supplier_lead_times_min_lead_time", + "model.jaffle_shop.cost_analysis_avg_lead_time", + "model.jaffle_shop.supplier_lead_times_max_lead_time", + "model.jaffle_shop.supplier_lead_times_avg_lead_time" + ], + "model.jaffle_shop.int_supply_order_costs_quantity": [ + "model.jaffle_shop.supplier_lead_times_total_quantity", + "model.jaffle_shop.product_profitability_total_supplied", + "model.jaffle_shop.supply_orders_fact_quantity" + ], + "model.jaffle_shop.int_supply_order_costs_total_cost": [ + "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold", + "model.jaffle_shop.supply_orders_fact_total_cost", + "model.jaffle_shop.product_profitability_total_supply_cost", + "model.jaffle_shop.product_profitability_net_margin", + "model.jaffle_shop.cost_analysis_total_supply_spend", + "model.jaffle_shop.supplier_lead_times_total_spend" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.order_fulfillment_order_id", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.order_returns_order_id", + "model.jaffle_shop.payments_fact" + ], + "model.jaffle_shop.orders": [ + "model.jaffle_shop.order_returns", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.payments_fact" + ], + "model.jaffle_shop.stg_payments_payment_id": [ + "model.jaffle_shop.payments_fact_payment_id" + ], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.payments_fact_customer_id", + "model.jaffle_shop.order_fulfillment_customer_id", + "model.jaffle_shop.order_returns_customer_id" + ], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.order_fulfillment_order_date", + "model.jaffle_shop.order_returns_order_date", + "model.jaffle_shop.payments_fact_order_date" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.order_returns_return_status", + "model.jaffle_shop.order_returns", + "model.jaffle_shop.payments_fact_order_status", + "model.jaffle_shop.order_returns_status", + "model.jaffle_shop.order_fulfillment_status" + ], + "model.jaffle_shop.stg_reviews": [ + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.int_customer_review_activity" + ], + "model.jaffle_shop.stg_reviews_product_id": [ + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.int_customer_review_activity_products_reviewed", + "model.jaffle_shop.int_reviews_with_products_product_id" + ], + "model.jaffle_shop.stg_reviews_customer_id": [ + "model.jaffle_shop.int_customer_review_activity", + "model.jaffle_shop.int_customer_review_activity_customer_id", + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.int_reviews_with_products_customer_id" + ], + "model.jaffle_shop.int_customer_review_activity_first_review_date": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_first_review_date" + ], + "model.jaffle_shop.int_customer_review_activity_last_review_date": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_last_review_date" + ], + "model.jaffle_shop.int_customer_review_activity_products_reviewed": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_products_reviewed" + ], + "model.jaffle_shop.stores_store_id": [ + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.revenue_summary_store_id": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily_store_id", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.gross_margin_store_id" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.stores_store_name": [ + "model.jaffle_shop.metric_store_daily_store_name" + ], + "model.jaffle_shop.stores_city": [ + "model.jaffle_shop.metric_store_daily_city" + ], + "model.jaffle_shop.revenue_summary_order_count": [ + "model.jaffle_shop.metric_store_daily_order_count", + "model.jaffle_shop.gross_margin_total_orders" + ], + "model.jaffle_shop.revenue_summary_revenue": [ + "model.jaffle_shop.metric_store_daily_revenue", + "model.jaffle_shop.gross_margin_gross_margin_pct", + "model.jaffle_shop.gross_margin_total_revenue" + ], + "model.jaffle_shop.revenue_summary_cost": [ + "model.jaffle_shop.metric_store_daily_cost", + "model.jaffle_shop.gross_margin_total_cost" + ], + "model.jaffle_shop.revenue_summary_margin": [ + "model.jaffle_shop.metric_store_daily_margin", + "model.jaffle_shop.gross_margin_total_margin", + "model.jaffle_shop.gross_margin_gross_margin_pct" + ], + "model.jaffle_shop.revenue_summary_discounts": [ + "model.jaffle_shop.metric_store_daily_discounts", + "model.jaffle_shop.gross_margin_total_discounts" + ], + "model.jaffle_shop.revenue_summary_net_revenue": [ + "model.jaffle_shop.gross_margin_total_net_revenue", + "model.jaffle_shop.metric_store_daily_net_revenue" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.store_performance_store_id": [ + "model.jaffle_shop.store_rankings_store_id" + ], + "model.jaffle_shop.store_performance_store_name": [ + "model.jaffle_shop.store_rankings_store_name" + ], + "model.jaffle_shop.store_performance_city": [ + "model.jaffle_shop.store_rankings_city" + ], + "model.jaffle_shop.store_performance_state": [ + "model.jaffle_shop.store_rankings_state" + ], + "model.jaffle_shop.store_performance_total_revenue": [ + "model.jaffle_shop.store_rankings_revenue_rank", + "model.jaffle_shop.store_rankings_total_revenue" + ], + "model.jaffle_shop.store_performance_total_margin": [ + "model.jaffle_shop.store_rankings_total_margin", + "model.jaffle_shop.store_rankings_margin_rank" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.store_rankings_order_count_rank", + "model.jaffle_shop.store_rankings_order_count" + ], + "model.jaffle_shop.store_performance_unique_customers": [ + "model.jaffle_shop.store_rankings_unique_customers", + "model.jaffle_shop.store_rankings_customer_reach_rank" + ], + "model.jaffle_shop.store_performance_revenue_per_employee": [ + "model.jaffle_shop.store_rankings_efficiency_rank", + "model.jaffle_shop.store_rankings_revenue_per_employee" + ], + "model.jaffle_shop.int_supply_order_costs_supply_order_id": [ + "model.jaffle_shop.supply_orders_fact_supply_order_id" + ], + "model.jaffle_shop.int_supply_order_costs_unit_cost": [ + "model.jaffle_shop.supply_orders_fact_unit_cost", + "model.jaffle_shop.cost_analysis_avg_unit_cost" + ], + "model.jaffle_shop.int_supply_order_costs_order_date": [ + "model.jaffle_shop.supply_orders_fact_order_date" + ], + "model.jaffle_shop.int_supply_order_costs_delivered_date": [ + "model.jaffle_shop.supply_orders_fact_delivered_date" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_store_performance_store_id": [ + "model.jaffle_shop.store_performance_store_id" + ], + "model.jaffle_shop.int_store_performance_store_name": [ + "model.jaffle_shop.store_performance_store_name" + ], + "model.jaffle_shop.int_store_performance_city": [ + "model.jaffle_shop.store_performance_city" + ], + "model.jaffle_shop.int_store_performance_state": [ + "model.jaffle_shop.store_performance_state" + ], + "model.jaffle_shop.int_store_performance_total_employees": [ + "model.jaffle_shop.store_performance_total_employees" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.int_store_performance_unique_customers": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.int_store_performance_total_revenue": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.int_store_performance_total_margin": [ + "model.jaffle_shop.store_performance_total_margin" + ], + "model.jaffle_shop.int_store_performance_avg_order_value": [ + "model.jaffle_shop.store_performance_avg_order_value" + ], + "model.jaffle_shop.int_store_performance_revenue_per_employee": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.store_performance_orders_per_employee" + ], + "model.jaffle_shop.stg_customers": [ + "model.jaffle_shop.customers", + "model.jaffle_shop.int_customer_order_history" + ], + "model.jaffle_shop.stg_customers_customer_id": [ + "model.jaffle_shop.int_customer_order_history_customer_id", + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_customer_order_history" + ], + "model.jaffle_shop.stg_customers_first_name": [ + "model.jaffle_shop.customers_first_name", + "model.jaffle_shop.int_customer_order_history_first_name", + "model.jaffle_shop.int_customer_order_history" + ], + "model.jaffle_shop.stg_customers_last_name": [ + "model.jaffle_shop.int_customer_order_history_last_name", + "model.jaffle_shop.customers_last_name", + "model.jaffle_shop.int_customer_order_history" + ], + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.int_promotion_effectiveness": [ + "model.jaffle_shop.promotion_roi" + ], + "model.jaffle_shop.int_promotion_effectiveness_promotion_name": [ + "model.jaffle_shop.promotion_roi_promotion_name", + "model.jaffle_shop.promotion_roi" + ], + "model.jaffle_shop.int_promotion_effectiveness_has_promotion": [ + "model.jaffle_shop.promotion_roi" + ], + "model.jaffle_shop.order_discounts_promotion_name": [ + "model.jaffle_shop.metric_promotion_daily_promotion_name", + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.int_promotion_effectiveness_discount_type": [ + "model.jaffle_shop.promotion_roi_discount_type" + ], + "model.jaffle_shop.int_promotion_effectiveness_order_count": [ + "model.jaffle_shop.promotion_roi_order_count" + ], + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value": [ + "model.jaffle_shop.promotion_roi_avg_order_value" + ], + "model.jaffle_shop.int_promotion_effectiveness_total_revenue": [ + "model.jaffle_shop.promotion_roi_total_revenue" + ], + "model.jaffle_shop.int_promotion_effectiveness_avg_margin": [ + "model.jaffle_shop.promotion_roi_avg_margin" + ], + "model.jaffle_shop.order_discounts_discount_amount": [ + "model.jaffle_shop.promotion_roi_total_discount_given", + "model.jaffle_shop.metric_promotion_daily_total_discount", + "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar" + ], + "model.jaffle_shop.order_discounts_net_revenue": [ + "model.jaffle_shop.metric_promotion_daily_total_net_revenue", + "model.jaffle_shop.promotion_roi_net_revenue_after_discount", + "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar" + ], + "model.jaffle_shop.revenue_summary_order_month": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.gross_margin_order_month" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.stores_store_id", + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.int_store_performance_store_id", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.orders_amount": [ + "model.jaffle_shop.order_fulfillment_amount", + "model.jaffle_shop.order_returns_amount" + ], + "model.jaffle_shop.int_store_employees_active_store_name": [ + "model.jaffle_shop.int_store_performance_store_name", + "model.jaffle_shop.order_fulfillment_store_name", + "model.jaffle_shop.stores_store_name" + ], + "model.jaffle_shop.int_store_employees_active_city": [ + "model.jaffle_shop.int_store_performance_city", + "model.jaffle_shop.order_fulfillment_city", + "model.jaffle_shop.stores_city" + ], + "model.jaffle_shop.int_store_employees_active_state": [ + "model.jaffle_shop.order_fulfillment_state", + "model.jaffle_shop.int_store_performance_state", + "model.jaffle_shop.stores_state" + ], + "model.jaffle_shop.int_store_employees_active_total_employees": [ + "model.jaffle_shop.int_store_performance_revenue_per_employee", + "model.jaffle_shop.int_store_performance_total_employees", + "model.jaffle_shop.stores_total_employees", + "model.jaffle_shop.order_fulfillment_store_employee_count", + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.stg_supply_orders": [ + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id", + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.stg_supply_orders_product_id": [ + "model.jaffle_shop.int_inventory_movements_product_id", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.int_supply_order_costs_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_inventory_movements_product_id", + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_order_items_enriched_product_id" + ], + "model.jaffle_shop.stg_supply_orders_store_id": [ + "model.jaffle_shop.int_supply_order_costs_store_id", + "model.jaffle_shop.int_inventory_movements_store_id" + ], + "model.jaffle_shop.stg_supply_orders_delivered_date": [ + "model.jaffle_shop.int_inventory_movements_movement_date", + "model.jaffle_shop.int_supply_order_costs_delivered_date", + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.int_store_order_assignments_order_date": [ + "model.jaffle_shop.int_inventory_movements_movement_date" + ], + "model.jaffle_shop.stg_supply_orders_quantity": [ + "model.jaffle_shop.int_supply_order_costs_total_cost", + "model.jaffle_shop.int_inventory_movements_quantity_in", + "model.jaffle_shop.int_supply_order_costs_quantity" + ], + "model.jaffle_shop.int_order_items_with_products_quantity": [ + "model.jaffle_shop.int_order_items_enriched_line_cost", + "model.jaffle_shop.int_inventory_movements_quantity_out", + "model.jaffle_shop.int_order_items_enriched_line_margin", + "model.jaffle_shop.int_order_items_enriched_quantity" + ], + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "seed.jaffle_shop.raw_stores_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "seed.jaffle_shop.raw_stores_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "seed.jaffle_shop.raw_stores_city": ["model.jaffle_shop.stg_stores_city"], + "seed.jaffle_shop.raw_stores_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "seed.jaffle_shop.raw_stores_opened_at": [ + "model.jaffle_shop.stg_stores_opened_at" + ], + "model.jaffle_shop.order_items_product_name": [ + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.metric_product_sales_daily_product_name" + ], + "model.jaffle_shop.order_items_category_name": [ + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.metric_product_sales_daily_category_name" + ], + "model.jaffle_shop.order_items_order_id": [ + "model.jaffle_shop.metric_product_sales_daily" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.int_product_stock_levels", + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.metric_monthly_sales_month_start": [ + "model.jaffle_shop.rpt_executive_dashboard_month_start" + ], + "model.jaffle_shop.metric_monthly_sales_total_orders": [ + "model.jaffle_shop.rpt_executive_dashboard_total_orders" + ], + "model.jaffle_shop.metric_monthly_sales_total_revenue": [ + "model.jaffle_shop.rpt_executive_dashboard_total_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_net_revenue": [ + "model.jaffle_shop.rpt_executive_dashboard_net_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_total_margin": [ + "model.jaffle_shop.rpt_executive_dashboard_total_margin" + ], + "model.jaffle_shop.gross_margin_total_margin": [ + "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct" + ], + "model.jaffle_shop.gross_margin_total_revenue": [ + "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct" + ], + "model.jaffle_shop.metric_monthly_sales_total_items_sold": [ + "model.jaffle_shop.rpt_executive_dashboard_total_items_sold" + ], + "model.jaffle_shop.metric_monthly_sales_active_days": [ + "model.jaffle_shop.rpt_executive_dashboard_active_days" + ], + "model.jaffle_shop.orders_credit_card_amount": [ + "model.jaffle_shop.order_returns_credit_card_amount" + ], + "model.jaffle_shop.orders_coupon_amount": [ + "model.jaffle_shop.order_returns_coupon_amount" + ], + "model.jaffle_shop.orders_bank_transfer_amount": [ + "model.jaffle_shop.order_returns_bank_transfer_amount" + ], + "model.jaffle_shop.orders_gift_card_amount": [ + "model.jaffle_shop.order_returns_gift_card_amount" + ], + "model.jaffle_shop.product_performance_category_name": [ + "model.jaffle_shop.product_profitability_category_name" + ], + "model.jaffle_shop.product_performance_total_margin": [ + "model.jaffle_shop.product_profitability_gross_margin_pct", + "model.jaffle_shop.product_profitability_gross_margin" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.rpt_sales_dashboard" + ], + "model.jaffle_shop.metric_weekly_sales_week_start": [ + "model.jaffle_shop.rpt_sales_dashboard_week_start", + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_total_orders": [ + "model.jaffle_shop.rpt_sales_dashboard_total_orders" + ], + "model.jaffle_shop.metric_weekly_sales_total_revenue": [ + "model.jaffle_shop.rpt_sales_dashboard_total_revenue", + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_net_revenue": [ + "model.jaffle_shop.rpt_sales_dashboard_net_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_total_margin": [ + "model.jaffle_shop.rpt_sales_dashboard_total_margin" + ], + "model.jaffle_shop.metric_weekly_sales_total_discounts": [ + "model.jaffle_shop.rpt_sales_dashboard_total_discounts" + ], + "model.jaffle_shop.metric_weekly_sales_total_items_sold": [ + "model.jaffle_shop.rpt_sales_dashboard_total_items_sold" + ], + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value": [ + "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value" + ], + "model.jaffle_shop.product_profitability_product_id": [ + "model.jaffle_shop.cost_analysis", + "model.jaffle_shop.cost_analysis_product_id" + ], + "model.jaffle_shop.product_profitability": [ + "model.jaffle_shop.cost_analysis" + ], + "model.jaffle_shop.product_profitability_product_name": [ + "model.jaffle_shop.cost_analysis_product_name" + ], + "model.jaffle_shop.product_profitability_category_name": [ + "model.jaffle_shop.cost_analysis_category_name" + ], + "model.jaffle_shop.product_profitability_total_revenue": [ + "model.jaffle_shop.cost_analysis_total_revenue" + ], + "model.jaffle_shop.product_profitability_gross_margin": [ + "model.jaffle_shop.cost_analysis_gross_margin" + ], + "model.jaffle_shop.product_profitability_total_quantity_sold": [ + "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold", + "model.jaffle_shop.cost_analysis_total_quantity_sold" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_id", + "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.orders_status", + "model.jaffle_shop.new_orders_status", + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.stg_promotions_promotion_name": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_name" + ], + "model.jaffle_shop.stg_promotions_discount_type": [ + "model.jaffle_shop.int_orders_with_promotions_discount_type" + ], + "model.jaffle_shop.stg_promotions_discount_value": [ + "model.jaffle_shop.int_orders_with_promotions_discount_value" + ], + "seed.jaffle_shop.raw_supply_orders": [ + "model.jaffle_shop.stg_supply_orders" + ], + "seed.jaffle_shop.raw_supply_orders_id": [ + "model.jaffle_shop.stg_supply_orders_supply_order_id" + ], + "seed.jaffle_shop.raw_supply_orders_product_id": [ + "model.jaffle_shop.stg_supply_orders_product_id" + ], + "seed.jaffle_shop.raw_supply_orders_store_id": [ + "model.jaffle_shop.stg_supply_orders_store_id" + ], + "seed.jaffle_shop.raw_supply_orders_quantity": [ + "model.jaffle_shop.stg_supply_orders_quantity" + ], + "seed.jaffle_shop.raw_supply_orders_order_date": [ + "model.jaffle_shop.stg_supply_orders_order_date" + ], + "seed.jaffle_shop.raw_supply_orders_delivered_date": [ + "model.jaffle_shop.stg_supply_orders_delivered_date" + ], + "model.jaffle_shop.int_category_hierarchy_parent_category_id": [ + "model.jaffle_shop.product_categories_parent_category_id" + ], + "model.jaffle_shop.stg_employees_employee_id": [ + "model.jaffle_shop.store_staffing_employee_id" + ], + "model.jaffle_shop.stg_employees_first_name": [ + "model.jaffle_shop.store_staffing_first_name" + ], + "model.jaffle_shop.stg_employees_last_name": [ + "model.jaffle_shop.store_staffing_last_name" + ], + "model.jaffle_shop.int_order_payments_matched_order_subtotal": [ + "model.jaffle_shop.order_payment_status_payment_difference", + "model.jaffle_shop.order_payment_status_order_subtotal" + ], + "model.jaffle_shop.int_order_payments_matched_payment_method_count": [ + "model.jaffle_shop.order_payment_status_payment_method_count" + ], + "model.jaffle_shop.metric_daily_revenue_unique_customers": [ + "model.jaffle_shop.metric_weekly_sales_total_customer_visits" + ], + "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders": [ + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": [ + "model.jaffle_shop.customer_lifetime_value_monthly_value", + "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.products" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.products" + ], + "model.jaffle_shop.int_order_items_with_products_order_item_id": [ + "model.jaffle_shop.int_order_items_enriched_order_item_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_name": [ + "model.jaffle_shop.int_order_items_enriched_product_name" + ], + "model.jaffle_shop.int_order_items_with_products_category_name": [ + "model.jaffle_shop.int_order_items_enriched_category_name" + ], + "model.jaffle_shop.int_order_items_with_products_root_category": [ + "model.jaffle_shop.int_order_items_enriched_root_category" + ], + "model.jaffle_shop.int_order_items_with_products_category_path": [ + "model.jaffle_shop.int_order_items_enriched_category_path" + ], + "model.jaffle_shop.int_order_items_with_products_unit_price": [ + "model.jaffle_shop.int_order_items_enriched_unit_price" + ], + "model.jaffle_shop.int_order_items_with_products_line_total": [ + "model.jaffle_shop.int_order_items_enriched_line_total", + "model.jaffle_shop.int_order_items_enriched_line_margin" + ], + "model.jaffle_shop.int_product_margins_cost": [ + "model.jaffle_shop.int_order_items_enriched_line_cost", + "model.jaffle_shop.int_order_items_enriched_line_margin", + "model.jaffle_shop.int_order_items_enriched_cost" + ], + "model.jaffle_shop.int_product_margins_margin_pct": [ + "model.jaffle_shop.products_margin_pct", + "model.jaffle_shop.int_order_items_enriched_margin_pct" + ], + "model.jaffle_shop.int_store_employees_active_manager_count": [ + "model.jaffle_shop.stores_manager_count" + ], + "model.jaffle_shop.int_store_employees_active_barista_count": [ + "model.jaffle_shop.stores_barista_count" + ], + "model.jaffle_shop.int_store_employees_active_cashier_count": [ + "model.jaffle_shop.stores_cashier_count" + ], + "model.jaffle_shop.int_store_employees_active_cook_count": [ + "model.jaffle_shop.stores_cook_count" + ], + "model.jaffle_shop.int_store_employees_active_earliest_hire": [ + "model.jaffle_shop.stores_earliest_hire" + ], + "model.jaffle_shop.int_store_employees_active_latest_hire": [ + "model.jaffle_shop.stores_latest_hire" + ], + "seed.jaffle_shop.raw_customers": ["model.jaffle_shop.stg_customers"], + "seed.jaffle_shop.raw_customers_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "seed.jaffle_shop.raw_customers_first_name": [ + "model.jaffle_shop.stg_customers_first_name" + ], + "seed.jaffle_shop.raw_customers_last_name": [ + "model.jaffle_shop.stg_customers_last_name" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.products_product_id", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.products" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.products" + ], + "model.jaffle_shop.int_products_with_categories_product_name": [ + "model.jaffle_shop.products_product_name", + "model.jaffle_shop.int_order_items_with_products_product_name", + "model.jaffle_shop.int_reviews_with_products_product_name" + ], + "model.jaffle_shop.int_products_with_categories_category_id": [ + "model.jaffle_shop.products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_category_name": [ + "model.jaffle_shop.int_reviews_with_products_category_name", + "model.jaffle_shop.products_category_name", + "model.jaffle_shop.int_order_items_with_products_category_name" + ], + "model.jaffle_shop.int_products_with_categories_root_category": [ + "model.jaffle_shop.products_root_category", + "model.jaffle_shop.int_reviews_with_products_root_category", + "model.jaffle_shop.int_order_items_with_products_root_category" + ], + "model.jaffle_shop.int_products_with_categories_category_path": [ + "model.jaffle_shop.products_category_path", + "model.jaffle_shop.int_order_items_with_products_category_path" + ], + "model.jaffle_shop.int_products_with_categories_price": [ + "model.jaffle_shop.products_price" + ], + "model.jaffle_shop.int_products_with_categories_cost": [ + "model.jaffle_shop.products_cost" + ], + "model.jaffle_shop.int_product_margins_margin": [ + "model.jaffle_shop.products_margin" + ], + "model.jaffle_shop.int_products_with_categories_created_at": [ + "model.jaffle_shop.products_created_at" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_promotions_name": [ + "model.jaffle_shop.stg_promotions_promotion_name" + ], + "seed.jaffle_shop.raw_promotions_discount_type": [ + "model.jaffle_shop.stg_promotions_discount_type" + ], + "seed.jaffle_shop.raw_promotions_discount_value": [ + "model.jaffle_shop.stg_promotions_discount_value" + ], + "seed.jaffle_shop.raw_promotions_start_date": [ + "model.jaffle_shop.stg_promotions_start_date" + ], + "seed.jaffle_shop.raw_promotions_end_date": [ + "model.jaffle_shop.stg_promotions_end_date" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_product_stock_levels_store_id": [ + "model.jaffle_shop.product_inventory_store_id", + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_product_stock_levels_product_id": [ + "model.jaffle_shop.product_inventory_product_id", + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_product_stock_levels_product_store_key": [ + "model.jaffle_shop.product_inventory_product_store_key" + ], + "model.jaffle_shop.int_product_stock_levels_total_received": [ + "model.jaffle_shop.product_inventory_total_received" + ], + "model.jaffle_shop.int_product_stock_levels_total_sold": [ + "model.jaffle_shop.product_inventory_total_sold" + ], + "model.jaffle_shop.int_product_stock_levels_current_stock": [ + "model.jaffle_shop.product_inventory_stock_status", + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.int_product_stock_levels_last_restock_date": [ + "model.jaffle_shop.product_inventory_last_restock_date" + ], + "model.jaffle_shop.int_product_stock_levels_last_sale_date": [ + "model.jaffle_shop.product_inventory_last_sale_date" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.metric_daily_orders_placed_orders", + "model.jaffle_shop.metric_daily_orders_shipped_orders", + "model.jaffle_shop.metric_daily_orders_returned_orders", + "model.jaffle_shop.metric_daily_orders_completed_orders" + ], + "model.jaffle_shop.int_product_ratings_product_name": [ + "model.jaffle_shop.product_reviews_product_name" + ], + "model.jaffle_shop.int_product_ratings_category_name": [ + "model.jaffle_shop.product_reviews_category_name" + ], + "model.jaffle_shop.int_product_ratings_root_category": [ + "model.jaffle_shop.product_reviews_root_category" + ], + "model.jaffle_shop.int_inventory_movements_product_id": [ + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.int_inventory_movements_store_id": [ + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.product_inventory_product_store_key": [ + "model.jaffle_shop.inventory_health_product_store_key" + ], + "model.jaffle_shop.int_inventory_movements_quantity_in": [ + "model.jaffle_shop.inventory_health_total_inbound", + "model.jaffle_shop.inventory_health_inventory_balance" + ], + "model.jaffle_shop.int_inventory_movements_quantity_out": [ + "model.jaffle_shop.inventory_health_total_outbound", + "model.jaffle_shop.inventory_health_inventory_balance", + "model.jaffle_shop.inventory_health_avg_units_per_sale" + ], + "model.jaffle_shop.int_inventory_movements_movement_type": [ + "model.jaffle_shop.inventory_health_restock_events", + "model.jaffle_shop.inventory_health_avg_units_per_sale", + "model.jaffle_shop.inventory_health_sale_events" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_name": [ + "model.jaffle_shop.stg_categories_category_name" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.stg_reviews_rating": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating", + "model.jaffle_shop.int_customer_review_activity_min_rating", + "model.jaffle_shop.int_customer_review_activity_max_rating", + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.stg_reviews_review_date": [ + "model.jaffle_shop.int_customer_review_activity_last_review_date", + "model.jaffle_shop.int_reviews_with_products_review_date", + "model.jaffle_shop.int_customer_review_activity_first_review_date" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items_order_item_id": [ + "model.jaffle_shop.int_order_items_with_products_order_item_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.stg_order_items_quantity": [ + "model.jaffle_shop.int_order_items_with_products_line_total", + "model.jaffle_shop.int_order_items_with_products_quantity" + ], + "model.jaffle_shop.stg_order_items_unit_price": [ + "model.jaffle_shop.int_order_items_with_products_unit_price", + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_customer_segments_customer_id": [ + "model.jaffle_shop.customer_segments_final_customer_id" + ], + "model.jaffle_shop.int_customer_segments_first_name": [ + "model.jaffle_shop.customer_segments_final_first_name" + ], + "model.jaffle_shop.int_customer_segments_last_name": [ + "model.jaffle_shop.customer_segments_final_last_name" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.int_customer_segments_recency_score": [ + "model.jaffle_shop.customer_segments_final_recency_score" + ], + "model.jaffle_shop.int_customer_segments_frequency_score": [ + "model.jaffle_shop.customer_segments_final_frequency_score" + ], + "model.jaffle_shop.int_customer_segments_monetary_score": [ + "model.jaffle_shop.customer_segments_final_monetary_score" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.int_customer_segments_total_orders": [ + "model.jaffle_shop.customer_segments_final_total_orders" + ], + "model.jaffle_shop.int_customer_segments_total_spent": [ + "model.jaffle_shop.customer_segments_final_total_spent" + ], + "model.jaffle_shop.int_customer_segments_days_since_last_order": [ + "model.jaffle_shop.customer_segments_final_days_since_last_order" + ], + "model.jaffle_shop.int_order_enriched_total_quantity": [ + "model.jaffle_shop.int_customer_order_history_total_items_purchased" + ], + "model.jaffle_shop.int_reviews_with_products_product_name": [ + "model.jaffle_shop.int_product_ratings", + "model.jaffle_shop.int_product_ratings_product_name" + ], + "model.jaffle_shop.int_reviews_with_products": [ + "model.jaffle_shop.int_product_ratings" + ], + "model.jaffle_shop.int_reviews_with_products_root_category": [ + "model.jaffle_shop.int_product_ratings_root_category", + "model.jaffle_shop.int_product_ratings" + ], + "model.jaffle_shop.int_reviews_with_products_category_name": [ + "model.jaffle_shop.int_product_ratings_category_name", + "model.jaffle_shop.int_product_ratings" + ], + "model.jaffle_shop.int_reviews_with_products_product_id": [ + "model.jaffle_shop.int_product_ratings_product_id", + "model.jaffle_shop.int_product_ratings" + ], + "model.jaffle_shop.int_reviews_with_products_rating": [ + "model.jaffle_shop.int_product_ratings_positive_reviews", + "model.jaffle_shop.int_product_ratings_avg_rating", + "model.jaffle_shop.int_product_ratings_negative_reviews", + "model.jaffle_shop.int_product_ratings_max_rating", + "model.jaffle_shop.int_product_ratings_min_rating" + ], + "model.jaffle_shop.stg_reviews_review_id": [ + "model.jaffle_shop.int_reviews_with_products_review_id" + ], + "model.jaffle_shop.stg_reviews_order_id": [ + "model.jaffle_shop.int_reviews_with_products_order_id" + ], + "model.jaffle_shop.int_customer_order_history_total_orders": [ + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_frequency_score", + "model.jaffle_shop.int_customer_segments_total_orders", + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.int_customer_order_history_customer_id": [ + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.int_customer_segments_customer_id" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_order_history_first_name": [ + "model.jaffle_shop.int_customer_segments_first_name" + ], + "model.jaffle_shop.int_customer_order_history_last_name": [ + "model.jaffle_shop.int_customer_segments_last_name" + ], + "model.jaffle_shop.int_customer_order_history_total_spent": [ + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_monetary_score", + "model.jaffle_shop.int_customer_segments_customer_segment", + "model.jaffle_shop.int_customer_segments_total_spent" + ], + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": [ + "model.jaffle_shop.int_customer_segments_recency_score", + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_days_since_last_order", + "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.metric_customer_retention_monthly" + ], + "model.jaffle_shop.customer_retention_months_since_first": [ + "model.jaffle_shop.metric_customer_retention_monthly", + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first" + ], + "model.jaffle_shop.customer_retention_cohort_month": [ + "model.jaffle_shop.metric_customer_retention_monthly", + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month" + ], + "model.jaffle_shop.customer_retention_customers": [ + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_performance_order_count", + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "model.jaffle_shop.int_store_revenue_unique_customers": [ + "model.jaffle_shop.int_store_performance_unique_customers" + ], + "model.jaffle_shop.int_store_revenue_total_revenue": [ + "model.jaffle_shop.int_store_performance_total_revenue", + "model.jaffle_shop.int_store_performance_revenue_per_employee" + ], + "model.jaffle_shop.int_store_revenue_total_margin": [ + "model.jaffle_shop.int_store_performance_total_margin" + ], + "model.jaffle_shop.int_store_revenue_avg_order_value": [ + "model.jaffle_shop.int_store_performance_avg_order_value" + ], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_name": [ + "model.jaffle_shop.stg_products_product_name" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "seed.jaffle_shop.raw_products_price": [ + "model.jaffle_shop.stg_products_price", + "model.jaffle_shop.stg_products_price_cents" + ], + "seed.jaffle_shop.raw_products_cost": [ + "model.jaffle_shop.stg_products_cost_cents", + "model.jaffle_shop.stg_products_cost" + ], + "seed.jaffle_shop.raw_products_created_at": [ + "model.jaffle_shop.stg_products_created_at" + ], + "model.jaffle_shop.metric_store_daily_store_id": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings_store_id": [ + "model.jaffle_shop.rpt_store_dashboard", + "model.jaffle_shop.rpt_store_dashboard_store_id" + ], + "model.jaffle_shop.store_inventory_store_id": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings_store_name": [ + "model.jaffle_shop.rpt_store_dashboard_store_name" + ], + "model.jaffle_shop.store_rankings_city": [ + "model.jaffle_shop.rpt_store_dashboard_city" + ], + "model.jaffle_shop.store_rankings_state": [ + "model.jaffle_shop.rpt_store_dashboard_state" + ], + "model.jaffle_shop.store_rankings_total_revenue": [ + "model.jaffle_shop.rpt_store_dashboard_total_revenue" + ], + "model.jaffle_shop.store_rankings_total_margin": [ + "model.jaffle_shop.rpt_store_dashboard_total_margin" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.rpt_store_dashboard_order_count" + ], + "model.jaffle_shop.store_rankings_unique_customers": [ + "model.jaffle_shop.rpt_store_dashboard_unique_customers" + ], + "model.jaffle_shop.store_rankings_revenue_per_employee": [ + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_revenue_rank": [ + "model.jaffle_shop.rpt_store_dashboard_revenue_rank" + ], + "model.jaffle_shop.store_rankings_efficiency_rank": [ + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank" + ], + "model.jaffle_shop.store_inventory_total_stock_units": [ + "model.jaffle_shop.rpt_store_dashboard_total_stock_units" + ], + "model.jaffle_shop.store_inventory_out_of_stock_products": [ + "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products" + ], + "model.jaffle_shop.store_inventory_low_stock_products": [ + "model.jaffle_shop.rpt_store_dashboard_low_stock_products" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.rpt_store_dashboard_active_days" + ], + "model.jaffle_shop.metric_store_daily_revenue": [ + "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_payments_id": [ + "model.jaffle_shop.stg_payments_payment_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_payments_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_order_items_id": [ + "model.jaffle_shop.stg_order_items_order_item_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_order_items_quantity": [ + "model.jaffle_shop.stg_order_items_quantity" + ], + "seed.jaffle_shop.raw_order_items_unit_price": [ + "model.jaffle_shop.stg_order_items_unit_price" + ], + "model.jaffle_shop.order_discounts_order_date": [ + "model.jaffle_shop.metric_promotion_daily_order_date", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.order_discounts_discount_type": [ + "model.jaffle_shop.metric_promotion_daily_discount_type", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.order_discounts_subtotal": [ + "model.jaffle_shop.metric_promotion_daily_total_order_value" + ], + "model.jaffle_shop.order_discounts_discount_pct_of_order": [ + "model.jaffle_shop.metric_promotion_daily_avg_discount_pct" + ], + "model.jaffle_shop.stg_supply_orders_supply_order_id": [ + "model.jaffle_shop.int_supply_order_costs_supply_order_id" + ], + "model.jaffle_shop.stg_supply_orders_order_date": [ + "model.jaffle_shop.int_supply_order_costs_order_date", + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.int_daily_order_summary_order_date": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.int_daily_order_summary_order_count": [ + "model.jaffle_shop.metric_daily_revenue_order_count" + ], + "model.jaffle_shop.int_daily_order_summary_total_revenue": [ + "model.jaffle_shop.metric_daily_revenue_total_revenue", + "model.jaffle_shop.metric_daily_revenue_net_revenue" + ], + "model.jaffle_shop.int_daily_order_summary_total_cost": [ + "model.jaffle_shop.metric_daily_revenue_total_cost" + ], + "model.jaffle_shop.int_daily_order_summary_total_margin": [ + "model.jaffle_shop.metric_daily_revenue_total_margin" + ], + "model.jaffle_shop.int_daily_order_summary_total_discounts": [ + "model.jaffle_shop.metric_daily_revenue_total_discounts", + "model.jaffle_shop.metric_daily_revenue_net_revenue" + ], + "model.jaffle_shop.int_daily_order_summary_avg_order_value": [ + "model.jaffle_shop.metric_daily_revenue_avg_order_value" + ], + "model.jaffle_shop.int_daily_order_summary_unique_customers": [ + "model.jaffle_shop.metric_daily_revenue_unique_customers" + ], + "model.jaffle_shop.int_daily_order_summary_total_items_sold": [ + "model.jaffle_shop.metric_daily_revenue_total_items_sold" + ], + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": [ + "model.jaffle_shop.customer_lifetime_value_last_order_date" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-impact-overview.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-impact-overview.json new file mode 100644 index 000000000..ec3a34968 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-impact-overview.json @@ -0,0 +1 @@ +{ "current": { "nodes": {}, "columns": {}, "parent_map": {}, "child_map": {} } } diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue-no-downstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue-no-downstream.json new file mode 100644 index 000000000..e7d925653 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue-no-downstream.json @@ -0,0 +1,1340 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "seed.jaffle_shop.raw_orders": [], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories_category_id", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_promotions": [], + "seed.jaffle_shop.raw_categories": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "seed.jaffle_shop.raw_stores": [], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "seed.jaffle_shop.raw_products": [], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_order_promotions": [], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products_category_id", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "seed.jaffle_shop.raw_promotions_id": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ] + }, + "child_map": { + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue-no-upstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue-no-upstream.json new file mode 100644 index 000000000..3b463e7e9 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue-no-upstream.json @@ -0,0 +1,96 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.int_store_revenue": [] + }, + "child_map": { + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue.json new file mode 100644 index 000000000..e9e2a8122 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_int_store_revenue.json @@ -0,0 +1,1412 @@ +{ + "current": { + "nodes": { + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_stores": [], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products_category_id", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories_category_id", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories" + ], + "seed.jaffle_shop.raw_categories": [], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "seed.jaffle_shop.raw_order_items": [], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_payments": [], + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_promotions": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "seed.jaffle_shop.raw_products": [], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_promotions_id": [], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts-no-downstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts-no-downstream.json new file mode 100644 index 000000000..d8ade479f --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts-no-downstream.json @@ -0,0 +1,1260 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.order_discounts": { + "id": "model.jaffle_shop.order_discounts", + "name": "order_discounts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndiscounts as (\n select\n order_id,\n customer_id,\n order_date,\n subtotal,\n has_promotion,\n promotion_name,\n discount_type,\n discount_value,\n discount_amount,\n case when subtotal > 0\n then round(discount_amount / subtotal * 100, 1)\n else 0\n end as discount_pct_of_order,\n subtotal - discount_amount as net_revenue\n from orders\n where has_promotion = true\n)\n\nselect * from discounts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "has_promotion": { + "id": "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "has_promotion": { + "id": "model.jaffle_shop.int_order_enriched_has_promotion", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_has_promotion": { + "id": "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_has_promotion": { + "id": "model.jaffle_shop.int_order_enriched_has_promotion", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "seed.jaffle_shop.raw_orders": [], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories_category_id", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_promotions": [], + "seed.jaffle_shop.raw_categories": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "seed.jaffle_shop.raw_products": [], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_order_promotions": [], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products_category_id", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_has_promotion": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "seed.jaffle_shop.raw_promotions_id": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.int_order_enriched_has_promotion": [ + "model.jaffle_shop.int_orders_with_promotions_has_promotion" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.int_order_enriched_has_promotion": [ + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_has_promotion": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts-no-upstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts-no-upstream.json new file mode 100644 index 000000000..aca69d120 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts-no-upstream.json @@ -0,0 +1,56 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.order_discounts": { + "id": "model.jaffle_shop.order_discounts", + "name": "order_discounts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndiscounts as (\n select\n order_id,\n customer_id,\n order_date,\n subtotal,\n has_promotion,\n promotion_name,\n discount_type,\n discount_value,\n discount_amount,\n case when subtotal > 0\n then round(discount_amount / subtotal * 100, 1)\n else 0\n end as discount_pct_of_order,\n subtotal - discount_amount as net_revenue\n from orders\n where has_promotion = true\n)\n\nselect * from discounts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.promotion_roi": { + "id": "model.jaffle_shop.promotion_roi", + "name": "promotion_roi", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with effectiveness as (\n select * from {{ ref('int_promotion_effectiveness') }}\n),\n\ndiscounts as (\n select\n promotion_name,\n count(*) as usage_count,\n sum(discount_amount) as total_discount_given,\n sum(net_revenue) as total_net_revenue\n from {{ ref('order_discounts') }}\n group by promotion_name\n),\n\nroi as (\n select\n e.promotion_name,\n e.discount_type,\n e.order_count,\n e.avg_order_value,\n e.total_revenue,\n e.avg_margin,\n coalesce(d.total_discount_given, 0) as total_discount_given,\n coalesce(d.total_net_revenue, 0) as net_revenue_after_discount,\n case when coalesce(d.total_discount_given, 0) > 0\n then round(coalesce(d.total_net_revenue, 0) / d.total_discount_given, 2)\n else 0\n end as revenue_per_discount_dollar\n from effectiveness e\n left join discounts d on e.promotion_name = d.promotion_name\n where e.has_promotion = true\n)\n\nselect * from roi", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_promotion_daily": { + "id": "model.jaffle_shop.metric_promotion_daily", + "name": "metric_promotion_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with discounts as (\n select * from {{ ref('order_discounts') }}\n),\n\ndaily as (\n select\n order_date,\n promotion_name,\n discount_type,\n count(*) as usage_count,\n sum(discount_amount) as total_discount,\n sum(subtotal) as total_order_value,\n sum(net_revenue) as total_net_revenue,\n avg(discount_pct_of_order) as avg_discount_pct\n from discounts\n group by order_date, promotion_name, discount_type\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { + "model.jaffle_shop.order_discounts": [], + "model.jaffle_shop.promotion_roi": ["model.jaffle_shop.order_discounts"], + "model.jaffle_shop.metric_promotion_daily": [ + "model.jaffle_shop.order_discounts" + ] + }, + "child_map": { + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.metric_promotion_daily" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts.json new file mode 100644 index 000000000..b6e7e5340 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_order_discounts.json @@ -0,0 +1,1292 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.order_discounts": { + "id": "model.jaffle_shop.order_discounts", + "name": "order_discounts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndiscounts as (\n select\n order_id,\n customer_id,\n order_date,\n subtotal,\n has_promotion,\n promotion_name,\n discount_type,\n discount_value,\n discount_amount,\n case when subtotal > 0\n then round(discount_amount / subtotal * 100, 1)\n else 0\n end as discount_pct_of_order,\n subtotal - discount_amount as net_revenue\n from orders\n where has_promotion = true\n)\n\nselect * from discounts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "has_promotion": { + "id": "model.jaffle_shop.int_order_enriched_has_promotion", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.promotion_roi": { + "id": "model.jaffle_shop.promotion_roi", + "name": "promotion_roi", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with effectiveness as (\n select * from {{ ref('int_promotion_effectiveness') }}\n),\n\ndiscounts as (\n select\n promotion_name,\n count(*) as usage_count,\n sum(discount_amount) as total_discount_given,\n sum(net_revenue) as total_net_revenue\n from {{ ref('order_discounts') }}\n group by promotion_name\n),\n\nroi as (\n select\n e.promotion_name,\n e.discount_type,\n e.order_count,\n e.avg_order_value,\n e.total_revenue,\n e.avg_margin,\n coalesce(d.total_discount_given, 0) as total_discount_given,\n coalesce(d.total_net_revenue, 0) as net_revenue_after_discount,\n case when coalesce(d.total_discount_given, 0) > 0\n then round(coalesce(d.total_net_revenue, 0) / d.total_discount_given, 2)\n else 0\n end as revenue_per_discount_dollar\n from effectiveness e\n left join discounts d on e.promotion_name = d.promotion_name\n where e.has_promotion = true\n)\n\nselect * from roi", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "has_promotion": { + "id": "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_promotion_daily": { + "id": "model.jaffle_shop.metric_promotion_daily", + "name": "metric_promotion_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with discounts as (\n select * from {{ ref('order_discounts') }}\n),\n\ndaily as (\n select\n order_date,\n promotion_name,\n discount_type,\n count(*) as usage_count,\n sum(discount_amount) as total_discount,\n sum(subtotal) as total_order_value,\n sum(net_revenue) as total_net_revenue,\n avg(discount_pct_of_order) as avg_discount_pct\n from discounts\n group by order_date, promotion_name, discount_type\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_has_promotion": { + "id": "model.jaffle_shop.int_order_enriched_has_promotion", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_has_promotion": { + "id": "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products_category_id", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories_category_id", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories" + ], + "seed.jaffle_shop.raw_categories": [], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_payments": [], + "model.jaffle_shop.promotion_roi": ["model.jaffle_shop.order_discounts"], + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_promotions": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "seed.jaffle_shop.raw_products": [], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.metric_promotion_daily": [ + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.int_order_enriched_has_promotion": [ + "model.jaffle_shop.int_orders_with_promotions_has_promotion" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_promotions_id": [], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_has_promotion": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.int_order_enriched_has_promotion": [ + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "model.jaffle_shop.int_orders_with_promotions_has_promotion": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary-no-downstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary-no-downstream.json new file mode 100644 index 000000000..1ffab5f09 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary-no-downstream.json @@ -0,0 +1,1435 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "seed.jaffle_shop.raw_orders": [], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories_category_id", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_promotions": [], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "seed.jaffle_shop.raw_categories": [], + "seed.jaffle_shop.raw_stores": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "seed.jaffle_shop.raw_products": [], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_order_promotions": [], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products_category_id", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_orders_order_date": [], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "seed.jaffle_shop.raw_promotions_id": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ] + }, + "child_map": { + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary-no-upstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary-no-upstream.json new file mode 100644 index 000000000..923a49da1 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary-no-upstream.json @@ -0,0 +1,92 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.gross_margin": ["model.jaffle_shop.revenue_summary"], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.gross_margin" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.revenue_summary": [] + }, + "child_map": { + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary.json new file mode 100644 index 000000000..4ab4e4892 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_revenue_summary.json @@ -0,0 +1,1503 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "seed.jaffle_shop.raw_stores": [], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products_category_id", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories_category_id", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories" + ], + "seed.jaffle_shop.raw_categories": [], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "seed.jaffle_shop.raw_order_items": [], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary" + ], + "seed.jaffle_shop.raw_payments": [], + "model.jaffle_shop.gross_margin": ["model.jaffle_shop.revenue_summary"], + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_promotions": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.gross_margin" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories_product_id", + "model.jaffle_shop.int_products_with_categories" + ], + "seed.jaffle_shop.raw_products": [], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_orders_order_date": [], + "seed.jaffle_shop.raw_promotions_id": [], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees-no-downstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees-no-downstream.json new file mode 100644 index 000000000..d4a780728 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees-no-downstream.json @@ -0,0 +1,38 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stg_employees": { + "id": "model.jaffle_shop.stg_employees", + "name": "stg_employees", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_employees') }}\n),\n\nrenamed as (\n select\n id as employee_id,\n store_id,\n first_name,\n last_name,\n role,\n cast(hired_at as date) as hired_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_employees": { + "id": "seed.jaffle_shop.raw_employees", + "name": "raw_employees", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { + "model.jaffle_shop.stg_employees": ["seed.jaffle_shop.raw_employees"], + "seed.jaffle_shop.raw_employees": [] + }, + "child_map": { + "seed.jaffle_shop.raw_employees": ["model.jaffle_shop.stg_employees"] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees-no-upstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees-no-upstream.json new file mode 100644 index 000000000..d2607f13c --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees-no-upstream.json @@ -0,0 +1,178 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stg_employees": { + "id": "model.jaffle_shop.stg_employees", + "name": "stg_employees", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_employees') }}\n),\n\nrenamed as (\n select\n id as employee_id,\n store_id,\n first_name,\n last_name,\n role,\n cast(hired_at as date) as hired_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_staffing": { + "id": "model.jaffle_shop.store_staffing", + "name": "store_staffing", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstaffing as (\n select\n e.employee_id,\n e.first_name,\n e.last_name,\n e.role,\n e.hired_at,\n e.store_id,\n s.store_name,\n s.city,\n s.state\n from employees e\n left join stores s on e.store_id = s.store_id\n)\n\nselect * from staffing", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { + "model.jaffle_shop.stg_employees": [], + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_employees" + ], + "model.jaffle_shop.store_staffing": ["model.jaffle_shop.stg_employees"], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.metric_store_daily": ["model.jaffle_shop.stores"], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active" + ] + }, + "child_map": { + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_employees": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing" + ], + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees.json new file mode 100644 index 000000000..dcd2e713a --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-model_jaffle_shop_stg_employees.json @@ -0,0 +1,192 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stg_employees": { + "id": "model.jaffle_shop.stg_employees", + "name": "stg_employees", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_employees') }}\n),\n\nrenamed as (\n select\n id as employee_id,\n store_id,\n first_name,\n last_name,\n role,\n cast(hired_at as date) as hired_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_employees": { + "id": "seed.jaffle_shop.raw_employees", + "name": "raw_employees", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_staffing": { + "id": "model.jaffle_shop.store_staffing", + "name": "store_staffing", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstaffing as (\n select\n e.employee_id,\n e.first_name,\n e.last_name,\n e.role,\n e.hired_at,\n e.store_id,\n s.store_name,\n s.city,\n s.state\n from employees e\n left join stores s on e.store_id = s.store_id\n)\n\nselect * from staffing", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { + "model.jaffle_shop.stg_employees": ["seed.jaffle_shop.raw_employees"], + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_employees" + ], + "seed.jaffle_shop.raw_employees": [], + "model.jaffle_shop.store_staffing": ["model.jaffle_shop.stg_employees"], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.metric_store_daily": ["model.jaffle_shop.stores"], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active" + ] + }, + "child_map": { + "seed.jaffle_shop.raw_employees": ["model.jaffle_shop.stg_employees"], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_employees": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing" + ], + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores-no-downstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores-no-downstream.json new file mode 100644 index 000000000..01d19aae1 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores-no-downstream.json @@ -0,0 +1,21 @@ +{ + "current": { + "nodes": { + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { "seed.jaffle_shop.raw_stores": [] }, + "child_map": {} + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores-no-upstream.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores-no-upstream.json new file mode 100644 index 000000000..dd5f822e1 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores-no-upstream.json @@ -0,0 +1,412 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.product_inventory": { + "id": "model.jaffle_shop.product_inventory", + "name": "product_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('int_product_stock_levels') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nproducts as (\n select * from {{ ref('stg_products') }}\n),\n\nfinal as (\n select\n s.product_store_key,\n s.product_id,\n p.product_name,\n s.store_id,\n st.store_name,\n s.total_received,\n s.total_sold,\n s.current_stock,\n s.last_restock_date,\n s.last_sale_date,\n case\n when s.current_stock <= 0 then 'out_of_stock'\n when s.current_stock < 10 then 'low_stock'\n when s.current_stock < 50 then 'adequate'\n else 'well_stocked'\n end as stock_status\n from stock s\n left join products p on s.product_id = p.product_id\n left join stores st on s.store_id = st.store_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_staffing": { + "id": "model.jaffle_shop.store_staffing", + "name": "store_staffing", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstaffing as (\n select\n e.employee_id,\n e.first_name,\n e.last_name,\n e.role,\n e.hired_at,\n e.store_id,\n s.store_name,\n s.city,\n s.state\n from employees e\n left join stores s on e.store_id = s.store_id\n)\n\nselect * from staffing", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_inventory_movements": { + "id": "model.jaffle_shop.int_inventory_movements", + "name": "int_inventory_movements", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_in as (\n select\n product_id,\n store_id,\n delivered_date as movement_date,\n quantity as quantity_in,\n 0 as quantity_out,\n 'supply' as movement_type\n from {{ ref('stg_supply_orders') }}\n),\n\norder_items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nstore_assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsales_out as (\n select\n oi.product_id,\n sa.store_id,\n sa.order_date as movement_date,\n 0 as quantity_in,\n oi.quantity as quantity_out,\n 'sale' as movement_type\n from order_items oi\n inner join store_assignments sa on oi.order_id = sa.order_id\n),\n\ncombined as (\n select * from supply_in\n union all\n select * from sales_out\n)\n\nselect * from combined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.reorder_recommendations": { + "id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_recommendations", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('product_inventory') }}\n),\n\nperformance as (\n select * from {{ ref('product_performance') }}\n),\n\nrecommendations as (\n select\n s.product_id,\n s.product_name,\n s.store_id,\n s.store_name,\n s.current_stock,\n s.stock_status,\n s.last_restock_date,\n p.total_quantity_sold,\n p.times_ordered,\n case\n when s.stock_status = 'out_of_stock' then 'urgent'\n when s.stock_status = 'low_stock' then 'soon'\n when s.stock_status = 'adequate' and p.times_ordered > 5 then 'monitor'\n else 'ok'\n end as reorder_priority,\n greatest(50 - s.current_stock, 0) as suggested_reorder_qty\n from stock s\n left join performance p on s.product_id = p.product_id\n)\n\nselect * from recommendations", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_inventory_daily": { + "id": "model.jaffle_shop.metric_inventory_daily", + "name": "metric_inventory_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nsnapshot as (\n select\n current_date as snapshot_date,\n count(distinct product_id) as total_products_tracked,\n count(distinct store_id) as total_stores,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_count,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_count,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_count,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_count,\n round(avg(current_stock), 1) as avg_stock_per_product_store\n from inventory\n)\n\nselect * from snapshot", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_product_stock_levels": { + "id": "model.jaffle_shop.int_product_stock_levels", + "name": "int_product_stock_levels", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='product_store_key'\n )\n}}\n\nwith movements as (\n select * from {{ ref('int_inventory_movements') }}\n),\n\nstock as (\n select\n product_id || '-' || store_id as product_store_key,\n product_id,\n store_id,\n sum(quantity_in) as total_received,\n sum(quantity_out) as total_sold,\n sum(quantity_in) - sum(quantity_out) as current_stock,\n max(case when movement_type = 'supply' then movement_date end) as last_restock_date,\n max(case when movement_type = 'sale' then movement_date end) as last_sale_date\n from movements\n\n {% if is_incremental() %}\n where movement_date > (select max(coalesce(last_restock_date, last_sale_date)) from {{ this }})\n {% endif %}\n\n group by product_id, store_id\n)\n\nselect * from stock", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.inventory_health": { + "id": "model.jaffle_shop.inventory_health", + "name": "inventory_health", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nmovements as (\n select\n product_id,\n store_id,\n sum(quantity_in) as total_inbound,\n sum(quantity_out) as total_outbound,\n count(case when movement_type = 'supply' then 1 end) as restock_events,\n count(case when movement_type = 'sale' then 1 end) as sale_events\n from {{ ref('int_inventory_movements') }}\n group by product_id, store_id\n),\n\nhealth as (\n select\n i.product_store_key,\n i.product_id,\n i.product_name,\n i.store_id,\n i.store_name,\n i.current_stock,\n i.stock_status,\n m.total_inbound,\n m.total_outbound,\n m.restock_events,\n m.sale_events,\n case\n when m.total_outbound > m.total_inbound then 'deficit'\n when i.current_stock > m.total_outbound * 2 then 'overstocked'\n else 'balanced'\n end as inventory_balance,\n case when m.sale_events > 0\n then round(cast(m.total_outbound as decimal) / m.sale_events, 1)\n else 0\n end as avg_units_per_sale\n from inventory i\n left join movements m on i.product_id = m.product_id and i.store_id = m.store_id\n)\n\nselect * from health", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_inventory": { + "id": "model.jaffle_shop.store_inventory", + "name": "store_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nstore_level as (\n select\n store_id,\n store_name,\n count(distinct product_id) as unique_products,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_products,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_products,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_stock_products,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_products\n from inventory\n group by store_id, store_name\n)\n\nselect * from store_level", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.int_product_stock_levels" + ], + "model.jaffle_shop.store_staffing": ["model.jaffle_shop.stg_stores"], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.stores" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_inventory" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.reorder_recommendations": [ + "model.jaffle_shop.product_inventory" + ], + "seed.jaffle_shop.raw_stores": [], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.metric_inventory_daily": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_stores" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_stores" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.gross_margin" + ], + "model.jaffle_shop.inventory_health": [ + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.gross_margin": ["model.jaffle_shop.revenue_summary"], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_order_assignments" + ] + }, + "child_map": { + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.store_staffing" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.metric_inventory_daily", + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.int_product_stock_levels", + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores.json new file mode 100644 index 000000000..dd5f822e1 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/cll-node-seed_jaffle_shop_raw_stores.json @@ -0,0 +1,412 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.product_inventory": { + "id": "model.jaffle_shop.product_inventory", + "name": "product_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('int_product_stock_levels') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nproducts as (\n select * from {{ ref('stg_products') }}\n),\n\nfinal as (\n select\n s.product_store_key,\n s.product_id,\n p.product_name,\n s.store_id,\n st.store_name,\n s.total_received,\n s.total_sold,\n s.current_stock,\n s.last_restock_date,\n s.last_sale_date,\n case\n when s.current_stock <= 0 then 'out_of_stock'\n when s.current_stock < 10 then 'low_stock'\n when s.current_stock < 50 then 'adequate'\n else 'well_stocked'\n end as stock_status\n from stock s\n left join products p on s.product_id = p.product_id\n left join stores st on s.store_id = st.store_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_staffing": { + "id": "model.jaffle_shop.store_staffing", + "name": "store_staffing", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstaffing as (\n select\n e.employee_id,\n e.first_name,\n e.last_name,\n e.role,\n e.hired_at,\n e.store_id,\n s.store_name,\n s.city,\n s.state\n from employees e\n left join stores s on e.store_id = s.store_id\n)\n\nselect * from staffing", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_inventory_movements": { + "id": "model.jaffle_shop.int_inventory_movements", + "name": "int_inventory_movements", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_in as (\n select\n product_id,\n store_id,\n delivered_date as movement_date,\n quantity as quantity_in,\n 0 as quantity_out,\n 'supply' as movement_type\n from {{ ref('stg_supply_orders') }}\n),\n\norder_items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nstore_assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsales_out as (\n select\n oi.product_id,\n sa.store_id,\n sa.order_date as movement_date,\n 0 as quantity_in,\n oi.quantity as quantity_out,\n 'sale' as movement_type\n from order_items oi\n inner join store_assignments sa on oi.order_id = sa.order_id\n),\n\ncombined as (\n select * from supply_in\n union all\n select * from sales_out\n)\n\nselect * from combined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.reorder_recommendations": { + "id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_recommendations", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('product_inventory') }}\n),\n\nperformance as (\n select * from {{ ref('product_performance') }}\n),\n\nrecommendations as (\n select\n s.product_id,\n s.product_name,\n s.store_id,\n s.store_name,\n s.current_stock,\n s.stock_status,\n s.last_restock_date,\n p.total_quantity_sold,\n p.times_ordered,\n case\n when s.stock_status = 'out_of_stock' then 'urgent'\n when s.stock_status = 'low_stock' then 'soon'\n when s.stock_status = 'adequate' and p.times_ordered > 5 then 'monitor'\n else 'ok'\n end as reorder_priority,\n greatest(50 - s.current_stock, 0) as suggested_reorder_qty\n from stock s\n left join performance p on s.product_id = p.product_id\n)\n\nselect * from recommendations", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_inventory_daily": { + "id": "model.jaffle_shop.metric_inventory_daily", + "name": "metric_inventory_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nsnapshot as (\n select\n current_date as snapshot_date,\n count(distinct product_id) as total_products_tracked,\n count(distinct store_id) as total_stores,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_count,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_count,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_count,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_count,\n round(avg(current_stock), 1) as avg_stock_per_product_store\n from inventory\n)\n\nselect * from snapshot", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_product_stock_levels": { + "id": "model.jaffle_shop.int_product_stock_levels", + "name": "int_product_stock_levels", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='product_store_key'\n )\n}}\n\nwith movements as (\n select * from {{ ref('int_inventory_movements') }}\n),\n\nstock as (\n select\n product_id || '-' || store_id as product_store_key,\n product_id,\n store_id,\n sum(quantity_in) as total_received,\n sum(quantity_out) as total_sold,\n sum(quantity_in) - sum(quantity_out) as current_stock,\n max(case when movement_type = 'supply' then movement_date end) as last_restock_date,\n max(case when movement_type = 'sale' then movement_date end) as last_sale_date\n from movements\n\n {% if is_incremental() %}\n where movement_date > (select max(coalesce(last_restock_date, last_sale_date)) from {{ this }})\n {% endif %}\n\n group by product_id, store_id\n)\n\nselect * from stock", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.inventory_health": { + "id": "model.jaffle_shop.inventory_health", + "name": "inventory_health", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nmovements as (\n select\n product_id,\n store_id,\n sum(quantity_in) as total_inbound,\n sum(quantity_out) as total_outbound,\n count(case when movement_type = 'supply' then 1 end) as restock_events,\n count(case when movement_type = 'sale' then 1 end) as sale_events\n from {{ ref('int_inventory_movements') }}\n group by product_id, store_id\n),\n\nhealth as (\n select\n i.product_store_key,\n i.product_id,\n i.product_name,\n i.store_id,\n i.store_name,\n i.current_stock,\n i.stock_status,\n m.total_inbound,\n m.total_outbound,\n m.restock_events,\n m.sale_events,\n case\n when m.total_outbound > m.total_inbound then 'deficit'\n when i.current_stock > m.total_outbound * 2 then 'overstocked'\n else 'balanced'\n end as inventory_balance,\n case when m.sale_events > 0\n then round(cast(m.total_outbound as decimal) / m.sale_events, 1)\n else 0\n end as avg_units_per_sale\n from inventory i\n left join movements m on i.product_id = m.product_id and i.store_id = m.store_id\n)\n\nselect * from health", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_inventory": { + "id": "model.jaffle_shop.store_inventory", + "name": "store_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nstore_level as (\n select\n store_id,\n store_name,\n count(distinct product_id) as unique_products,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_products,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_products,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_stock_products,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_products\n from inventory\n group by store_id, store_name\n)\n\nselect * from store_level", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": {}, + "parent_map": { + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.int_product_stock_levels" + ], + "model.jaffle_shop.store_staffing": ["model.jaffle_shop.stg_stores"], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.stores" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_inventory" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.reorder_recommendations": [ + "model.jaffle_shop.product_inventory" + ], + "seed.jaffle_shop.raw_stores": [], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.metric_inventory_daily": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_stores" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_stores" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.gross_margin" + ], + "model.jaffle_shop.inventory_health": [ + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.gross_margin": ["model.jaffle_shop.revenue_summary"], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_order_assignments" + ] + }, + "child_map": { + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.store_staffing" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.metric_inventory_daily", + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.int_product_stock_levels", + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_customer_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_customer_id.json new file mode 100644 index 000000000..2599891c6 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_customer_id.json @@ -0,0 +1,511 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_customer_acquisition_monthly": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "metric_customer_acquisition_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with cohorts as (\n select * from {{ ref('customer_cohorts') }}\n),\n\nfinal as (\n select\n cohort_month,\n cohort_size as new_customers,\n avg_lifetime_orders,\n avg_tenure_days,\n sum(cohort_size) over (order by cohort_month) as cumulative_customers\n from cohorts\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_lifetime_value": { + "id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_lifetime_value", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nclv as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.number_of_orders,\n c.customer_lifetime_value as total_revenue,\n fl.first_order_date,\n fl.last_order_date,\n fl.customer_tenure_days,\n fl.days_since_last_order,\n case when fl.customer_tenure_days > 0\n then round(c.customer_lifetime_value / (fl.customer_tenure_days / 30.0), 2)\n else c.customer_lifetime_value\n end as monthly_value,\n case when c.number_of_orders > 0\n then round(c.customer_lifetime_value / c.number_of_orders, 2)\n else 0\n end as avg_order_value\n from customers c\n left join first_last fl on c.customer_id = fl.customer_id\n)\n\nselect * from clv", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_cohorts": { + "id": "model.jaffle_shop.customer_cohorts", + "name": "customer_cohorts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\ncohorts as (\n select\n {{ dbt.date_trunc('month', 'first_order_date') }} as cohort_month,\n count(*) as cohort_size,\n avg(lifetime_orders) as avg_lifetime_orders,\n avg(customer_tenure_days) as avg_tenure_days\n from first_last\n group by {{ dbt.date_trunc('month', 'first_order_date') }}\n)\n\nselect * from cohorts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_first_last_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "int_customer_first_last_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_last as (\n select\n customer_id,\n min(order_date) as first_order_date,\n max(order_date) as last_order_date,\n {{ dbt.datediff('min(order_date)', 'max(order_date)', 'day') }} as customer_tenure_days,\n count(*) as lifetime_orders,\n {{ dbt.datediff('max(order_date)', '(select max(order_date) from orders)', 'day') }} as days_since_last_order\n from orders\n group by customer_id\n)\n\nselect * from first_last", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_customer_retention_monthly": { + "id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "metric_customer_retention_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with retention as (\n select * from {{ ref('customer_retention') }}\n),\n\ncohort_sizes as (\n select\n cohort_month,\n customers as cohort_size\n from retention\n where months_since_first = 0\n),\n\nrates as (\n select\n r.cohort_month,\n r.months_since_first,\n r.customers as retained_customers,\n cs.cohort_size,\n round(cast(r.customers as decimal) / cs.cohort_size * 100, 1) as retention_rate\n from retention r\n inner join cohort_sizes cs on r.cohort_month = cs.cohort_month\n)\n\nselect * from rates", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "retained_customers": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retained_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "cohort_size": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "retention_rate": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retention_rate", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_retention": { + "id": "model.jaffle_shop.customer_retention", + "name": "customer_retention", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ncohort_orders as (\n select\n fl.customer_id,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as cohort_month,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n {{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }} as months_since_first\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n),\n\nretention as (\n select\n cohort_month,\n months_since_first,\n count(distinct customer_id) as customers\n from cohort_orders\n group by cohort_month, months_since_first\n)\n\nselect * from retention", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customers": { + "id": "model.jaffle_shop.customer_retention_customers", + "table_id": "model.jaffle_shop.customer_retention", + "name": "customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_acquisition": { + "id": "model.jaffle_shop.customer_acquisition", + "name": "customer_acquisition", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_order_details as (\n select\n fl.customer_id,\n fl.first_order_date,\n o.has_promotion as acquired_via_promotion,\n o.promotion_name as acquisition_promotion,\n o.subtotal as first_order_value,\n o.item_count as first_order_items,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as acquisition_month\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n and fl.first_order_date = o.order_date\n)\n\nselect * from first_order_details", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_acquisition_customer_id", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_customer_id": { + "id": "model.jaffle_shop.order_discounts_customer_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_customer_id": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_unique_customers": { + "id": "model.jaffle_shop.int_daily_order_summary_unique_customers", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_customer_visits": { + "id": "model.jaffle_shop.metric_weekly_sales_total_customer_visits", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_customer_visits", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_unique_customers": { + "id": "model.jaffle_shop.metric_daily_revenue_unique_customers", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retained_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retention_rate", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_customers": { + "id": "model.jaffle_shop.customer_retention_customers", + "table_id": "model.jaffle_shop.customer_retention", + "name": "customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_customer_id": { + "id": "model.jaffle_shop.int_order_enriched_customer_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_customer_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_customer_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_customer_id": { + "id": "model.jaffle_shop.customer_acquisition_customer_id", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [], + "model.jaffle_shop.order_discounts_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly": [ + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_daily_order_summary_unique_customers": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.metric_weekly_sales_total_customer_visits": [ + "model.jaffle_shop.metric_daily_revenue_unique_customers" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.metric_daily_revenue_unique_customers": [ + "model.jaffle_shop.int_daily_order_summary_unique_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly": [ + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_retention_customers": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.int_orders_with_promotions_customer_id" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.customer_acquisition": [ + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_acquisition_customer_id": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "seed.jaffle_shop.raw_orders_user_id" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final" + ] + }, + "child_map": { + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_id": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_retention_customers", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_acquisition_customer_id" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_cohorts", + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_daily_order_summary_unique_customers", + "model.jaffle_shop.order_discounts_customer_id" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.metric_customer_acquisition_monthly" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "model.jaffle_shop.int_orders_with_promotions_customer_id" + ], + "model.jaffle_shop.metric_daily_revenue_unique_customers": [ + "model.jaffle_shop.metric_weekly_sales_total_customer_visits" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_daily_order_summary_unique_customers": [ + "model.jaffle_shop.metric_daily_revenue_unique_customers" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.metric_customer_retention_monthly" + ], + "model.jaffle_shop.customer_retention_customers": [ + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_item_count.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_item_count.json new file mode 100644 index 000000000..1e2d11f08 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_item_count.json @@ -0,0 +1,64 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.metric_daily_orders_avg_items_per_order": { + "id": "model.jaffle_shop.metric_daily_orders_avg_items_per_order", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_item_count": { + "id": "model.jaffle_shop.int_order_totals_item_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_item_count": { + "id": "model.jaffle_shop.int_order_enriched_item_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_items": { + "id": "model.jaffle_shop.customer_acquisition_first_order_items", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_items", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.metric_daily_orders_avg_items_per_order": [ + "model.jaffle_shop.int_order_enriched_item_count" + ], + "model.jaffle_shop.int_order_totals_item_count": [], + "model.jaffle_shop.int_order_enriched_item_count": [ + "model.jaffle_shop.int_order_totals_item_count" + ], + "model.jaffle_shop.customer_acquisition_first_order_items": [ + "model.jaffle_shop.int_order_enriched_item_count" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_item_count": [ + "model.jaffle_shop.metric_daily_orders_avg_items_per_order", + "model.jaffle_shop.customer_acquisition_first_order_items" + ], + "model.jaffle_shop.int_order_totals_item_count": [ + "model.jaffle_shop.int_order_enriched_item_count" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_order_date.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_order_date.json new file mode 100644 index 000000000..75a1e921d --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_order_date.json @@ -0,0 +1,1493 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.metric_daily_orders": { + "id": "model.jaffle_shop.metric_daily_orders", + "name": "metric_daily_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as total_orders,\n sum(case when status in ('completed', 'Scompleted') then 1 else 0 end) as completed_orders,\n sum(case when status in ('returned', 'Sreturned', 'return_pending', 'Sreturn_pending') then 1 else 0 end) as returned_orders,\n sum(case when status in ('shipped', 'Sshipped') then 1 else 0 end) as shipped_orders,\n sum(case when status in ('placed', 'Splaced') then 1 else 0 end) as placed_orders,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n avg(item_count) as avg_items_per_order\n from orders\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_daily_orders_order_date", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_customer_acquisition_monthly": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "metric_customer_acquisition_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with cohorts as (\n select * from {{ ref('customer_cohorts') }}\n),\n\nfinal as (\n select\n cohort_month,\n cohort_size as new_customers,\n avg_lifetime_orders,\n avg_tenure_days,\n sum(cohort_size) over (order by cohort_month) as cumulative_customers\n from cohorts\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_tenure_days": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cumulative_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cumulative_customers", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_promotion_daily": { + "id": "model.jaffle_shop.metric_promotion_daily", + "name": "metric_promotion_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with discounts as (\n select * from {{ ref('order_discounts') }}\n),\n\ndaily as (\n select\n order_date,\n promotion_name,\n discount_type,\n count(*) as usage_count,\n sum(discount_amount) as total_discount,\n sum(subtotal) as total_order_value,\n sum(net_revenue) as total_net_revenue,\n avg(discount_pct_of_order) as avg_discount_pct\n from discounts\n group by order_date, promotion_name, discount_type\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_promotion_daily_order_date", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_cohorts": { + "id": "model.jaffle_shop.customer_cohorts", + "name": "customer_cohorts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\ncohorts as (\n select\n {{ dbt.date_trunc('month', 'first_order_date') }} as cohort_month,\n count(*) as cohort_size,\n avg(lifetime_orders) as avg_lifetime_orders,\n avg(customer_tenure_days) as avg_tenure_days\n from first_last\n group by {{ dbt.date_trunc('month', 'first_order_date') }}\n)\n\nselect * from cohorts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.customer_cohorts_cohort_month", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_tenure_days": { + "id": "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_daily_order_summary": { + "id": "model.jaffle_shop.int_daily_order_summary", + "name": "int_daily_order_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='order_date'\n )\n}}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as order_count,\n count(distinct customer_id) as unique_customers,\n sum(subtotal) as total_revenue,\n sum(total_cost) as total_cost,\n sum(total_margin) as total_margin,\n sum(total_quantity) as total_items_sold,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n sum(discount_amount) as total_discounts,\n avg(subtotal) as avg_order_value\n from orders\n\n {% if is_incremental() %}\n where order_date > (select max(order_date) from {{ this }})\n {% endif %}\n\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.int_daily_order_summary_order_date", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_weekly_sales": { + "id": "model.jaffle_shop.metric_weekly_sales", + "name": "metric_weekly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nweekly as (\n select\n {{ dbt.date_trunc('week', 'order_date') }} as week_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n sum(unique_customers) as total_customer_visits,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold\n from daily\n group by {{ dbt.date_trunc('week', 'order_date') }}\n)\n\nselect * from weekly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "week_start": { + "id": "model.jaffle_shop.metric_weekly_sales_week_start", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "week_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_daily_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue", + "name": "metric_daily_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('int_daily_order_summary') }}\n),\n\nfinal as (\n select\n order_date,\n order_count,\n total_revenue,\n total_cost,\n total_margin,\n total_discounts,\n total_revenue - total_discounts as net_revenue,\n avg_order_value,\n unique_customers,\n total_items_sold\n from daily\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_daily_revenue_order_date", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_month": { + "id": "model.jaffle_shop.revenue_summary_order_month", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_customer_retention_monthly": { + "id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "metric_customer_retention_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with retention as (\n select * from {{ ref('customer_retention') }}\n),\n\ncohort_sizes as (\n select\n cohort_month,\n customers as cohort_size\n from retention\n where months_since_first = 0\n),\n\nrates as (\n select\n r.cohort_month,\n r.months_since_first,\n r.customers as retained_customers,\n cs.cohort_size,\n round(cast(r.customers as decimal) / cs.cohort_size * 100, 1) as retention_rate\n from retention r\n inner join cohort_sizes cs on r.cohort_month = cs.cohort_month\n)\n\nselect * from rates", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "months_since_first": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_months_since_first", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_retention": { + "id": "model.jaffle_shop.customer_retention", + "name": "customer_retention", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ncohort_orders as (\n select\n fl.customer_id,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as cohort_month,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n {{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }} as months_since_first\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n),\n\nretention as (\n select\n cohort_month,\n months_since_first,\n count(distinct customer_id) as customers\n from cohort_orders\n group by cohort_month, months_since_first\n)\n\nselect * from retention", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.customer_retention_cohort_month", + "table_id": "model.jaffle_shop.customer_retention", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "months_since_first": { + "id": "model.jaffle_shop.customer_retention_months_since_first", + "table_id": "model.jaffle_shop.customer_retention", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_monthly_sales": { + "id": "model.jaffle_shop.metric_monthly_sales", + "name": "metric_monthly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nmonthly as (\n select\n {{ dbt.date_trunc('month', 'order_date') }} as month_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold,\n count(distinct order_date) as active_days\n from daily\n group by {{ dbt.date_trunc('month', 'order_date') }}\n)\n\nselect * from monthly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "month_start": { + "id": "model.jaffle_shop.metric_monthly_sales_month_start", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "month_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.metric_monthly_sales_active_days", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_month": { + "id": "model.jaffle_shop.gross_margin_order_month", + "table_id": "model.jaffle_shop.gross_margin", + "name": "order_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_acquisition": { + "id": "model.jaffle_shop.customer_acquisition", + "name": "customer_acquisition", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_order_details as (\n select\n fl.customer_id,\n fl.first_order_date,\n o.has_promotion as acquired_via_promotion,\n o.promotion_name as acquisition_promotion,\n o.subtotal as first_order_value,\n o.item_count as first_order_items,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as acquisition_month\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n and fl.first_order_date = o.order_date\n)\n\nselect * from first_order_details", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "first_order_date": { + "id": "model.jaffle_shop.customer_acquisition_first_order_date", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "acquisition_month": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_month", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_product_sales_daily": { + "id": "model.jaffle_shop.metric_product_sales_daily", + "name": "metric_product_sales_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('order_items') }}\n),\n\norders as (\n select order_id, order_date from {{ ref('int_order_enriched') }}\n),\n\ndaily_product as (\n select\n o.order_date,\n i.product_id,\n i.product_name,\n i.category_name,\n sum(i.quantity) as units_sold,\n sum(i.line_total) as revenue,\n sum(i.line_margin) as margin,\n count(distinct o.order_id) as order_count\n from items i\n inner join orders o on i.order_id = o.order_id\n group by o.order_date, i.product_id, i.product_name, i.category_name\n)\n\nselect * from daily_product", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_date", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "month_start": { + "id": "model.jaffle_shop.rpt_executive_dashboard_month_start", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "month_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.rpt_executive_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_sales_dashboard": { + "id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "rpt_sales_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with weekly as (\n select * from {{ ref('metric_weekly_sales') }}\n),\n\nfinal as (\n select\n w.week_start,\n w.total_orders,\n w.total_revenue,\n w.net_revenue,\n w.total_margin,\n w.total_discounts,\n w.total_items_sold,\n w.avg_daily_order_value,\n lag(w.total_revenue) over (order by w.week_start) as prev_week_revenue,\n case when lag(w.total_revenue) over (order by w.week_start) > 0\n then round((w.total_revenue - lag(w.total_revenue) over (order by w.week_start))\n / lag(w.total_revenue) over (order by w.week_start) * 100, 1)\n else null\n end as revenue_wow_growth_pct\n from weekly w\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "week_start": { + "id": "model.jaffle_shop.rpt_sales_dashboard_week_start", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "week_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "prev_week_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "prev_week_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "revenue_wow_growth_pct": { + "id": "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "revenue_wow_growth_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_order_date": { + "id": "model.jaffle_shop.metric_daily_orders_order_date", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_days_since_last_order": { + "id": "model.jaffle_shop.int_customer_segments_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_recency_score": { + "id": "model.jaffle_shop.int_customer_segments_recency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_order_date": { + "id": "model.jaffle_shop.order_discounts_order_date", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cumulative_customers", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_first_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_first_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_last_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_last_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": { + "id": "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_monthly_value": { + "id": "model.jaffle_shop.customer_lifetime_value_monthly_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_order_date": { + "id": "model.jaffle_shop.metric_promotion_daily_order_date", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_cohort_month": { + "id": "model.jaffle_shop.customer_cohorts_cohort_month", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_avg_tenure_days": { + "id": "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": { + "id": "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_order_date": { + "id": "model.jaffle_shop.int_daily_order_summary_order_date", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_week_start": { + "id": "model.jaffle_shop.metric_weekly_sales_week_start", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "week_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_recency_score": { + "id": "model.jaffle_shop.customer_segments_final_recency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_days_since_last_order": { + "id": "model.jaffle_shop.customer_segments_final_days_since_last_order", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_order_date": { + "id": "model.jaffle_shop.metric_daily_revenue_order_date", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_month": { + "id": "model.jaffle_shop.revenue_summary_order_month", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_months_since_first", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_cohort_month": { + "id": "model.jaffle_shop.customer_retention_cohort_month", + "table_id": "model.jaffle_shop.customer_retention", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_months_since_first": { + "id": "model.jaffle_shop.customer_retention_months_since_first", + "table_id": "model.jaffle_shop.customer_retention", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_month_start": { + "id": "model.jaffle_shop.metric_monthly_sales_month_start", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "month_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_active_days": { + "id": "model.jaffle_shop.metric_monthly_sales_active_days", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_distinct_order_days": { + "id": "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "distinct_order_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_order_month": { + "id": "model.jaffle_shop.gross_margin_order_month", + "table_id": "model.jaffle_shop.gross_margin", + "name": "order_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_date": { + "id": "model.jaffle_shop.customer_acquisition_first_order_date", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_acquisition_month": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_month", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_order_date": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_date", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_monthly_value": { + "id": "model.jaffle_shop.customer_360_monthly_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_tenure_days": { + "id": "model.jaffle_shop.customer_360_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_days_since_last_order": { + "id": "model.jaffle_shop.customer_360_days_since_last_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_months_active": { + "id": "model.jaffle_shop.customer_360_months_active", + "table_id": "model.jaffle_shop.customer_360", + "name": "months_active", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_month_start": { + "id": "model.jaffle_shop.rpt_executive_dashboard_month_start", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "month_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_executive_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_week_start": { + "id": "model.jaffle_shop.rpt_sales_dashboard_week_start", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "week_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "prev_week_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct": { + "id": "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "revenue_wow_growth_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.metric_daily_orders": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_daily_orders_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_segments_days_since_last_order": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_recency_score": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "seed.jaffle_shop.raw_orders_order_date": [], + "model.jaffle_shop.order_discounts_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly": [ + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month": [ + "model.jaffle_shop.customer_cohorts_cohort_month" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days": [ + "model.jaffle_shop.customer_cohorts_avg_tenure_days" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers": [ + "model.jaffle_shop.customer_cohorts_cohort_month" + ], + "model.jaffle_shop.customer_lifetime_value_first_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_last_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_last_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.customer_lifetime_value_monthly_value": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.metric_promotion_daily": [ + "model.jaffle_shop.order_discounts_order_date" + ], + "model.jaffle_shop.metric_promotion_daily_order_date": [ + "model.jaffle_shop.order_discounts_order_date" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.revenue_summary_order_date" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_cohorts_cohort_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_cohorts_avg_tenure_days": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_daily_order_summary_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.metric_daily_revenue_order_date", + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_week_start": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_segments_final_recency_score": [ + "model.jaffle_shop.int_customer_segments_recency_score" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.int_customer_segments_rfm_total" + ], + "model.jaffle_shop.customer_segments_final_days_since_last_order": [ + "model.jaffle_shop.int_customer_segments_days_since_last_order" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.metric_daily_revenue_order_date": [ + "model.jaffle_shop.int_daily_order_summary_order_date" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_week": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_month": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_customer_retention_monthly": [ + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_retention_cohort_month", + "model.jaffle_shop.customer_retention_months_since_first" + ], + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month": [ + "model.jaffle_shop.customer_retention_cohort_month" + ], + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first": [ + "model.jaffle_shop.customer_retention_months_since_first" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_cohort_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_months_since_first": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.metric_daily_revenue_order_date", + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_month_start": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.metric_monthly_sales_active_days": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_customer_order_history_distinct_order_days": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.gross_margin_order_month": [ + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.customer_acquisition": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_acquisition_first_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_acquisition_acquisition_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.metric_product_sales_daily": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_product_sales_daily_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.rpt_store_dashboard_active_days": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.customer_360_monthly_value": [ + "model.jaffle_shop.customer_lifetime_value_monthly_value" + ], + "model.jaffle_shop.customer_360_customer_tenure_days": [ + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days" + ], + "model.jaffle_shop.customer_360_days_since_last_order": [ + "model.jaffle_shop.customer_lifetime_value_days_since_last_order" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.customer_360_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.customer_360_months_active": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.rpt_executive_dashboard_month_start": [ + "model.jaffle_shop.metric_monthly_sales_month_start" + ], + "model.jaffle_shop.rpt_executive_dashboard_active_days": [ + "model.jaffle_shop.metric_monthly_sales_active_days" + ], + "model.jaffle_shop.rpt_sales_dashboard": [ + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.rpt_sales_dashboard_week_start": [ + "model.jaffle_shop.metric_weekly_sales_week_start" + ], + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue": [ + "model.jaffle_shop.metric_weekly_sales_week_start" + ], + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct": [ + "model.jaffle_shop.metric_weekly_sales_week_start" + ] + }, + "child_map": { + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.metric_daily_orders", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "model.jaffle_shop.revenue_summary_order_week", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.customer_retention_months_since_first", + "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "model.jaffle_shop.int_daily_order_summary_order_date", + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.metric_product_sales_daily_order_date", + "model.jaffle_shop.customer_360_months_active", + "model.jaffle_shop.int_daily_order_summary", + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "model.jaffle_shop.revenue_summary_order_date", + "model.jaffle_shop.order_discounts_order_date", + "model.jaffle_shop.metric_daily_orders_order_date", + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": [ + "model.jaffle_shop.int_customer_segments_days_since_last_order", + "model.jaffle_shop.int_customer_segments_recency_score", + "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.metric_customer_acquisition_monthly" + ], + "model.jaffle_shop.customer_cohorts_cohort_month": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers" + ], + "model.jaffle_shop.customer_cohorts_avg_tenure_days": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_retention_cohort_month", + "model.jaffle_shop.customer_retention_months_since_first", + "model.jaffle_shop.customer_acquisition_acquisition_month", + "model.jaffle_shop.customer_360_months_active", + "model.jaffle_shop.customer_cohorts_cohort_month", + "model.jaffle_shop.customer_cohorts", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_lifetime_value_first_order_date", + "model.jaffle_shop.customer_acquisition_first_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": [ + "model.jaffle_shop.customer_lifetime_value_last_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": [ + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "model.jaffle_shop.customer_lifetime_value_monthly_value", + "model.jaffle_shop.customer_cohorts_avg_tenure_days" + ], + "model.jaffle_shop.order_discounts_order_date": [ + "model.jaffle_shop.metric_promotion_daily_order_date", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.metric_daily_revenue_order_date": [ + "model.jaffle_shop.metric_monthly_sales_active_days", + "model.jaffle_shop.metric_monthly_sales_month_start", + "model.jaffle_shop.metric_weekly_sales", + "model.jaffle_shop.metric_weekly_sales_week_start", + "model.jaffle_shop.metric_monthly_sales" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.int_customer_segments_recency_score": [ + "model.jaffle_shop.customer_segments_final_recency_score" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.int_customer_segments_days_since_last_order": [ + "model.jaffle_shop.customer_segments_final_days_since_last_order" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.int_daily_order_summary_order_date": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.metric_customer_retention_monthly" + ], + "model.jaffle_shop.customer_retention_cohort_month": [ + "model.jaffle_shop.metric_customer_retention_monthly", + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month" + ], + "model.jaffle_shop.customer_retention_months_since_first": [ + "model.jaffle_shop.metric_customer_retention_monthly", + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_month": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.gross_margin_order_month" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.rpt_store_dashboard_active_days" + ], + "model.jaffle_shop.customer_lifetime_value_monthly_value": [ + "model.jaffle_shop.customer_360_monthly_value" + ], + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": [ + "model.jaffle_shop.customer_360_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": [ + "model.jaffle_shop.customer_360_days_since_last_order" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.customer_360_customer_segment", + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.customer_360_rfm_total" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.metric_monthly_sales_month_start": [ + "model.jaffle_shop.rpt_executive_dashboard_month_start" + ], + "model.jaffle_shop.metric_monthly_sales_active_days": [ + "model.jaffle_shop.rpt_executive_dashboard_active_days" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.rpt_sales_dashboard" + ], + "model.jaffle_shop.metric_weekly_sales_week_start": [ + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "model.jaffle_shop.rpt_sales_dashboard_week_start" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_order_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_order_id.json new file mode 100644 index 000000000..f6039d80d --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_order_id.json @@ -0,0 +1,672 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "total_orders": { + "id": "model.jaffle_shop.int_customer_segments_total_orders", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "frequency_score": { + "id": "model.jaffle_shop.int_customer_segments_frequency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "frequency_score": { + "id": "model.jaffle_shop.customer_segments_final_frequency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.customer_segments_final_total_orders", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_product_sales_daily": { + "id": "model.jaffle_shop.metric_product_sales_daily", + "name": "metric_product_sales_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('order_items') }}\n),\n\norders as (\n select order_id, order_date from {{ ref('int_order_enriched') }}\n),\n\ndaily_product as (\n select\n o.order_date,\n i.product_id,\n i.product_name,\n i.category_name,\n sum(i.quantity) as units_sold,\n sum(i.line_total) as revenue,\n sum(i.line_margin) as margin,\n count(distinct o.order_id) as order_count\n from items i\n inner join orders o on i.order_id = o.order_id\n group by o.order_date, i.product_id, i.product_name, i.category_name\n)\n\nselect * from daily_product", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_count": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_count", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_total_orders": { + "id": "model.jaffle_shop.int_customer_segments_total_orders", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_frequency_score": { + "id": "model.jaffle_shop.int_customer_segments_frequency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_order_id": { + "id": "model.jaffle_shop.order_discounts_order_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_frequency_score": { + "id": "model.jaffle_shop.customer_segments_final_frequency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_total_orders": { + "id": "model.jaffle_shop.customer_segments_final_total_orders", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_orders": { + "id": "model.jaffle_shop.int_customer_order_history_total_orders", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_order_count": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_count", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_total_orders": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_frequency_score": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.order_discounts_order_id": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_segments_final_frequency_score": [ + "model.jaffle_shop.int_customer_segments_frequency_score" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.int_customer_segments_rfm_total" + ], + "model.jaffle_shop.customer_segments_final_total_orders": [ + "model.jaffle_shop.int_customer_segments_total_orders" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_customer_order_history_total_orders": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.gross_margin": ["model.jaffle_shop.revenue_summary"], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.metric_product_sales_daily": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.metric_product_sales_daily_order_count": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.customer_360_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.customer_segments_final_customer_segment" + ] + }, + "child_map": { + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers" + ], + "model.jaffle_shop.int_customer_order_history_total_orders": [ + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_total_orders", + "model.jaffle_shop.int_customer_segments_customer_segment", + "model.jaffle_shop.int_customer_segments_frequency_score" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.metric_product_sales_daily_order_count", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.order_discounts_order_id", + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.int_customer_segments_frequency_score": [ + "model.jaffle_shop.customer_segments_final_frequency_score" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.int_customer_segments_total_orders": [ + "model.jaffle_shop.customer_segments_final_total_orders" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.customer_360_customer_segment", + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.customer_360_rfm_total" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_status.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_status.json new file mode 100644 index 000000000..0633f06b5 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_order_enriched_status.json @@ -0,0 +1,209 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.metric_daily_orders_completed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_completed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "completed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_returned_orders": { + "id": "model.jaffle_shop.metric_daily_orders_returned_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "returned_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_shipped_orders": { + "id": "model.jaffle_shop.metric_daily_orders_shipped_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "shipped_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_placed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_placed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "placed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.metric_daily_orders_completed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_returned_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_shipped_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_placed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "seed.jaffle_shop.raw_orders_status": [], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.metric_daily_orders_shipped_orders", + "model.jaffle_shop.metric_daily_orders_returned_orders", + "model.jaffle_shop.metric_daily_orders_completed_orders", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.metric_daily_orders_placed_orders" + ], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_order_count.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_order_count.json new file mode 100644 index 000000000..13e663158 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_order_count.json @@ -0,0 +1,167 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_order_count": { + "id": "model.jaffle_shop.store_performance_order_count", + "table_id": "model.jaffle_shop.store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_orders_per_employee": { + "id": "model.jaffle_shop.store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_order_count": { + "id": "model.jaffle_shop.int_store_performance_order_count", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_orders_per_employee": { + "id": "model.jaffle_shop.int_store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_order_count": { + "id": "model.jaffle_shop.int_store_revenue_order_count", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count": { + "id": "model.jaffle_shop.store_rankings_order_count", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count_rank": { + "id": "model.jaffle_shop.store_rankings_order_count_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_order_count": { + "id": "model.jaffle_shop.rpt_store_dashboard_order_count", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.int_store_performance_order_count" + ], + "model.jaffle_shop.store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.store_rankings_order_count_rank": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.rpt_store_dashboard_order_count": [ + "model.jaffle_shop.store_rankings_order_count" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.store_performance_orders_per_employee" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_performance_orders_per_employee", + "model.jaffle_shop.int_store_performance_order_count" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.store_rankings_order_count_rank", + "model.jaffle_shop.store_rankings_order_count" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.rpt_store_dashboard_order_count" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_store_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_store_id.json new file mode 100644 index 000000000..03cba8052 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_store_id.json @@ -0,0 +1,139 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue_store_id" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.int_store_revenue_store_id" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_total_cost.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_total_cost.json new file mode 100644 index 000000000..315381491 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_total_cost.json @@ -0,0 +1,155 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.int_order_totals_total_cost": { + "id": "model.jaffle_shop.int_order_totals_total_cost", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_cost": { + "id": "model.jaffle_shop.int_product_margins_cost", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_cost": { + "id": "model.jaffle_shop.int_order_enriched_total_cost", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_quantity": { + "id": "seed.jaffle_shop.raw_order_items_quantity", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_quantity": { + "id": "model.jaffle_shop.stg_order_items_quantity", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_cost": { + "id": "model.jaffle_shop.int_order_items_enriched_line_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_quantity": { + "id": "model.jaffle_shop.int_order_items_with_products_quantity", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_cost": { + "id": "seed.jaffle_shop.raw_products_cost", + "table_id": "seed.jaffle_shop.raw_products", + "name": "cost", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_cost": { + "id": "model.jaffle_shop.int_store_revenue_total_cost", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_cost": { + "id": "model.jaffle_shop.stg_products_cost", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.int_order_totals_total_cost": [ + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.int_product_margins_cost": [ + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_order_enriched_total_cost": [ + "model.jaffle_shop.int_order_totals_total_cost" + ], + "seed.jaffle_shop.raw_order_items_quantity": [], + "model.jaffle_shop.stg_order_items_quantity": [ + "seed.jaffle_shop.raw_order_items_quantity" + ], + "model.jaffle_shop.int_order_items_enriched_line_cost": [ + "model.jaffle_shop.int_order_items_with_products_quantity", + "model.jaffle_shop.int_product_margins_cost" + ], + "model.jaffle_shop.int_order_items_with_products_quantity": [ + "model.jaffle_shop.stg_order_items_quantity" + ], + "seed.jaffle_shop.raw_products_cost": [], + "model.jaffle_shop.int_store_revenue_total_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "model.jaffle_shop.stg_products_cost": [ + "seed.jaffle_shop.raw_products_cost" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_total_cost": [ + "model.jaffle_shop.int_store_revenue_total_cost" + ], + "model.jaffle_shop.int_order_items_enriched_line_cost": [ + "model.jaffle_shop.int_order_totals_total_cost" + ], + "model.jaffle_shop.int_order_items_with_products_quantity": [ + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.stg_products_cost": [ + "model.jaffle_shop.int_product_margins_cost" + ], + "model.jaffle_shop.int_order_totals_total_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "seed.jaffle_shop.raw_order_items_quantity": [ + "model.jaffle_shop.stg_order_items_quantity" + ], + "model.jaffle_shop.int_product_margins_cost": [ + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.stg_order_items_quantity": [ + "model.jaffle_shop.int_order_items_with_products_quantity" + ], + "seed.jaffle_shop.raw_products_cost": [ + "model.jaffle_shop.stg_products_cost" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_total_revenue.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_total_revenue.json new file mode 100644 index 000000000..d8c6ebf58 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_total_revenue.json @@ -0,0 +1,314 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.store_performance_total_revenue": { + "id": "model.jaffle_shop.store_performance_total_revenue", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_revenue_per_employee": { + "id": "model.jaffle_shop.store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_subtotal": { + "id": "model.jaffle_shop.int_order_totals_subtotal", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_subtotal": { + "id": "model.jaffle_shop.int_order_enriched_subtotal", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_quantity": { + "id": "seed.jaffle_shop.raw_order_items_quantity", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_unit_price": { + "id": "seed.jaffle_shop.raw_order_items_unit_price", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "unit_price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_quantity": { + "id": "model.jaffle_shop.stg_order_items_quantity", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_unit_price": { + "id": "model.jaffle_shop.stg_order_items_unit_price", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_total": { + "id": "model.jaffle_shop.int_order_items_enriched_line_total", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_line_total": { + "id": "model.jaffle_shop.int_order_items_with_products_line_total", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_total_revenue": { + "id": "model.jaffle_shop.int_store_performance_total_revenue", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_revenue_per_employee": { + "id": "model.jaffle_shop.int_store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_revenue": { + "id": "model.jaffle_shop.int_store_revenue_total_revenue", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_total_revenue": { + "id": "model.jaffle_shop.store_rankings_total_revenue", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_revenue_per_employee": { + "id": "model.jaffle_shop.store_rankings_revenue_per_employee", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_revenue_rank": { + "id": "model.jaffle_shop.store_rankings_revenue_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_efficiency_rank": { + "id": "model.jaffle_shop.store_rankings_efficiency_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_total_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_revenue_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_efficiency_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.store_performance_total_revenue": [ + "model.jaffle_shop.int_store_performance_total_revenue" + ], + "model.jaffle_shop.store_performance_revenue_per_employee": [ + "model.jaffle_shop.int_store_performance_revenue_per_employee" + ], + "model.jaffle_shop.int_order_totals_subtotal": [ + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.int_order_enriched_subtotal": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "seed.jaffle_shop.raw_order_items_quantity": [], + "seed.jaffle_shop.raw_order_items_unit_price": [], + "model.jaffle_shop.stg_order_items_quantity": [ + "seed.jaffle_shop.raw_order_items_quantity" + ], + "model.jaffle_shop.stg_order_items_unit_price": [ + "seed.jaffle_shop.raw_order_items_unit_price" + ], + "model.jaffle_shop.int_order_items_enriched_line_total": [ + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_order_items_with_products_line_total": [ + "model.jaffle_shop.stg_order_items_unit_price", + "model.jaffle_shop.stg_order_items_quantity" + ], + "model.jaffle_shop.int_store_performance_total_revenue": [ + "model.jaffle_shop.int_store_revenue_total_revenue" + ], + "model.jaffle_shop.int_store_performance_revenue_per_employee": [ + "model.jaffle_shop.int_store_revenue_total_revenue" + ], + "model.jaffle_shop.int_store_revenue_total_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.store_rankings_total_revenue": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.store_rankings_revenue_per_employee": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_revenue_rank": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.store_rankings_efficiency_rank": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.rpt_store_dashboard_total_revenue": [ + "model.jaffle_shop.store_rankings_total_revenue" + ], + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee": [ + "model.jaffle_shop.store_rankings_revenue_per_employee" + ], + "model.jaffle_shop.rpt_store_dashboard_revenue_rank": [ + "model.jaffle_shop.store_rankings_revenue_rank" + ], + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank": [ + "model.jaffle_shop.store_rankings_efficiency_rank" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_subtotal": [ + "model.jaffle_shop.int_store_revenue_total_revenue" + ], + "model.jaffle_shop.int_order_totals_subtotal": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_store_performance_total_revenue": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.int_store_performance_revenue_per_employee": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.int_order_items_enriched_line_total": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "seed.jaffle_shop.raw_order_items_quantity": [ + "model.jaffle_shop.stg_order_items_quantity" + ], + "seed.jaffle_shop.raw_order_items_unit_price": [ + "model.jaffle_shop.stg_order_items_unit_price" + ], + "model.jaffle_shop.int_order_items_with_products_line_total": [ + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.stg_order_items_quantity": [ + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.stg_order_items_unit_price": [ + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_store_revenue_total_revenue": [ + "model.jaffle_shop.int_store_performance_total_revenue", + "model.jaffle_shop.int_store_performance_revenue_per_employee" + ], + "model.jaffle_shop.store_performance_total_revenue": [ + "model.jaffle_shop.store_rankings_total_revenue", + "model.jaffle_shop.store_rankings_revenue_rank" + ], + "model.jaffle_shop.store_performance_revenue_per_employee": [ + "model.jaffle_shop.store_rankings_efficiency_rank", + "model.jaffle_shop.store_rankings_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_total_revenue": [ + "model.jaffle_shop.rpt_store_dashboard_total_revenue" + ], + "model.jaffle_shop.store_rankings_revenue_per_employee": [ + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_revenue_rank": [ + "model.jaffle_shop.rpt_store_dashboard_revenue_rank" + ], + "model.jaffle_shop.store_rankings_efficiency_rank": [ + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_unique_customers.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_unique_customers.json new file mode 100644 index 000000000..ab4a840ed --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_int_store_revenue_unique_customers.json @@ -0,0 +1,139 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_orders_user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_unique_customers": { + "id": "model.jaffle_shop.store_performance_unique_customers", + "table_id": "model.jaffle_shop.store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_customer_id": { + "id": "model.jaffle_shop.int_store_order_assignments_customer_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_unique_customers": { + "id": "model.jaffle_shop.int_store_performance_unique_customers", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_unique_customers": { + "id": "model.jaffle_shop.int_store_revenue_unique_customers", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_unique_customers": { + "id": "model.jaffle_shop.store_rankings_unique_customers", + "table_id": "model.jaffle_shop.store_rankings", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_customer_reach_rank": { + "id": "model.jaffle_shop.store_rankings_customer_reach_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "customer_reach_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_unique_customers": { + "id": "model.jaffle_shop.rpt_store_dashboard_unique_customers", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_user_id": [], + "model.jaffle_shop.store_performance_unique_customers": [ + "model.jaffle_shop.int_store_performance_unique_customers" + ], + "model.jaffle_shop.int_store_order_assignments_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_store_performance_unique_customers": [ + "model.jaffle_shop.int_store_revenue_unique_customers" + ], + "model.jaffle_shop.int_store_revenue_unique_customers": [ + "model.jaffle_shop.int_store_order_assignments_customer_id" + ], + "model.jaffle_shop.store_rankings_unique_customers": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.store_rankings_customer_reach_rank": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "seed.jaffle_shop.raw_orders_user_id" + ], + "model.jaffle_shop.rpt_store_dashboard_unique_customers": [ + "model.jaffle_shop.store_rankings_unique_customers" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_customer_id": [ + "model.jaffle_shop.int_store_order_assignments_customer_id" + ], + "model.jaffle_shop.int_store_performance_unique_customers": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.int_store_revenue_unique_customers": [ + "model.jaffle_shop.int_store_performance_unique_customers" + ], + "model.jaffle_shop.int_store_order_assignments_customer_id": [ + "model.jaffle_shop.int_store_revenue_unique_customers" + ], + "model.jaffle_shop.store_performance_unique_customers": [ + "model.jaffle_shop.store_rankings_customer_reach_rank", + "model.jaffle_shop.store_rankings_unique_customers" + ], + "seed.jaffle_shop.raw_orders_user_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.store_rankings_unique_customers": [ + "model.jaffle_shop.rpt_store_dashboard_unique_customers" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_credit_card_amount.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_credit_card_amount.json new file mode 100644 index 000000000..4aaf8057e --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_credit_card_amount.json @@ -0,0 +1,95 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.orders_credit_card_amount": { + "id": "model.jaffle_shop.orders_credit_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_credit_card_amount": { + "id": "model.jaffle_shop.order_returns_credit_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_payment_method": { + "id": "model.jaffle_shop.stg_payments_payment_method", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_amount": { + "id": "model.jaffle_shop.stg_payments_amount", + "table_id": "model.jaffle_shop.stg_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_payment_method": { + "id": "seed.jaffle_shop.raw_payments_payment_method", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.orders_credit_card_amount": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.order_returns_credit_card_amount": [ + "model.jaffle_shop.orders_credit_card_amount" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "seed.jaffle_shop.raw_payments_payment_method" + ], + "model.jaffle_shop.stg_payments_amount": [ + "seed.jaffle_shop.raw_payments_amount" + ], + "seed.jaffle_shop.raw_payments_payment_method": [], + "seed.jaffle_shop.raw_payments_amount": [] + }, + "child_map": { + "model.jaffle_shop.stg_payments_amount": [ + "model.jaffle_shop.orders_credit_card_amount" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "model.jaffle_shop.orders_credit_card_amount" + ], + "model.jaffle_shop.orders_credit_card_amount": [ + "model.jaffle_shop.order_returns_credit_card_amount" + ], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments_amount" + ], + "seed.jaffle_shop.raw_payments_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_customer_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_customer_id.json new file mode 100644 index 000000000..842ccb1b7 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_customer_id.json @@ -0,0 +1,66 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_orders_user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_customer_id": { + "id": "model.jaffle_shop.orders_customer_id", + "table_id": "model.jaffle_shop.orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_customer_id": { + "id": "model.jaffle_shop.order_returns_customer_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_user_id": [], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.order_returns_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "seed.jaffle_shop.raw_orders_user_id" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.order_returns_customer_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_order_date.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_order_date.json new file mode 100644 index 000000000..189f76ba6 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_order_date.json @@ -0,0 +1,66 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_date": { + "id": "model.jaffle_shop.orders_order_date", + "table_id": "model.jaffle_shop.orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_date": { + "id": "model.jaffle_shop.order_returns_order_date", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_order_date": [], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.order_returns_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.order_returns_order_date" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_order_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_order_id.json new file mode 100644 index 000000000..447b914f1 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_order_id.json @@ -0,0 +1,66 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_id": { + "id": "model.jaffle_shop.orders_order_id", + "table_id": "model.jaffle_shop.orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_id": { + "id": "model.jaffle_shop.order_returns_order_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.order_returns_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.order_returns_order_id" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_status.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_status.json new file mode 100644 index 000000000..0cc89c4a1 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_order_returns_status.json @@ -0,0 +1,66 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_status": [], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.order_returns_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.order_returns_status" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_credit_card_amount.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_credit_card_amount.json new file mode 100644 index 000000000..4aaf8057e --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_credit_card_amount.json @@ -0,0 +1,95 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.orders_credit_card_amount": { + "id": "model.jaffle_shop.orders_credit_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_credit_card_amount": { + "id": "model.jaffle_shop.order_returns_credit_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_payment_method": { + "id": "model.jaffle_shop.stg_payments_payment_method", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_amount": { + "id": "model.jaffle_shop.stg_payments_amount", + "table_id": "model.jaffle_shop.stg_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_payment_method": { + "id": "seed.jaffle_shop.raw_payments_payment_method", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.orders_credit_card_amount": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.order_returns_credit_card_amount": [ + "model.jaffle_shop.orders_credit_card_amount" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "seed.jaffle_shop.raw_payments_payment_method" + ], + "model.jaffle_shop.stg_payments_amount": [ + "seed.jaffle_shop.raw_payments_amount" + ], + "seed.jaffle_shop.raw_payments_payment_method": [], + "seed.jaffle_shop.raw_payments_amount": [] + }, + "child_map": { + "model.jaffle_shop.stg_payments_amount": [ + "model.jaffle_shop.orders_credit_card_amount" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "model.jaffle_shop.orders_credit_card_amount" + ], + "model.jaffle_shop.orders_credit_card_amount": [ + "model.jaffle_shop.order_returns_credit_card_amount" + ], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments_amount" + ], + "seed.jaffle_shop.raw_payments_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_customer_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_customer_id.json new file mode 100644 index 000000000..8f6b7308f --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_customer_id.json @@ -0,0 +1,92 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_orders_user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_customer_id": { + "id": "model.jaffle_shop.orders_customer_id", + "table_id": "model.jaffle_shop.orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_customer_id": { + "id": "model.jaffle_shop.order_returns_customer_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_customer_id": { + "id": "model.jaffle_shop.payments_fact_customer_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_customer_id": { + "id": "model.jaffle_shop.order_fulfillment_customer_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_user_id": [], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.order_returns_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.payments_fact_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "seed.jaffle_shop.raw_orders_user_id" + ], + "model.jaffle_shop.order_fulfillment_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.payments_fact_customer_id", + "model.jaffle_shop.order_returns_customer_id", + "model.jaffle_shop.order_fulfillment_customer_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_gift_card_amount.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_gift_card_amount.json new file mode 100644 index 000000000..a62f010b3 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_gift_card_amount.json @@ -0,0 +1,95 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.orders_gift_card_amount": { + "id": "model.jaffle_shop.orders_gift_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_gift_card_amount": { + "id": "model.jaffle_shop.order_returns_gift_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_payment_method": { + "id": "model.jaffle_shop.stg_payments_payment_method", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_amount": { + "id": "model.jaffle_shop.stg_payments_amount", + "table_id": "model.jaffle_shop.stg_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_payment_method": { + "id": "seed.jaffle_shop.raw_payments_payment_method", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.orders_gift_card_amount": [ + "model.jaffle_shop.stg_payments_amount", + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.order_returns_gift_card_amount": [ + "model.jaffle_shop.orders_gift_card_amount" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "seed.jaffle_shop.raw_payments_payment_method" + ], + "model.jaffle_shop.stg_payments_amount": [ + "seed.jaffle_shop.raw_payments_amount" + ], + "seed.jaffle_shop.raw_payments_payment_method": [], + "seed.jaffle_shop.raw_payments_amount": [] + }, + "child_map": { + "model.jaffle_shop.stg_payments_amount": [ + "model.jaffle_shop.orders_gift_card_amount" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "model.jaffle_shop.orders_gift_card_amount" + ], + "model.jaffle_shop.orders_gift_card_amount": [ + "model.jaffle_shop.order_returns_gift_card_amount" + ], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments_amount" + ], + "seed.jaffle_shop.raw_payments_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_order_date.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_order_date.json new file mode 100644 index 000000000..b63280642 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_order_date.json @@ -0,0 +1,92 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_date": { + "id": "model.jaffle_shop.orders_order_date", + "table_id": "model.jaffle_shop.orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_date": { + "id": "model.jaffle_shop.order_returns_order_date", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_date": { + "id": "model.jaffle_shop.payments_fact_order_date", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_order_date": { + "id": "model.jaffle_shop.order_fulfillment_order_date", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_order_date": [], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.order_returns_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.payments_fact_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.order_fulfillment_order_date": [ + "model.jaffle_shop.orders_order_date" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.order_returns_order_date", + "model.jaffle_shop.payments_fact_order_date", + "model.jaffle_shop.order_fulfillment_order_date" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_order_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_order_id.json new file mode 100644 index 000000000..768bb4210 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_order_id.json @@ -0,0 +1,120 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.payments_fact": { + "id": "model.jaffle_shop.payments_fact", + "name": "payments_fact", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('orders') }}\n),\n\nfinal as (\n select\n p.payment_id,\n p.order_id,\n o.customer_id,\n o.order_date,\n p.payment_method,\n p.amount,\n o.status as order_status\n from payments p\n left join orders o on p.order_id = o.order_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_fulfillment_order_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_id": { + "id": "model.jaffle_shop.orders_order_id", + "table_id": "model.jaffle_shop.orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_id": { + "id": "model.jaffle_shop.order_returns_order_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_order_id": { + "id": "model.jaffle_shop.order_fulfillment_order_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.order_returns_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.payments_fact": ["model.jaffle_shop.orders_order_id"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.order_fulfillment_order_id": [ + "model.jaffle_shop.orders_order_id" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.order_returns_order_id", + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.order_fulfillment_order_id" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_status.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_status.json new file mode 100644 index 000000000..15452f2cb --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_orders_status.json @@ -0,0 +1,139 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_status": { + "id": "model.jaffle_shop.payments_fact_order_status", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_status", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_status": { + "id": "model.jaffle_shop.order_fulfillment_status", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders_status": [], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.order_returns": ["model.jaffle_shop.orders_status"], + "model.jaffle_shop.order_returns_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_returns_return_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.payments_fact_order_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.order_fulfillment_status": [ + "model.jaffle_shop.orders_status" + ] + }, + "child_map": { + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.order_fulfillment_status", + "model.jaffle_shop.order_returns_status", + "model.jaffle_shop.order_returns_return_status", + "model.jaffle_shop.order_returns", + "model.jaffle_shop.payments_fact_order_status" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_customer_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_customer_id.json new file mode 100644 index 000000000..51b8db535 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_customer_id.json @@ -0,0 +1,341 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.customer_lifetime_value": { + "id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_lifetime_value", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nclv as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.number_of_orders,\n c.customer_lifetime_value as total_revenue,\n fl.first_order_date,\n fl.last_order_date,\n fl.customer_tenure_days,\n fl.days_since_last_order,\n case when fl.customer_tenure_days > 0\n then round(c.customer_lifetime_value / (fl.customer_tenure_days / 30.0), 2)\n else c.customer_lifetime_value\n end as monthly_value,\n case when c.number_of_orders > 0\n then round(c.customer_lifetime_value / c.number_of_orders, 2)\n else 0\n end as avg_order_value\n from customers c\n left join first_last fl on c.customer_id = fl.customer_id\n)\n\nselect * from clv", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_id", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_segments_final_customer_id", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_segments_customer_id", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_order_history_customer_id", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_360_customer_id", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customers": { + "id": "model.jaffle_shop.customers", + "name": "customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\ncustomer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n),\n\ncustomer_payments as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders on\n payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders\n on customers.customer_id = customer_orders.customer_id\n\n left join customer_payments\n on customers.customer_id = customer_payments.customer_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customers_customer_id", + "table_id": "model.jaffle_shop.customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.customer_lifetime_value_customer_id": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_id", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_id": { + "id": "model.jaffle_shop.customer_segments_final_customer_id", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_id": { + "id": "model.jaffle_shop.int_customer_segments_customer_id", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_customer_id": { + "id": "model.jaffle_shop.int_customer_order_history_customer_id", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_id": { + "id": "seed.jaffle_shop.raw_customers_id", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_customer_id": { + "id": "model.jaffle_shop.stg_customers_customer_id", + "table_id": "model.jaffle_shop.stg_customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_id": { + "id": "model.jaffle_shop.customer_360_customer_id", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_customer_id": { + "id": "model.jaffle_shop.customers_customer_id", + "table_id": "model.jaffle_shop.customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customers" + ], + "model.jaffle_shop.customer_lifetime_value_customer_id": [ + "model.jaffle_shop.customers_customer_id" + ], + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.customer_segments_final_customer_id": [ + "model.jaffle_shop.int_customer_segments_customer_id" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_order_history_customer_id" + ], + "model.jaffle_shop.int_customer_segments_customer_id": [ + "model.jaffle_shop.int_customer_order_history_customer_id" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.int_customer_order_history_customer_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "seed.jaffle_shop.raw_customers_id": [], + "model.jaffle_shop.stg_customers_customer_id": [ + "seed.jaffle_shop.raw_customers_id" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.customer_lifetime_value_customer_id", + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.customer_segments_final_customer_id" + ], + "model.jaffle_shop.customer_360_customer_id": [ + "model.jaffle_shop.customers_customer_id" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.customers_customer_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ] + }, + "child_map": { + "model.jaffle_shop.customers_customer_id": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_lifetime_value_customer_id", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.customer_360_customer_id" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_customer_segments_customer_id": [ + "model.jaffle_shop.customer_segments_final_customer_id" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_order_history_customer_id": [ + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.int_customer_segments_customer_id" + ], + "model.jaffle_shop.stg_customers_customer_id": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_customer_order_history_customer_id" + ], + "seed.jaffle_shop.raw_customers_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.customer_lifetime_value_customer_id": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_segments_final_customer_id": [ + "model.jaffle_shop.customer_360" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_first_name.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_first_name.json new file mode 100644 index 000000000..c9ff0065c --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_first_name.json @@ -0,0 +1,267 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "first_name": { + "id": "model.jaffle_shop.customer_segments_final_first_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "first_name": { + "id": "model.jaffle_shop.int_customer_segments_first_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "first_name": { + "id": "model.jaffle_shop.int_customer_order_history_first_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "first_name": { + "id": "model.jaffle_shop.customer_360_first_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.customer_lifetime_value_first_name": { + "id": "model.jaffle_shop.customer_lifetime_value_first_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_first_name": { + "id": "model.jaffle_shop.customer_segments_final_first_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_first_name": { + "id": "model.jaffle_shop.int_customer_segments_first_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_first_name": { + "id": "model.jaffle_shop.int_customer_order_history_first_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_first_name": { + "id": "seed.jaffle_shop.raw_customers_first_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_first_name": { + "id": "model.jaffle_shop.stg_customers_first_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_first_name": { + "id": "model.jaffle_shop.customer_360_first_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_first_name": { + "id": "model.jaffle_shop.customers_first_name", + "table_id": "model.jaffle_shop.customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.customer_lifetime_value_first_name": [ + "model.jaffle_shop.customers_first_name" + ], + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.customer_segments_final_first_name": [ + "model.jaffle_shop.int_customer_segments_first_name" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history" + ], + "model.jaffle_shop.int_customer_segments_first_name": [ + "model.jaffle_shop.int_customer_order_history_first_name" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.stg_customers_first_name" + ], + "model.jaffle_shop.int_customer_order_history_first_name": [ + "model.jaffle_shop.stg_customers_first_name" + ], + "seed.jaffle_shop.raw_customers_first_name": [], + "model.jaffle_shop.stg_customers_first_name": [ + "seed.jaffle_shop.raw_customers_first_name" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.customer_360_first_name": [ + "model.jaffle_shop.customers_first_name" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.customers_first_name": [ + "model.jaffle_shop.stg_customers_first_name" + ] + }, + "child_map": { + "model.jaffle_shop.customers_first_name": [ + "model.jaffle_shop.customer_360_first_name", + "model.jaffle_shop.customer_lifetime_value_first_name" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_customer_segments_first_name": [ + "model.jaffle_shop.customer_segments_final_first_name" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_order_history_first_name": [ + "model.jaffle_shop.int_customer_segments_first_name" + ], + "model.jaffle_shop.stg_customers_first_name": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.customers_first_name", + "model.jaffle_shop.int_customer_order_history_first_name" + ], + "seed.jaffle_shop.raw_customers_first_name": [ + "model.jaffle_shop.stg_customers_first_name" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_full_name.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_full_name.json new file mode 100644 index 000000000..a0fbe1feb --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_full_name.json @@ -0,0 +1,50 @@ +{ + "current": { + "nodes": {}, + "columns": { + "seed.jaffle_shop.raw_customers_first_name": { + "id": "seed.jaffle_shop.raw_customers_first_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_last_name": { + "id": "seed.jaffle_shop.raw_customers_last_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_full_name": { + "id": "model.jaffle_shop.stg_customers_full_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "full_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "added", + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_customers_first_name": [], + "seed.jaffle_shop.raw_customers_last_name": [], + "model.jaffle_shop.stg_customers_full_name": [ + "seed.jaffle_shop.raw_customers_first_name", + "seed.jaffle_shop.raw_customers_last_name" + ] + }, + "child_map": { + "seed.jaffle_shop.raw_customers_first_name": [ + "model.jaffle_shop.stg_customers_full_name" + ], + "seed.jaffle_shop.raw_customers_last_name": [ + "model.jaffle_shop.stg_customers_full_name" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_last_name.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_last_name.json new file mode 100644 index 000000000..b73ba35cf --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_customers_last_name.json @@ -0,0 +1,267 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "last_name": { + "id": "model.jaffle_shop.customer_segments_final_last_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "last_name": { + "id": "model.jaffle_shop.int_customer_segments_last_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "last_name": { + "id": "model.jaffle_shop.int_customer_order_history_last_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "last_name": { + "id": "model.jaffle_shop.customer_360_last_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.customer_lifetime_value_last_name": { + "id": "model.jaffle_shop.customer_lifetime_value_last_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_last_name": { + "id": "model.jaffle_shop.customer_segments_final_last_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_last_name": { + "id": "model.jaffle_shop.int_customer_segments_last_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_last_name": { + "id": "model.jaffle_shop.int_customer_order_history_last_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_last_name": { + "id": "seed.jaffle_shop.raw_customers_last_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_last_name": { + "id": "model.jaffle_shop.stg_customers_last_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_last_name": { + "id": "model.jaffle_shop.customer_360_last_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_last_name": { + "id": "model.jaffle_shop.customers_last_name", + "table_id": "model.jaffle_shop.customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.customer_lifetime_value_last_name": [ + "model.jaffle_shop.customers_last_name" + ], + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.customer_segments_final_last_name": [ + "model.jaffle_shop.int_customer_segments_last_name" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history" + ], + "model.jaffle_shop.int_customer_segments_last_name": [ + "model.jaffle_shop.int_customer_order_history_last_name" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.stg_customers_last_name" + ], + "model.jaffle_shop.int_customer_order_history_last_name": [ + "model.jaffle_shop.stg_customers_last_name" + ], + "seed.jaffle_shop.raw_customers_last_name": [], + "model.jaffle_shop.stg_customers_last_name": [ + "seed.jaffle_shop.raw_customers_last_name" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.customer_360_last_name": [ + "model.jaffle_shop.customers_last_name" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.customers_last_name": [ + "model.jaffle_shop.stg_customers_last_name" + ] + }, + "child_map": { + "model.jaffle_shop.customers_last_name": [ + "model.jaffle_shop.customer_360_last_name", + "model.jaffle_shop.customer_lifetime_value_last_name" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_customer_segments_last_name": [ + "model.jaffle_shop.customer_segments_final_last_name" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_order_history_last_name": [ + "model.jaffle_shop.int_customer_segments_last_name" + ], + "model.jaffle_shop.stg_customers_last_name": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_order_history_last_name", + "model.jaffle_shop.customers_last_name" + ], + "seed.jaffle_shop.raw_customers_last_name": [ + "model.jaffle_shop.stg_customers_last_name" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_customer_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_customer_id.json new file mode 100644 index 000000000..eed69c685 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_customer_id.json @@ -0,0 +1,740 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_customer_acquisition_monthly": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "metric_customer_acquisition_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with cohorts as (\n select * from {{ ref('customer_cohorts') }}\n),\n\nfinal as (\n select\n cohort_month,\n cohort_size as new_customers,\n avg_lifetime_orders,\n avg_tenure_days,\n sum(cohort_size) over (order by cohort_month) as cumulative_customers\n from cohorts\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_lifetime_value": { + "id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_lifetime_value", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nclv as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.number_of_orders,\n c.customer_lifetime_value as total_revenue,\n fl.first_order_date,\n fl.last_order_date,\n fl.customer_tenure_days,\n fl.days_since_last_order,\n case when fl.customer_tenure_days > 0\n then round(c.customer_lifetime_value / (fl.customer_tenure_days / 30.0), 2)\n else c.customer_lifetime_value\n end as monthly_value,\n case when c.number_of_orders > 0\n then round(c.customer_lifetime_value / c.number_of_orders, 2)\n else 0\n end as avg_order_value\n from customers c\n left join first_last fl on c.customer_id = fl.customer_id\n)\n\nselect * from clv", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_cohorts": { + "id": "model.jaffle_shop.customer_cohorts", + "name": "customer_cohorts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\ncohorts as (\n select\n {{ dbt.date_trunc('month', 'first_order_date') }} as cohort_month,\n count(*) as cohort_size,\n avg(lifetime_orders) as avg_lifetime_orders,\n avg(customer_tenure_days) as avg_tenure_days\n from first_last\n group by {{ dbt.date_trunc('month', 'first_order_date') }}\n)\n\nselect * from cohorts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_first_last_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "int_customer_first_last_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_last as (\n select\n customer_id,\n min(order_date) as first_order_date,\n max(order_date) as last_order_date,\n {{ dbt.datediff('min(order_date)', 'max(order_date)', 'day') }} as customer_tenure_days,\n count(*) as lifetime_orders,\n {{ dbt.datediff('max(order_date)', '(select max(order_date) from orders)', 'day') }} as days_since_last_order\n from orders\n group by customer_id\n)\n\nselect * from first_last", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_acquisition": { + "id": "model.jaffle_shop.customer_acquisition", + "name": "customer_acquisition", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_order_details as (\n select\n fl.customer_id,\n fl.first_order_date,\n o.has_promotion as acquired_via_promotion,\n o.promotion_name as acquisition_promotion,\n o.subtotal as first_order_value,\n o.item_count as first_order_items,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as acquisition_month\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n and fl.first_order_date = o.order_date\n)\n\nselect * from first_order_details", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_acquisition_customer_id", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customers": { + "id": "model.jaffle_shop.customers", + "name": "customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\ncustomer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n),\n\ncustomer_payments as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders on\n payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders\n on customers.customer_id = customer_orders.customer_id\n\n left join customer_payments\n on customers.customer_id = customer_payments.customer_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_customer_retention_monthly": { + "id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "metric_customer_retention_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with retention as (\n select * from {{ ref('customer_retention') }}\n),\n\ncohort_sizes as (\n select\n cohort_month,\n customers as cohort_size\n from retention\n where months_since_first = 0\n),\n\nrates as (\n select\n r.cohort_month,\n r.months_since_first,\n r.customers as retained_customers,\n cs.cohort_size,\n round(cast(r.customers as decimal) / cs.cohort_size * 100, 1) as retention_rate\n from retention r\n inner join cohort_sizes cs on r.cohort_month = cs.cohort_month\n)\n\nselect * from rates", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "retained_customers": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retained_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "cohort_size": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "retention_rate": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retention_rate", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_retention": { + "id": "model.jaffle_shop.customer_retention", + "name": "customer_retention", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ncohort_orders as (\n select\n fl.customer_id,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as cohort_month,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n {{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }} as months_since_first\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n),\n\nretention as (\n select\n cohort_month,\n months_since_first,\n count(distinct customer_id) as customers\n from cohort_orders\n group by cohort_month, months_since_first\n)\n\nselect * from retention", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customers": { + "id": "model.jaffle_shop.customer_retention_customers", + "table_id": "model.jaffle_shop.customer_retention", + "name": "customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_payment_methods": { + "id": "model.jaffle_shop.int_customer_payment_methods", + "name": "int_customer_payment_methods", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('stg_orders') }}\n),\n\ncustomer_payments as (\n select\n o.customer_id,\n p.payment_method,\n count(*) as usage_count,\n sum(p.amount) as total_amount\n from payments p\n inner join orders o on p.order_id = o.order_id\n group by o.customer_id, p.payment_method\n),\n\npreferred as (\n select\n customer_id,\n payment_method as preferred_payment_method,\n row_number() over (partition by customer_id order by usage_count desc) as rn\n from customer_payments\n),\n\npivoted as (\n select\n cp.customer_id,\n sum(case when cp.payment_method = 'credit_card' then cp.total_amount else 0 end) as credit_card_total,\n sum(case when cp.payment_method = 'bank_transfer' then cp.total_amount else 0 end) as bank_transfer_total,\n sum(case when cp.payment_method = 'coupon' then cp.total_amount else 0 end) as coupon_total,\n sum(case when cp.payment_method = 'gift_card' then cp.total_amount else 0 end) as gift_card_total,\n max(pref.preferred_payment_method) as preferred_payment_method\n from customer_payments cp\n left join preferred pref on cp.customer_id = pref.customer_id and pref.rn = 1\n group by cp.customer_id\n)\n\nselect * from pivoted", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_payment_methods_customer_id", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_customer_id": { + "id": "model.jaffle_shop.order_discounts_customer_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_unique_customers": { + "id": "model.jaffle_shop.int_store_performance_unique_customers", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_customer_id": { + "id": "model.jaffle_shop.orders_customer_id", + "table_id": "model.jaffle_shop.orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_customer_id": { + "id": "model.jaffle_shop.order_returns_customer_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_unique_customers": { + "id": "model.jaffle_shop.store_performance_unique_customers", + "table_id": "model.jaffle_shop.store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_customer_id": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_unique_customers": { + "id": "model.jaffle_shop.int_store_revenue_unique_customers", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_unique_customers": { + "id": "model.jaffle_shop.int_daily_order_summary_unique_customers", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_customer_visits": { + "id": "model.jaffle_shop.metric_weekly_sales_total_customer_visits", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_customer_visits", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_unique_customers": { + "id": "model.jaffle_shop.store_rankings_unique_customers", + "table_id": "model.jaffle_shop.store_rankings", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_customer_reach_rank": { + "id": "model.jaffle_shop.store_rankings_customer_reach_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "customer_reach_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_customer_id": { + "id": "model.jaffle_shop.customer_acquisition_customer_id", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_customer_id": { + "id": "model.jaffle_shop.int_store_order_assignments_customer_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_customer_id": { + "id": "model.jaffle_shop.new_orders_customer_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_unique_customers": { + "id": "model.jaffle_shop.metric_daily_revenue_unique_customers", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retained_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retention_rate", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_customers": { + "id": "model.jaffle_shop.customer_retention_customers", + "table_id": "model.jaffle_shop.customer_retention", + "name": "customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_customer_id": { + "id": "model.jaffle_shop.int_order_enriched_customer_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_customer_id": { + "id": "model.jaffle_shop.payments_fact_customer_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_customer_id": { + "id": "model.jaffle_shop.order_fulfillment_customer_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_customer_id": { + "id": "model.jaffle_shop.int_customer_payment_methods_customer_id", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_unique_customers": { + "id": "model.jaffle_shop.rpt_store_dashboard_unique_customers", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_customer_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_customer_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.order_discounts_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_store_performance_unique_customers": [ + "model.jaffle_shop.int_store_revenue_unique_customers" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly": [ + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.customers" + ], + "model.jaffle_shop.order_returns_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.store_performance_unique_customers": [ + "model.jaffle_shop.int_store_performance_unique_customers" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_store_revenue_unique_customers": [ + "model.jaffle_shop.int_store_order_assignments_customer_id" + ], + "model.jaffle_shop.int_daily_order_summary_unique_customers": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.metric_weekly_sales_total_customer_visits": [ + "model.jaffle_shop.metric_daily_revenue_unique_customers" + ], + "model.jaffle_shop.store_rankings_unique_customers": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.store_rankings_customer_reach_rank": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.customer_acquisition": [ + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_acquisition_customer_id": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_store_order_assignments_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.new_orders_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.metric_daily_revenue_unique_customers": [ + "model.jaffle_shop.int_daily_order_summary_unique_customers" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.metric_customer_retention_monthly": [ + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_retention_customers": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.int_orders_with_promotions_customer_id" + ], + "model.jaffle_shop.payments_fact_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "seed.jaffle_shop.raw_orders_user_id" + ], + "model.jaffle_shop.order_fulfillment_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.int_customer_payment_methods": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_customer_payment_methods_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.rpt_store_dashboard_unique_customers": [ + "model.jaffle_shop.store_rankings_unique_customers" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ] + }, + "child_map": { + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_id": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_retention_customers", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_acquisition_customer_id" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_cohorts", + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_daily_order_summary_unique_customers", + "model.jaffle_shop.order_discounts_customer_id" + ], + "model.jaffle_shop.int_store_revenue_unique_customers": [ + "model.jaffle_shop.int_store_performance_unique_customers" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.metric_customer_acquisition_monthly" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "model.jaffle_shop.int_store_order_assignments_customer_id", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.customers", + "model.jaffle_shop.new_orders_customer_id", + "model.jaffle_shop.int_customer_payment_methods_customer_id", + "model.jaffle_shop.int_orders_with_promotions_customer_id", + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.payments_fact_customer_id", + "model.jaffle_shop.order_returns_customer_id", + "model.jaffle_shop.order_fulfillment_customer_id" + ], + "model.jaffle_shop.int_store_performance_unique_customers": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.int_store_order_assignments_customer_id": [ + "model.jaffle_shop.int_store_revenue_unique_customers" + ], + "model.jaffle_shop.metric_daily_revenue_unique_customers": [ + "model.jaffle_shop.metric_weekly_sales_total_customer_visits" + ], + "model.jaffle_shop.store_performance_unique_customers": [ + "model.jaffle_shop.store_rankings_customer_reach_rank", + "model.jaffle_shop.store_rankings_unique_customers" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_daily_order_summary_unique_customers": [ + "model.jaffle_shop.metric_daily_revenue_unique_customers" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.metric_customer_retention_monthly" + ], + "model.jaffle_shop.customer_retention_customers": [ + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.store_rankings_unique_customers": [ + "model.jaffle_shop.rpt_store_dashboard_unique_customers" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.customer_360" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_order_date.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_order_date.json new file mode 100644 index 000000000..b72a4d3d9 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_order_date.json @@ -0,0 +1,1644 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.metric_daily_orders": { + "id": "model.jaffle_shop.metric_daily_orders", + "name": "metric_daily_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as total_orders,\n sum(case when status in ('completed', 'Scompleted') then 1 else 0 end) as completed_orders,\n sum(case when status in ('returned', 'Sreturned', 'return_pending', 'Sreturn_pending') then 1 else 0 end) as returned_orders,\n sum(case when status in ('shipped', 'Sshipped') then 1 else 0 end) as shipped_orders,\n sum(case when status in ('placed', 'Splaced') then 1 else 0 end) as placed_orders,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n avg(item_count) as avg_items_per_order\n from orders\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_daily_orders_order_date", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_customer_acquisition_monthly": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "metric_customer_acquisition_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with cohorts as (\n select * from {{ ref('customer_cohorts') }}\n),\n\nfinal as (\n select\n cohort_month,\n cohort_size as new_customers,\n avg_lifetime_orders,\n avg_tenure_days,\n sum(cohort_size) over (order by cohort_month) as cumulative_customers\n from cohorts\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_tenure_days": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cumulative_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cumulative_customers", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_promotion_daily": { + "id": "model.jaffle_shop.metric_promotion_daily", + "name": "metric_promotion_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with discounts as (\n select * from {{ ref('order_discounts') }}\n),\n\ndaily as (\n select\n order_date,\n promotion_name,\n discount_type,\n count(*) as usage_count,\n sum(discount_amount) as total_discount,\n sum(subtotal) as total_order_value,\n sum(net_revenue) as total_net_revenue,\n avg(discount_pct_of_order) as avg_discount_pct\n from discounts\n group by order_date, promotion_name, discount_type\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_promotion_daily_order_date", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_month": { + "id": "model.jaffle_shop.gross_margin_order_month", + "table_id": "model.jaffle_shop.gross_margin", + "name": "order_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_cohorts": { + "id": "model.jaffle_shop.customer_cohorts", + "name": "customer_cohorts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\ncohorts as (\n select\n {{ dbt.date_trunc('month', 'first_order_date') }} as cohort_month,\n count(*) as cohort_size,\n avg(lifetime_orders) as avg_lifetime_orders,\n avg(customer_tenure_days) as avg_tenure_days\n from first_last\n group by {{ dbt.date_trunc('month', 'first_order_date') }}\n)\n\nselect * from cohorts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.customer_cohorts_cohort_month", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_tenure_days": { + "id": "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_daily_order_summary": { + "id": "model.jaffle_shop.int_daily_order_summary", + "name": "int_daily_order_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='order_date'\n )\n}}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as order_count,\n count(distinct customer_id) as unique_customers,\n sum(subtotal) as total_revenue,\n sum(total_cost) as total_cost,\n sum(total_margin) as total_margin,\n sum(total_quantity) as total_items_sold,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n sum(discount_amount) as total_discounts,\n avg(subtotal) as avg_order_value\n from orders\n\n {% if is_incremental() %}\n where order_date > (select max(order_date) from {{ this }})\n {% endif %}\n\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.int_daily_order_summary_order_date", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_weekly_sales": { + "id": "model.jaffle_shop.metric_weekly_sales", + "name": "metric_weekly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nweekly as (\n select\n {{ dbt.date_trunc('week', 'order_date') }} as week_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n sum(unique_customers) as total_customer_visits,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold\n from daily\n group by {{ dbt.date_trunc('week', 'order_date') }}\n)\n\nselect * from weekly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "week_start": { + "id": "model.jaffle_shop.metric_weekly_sales_week_start", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "week_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_acquisition": { + "id": "model.jaffle_shop.customer_acquisition", + "name": "customer_acquisition", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_order_details as (\n select\n fl.customer_id,\n fl.first_order_date,\n o.has_promotion as acquired_via_promotion,\n o.promotion_name as acquisition_promotion,\n o.subtotal as first_order_value,\n o.item_count as first_order_items,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as acquisition_month\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n and fl.first_order_date = o.order_date\n)\n\nselect * from first_order_details", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "first_order_date": { + "id": "model.jaffle_shop.customer_acquisition_first_order_date", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "acquisition_month": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_month", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_product_sales_daily": { + "id": "model.jaffle_shop.metric_product_sales_daily", + "name": "metric_product_sales_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('order_items') }}\n),\n\norders as (\n select order_id, order_date from {{ ref('int_order_enriched') }}\n),\n\ndaily_product as (\n select\n o.order_date,\n i.product_id,\n i.product_name,\n i.category_name,\n sum(i.quantity) as units_sold,\n sum(i.line_total) as revenue,\n sum(i.line_margin) as margin,\n count(distinct o.order_id) as order_count\n from items i\n inner join orders o on i.order_id = o.order_id\n group by o.order_date, i.product_id, i.product_name, i.category_name\n)\n\nselect * from daily_product", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_date", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_daily_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue", + "name": "metric_daily_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('int_daily_order_summary') }}\n),\n\nfinal as (\n select\n order_date,\n order_count,\n total_revenue,\n total_cost,\n total_margin,\n total_discounts,\n total_revenue - total_discounts as net_revenue,\n avg_order_value,\n unique_customers,\n total_items_sold\n from daily\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_daily_revenue_order_date", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_month": { + "id": "model.jaffle_shop.revenue_summary_order_month", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_customer_retention_monthly": { + "id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "metric_customer_retention_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with retention as (\n select * from {{ ref('customer_retention') }}\n),\n\ncohort_sizes as (\n select\n cohort_month,\n customers as cohort_size\n from retention\n where months_since_first = 0\n),\n\nrates as (\n select\n r.cohort_month,\n r.months_since_first,\n r.customers as retained_customers,\n cs.cohort_size,\n round(cast(r.customers as decimal) / cs.cohort_size * 100, 1) as retention_rate\n from retention r\n inner join cohort_sizes cs on r.cohort_month = cs.cohort_month\n)\n\nselect * from rates", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "months_since_first": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_months_since_first", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_retention": { + "id": "model.jaffle_shop.customer_retention", + "name": "customer_retention", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ncohort_orders as (\n select\n fl.customer_id,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as cohort_month,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n {{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }} as months_since_first\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n),\n\nretention as (\n select\n cohort_month,\n months_since_first,\n count(distinct customer_id) as customers\n from cohort_orders\n group by cohort_month, months_since_first\n)\n\nselect * from retention", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.customer_retention_cohort_month", + "table_id": "model.jaffle_shop.customer_retention", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "months_since_first": { + "id": "model.jaffle_shop.customer_retention_months_since_first", + "table_id": "model.jaffle_shop.customer_retention", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_monthly_sales": { + "id": "model.jaffle_shop.metric_monthly_sales", + "name": "metric_monthly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nmonthly as (\n select\n {{ dbt.date_trunc('month', 'order_date') }} as month_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold,\n count(distinct order_date) as active_days\n from daily\n group by {{ dbt.date_trunc('month', 'order_date') }}\n)\n\nselect * from monthly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "month_start": { + "id": "model.jaffle_shop.metric_monthly_sales_month_start", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "month_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.metric_monthly_sales_active_days", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "month_start": { + "id": "model.jaffle_shop.rpt_executive_dashboard_month_start", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "month_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.rpt_executive_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_sales_dashboard": { + "id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "rpt_sales_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with weekly as (\n select * from {{ ref('metric_weekly_sales') }}\n),\n\nfinal as (\n select\n w.week_start,\n w.total_orders,\n w.total_revenue,\n w.net_revenue,\n w.total_margin,\n w.total_discounts,\n w.total_items_sold,\n w.avg_daily_order_value,\n lag(w.total_revenue) over (order by w.week_start) as prev_week_revenue,\n case when lag(w.total_revenue) over (order by w.week_start) > 0\n then round((w.total_revenue - lag(w.total_revenue) over (order by w.week_start))\n / lag(w.total_revenue) over (order by w.week_start) * 100, 1)\n else null\n end as revenue_wow_growth_pct\n from weekly w\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "week_start": { + "id": "model.jaffle_shop.rpt_sales_dashboard_week_start", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "week_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "prev_week_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "prev_week_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "revenue_wow_growth_pct": { + "id": "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "revenue_wow_growth_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_order_date": { + "id": "model.jaffle_shop.metric_daily_orders_order_date", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_days_since_last_order": { + "id": "model.jaffle_shop.int_customer_segments_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_recency_score": { + "id": "model.jaffle_shop.int_customer_segments_recency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_distinct_order_days": { + "id": "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "distinct_order_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_order_date": { + "id": "model.jaffle_shop.order_discounts_order_date", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cumulative_customers", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_date": { + "id": "model.jaffle_shop.orders_order_date", + "table_id": "model.jaffle_shop.orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_first_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_first_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_last_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_last_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": { + "id": "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_monthly_value": { + "id": "model.jaffle_shop.customer_lifetime_value_monthly_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_order_date": { + "id": "model.jaffle_shop.metric_promotion_daily_order_date", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_order_month": { + "id": "model.jaffle_shop.gross_margin_order_month", + "table_id": "model.jaffle_shop.gross_margin", + "name": "order_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_date": { + "id": "model.jaffle_shop.order_returns_order_date", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_cohort_month": { + "id": "model.jaffle_shop.customer_cohorts_cohort_month", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_avg_tenure_days": { + "id": "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": { + "id": "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_order_date": { + "id": "model.jaffle_shop.int_daily_order_summary_order_date", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_week_start": { + "id": "model.jaffle_shop.metric_weekly_sales_week_start", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "week_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_movement_date": { + "id": "model.jaffle_shop.int_inventory_movements_movement_date", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_date": { + "id": "model.jaffle_shop.customer_acquisition_first_order_date", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_acquisition_month": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_month", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_recency_score": { + "id": "model.jaffle_shop.customer_segments_final_recency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_days_since_last_order": { + "id": "model.jaffle_shop.customer_segments_final_days_since_last_order", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_order_date": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_date", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_date": { + "id": "model.jaffle_shop.int_store_order_assignments_order_date", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_order_date": { + "id": "model.jaffle_shop.new_orders_order_date", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_order_date": { + "id": "model.jaffle_shop.metric_daily_revenue_order_date", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_month": { + "id": "model.jaffle_shop.revenue_summary_order_month", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_first_order": { + "id": "model.jaffle_shop.customers_first_order", + "table_id": "model.jaffle_shop.customers", + "name": "first_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_most_recent_order": { + "id": "model.jaffle_shop.customers_most_recent_order", + "table_id": "model.jaffle_shop.customers", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_months_since_first", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_cohort_month": { + "id": "model.jaffle_shop.customer_retention_cohort_month", + "table_id": "model.jaffle_shop.customer_retention", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_months_since_first": { + "id": "model.jaffle_shop.customer_retention_months_since_first", + "table_id": "model.jaffle_shop.customer_retention", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_month_start": { + "id": "model.jaffle_shop.metric_monthly_sales_month_start", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "month_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_active_days": { + "id": "model.jaffle_shop.metric_monthly_sales_active_days", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_date": { + "id": "model.jaffle_shop.payments_fact_order_date", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_order_date": { + "id": "model.jaffle_shop.order_fulfillment_order_date", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_month_start": { + "id": "model.jaffle_shop.rpt_executive_dashboard_month_start", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "month_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_executive_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_first_order": { + "id": "model.jaffle_shop.customer_360_first_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_most_recent_order": { + "id": "model.jaffle_shop.customer_360_most_recent_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_monthly_value": { + "id": "model.jaffle_shop.customer_360_monthly_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_tenure_days": { + "id": "model.jaffle_shop.customer_360_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_days_since_last_order": { + "id": "model.jaffle_shop.customer_360_days_since_last_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_months_active": { + "id": "model.jaffle_shop.customer_360_months_active", + "table_id": "model.jaffle_shop.customer_360", + "name": "months_active", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_week_start": { + "id": "model.jaffle_shop.rpt_sales_dashboard_week_start", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "week_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "prev_week_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct": { + "id": "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "revenue_wow_growth_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.metric_daily_orders": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_daily_orders_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_segments_days_since_last_order": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_recency_score": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "seed.jaffle_shop.raw_orders_order_date": [], + "model.jaffle_shop.int_customer_order_history_distinct_order_days": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.order_discounts_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly": [ + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month": [ + "model.jaffle_shop.customer_cohorts_cohort_month" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days": [ + "model.jaffle_shop.customer_cohorts_avg_tenure_days" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers": [ + "model.jaffle_shop.customer_cohorts_cohort_month" + ], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_first_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_last_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_last_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.customer_lifetime_value_monthly_value": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.metric_promotion_daily": [ + "model.jaffle_shop.order_discounts_order_date" + ], + "model.jaffle_shop.metric_promotion_daily_order_date": [ + "model.jaffle_shop.order_discounts_order_date" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.gross_margin_order_month": [ + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.order_returns_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.revenue_summary_order_date" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_cohorts_cohort_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_cohorts_avg_tenure_days": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_daily_order_summary_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.metric_daily_revenue_order_date", + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_week_start": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.int_inventory_movements_movement_date": [ + "model.jaffle_shop.int_store_order_assignments_order_date" + ], + "model.jaffle_shop.customer_acquisition": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_acquisition_first_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_acquisition_acquisition_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_segments_final_recency_score": [ + "model.jaffle_shop.int_customer_segments_recency_score" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.int_customer_segments_rfm_total" + ], + "model.jaffle_shop.customer_segments_final_days_since_last_order": [ + "model.jaffle_shop.int_customer_segments_days_since_last_order" + ], + "model.jaffle_shop.metric_product_sales_daily": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_product_sales_daily_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_store_order_assignments_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.new_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.metric_daily_revenue_order_date": [ + "model.jaffle_shop.int_daily_order_summary_order_date" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_week": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_month": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.customers_first_order": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.customers_most_recent_order": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.metric_customer_retention_monthly": [ + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_retention_cohort_month", + "model.jaffle_shop.customer_retention_months_since_first" + ], + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month": [ + "model.jaffle_shop.customer_retention_cohort_month" + ], + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first": [ + "model.jaffle_shop.customer_retention_months_since_first" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_cohort_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_months_since_first": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.metric_daily_revenue_order_date", + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_month_start": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.metric_monthly_sales_active_days": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.payments_fact_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.order_fulfillment_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.rpt_store_dashboard_active_days": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.rpt_executive_dashboard_month_start": [ + "model.jaffle_shop.metric_monthly_sales_month_start" + ], + "model.jaffle_shop.rpt_executive_dashboard_active_days": [ + "model.jaffle_shop.metric_monthly_sales_active_days" + ], + "model.jaffle_shop.customer_360_first_order": [ + "model.jaffle_shop.customers_first_order" + ], + "model.jaffle_shop.customer_360_most_recent_order": [ + "model.jaffle_shop.customers_most_recent_order" + ], + "model.jaffle_shop.customer_360_monthly_value": [ + "model.jaffle_shop.customer_lifetime_value_monthly_value" + ], + "model.jaffle_shop.customer_360_customer_tenure_days": [ + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days" + ], + "model.jaffle_shop.customer_360_days_since_last_order": [ + "model.jaffle_shop.customer_lifetime_value_days_since_last_order" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.customer_360_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.customer_360_months_active": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.rpt_sales_dashboard": [ + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.rpt_sales_dashboard_week_start": [ + "model.jaffle_shop.metric_weekly_sales_week_start" + ], + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue": [ + "model.jaffle_shop.metric_weekly_sales_week_start" + ], + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct": [ + "model.jaffle_shop.metric_weekly_sales_week_start" + ] + }, + "child_map": { + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.metric_daily_orders", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "model.jaffle_shop.revenue_summary_order_week", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.customer_retention_months_since_first", + "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "model.jaffle_shop.int_daily_order_summary_order_date", + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.metric_product_sales_daily_order_date", + "model.jaffle_shop.customer_360_months_active", + "model.jaffle_shop.int_daily_order_summary", + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "model.jaffle_shop.revenue_summary_order_date", + "model.jaffle_shop.order_discounts_order_date", + "model.jaffle_shop.metric_daily_orders_order_date", + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": [ + "model.jaffle_shop.int_customer_segments_days_since_last_order", + "model.jaffle_shop.int_customer_segments_recency_score", + "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.metric_customer_acquisition_monthly" + ], + "model.jaffle_shop.customer_cohorts_cohort_month": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers" + ], + "model.jaffle_shop.customer_cohorts_avg_tenure_days": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.customers_most_recent_order", + "model.jaffle_shop.new_orders_order_date", + "model.jaffle_shop.orders_order_date", + "model.jaffle_shop.customers_first_order", + "model.jaffle_shop.int_store_order_assignments_order_date", + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_retention_cohort_month", + "model.jaffle_shop.customer_retention_months_since_first", + "model.jaffle_shop.customer_acquisition_acquisition_month", + "model.jaffle_shop.customer_360_months_active", + "model.jaffle_shop.customer_cohorts_cohort_month", + "model.jaffle_shop.customer_cohorts", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_lifetime_value_first_order_date", + "model.jaffle_shop.customer_acquisition_first_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": [ + "model.jaffle_shop.customer_lifetime_value_last_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": [ + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "model.jaffle_shop.customer_lifetime_value_monthly_value", + "model.jaffle_shop.customer_cohorts_avg_tenure_days" + ], + "model.jaffle_shop.order_discounts_order_date": [ + "model.jaffle_shop.metric_promotion_daily_order_date", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.revenue_summary_order_month": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.gross_margin_order_month" + ], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.order_returns_order_date", + "model.jaffle_shop.payments_fact_order_date", + "model.jaffle_shop.order_fulfillment_order_date" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.metric_daily_revenue_order_date": [ + "model.jaffle_shop.metric_monthly_sales_active_days", + "model.jaffle_shop.metric_monthly_sales_month_start", + "model.jaffle_shop.metric_weekly_sales", + "model.jaffle_shop.metric_weekly_sales_week_start", + "model.jaffle_shop.metric_monthly_sales" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.int_store_order_assignments_order_date": [ + "model.jaffle_shop.int_inventory_movements_movement_date" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.int_customer_segments_recency_score": [ + "model.jaffle_shop.customer_segments_final_recency_score" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.int_customer_segments_days_since_last_order": [ + "model.jaffle_shop.customer_segments_final_days_since_last_order" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.int_daily_order_summary_order_date": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.metric_customer_retention_monthly" + ], + "model.jaffle_shop.customer_retention_cohort_month": [ + "model.jaffle_shop.metric_customer_retention_monthly", + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month" + ], + "model.jaffle_shop.customer_retention_months_since_first": [ + "model.jaffle_shop.metric_customer_retention_monthly", + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.rpt_store_dashboard_active_days" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.rpt_executive_dashboard", + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.metric_monthly_sales_month_start": [ + "model.jaffle_shop.rpt_executive_dashboard_month_start" + ], + "model.jaffle_shop.metric_monthly_sales_active_days": [ + "model.jaffle_shop.rpt_executive_dashboard_active_days" + ], + "model.jaffle_shop.customers_first_order": [ + "model.jaffle_shop.customer_360_first_order" + ], + "model.jaffle_shop.customers_most_recent_order": [ + "model.jaffle_shop.customer_360_most_recent_order" + ], + "model.jaffle_shop.customer_lifetime_value_monthly_value": [ + "model.jaffle_shop.customer_360_monthly_value" + ], + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": [ + "model.jaffle_shop.customer_360_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": [ + "model.jaffle_shop.customer_360_days_since_last_order" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.customer_360_rfm_total" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.rpt_sales_dashboard" + ], + "model.jaffle_shop.metric_weekly_sales_week_start": [ + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "model.jaffle_shop.rpt_sales_dashboard_week_start" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_order_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_order_id.json new file mode 100644 index 000000000..9cb0fe867 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_order_id.json @@ -0,0 +1,1947 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "active_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "active_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_orders_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_orders_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_daily_orders": { + "id": "model.jaffle_shop.metric_daily_orders", + "name": "metric_daily_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as total_orders,\n sum(case when status in ('completed', 'Scompleted') then 1 else 0 end) as completed_orders,\n sum(case when status in ('returned', 'Sreturned', 'return_pending', 'Sreturn_pending') then 1 else 0 end) as returned_orders,\n sum(case when status in ('shipped', 'Sshipped') then 1 else 0 end) as shipped_orders,\n sum(case when status in ('placed', 'Splaced') then 1 else 0 end) as placed_orders,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n avg(item_count) as avg_items_per_order\n from orders\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "total_orders": { + "id": "model.jaffle_shop.int_customer_segments_total_orders", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "frequency_score": { + "id": "model.jaffle_shop.int_customer_segments_frequency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_inventory_daily": { + "id": "model.jaffle_shop.metric_inventory_daily", + "name": "metric_inventory_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nsnapshot as (\n select\n current_date as snapshot_date,\n count(distinct product_id) as total_products_tracked,\n count(distinct store_id) as total_stores,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_count,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_count,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_count,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_count,\n round(avg(current_stock), 1) as avg_stock_per_product_store\n from inventory\n)\n\nselect * from snapshot", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "total_orders": { + "id": "model.jaffle_shop.int_customer_order_history_total_orders", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_stock_levels": { + "id": "model.jaffle_shop.int_product_stock_levels", + "name": "int_product_stock_levels", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='product_store_key'\n )\n}}\n\nwith movements as (\n select * from {{ ref('int_inventory_movements') }}\n),\n\nstock as (\n select\n product_id || '-' || store_id as product_store_key,\n product_id,\n store_id,\n sum(quantity_in) as total_received,\n sum(quantity_out) as total_sold,\n sum(quantity_in) - sum(quantity_out) as current_stock,\n max(case when movement_type = 'supply' then movement_date end) as last_restock_date,\n max(case when movement_type = 'sale' then movement_date end) as last_sale_date\n from movements\n\n {% if is_incremental() %}\n where movement_date > (select max(coalesce(last_restock_date, last_sale_date)) from {{ this }})\n {% endif %}\n\n group by product_id, store_id\n)\n\nselect * from stock", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_discounts": { + "id": "model.jaffle_shop.order_discounts", + "name": "order_discounts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndiscounts as (\n select\n order_id,\n customer_id,\n order_date,\n subtotal,\n has_promotion,\n promotion_name,\n discount_type,\n discount_value,\n discount_amount,\n case when subtotal > 0\n then round(discount_amount / subtotal * 100, 1)\n else 0\n end as discount_pct_of_order,\n subtotal - discount_amount as net_revenue\n from orders\n where has_promotion = true\n)\n\nselect * from discounts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_discounts_order_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_count": { + "id": "model.jaffle_shop.int_store_performance_order_count", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "orders_per_employee": { + "id": "model.jaffle_shop.int_store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_customer_acquisition_monthly": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "metric_customer_acquisition_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with cohorts as (\n select * from {{ ref('customer_cohorts') }}\n),\n\nfinal as (\n select\n cohort_month,\n cohort_size as new_customers,\n avg_lifetime_orders,\n avg_tenure_days,\n sum(cohort_size) over (order by cohort_month) as cumulative_customers\n from cohorts\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.orders": { + "id": "model.jaffle_shop.orders", + "name": "orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norder_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(case when payment_method = '{{ payment_method }}' then amount else 0 end) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n),\n\nfinal as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n\n left join order_payments\n on orders.order_id = order_payments.order_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.orders_order_id", + "table_id": "model.jaffle_shop.orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_lifetime_value": { + "id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_lifetime_value", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nclv as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.number_of_orders,\n c.customer_lifetime_value as total_revenue,\n fl.first_order_date,\n fl.last_order_date,\n fl.customer_tenure_days,\n fl.days_since_last_order,\n case when fl.customer_tenure_days > 0\n then round(c.customer_lifetime_value / (fl.customer_tenure_days / 30.0), 2)\n else c.customer_lifetime_value\n end as monthly_value,\n case when c.number_of_orders > 0\n then round(c.customer_lifetime_value / c.number_of_orders, 2)\n else 0\n end as avg_order_value\n from customers c\n left join first_last fl on c.customer_id = fl.customer_id\n)\n\nselect * from clv", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "number_of_orders": { + "id": "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.customer_lifetime_value_avg_order_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_promotion_daily": { + "id": "model.jaffle_shop.metric_promotion_daily", + "name": "metric_promotion_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with discounts as (\n select * from {{ ref('order_discounts') }}\n),\n\ndaily as (\n select\n order_date,\n promotion_name,\n discount_type,\n count(*) as usage_count,\n sum(discount_amount) as total_discount,\n sum(subtotal) as total_order_value,\n sum(net_revenue) as total_net_revenue,\n avg(discount_pct_of_order) as avg_discount_pct\n from discounts\n group by order_date, promotion_name, discount_type\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.gross_margin_store_id", + "table_id": "model.jaffle_shop.gross_margin", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_returns_order_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.metric_store_daily_store_id", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_count": { + "id": "model.jaffle_shop.store_performance_order_count", + "table_id": "model.jaffle_shop.store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "orders_per_employee": { + "id": "model.jaffle_shop.store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_cohorts": { + "id": "model.jaffle_shop.customer_cohorts", + "name": "customer_cohorts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\ncohorts as (\n select\n {{ dbt.date_trunc('month', 'first_order_date') }} as cohort_month,\n count(*) as cohort_size,\n avg(lifetime_orders) as avg_lifetime_orders,\n avg(customer_tenure_days) as avg_tenure_days\n from first_last\n group by {{ dbt.date_trunc('month', 'first_order_date') }}\n)\n\nselect * from cohorts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_first_last_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "int_customer_first_last_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_last as (\n select\n customer_id,\n min(order_date) as first_order_date,\n max(order_date) as last_order_date,\n {{ dbt.datediff('min(order_date)', 'max(order_date)', 'day') }} as customer_tenure_days,\n count(*) as lifetime_orders,\n {{ dbt.datediff('max(order_date)', '(select max(order_date) from orders)', 'day') }} as days_since_last_order\n from orders\n group by customer_id\n)\n\nselect * from first_last", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_store_revenue_order_count", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_daily_order_summary": { + "id": "model.jaffle_shop.int_daily_order_summary", + "name": "int_daily_order_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='order_date'\n )\n}}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as order_count,\n count(distinct customer_id) as unique_customers,\n sum(subtotal) as total_revenue,\n sum(total_cost) as total_cost,\n sum(total_margin) as total_margin,\n sum(total_quantity) as total_items_sold,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n sum(discount_amount) as total_discounts,\n avg(subtotal) as avg_order_value\n from orders\n\n {% if is_incremental() %}\n where order_date > (select max(order_date) from {{ this }})\n {% endif %}\n\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_weekly_sales": { + "id": "model.jaffle_shop.metric_weekly_sales", + "name": "metric_weekly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nweekly as (\n select\n {{ dbt.date_trunc('week', 'order_date') }} as week_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n sum(unique_customers) as total_customer_visits,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold\n from daily\n group by {{ dbt.date_trunc('week', 'order_date') }}\n)\n\nselect * from weekly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_inventory_movements": { + "id": "model.jaffle_shop.int_inventory_movements", + "name": "int_inventory_movements", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_in as (\n select\n product_id,\n store_id,\n delivered_date as movement_date,\n quantity as quantity_in,\n 0 as quantity_out,\n 'supply' as movement_type\n from {{ ref('stg_supply_orders') }}\n),\n\norder_items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nstore_assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsales_out as (\n select\n oi.product_id,\n sa.store_id,\n sa.order_date as movement_date,\n 0 as quantity_in,\n oi.quantity as quantity_out,\n 'sale' as movement_type\n from order_items oi\n inner join store_assignments sa on oi.order_id = sa.order_id\n),\n\ncombined as (\n select * from supply_in\n union all\n select * from sales_out\n)\n\nselect * from combined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_inventory_movements_store_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.promotion_roi": { + "id": "model.jaffle_shop.promotion_roi", + "name": "promotion_roi", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with effectiveness as (\n select * from {{ ref('int_promotion_effectiveness') }}\n),\n\ndiscounts as (\n select\n promotion_name,\n count(*) as usage_count,\n sum(discount_amount) as total_discount_given,\n sum(net_revenue) as total_net_revenue\n from {{ ref('order_discounts') }}\n group by promotion_name\n),\n\nroi as (\n select\n e.promotion_name,\n e.discount_type,\n e.order_count,\n e.avg_order_value,\n e.total_revenue,\n e.avg_margin,\n coalesce(d.total_discount_given, 0) as total_discount_given,\n coalesce(d.total_net_revenue, 0) as net_revenue_after_discount,\n case when coalesce(d.total_discount_given, 0) > 0\n then round(coalesce(d.total_net_revenue, 0) / d.total_discount_given, 2)\n else 0\n end as revenue_per_discount_dollar\n from effectiveness e\n left join discounts d on e.promotion_name = d.promotion_name\n where e.has_promotion = true\n)\n\nselect * from roi", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_count": { + "id": "model.jaffle_shop.store_rankings_order_count", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count_rank": { + "id": "model.jaffle_shop.store_rankings_order_count_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_acquisition": { + "id": "model.jaffle_shop.customer_acquisition", + "name": "customer_acquisition", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_order_details as (\n select\n fl.customer_id,\n fl.first_order_date,\n o.has_promotion as acquired_via_promotion,\n o.promotion_name as acquisition_promotion,\n o.subtotal as first_order_value,\n o.item_count as first_order_items,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as acquisition_month\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n and fl.first_order_date = o.order_date\n)\n\nselect * from first_order_details", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "frequency_score": { + "id": "model.jaffle_shop.customer_segments_final_frequency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.customer_segments_final_total_orders", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_product_sales_daily": { + "id": "model.jaffle_shop.metric_product_sales_daily", + "name": "metric_product_sales_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('order_items') }}\n),\n\norders as (\n select order_id, order_date from {{ ref('int_order_enriched') }}\n),\n\ndaily_product as (\n select\n o.order_date,\n i.product_id,\n i.product_name,\n i.category_name,\n sum(i.quantity) as units_sold,\n sum(i.line_total) as revenue,\n sum(i.line_margin) as margin,\n count(distinct o.order_id) as order_count\n from items i\n inner join orders o on i.order_id = o.order_id\n group by o.order_date, i.product_id, i.product_name, i.category_name\n)\n\nselect * from daily_product", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_count": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_count", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.product_inventory": { + "id": "model.jaffle_shop.product_inventory", + "name": "product_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('int_product_stock_levels') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nproducts as (\n select * from {{ ref('stg_products') }}\n),\n\nfinal as (\n select\n s.product_store_key,\n s.product_id,\n p.product_name,\n s.store_id,\n st.store_name,\n s.total_received,\n s.total_sold,\n s.current_stock,\n s.last_restock_date,\n s.last_sale_date,\n case\n when s.current_stock <= 0 then 'out_of_stock'\n when s.current_stock < 10 then 'low_stock'\n when s.current_stock < 50 then 'adequate'\n else 'well_stocked'\n end as stock_status\n from stock s\n left join products p on s.product_id = p.product_id\n left join stores st on s.store_id = st.store_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_daily_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue", + "name": "metric_daily_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('int_daily_order_summary') }}\n),\n\nfinal as (\n select\n order_date,\n order_count,\n total_revenue,\n total_cost,\n total_margin,\n total_discounts,\n total_revenue - total_discounts as net_revenue,\n avg_order_value,\n unique_customers,\n total_items_sold\n from daily\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.reorder_recommendations": { + "id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_recommendations", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('product_inventory') }}\n),\n\nperformance as (\n select * from {{ ref('product_performance') }}\n),\n\nrecommendations as (\n select\n s.product_id,\n s.product_name,\n s.store_id,\n s.store_name,\n s.current_stock,\n s.stock_status,\n s.last_restock_date,\n p.total_quantity_sold,\n p.times_ordered,\n case\n when s.stock_status = 'out_of_stock' then 'urgent'\n when s.stock_status = 'low_stock' then 'soon'\n when s.stock_status = 'adequate' and p.times_ordered > 5 then 'monitor'\n else 'ok'\n end as reorder_priority,\n greatest(50 - s.current_stock, 0) as suggested_reorder_qty\n from stock s\n left join performance p on s.product_id = p.product_id\n)\n\nselect * from recommendations", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.revenue_summary_store_id", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customers": { + "id": "model.jaffle_shop.customers", + "name": "customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\ncustomer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n),\n\ncustomer_payments as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders on\n payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders\n on customers.customer_id = customer_orders.customer_id\n\n left join customer_payments\n on customers.customer_id = customer_payments.customer_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "number_of_orders": { + "id": "model.jaffle_shop.customers_number_of_orders", + "table_id": "model.jaffle_shop.customers", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_customer_retention_monthly": { + "id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "metric_customer_retention_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with retention as (\n select * from {{ ref('customer_retention') }}\n),\n\ncohort_sizes as (\n select\n cohort_month,\n customers as cohort_size\n from retention\n where months_since_first = 0\n),\n\nrates as (\n select\n r.cohort_month,\n r.months_since_first,\n r.customers as retained_customers,\n cs.cohort_size,\n round(cast(r.customers as decimal) / cs.cohort_size * 100, 1) as retention_rate\n from retention r\n inner join cohort_sizes cs on r.cohort_month = cs.cohort_month\n)\n\nselect * from rates", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_retention": { + "id": "model.jaffle_shop.customer_retention", + "name": "customer_retention", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ncohort_orders as (\n select\n fl.customer_id,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as cohort_month,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n {{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }} as months_since_first\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n),\n\nretention as (\n select\n cohort_month,\n months_since_first,\n count(distinct customer_id) as customers\n from cohort_orders\n group by cohort_month, months_since_first\n)\n\nselect * from retention", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_monthly_sales": { + "id": "model.jaffle_shop.metric_monthly_sales", + "name": "metric_monthly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nmonthly as (\n select\n {{ dbt.date_trunc('month', 'order_date') }} as month_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold,\n count(distinct order_date) as active_days\n from daily\n group by {{ dbt.date_trunc('month', 'order_date') }}\n)\n\nselect * from monthly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.payments_fact": { + "id": "model.jaffle_shop.payments_fact", + "name": "payments_fact", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('orders') }}\n),\n\nfinal as (\n select\n p.payment_id,\n p.order_id,\n o.customer_id,\n o.order_date,\n p.payment_method,\n p.amount,\n o.status as order_status\n from payments p\n left join orders o on p.order_id = o.order_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_fulfillment_order_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.order_fulfillment_store_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_payment_methods": { + "id": "model.jaffle_shop.int_customer_payment_methods", + "name": "int_customer_payment_methods", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('stg_orders') }}\n),\n\ncustomer_payments as (\n select\n o.customer_id,\n p.payment_method,\n count(*) as usage_count,\n sum(p.amount) as total_amount\n from payments p\n inner join orders o on p.order_id = o.order_id\n group by o.customer_id, p.payment_method\n),\n\npreferred as (\n select\n customer_id,\n payment_method as preferred_payment_method,\n row_number() over (partition by customer_id order by usage_count desc) as rn\n from customer_payments\n),\n\npivoted as (\n select\n cp.customer_id,\n sum(case when cp.payment_method = 'credit_card' then cp.total_amount else 0 end) as credit_card_total,\n sum(case when cp.payment_method = 'bank_transfer' then cp.total_amount else 0 end) as bank_transfer_total,\n sum(case when cp.payment_method = 'coupon' then cp.total_amount else 0 end) as coupon_total,\n sum(case when cp.payment_method = 'gift_card' then cp.total_amount else 0 end) as gift_card_total,\n max(pref.preferred_payment_method) as preferred_payment_method\n from customer_payments cp\n left join preferred pref on cp.customer_id = pref.customer_id and pref.rn = 1\n group by cp.customer_id\n)\n\nselect * from pivoted", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_count": { + "id": "model.jaffle_shop.rpt_store_dashboard_order_count", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_inventory": { + "id": "model.jaffle_shop.store_inventory", + "name": "store_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nstore_level as (\n select\n store_id,\n store_name,\n count(distinct product_id) as unique_products,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_products,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_products,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_stock_products,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_products\n from inventory\n group by store_id, store_name\n)\n\nselect * from store_level", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "number_of_orders": { + "id": "model.jaffle_shop.customer_360_number_of_orders", + "table_id": "model.jaffle_shop.customer_360", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.customer_360_avg_order_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_promotion_effectiveness": { + "id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "int_promotion_effectiveness", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders_with_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\neffectiveness as (\n select\n owp.has_promotion,\n owp.promotion_name,\n owp.discount_type,\n count(*) as order_count,\n avg(ot.subtotal) as avg_order_value,\n sum(ot.subtotal) as total_revenue,\n avg(ot.item_count) as avg_items_per_order,\n avg(ot.total_margin) as avg_margin\n from orders_with_promos owp\n left join order_totals ot on owp.order_id = ot.order_id\n group by owp.has_promotion, owp.promotion_name, owp.discount_type\n)\n\nselect * from effectiveness", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.inventory_health": { + "id": "model.jaffle_shop.inventory_health", + "name": "inventory_health", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nmovements as (\n select\n product_id,\n store_id,\n sum(quantity_in) as total_inbound,\n sum(quantity_out) as total_outbound,\n count(case when movement_type = 'supply' then 1 end) as restock_events,\n count(case when movement_type = 'sale' then 1 end) as sale_events\n from {{ ref('int_inventory_movements') }}\n group by product_id, store_id\n),\n\nhealth as (\n select\n i.product_store_key,\n i.product_id,\n i.product_name,\n i.store_id,\n i.store_name,\n i.current_stock,\n i.stock_status,\n m.total_inbound,\n m.total_outbound,\n m.restock_events,\n m.sale_events,\n case\n when m.total_outbound > m.total_inbound then 'deficit'\n when i.current_stock > m.total_outbound * 2 then 'overstocked'\n else 'balanced'\n end as inventory_balance,\n case when m.sale_events > 0\n then round(cast(m.total_outbound as decimal) / m.sale_events, 1)\n else 0\n end as avg_units_per_sale\n from inventory i\n left join movements m on i.product_id = m.product_id and i.store_id = m.store_id\n)\n\nselect * from health", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_sales_dashboard": { + "id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "rpt_sales_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with weekly as (\n select * from {{ ref('metric_weekly_sales') }}\n),\n\nfinal as (\n select\n w.week_start,\n w.total_orders,\n w.total_revenue,\n w.net_revenue,\n w.total_margin,\n w.total_discounts,\n w.total_items_sold,\n w.avg_daily_order_value,\n lag(w.total_revenue) over (order by w.week_start) as prev_week_revenue,\n case when lag(w.total_revenue) over (order by w.week_start) > 0\n then round((w.total_revenue - lag(w.total_revenue) over (order by w.week_start))\n / lag(w.total_revenue) over (order by w.week_start) * 100, 1)\n else null\n end as revenue_wow_growth_pct\n from weekly w\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.rpt_customer_dashboard_active_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "active_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_orders_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_total_orders": { + "id": "model.jaffle_shop.int_customer_segments_total_orders", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_frequency_score": { + "id": "model.jaffle_shop.int_customer_segments_frequency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_orders": { + "id": "model.jaffle_shop.int_customer_order_history_total_orders", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_order_id": { + "id": "model.jaffle_shop.order_discounts_order_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_order_count": { + "id": "model.jaffle_shop.int_store_performance_order_count", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_orders_per_employee": { + "id": "model.jaffle_shop.int_store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_id": { + "id": "model.jaffle_shop.orders_order_id", + "table_id": "model.jaffle_shop.orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_number_of_orders": { + "id": "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_avg_order_value": { + "id": "model.jaffle_shop.customer_lifetime_value_avg_order_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_store_id": { + "id": "model.jaffle_shop.gross_margin_store_id", + "table_id": "model.jaffle_shop.gross_margin", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_id": { + "id": "model.jaffle_shop.order_returns_order_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_store_id": { + "id": "model.jaffle_shop.metric_store_daily_store_id", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_order_count": { + "id": "model.jaffle_shop.store_performance_order_count", + "table_id": "model.jaffle_shop.store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_orders_per_employee": { + "id": "model.jaffle_shop.store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_order_count": { + "id": "model.jaffle_shop.int_store_revenue_order_count", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_store_id": { + "id": "model.jaffle_shop.int_inventory_movements_store_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count": { + "id": "model.jaffle_shop.store_rankings_order_count", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count_rank": { + "id": "model.jaffle_shop.store_rankings_order_count_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_frequency_score": { + "id": "model.jaffle_shop.customer_segments_final_frequency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_total_orders": { + "id": "model.jaffle_shop.customer_segments_final_total_orders", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_order_count": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_count", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_order_id": { + "id": "model.jaffle_shop.new_orders_order_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_store_id": { + "id": "model.jaffle_shop.revenue_summary_store_id", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_number_of_orders": { + "id": "model.jaffle_shop.customers_number_of_orders", + "table_id": "model.jaffle_shop.customers", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_order_id": { + "id": "model.jaffle_shop.order_fulfillment_order_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_store_id": { + "id": "model.jaffle_shop.order_fulfillment_store_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_order_count": { + "id": "model.jaffle_shop.rpt_store_dashboard_order_count", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_number_of_orders": { + "id": "model.jaffle_shop.customer_360_number_of_orders", + "table_id": "model.jaffle_shop.customer_360", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_avg_order_value": { + "id": "model.jaffle_shop.customer_360_avg_order_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.rpt_customer_dashboard_active_customers": [ + "model.jaffle_shop.customer_360_number_of_orders" + ], + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer": [ + "model.jaffle_shop.customer_360_number_of_orders" + ], + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.metric_daily_orders": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.int_customer_segments_total_orders": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_frequency_score": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.metric_inventory_daily": [ + "model.jaffle_shop.product_inventory" + ], + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_customer_order_history_total_orders": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.order_discounts_order_id": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.int_store_revenue_store_id" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly": [ + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.orders": ["model.jaffle_shop.stg_orders_order_id"], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.customers" + ], + "model.jaffle_shop.customer_lifetime_value_number_of_orders": [ + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.customer_lifetime_value_avg_order_value": [ + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.metric_promotion_daily": [ + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.gross_margin_store_id": [ + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.order_returns": ["model.jaffle_shop.orders"], + "model.jaffle_shop.order_returns_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.metric_store_daily_store_id": [ + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.int_store_performance_order_count" + ], + "model.jaffle_shop.store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "model.jaffle_shop.int_inventory_movements_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.promotion_roi": [ + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.store_rankings_order_count_rank": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.customer_acquisition": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_segments_final_frequency_score": [ + "model.jaffle_shop.int_customer_segments_frequency_score" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.int_customer_segments_rfm_total" + ], + "model.jaffle_shop.customer_segments_final_total_orders": [ + "model.jaffle_shop.int_customer_segments_total_orders" + ], + "model.jaffle_shop.metric_product_sales_daily": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.metric_product_sales_daily_order_count": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.int_product_stock_levels" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.new_orders_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.reorder_recommendations": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.revenue_summary_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.customers": ["model.jaffle_shop.stg_orders_order_id"], + "model.jaffle_shop.customers_number_of_orders": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.metric_customer_retention_monthly": [ + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.payments_fact": [ + "model.jaffle_shop.orders", + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.orders", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.order_fulfillment_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.order_fulfillment_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_customer_payment_methods": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.metric_store_daily_store_id", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.rpt_store_dashboard_order_count": [ + "model.jaffle_shop.store_rankings_order_count" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.customer_360_number_of_orders": [ + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.customer_360_avg_order_value": [ + "model.jaffle_shop.customer_lifetime_value_avg_order_value" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.customer_360_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.int_promotion_effectiveness": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.inventory_health": [ + "model.jaffle_shop.int_inventory_movements_store_id", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.rpt_sales_dashboard": [ + "model.jaffle_shop.metric_weekly_sales" + ] + }, + "child_map": { + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.customer_360_number_of_orders": [ + "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.metric_daily_orders", + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.order_discounts", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_cohorts", + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.int_customer_order_history_total_orders": [ + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_total_orders", + "model.jaffle_shop.int_customer_segments_customer_segment", + "model.jaffle_shop.int_customer_segments_frequency_score" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.metric_inventory_daily", + "model.jaffle_shop.inventory_health", + "model.jaffle_shop.store_inventory" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.metric_product_sales_daily_order_count", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.order_discounts_order_id", + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.inventory_health", + "model.jaffle_shop.int_product_stock_levels" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_performance_orders_per_employee", + "model.jaffle_shop.int_store_performance_order_count" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.metric_customer_acquisition_monthly" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.orders", + "model.jaffle_shop.orders_order_id", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.new_orders_order_id", + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customers_number_of_orders": [ + "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "model.jaffle_shop.customer_360_number_of_orders", + "model.jaffle_shop.customer_lifetime_value_avg_order_value" + ], + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.revenue_summary_store_id": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.gross_margin_store_id", + "model.jaffle_shop.metric_store_daily_store_id" + ], + "model.jaffle_shop.orders": [ + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.order_returns" + ], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.order_returns_order_id", + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.order_fulfillment_order_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.store_performance_orders_per_employee" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.int_store_revenue_store_id", + "model.jaffle_shop.int_inventory_movements_store_id", + "model.jaffle_shop.revenue_summary_store_id", + "model.jaffle_shop.order_fulfillment_store_id", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.int_store_revenue_order_count", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.int_promotion_effectiveness": [ + "model.jaffle_shop.promotion_roi" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.store_rankings_order_count_rank", + "model.jaffle_shop.store_rankings_order_count" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.int_customer_segments_frequency_score": [ + "model.jaffle_shop.customer_segments_final_frequency_score" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.int_customer_segments_total_orders": [ + "model.jaffle_shop.customer_segments_final_total_orders" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.metric_customer_retention_monthly" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily_store_id": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.rpt_store_dashboard_order_count" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.rpt_executive_dashboard", + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_lifetime_value_avg_order_value": [ + "model.jaffle_shop.customer_360_avg_order_value" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.customer_360_rfm_total" + ], + "model.jaffle_shop.int_inventory_movements_store_id": [ + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.rpt_sales_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_status.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_status.json new file mode 100644 index 000000000..e21e2f749 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_stg_orders_status.json @@ -0,0 +1,322 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.metric_daily_orders_completed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_completed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "completed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_returned_orders": { + "id": "model.jaffle_shop.metric_daily_orders_returned_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "returned_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_shipped_orders": { + "id": "model.jaffle_shop.metric_daily_orders_shipped_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "shipped_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_placed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_placed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "placed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_status": { + "id": "model.jaffle_shop.new_orders_status", + "table_id": "model.jaffle_shop.new_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_status": { + "id": "model.jaffle_shop.payments_fact_order_status", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_status", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_status": { + "id": "model.jaffle_shop.order_fulfillment_status", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.metric_daily_orders_completed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_returned_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_shipped_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_placed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "seed.jaffle_shop.raw_orders_status": [], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.order_returns": ["model.jaffle_shop.orders_status"], + "model.jaffle_shop.order_returns_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_returns_return_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.new_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.payments_fact_order_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.order_fulfillment_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.stg_orders_status" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.metric_daily_orders_shipped_orders", + "model.jaffle_shop.metric_daily_orders_returned_orders", + "model.jaffle_shop.metric_daily_orders_completed_orders", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.metric_daily_orders_placed_orders" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.int_orders_with_promotions_status", + "model.jaffle_shop.new_orders_status", + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.order_fulfillment_status", + "model.jaffle_shop.order_returns_status", + "model.jaffle_shop.order_returns_return_status", + "model.jaffle_shop.order_returns", + "model.jaffle_shop.payments_fact_order_status" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_city.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_city.json new file mode 100644 index 000000000..df3ee51f0 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_city.json @@ -0,0 +1,107 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.store_performance_city": { + "id": "model.jaffle_shop.store_performance_city", + "table_id": "model.jaffle_shop.store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_city": { + "id": "seed.jaffle_shop.raw_stores_city", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_city": { + "id": "model.jaffle_shop.int_store_performance_city", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_city": { + "id": "model.jaffle_shop.store_rankings_city", + "table_id": "model.jaffle_shop.store_rankings", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_city": { + "id": "model.jaffle_shop.stg_stores_city", + "table_id": "model.jaffle_shop.stg_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_city": { + "id": "model.jaffle_shop.int_store_employees_active_city", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_city": { + "id": "model.jaffle_shop.rpt_store_dashboard_city", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.store_performance_city": [ + "model.jaffle_shop.int_store_performance_city" + ], + "seed.jaffle_shop.raw_stores_city": [], + "model.jaffle_shop.int_store_performance_city": [ + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.store_rankings_city": [ + "model.jaffle_shop.store_performance_city" + ], + "model.jaffle_shop.stg_stores_city": ["seed.jaffle_shop.raw_stores_city"], + "model.jaffle_shop.int_store_employees_active_city": [ + "model.jaffle_shop.stg_stores_city" + ], + "model.jaffle_shop.rpt_store_dashboard_city": [ + "model.jaffle_shop.store_rankings_city" + ] + }, + "child_map": { + "model.jaffle_shop.int_store_performance_city": [ + "model.jaffle_shop.store_performance_city" + ], + "model.jaffle_shop.int_store_employees_active_city": [ + "model.jaffle_shop.int_store_performance_city" + ], + "model.jaffle_shop.stg_stores_city": [ + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.store_performance_city": [ + "model.jaffle_shop.store_rankings_city" + ], + "seed.jaffle_shop.raw_stores_city": ["model.jaffle_shop.stg_stores_city"], + "model.jaffle_shop.store_rankings_city": [ + "model.jaffle_shop.rpt_store_dashboard_city" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_state.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_state.json new file mode 100644 index 000000000..081a9df91 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_state.json @@ -0,0 +1,111 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.store_performance_state": { + "id": "model.jaffle_shop.store_performance_state", + "table_id": "model.jaffle_shop.store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_state": { + "id": "seed.jaffle_shop.raw_stores_state", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_state": { + "id": "model.jaffle_shop.int_store_performance_state", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_state": { + "id": "model.jaffle_shop.store_rankings_state", + "table_id": "model.jaffle_shop.store_rankings", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_state": { + "id": "model.jaffle_shop.stg_stores_state", + "table_id": "model.jaffle_shop.stg_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_state": { + "id": "model.jaffle_shop.int_store_employees_active_state", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_state": { + "id": "model.jaffle_shop.rpt_store_dashboard_state", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.store_performance_state": [ + "model.jaffle_shop.int_store_performance_state" + ], + "seed.jaffle_shop.raw_stores_state": [], + "model.jaffle_shop.int_store_performance_state": [ + "model.jaffle_shop.int_store_employees_active_state" + ], + "model.jaffle_shop.store_rankings_state": [ + "model.jaffle_shop.store_performance_state" + ], + "model.jaffle_shop.stg_stores_state": [ + "seed.jaffle_shop.raw_stores_state" + ], + "model.jaffle_shop.int_store_employees_active_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "model.jaffle_shop.rpt_store_dashboard_state": [ + "model.jaffle_shop.store_rankings_state" + ] + }, + "child_map": { + "model.jaffle_shop.int_store_performance_state": [ + "model.jaffle_shop.store_performance_state" + ], + "model.jaffle_shop.int_store_employees_active_state": [ + "model.jaffle_shop.int_store_performance_state" + ], + "model.jaffle_shop.stg_stores_state": [ + "model.jaffle_shop.int_store_employees_active_state" + ], + "model.jaffle_shop.store_performance_state": [ + "model.jaffle_shop.store_rankings_state" + ], + "seed.jaffle_shop.raw_stores_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "model.jaffle_shop.store_rankings_state": [ + "model.jaffle_shop.rpt_store_dashboard_state" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_store_id.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_store_id.json new file mode 100644 index 000000000..95c451686 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_store_id.json @@ -0,0 +1,138 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_id", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.store_performance_store_id": { + "id": "model.jaffle_shop.store_performance_store_id", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_id": { + "id": "seed.jaffle_shop.raw_stores_id", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_store_id": { + "id": "model.jaffle_shop.int_store_performance_store_id", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_store_id": { + "id": "model.jaffle_shop.store_rankings_store_id", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_store_id": { + "id": "model.jaffle_shop.stg_stores_store_id", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_store_id": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_id", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.store_performance_store_id": [ + "model.jaffle_shop.int_store_performance_store_id" + ], + "seed.jaffle_shop.raw_stores_id": [], + "model.jaffle_shop.int_store_performance_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id" + ], + "model.jaffle_shop.store_rankings_store_id": [ + "model.jaffle_shop.store_performance_store_id" + ], + "model.jaffle_shop.stg_stores_store_id": [ + "seed.jaffle_shop.raw_stores_id" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings_store_id" + ], + "model.jaffle_shop.rpt_store_dashboard_store_id": [ + "model.jaffle_shop.store_rankings_store_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_store_performance_store_id": [ + "model.jaffle_shop.store_performance_store_id" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.int_store_performance_store_id" + ], + "model.jaffle_shop.stg_stores_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id" + ], + "model.jaffle_shop.store_performance_store_id": [ + "model.jaffle_shop.store_rankings_store_id" + ], + "seed.jaffle_shop.raw_stores_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.store_rankings_store_id": [ + "model.jaffle_shop.rpt_store_dashboard_store_id", + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_store_name.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_store_name.json new file mode 100644 index 000000000..735339f56 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_store_name.json @@ -0,0 +1,111 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.store_performance_store_name": { + "id": "model.jaffle_shop.store_performance_store_name", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_name": { + "id": "seed.jaffle_shop.raw_stores_name", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_store_name": { + "id": "model.jaffle_shop.int_store_performance_store_name", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_store_name": { + "id": "model.jaffle_shop.store_rankings_store_name", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_store_name": { + "id": "model.jaffle_shop.stg_stores_store_name", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_name": { + "id": "model.jaffle_shop.int_store_employees_active_store_name", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_store_name": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_name", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.store_performance_store_name": [ + "model.jaffle_shop.int_store_performance_store_name" + ], + "seed.jaffle_shop.raw_stores_name": [], + "model.jaffle_shop.int_store_performance_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.store_rankings_store_name": [ + "model.jaffle_shop.store_performance_store_name" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "seed.jaffle_shop.raw_stores_name" + ], + "model.jaffle_shop.int_store_employees_active_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.rpt_store_dashboard_store_name": [ + "model.jaffle_shop.store_rankings_store_name" + ] + }, + "child_map": { + "model.jaffle_shop.int_store_performance_store_name": [ + "model.jaffle_shop.store_performance_store_name" + ], + "model.jaffle_shop.int_store_employees_active_store_name": [ + "model.jaffle_shop.int_store_performance_store_name" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.store_performance_store_name": [ + "model.jaffle_shop.store_rankings_store_name" + ], + "seed.jaffle_shop.raw_stores_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.store_rankings_store_name": [ + "model.jaffle_shop.rpt_store_dashboard_store_name" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_total_revenue.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_total_revenue.json new file mode 100644 index 000000000..c7c5a65ed --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-col-model_jaffle_shop_store_rankings_total_revenue.json @@ -0,0 +1,200 @@ +{ + "current": { + "nodes": {}, + "columns": { + "model.jaffle_shop.store_performance_total_revenue": { + "id": "model.jaffle_shop.store_performance_total_revenue", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_subtotal": { + "id": "model.jaffle_shop.int_order_totals_subtotal", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_subtotal": { + "id": "model.jaffle_shop.int_order_enriched_subtotal", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_quantity": { + "id": "seed.jaffle_shop.raw_order_items_quantity", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_unit_price": { + "id": "seed.jaffle_shop.raw_order_items_unit_price", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "unit_price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_quantity": { + "id": "model.jaffle_shop.stg_order_items_quantity", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_unit_price": { + "id": "model.jaffle_shop.stg_order_items_unit_price", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_total": { + "id": "model.jaffle_shop.int_order_items_enriched_line_total", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_line_total": { + "id": "model.jaffle_shop.int_order_items_with_products_line_total", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_total_revenue": { + "id": "model.jaffle_shop.int_store_performance_total_revenue", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_revenue": { + "id": "model.jaffle_shop.int_store_revenue_total_revenue", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_total_revenue": { + "id": "model.jaffle_shop.store_rankings_total_revenue", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_total_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.store_performance_total_revenue": [ + "model.jaffle_shop.int_store_performance_total_revenue" + ], + "model.jaffle_shop.int_order_totals_subtotal": [ + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.int_order_enriched_subtotal": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "seed.jaffle_shop.raw_order_items_quantity": [], + "seed.jaffle_shop.raw_order_items_unit_price": [], + "model.jaffle_shop.stg_order_items_quantity": [ + "seed.jaffle_shop.raw_order_items_quantity" + ], + "model.jaffle_shop.stg_order_items_unit_price": [ + "seed.jaffle_shop.raw_order_items_unit_price" + ], + "model.jaffle_shop.int_order_items_enriched_line_total": [ + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_order_items_with_products_line_total": [ + "model.jaffle_shop.stg_order_items_unit_price", + "model.jaffle_shop.stg_order_items_quantity" + ], + "model.jaffle_shop.int_store_performance_total_revenue": [ + "model.jaffle_shop.int_store_revenue_total_revenue" + ], + "model.jaffle_shop.int_store_revenue_total_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.store_rankings_total_revenue": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.rpt_store_dashboard_total_revenue": [ + "model.jaffle_shop.store_rankings_total_revenue" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_subtotal": [ + "model.jaffle_shop.int_store_revenue_total_revenue" + ], + "model.jaffle_shop.int_order_totals_subtotal": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_store_performance_total_revenue": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.int_order_items_enriched_line_total": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "seed.jaffle_shop.raw_order_items_quantity": [ + "model.jaffle_shop.stg_order_items_quantity" + ], + "seed.jaffle_shop.raw_order_items_unit_price": [ + "model.jaffle_shop.stg_order_items_unit_price" + ], + "model.jaffle_shop.int_order_items_with_products_line_total": [ + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.stg_order_items_quantity": [ + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.stg_order_items_unit_price": [ + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_store_revenue_total_revenue": [ + "model.jaffle_shop.int_store_performance_total_revenue" + ], + "model.jaffle_shop.store_performance_total_revenue": [ + "model.jaffle_shop.store_rankings_total_revenue" + ], + "model.jaffle_shop.store_rankings_total_revenue": [ + "model.jaffle_shop.rpt_store_dashboard_total_revenue" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-full-map.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-full-map.json new file mode 100644 index 000000000..135bfc197 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-full-map.json @@ -0,0 +1,20628 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "total_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_total_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "total_customers", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "active_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "active_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_clv": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_clv", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_clv", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_orders_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_orders_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_reviews_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_reviews_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_daily_orders": { + "id": "model.jaffle_shop.metric_daily_orders", + "name": "metric_daily_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as total_orders,\n sum(case when status in ('completed', 'Scompleted') then 1 else 0 end) as completed_orders,\n sum(case when status in ('returned', 'Sreturned', 'return_pending', 'Sreturn_pending') then 1 else 0 end) as returned_orders,\n sum(case when status in ('shipped', 'Sshipped') then 1 else 0 end) as shipped_orders,\n sum(case when status in ('placed', 'Splaced') then 1 else 0 end) as placed_orders,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n avg(item_count) as avg_items_per_order\n from orders\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_daily_orders_order_date", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.metric_daily_orders_total_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "completed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_completed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "completed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "returned_orders": { + "id": "model.jaffle_shop.metric_daily_orders_returned_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "returned_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "shipped_orders": { + "id": "model.jaffle_shop.metric_daily_orders_shipped_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "shipped_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "placed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_placed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "placed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "promoted_orders": { + "id": "model.jaffle_shop.metric_daily_orders_promoted_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "promoted_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_items_per_order": { + "id": "model.jaffle_shop.metric_daily_orders_avg_items_per_order", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_segments_customer_id", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.int_customer_segments_first_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.int_customer_segments_last_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.int_customer_segments_total_orders", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_spent": { + "id": "model.jaffle_shop.int_customer_segments_total_spent", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.int_customer_segments_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "recency_score": { + "id": "model.jaffle_shop.int_customer_segments_recency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "frequency_score": { + "id": "model.jaffle_shop.int_customer_segments_frequency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "monetary_score": { + "id": "model.jaffle_shop.int_customer_segments_monetary_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "monetary_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_inventory_daily": { + "id": "model.jaffle_shop.metric_inventory_daily", + "name": "metric_inventory_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nsnapshot as (\n select\n current_date as snapshot_date,\n count(distinct product_id) as total_products_tracked,\n count(distinct store_id) as total_stores,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_count,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_count,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_count,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_count,\n round(avg(current_stock), 1) as avg_stock_per_product_store\n from inventory\n)\n\nselect * from snapshot", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "snapshot_date": { + "id": "model.jaffle_shop.metric_inventory_daily_snapshot_date", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "snapshot_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_products_tracked": { + "id": "model.jaffle_shop.metric_inventory_daily_total_products_tracked", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_products_tracked", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_stores": { + "id": "model.jaffle_shop.metric_inventory_daily_total_stores", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_stores", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_stock_units": { + "id": "model.jaffle_shop.metric_inventory_daily_total_stock_units", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "out_of_stock_count": { + "id": "model.jaffle_shop.metric_inventory_daily_out_of_stock_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "out_of_stock_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "low_stock_count": { + "id": "model.jaffle_shop.metric_inventory_daily_low_stock_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "low_stock_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "adequate_count": { + "id": "model.jaffle_shop.metric_inventory_daily_adequate_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "adequate_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "well_stocked_count": { + "id": "model.jaffle_shop.metric_inventory_daily_well_stocked_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "well_stocked_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_stock_per_product_store": { + "id": "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "avg_stock_per_product_store", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_product_stock_levels": { + "id": "model.jaffle_shop.int_product_stock_levels", + "name": "int_product_stock_levels", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='product_store_key'\n )\n}}\n\nwith movements as (\n select * from {{ ref('int_inventory_movements') }}\n),\n\nstock as (\n select\n product_id || '-' || store_id as product_store_key,\n product_id,\n store_id,\n sum(quantity_in) as total_received,\n sum(quantity_out) as total_sold,\n sum(quantity_in) - sum(quantity_out) as current_stock,\n max(case when movement_type = 'supply' then movement_date end) as last_restock_date,\n max(case when movement_type = 'sale' then movement_date end) as last_sale_date\n from movements\n\n {% if is_incremental() %}\n where movement_date > (select max(coalesce(last_restock_date, last_sale_date)) from {{ this }})\n {% endif %}\n\n group by product_id, store_id\n)\n\nselect * from stock", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_store_key": { + "id": "model.jaffle_shop.int_product_stock_levels_product_store_key", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_product_stock_levels_product_id", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_product_stock_levels_store_id", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_received": { + "id": "model.jaffle_shop.int_product_stock_levels_total_received", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "total_received", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "total_sold": { + "id": "model.jaffle_shop.int_product_stock_levels_total_sold", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "total_sold", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "current_stock": { + "id": "model.jaffle_shop.int_product_stock_levels_current_stock", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "last_restock_date": { + "id": "model.jaffle_shop.int_product_stock_levels_last_restock_date", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "last_sale_date": { + "id": "model.jaffle_shop.int_product_stock_levels_last_sale_date", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "last_sale_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_promotions_name", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "seed.jaffle_shop.raw_promotions_discount_type", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "seed.jaffle_shop.raw_promotions_discount_value", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "discount_value", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "start_date": { + "id": "seed.jaffle_shop.raw_promotions_start_date", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "start_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "end_date": { + "id": "seed.jaffle_shop.raw_promotions_end_date", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "end_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_discounts": { + "id": "model.jaffle_shop.order_discounts", + "name": "order_discounts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndiscounts as (\n select\n order_id,\n customer_id,\n order_date,\n subtotal,\n has_promotion,\n promotion_name,\n discount_type,\n discount_value,\n discount_amount,\n case when subtotal > 0\n then round(discount_amount / subtotal * 100, 1)\n else 0\n end as discount_pct_of_order,\n subtotal - discount_amount as net_revenue\n from orders\n where has_promotion = true\n)\n\nselect * from discounts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_discounts_order_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.order_discounts_customer_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.order_discounts_order_date", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "subtotal": { + "id": "model.jaffle_shop.order_discounts_subtotal", + "table_id": "model.jaffle_shop.order_discounts", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "has_promotion": { + "id": "model.jaffle_shop.order_discounts_has_promotion", + "table_id": "model.jaffle_shop.order_discounts", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.order_discounts_promotion_name", + "table_id": "model.jaffle_shop.order_discounts", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.order_discounts_discount_type", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "model.jaffle_shop.order_discounts_discount_value", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_amount": { + "id": "model.jaffle_shop.order_discounts_discount_amount", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_amount", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_pct_of_order": { + "id": "model.jaffle_shop.order_discounts_discount_pct_of_order", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_pct_of_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.order_discounts_net_revenue", + "table_id": "model.jaffle_shop.order_discounts", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_subtotal": { + "id": "model.jaffle_shop.int_order_payments_matched_order_subtotal", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_subtotal", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "total_paid": { + "id": "model.jaffle_shop.int_order_payments_matched_total_paid", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "payment_count": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_count", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "payment_method_count": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_method_count", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_method_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "payment_status": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_status", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_review_activity": { + "id": "model.jaffle_shop.int_customer_review_activity", + "name": "int_customer_review_activity", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with reviews as (\n select * from {{ ref('stg_reviews') }}\n),\n\ncustomer_reviews as (\n select\n customer_id,\n count(*) as review_count,\n avg(rating) as avg_rating,\n min(rating) as min_rating,\n max(rating) as max_rating,\n min(review_date) as first_review_date,\n max(review_date) as last_review_date,\n count(distinct product_id) as products_reviewed\n from reviews\n group by customer_id\n)\n\nselect * from customer_reviews", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_review_activity_customer_id", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.int_customer_review_activity_review_count", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_avg_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "min_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_min_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "min_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "max_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_max_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "max_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "first_review_date": { + "id": "model.jaffle_shop.int_customer_review_activity_first_review_date", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "first_review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "last_review_date": { + "id": "model.jaffle_shop.int_customer_review_activity_last_review_date", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "last_review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "products_reviewed": { + "id": "model.jaffle_shop.int_customer_review_activity_products_reviewed", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "products_reviewed", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_customer_acquisition_monthly": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "metric_customer_acquisition_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with cohorts as (\n select * from {{ ref('customer_cohorts') }}\n),\n\nfinal as (\n select\n cohort_month,\n cohort_size as new_customers,\n avg_lifetime_orders,\n avg_tenure_days,\n sum(cohort_size) over (order by cohort_month) as cumulative_customers\n from cohorts\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "new_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "new_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "avg_lifetime_orders": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_lifetime_orders", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_tenure_days": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cumulative_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cumulative_customers", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.orders": { + "id": "model.jaffle_shop.orders", + "name": "orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norder_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(case when payment_method = '{{ payment_method }}' then amount else 0 end) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n),\n\nfinal as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n\n left join order_payments\n on orders.order_id = order_payments.order_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.orders_order_id", + "table_id": "model.jaffle_shop.orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.orders_customer_id", + "table_id": "model.jaffle_shop.orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.orders_order_date", + "table_id": "model.jaffle_shop.orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "credit_card_amount": { + "id": "model.jaffle_shop.orders_credit_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "coupon_amount": { + "id": "model.jaffle_shop.orders_coupon_amount", + "table_id": "model.jaffle_shop.orders", + "name": "coupon_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "bank_transfer_amount": { + "id": "model.jaffle_shop.orders_bank_transfer_amount", + "table_id": "model.jaffle_shop.orders", + "name": "bank_transfer_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "gift_card_amount": { + "id": "model.jaffle_shop.orders_gift_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.orders_amount", + "table_id": "model.jaffle_shop.orders", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_reviews_with_products": { + "id": "model.jaffle_shop.int_reviews_with_products", + "name": "int_reviews_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with reviews as (\n select * from {{ ref('stg_reviews') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\nenriched as (\n select\n r.review_id,\n r.order_id,\n r.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n r.customer_id,\n r.rating,\n r.review_date\n from reviews r\n left join products p on r.product_id = p.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "review_id": { + "id": "model.jaffle_shop.int_reviews_with_products_review_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "review_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.int_reviews_with_products_order_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_reviews_with_products_product_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_reviews_with_products_product_name", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_reviews_with_products_category_name", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_reviews_with_products_root_category", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.int_reviews_with_products_customer_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rating": { + "id": "model.jaffle_shop.int_reviews_with_products_rating", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "rating", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_date": { + "id": "model.jaffle_shop.int_reviews_with_products_review_date", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_lifetime_value": { + "id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_lifetime_value", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nclv as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.number_of_orders,\n c.customer_lifetime_value as total_revenue,\n fl.first_order_date,\n fl.last_order_date,\n fl.customer_tenure_days,\n fl.days_since_last_order,\n case when fl.customer_tenure_days > 0\n then round(c.customer_lifetime_value / (fl.customer_tenure_days / 30.0), 2)\n else c.customer_lifetime_value\n end as monthly_value,\n case when c.number_of_orders > 0\n then round(c.customer_lifetime_value / c.number_of_orders, 2)\n else 0\n end as avg_order_value\n from customers c\n left join first_last fl on c.customer_id = fl.customer_id\n)\n\nselect * from clv", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_id", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.customer_lifetime_value_first_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.customer_lifetime_value_last_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "number_of_orders": { + "id": "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.customer_lifetime_value_total_revenue", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "total_revenue", + "type": "HUGEINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "first_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_first_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_last_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_tenure_days": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "monthly_value": { + "id": "model.jaffle_shop.customer_lifetime_value_monthly_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.customer_lifetime_value_avg_order_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_promotion_daily": { + "id": "model.jaffle_shop.metric_promotion_daily", + "name": "metric_promotion_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with discounts as (\n select * from {{ ref('order_discounts') }}\n),\n\ndaily as (\n select\n order_date,\n promotion_name,\n discount_type,\n count(*) as usage_count,\n sum(discount_amount) as total_discount,\n sum(subtotal) as total_order_value,\n sum(net_revenue) as total_net_revenue,\n avg(discount_pct_of_order) as avg_discount_pct\n from discounts\n group by order_date, promotion_name, discount_type\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_promotion_daily_order_date", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.metric_promotion_daily_promotion_name", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.metric_promotion_daily_discount_type", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "usage_count": { + "id": "model.jaffle_shop.metric_promotion_daily_usage_count", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "usage_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_discount": { + "id": "model.jaffle_shop.metric_promotion_daily_total_discount", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_discount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_order_value": { + "id": "model.jaffle_shop.metric_promotion_daily_total_order_value", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_net_revenue": { + "id": "model.jaffle_shop.metric_promotion_daily_total_net_revenue", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_discount_pct": { + "id": "model.jaffle_shop.metric_promotion_daily_avg_discount_pct", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "avg_discount_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_category_hierarchy_category_name", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_parent_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_category_hierarchy_root_category", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "full_path": { + "id": "model.jaffle_shop.int_category_hierarchy_full_path", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "full_path", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "depth": { + "id": "model.jaffle_shop.int_category_hierarchy_depth", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "depth", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.metric_store_daily_store_id", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.metric_store_daily_store_name", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.metric_store_daily_city", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.metric_store_daily_order_count", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue": { + "id": "model.jaffle_shop.metric_store_daily_revenue", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.metric_store_daily_cost", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.metric_store_daily_margin", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discounts": { + "id": "model.jaffle_shop.metric_store_daily_discounts", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.metric_store_daily_net_revenue", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_performance_store_id", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.store_performance_store_name", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.store_performance_city", + "table_id": "model.jaffle_shop.store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.store_performance_state", + "table_id": "model.jaffle_shop.store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_employees": { + "id": "model.jaffle_shop.store_performance_total_employees", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.store_performance_order_count", + "table_id": "model.jaffle_shop.store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.store_performance_unique_customers", + "table_id": "model.jaffle_shop.store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.store_performance_total_revenue", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.store_performance_total_margin", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.store_performance_avg_order_value", + "table_id": "model.jaffle_shop.store_performance", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_per_employee": { + "id": "model.jaffle_shop.store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "orders_per_employee": { + "id": "model.jaffle_shop.store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_stores_id", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_stores_name", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "seed.jaffle_shop.raw_stores_city", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "seed.jaffle_shop.raw_stores_state", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "opened_at": { + "id": "seed.jaffle_shop.raw_stores_opened_at", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "opened_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_cohorts": { + "id": "model.jaffle_shop.customer_cohorts", + "name": "customer_cohorts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\ncohorts as (\n select\n {{ dbt.date_trunc('month', 'first_order_date') }} as cohort_month,\n count(*) as cohort_size,\n avg(lifetime_orders) as avg_lifetime_orders,\n avg(customer_tenure_days) as avg_tenure_days\n from first_last\n group by {{ dbt.date_trunc('month', 'first_order_date') }}\n)\n\nselect * from cohorts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.customer_cohorts_cohort_month", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cohort_size": { + "id": "model.jaffle_shop.customer_cohorts_cohort_size", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_lifetime_orders": { + "id": "model.jaffle_shop.customer_cohorts_avg_lifetime_orders", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_lifetime_orders", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_tenure_days": { + "id": "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_first_last_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "int_customer_first_last_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_last as (\n select\n customer_id,\n min(order_date) as first_order_date,\n max(order_date) as last_order_date,\n {{ dbt.datediff('min(order_date)', 'max(order_date)', 'day') }} as customer_tenure_days,\n count(*) as lifetime_orders,\n {{ dbt.datediff('max(order_date)', '(select max(order_date) from orders)', 'day') }} as days_since_last_order\n from orders\n group by customer_id\n)\n\nselect * from first_last", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "last_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_tenure_days": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "lifetime_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "lifetime_orders", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_daily_order_summary": { + "id": "model.jaffle_shop.int_daily_order_summary", + "name": "int_daily_order_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='order_date'\n )\n}}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as order_count,\n count(distinct customer_id) as unique_customers,\n sum(subtotal) as total_revenue,\n sum(total_cost) as total_cost,\n sum(total_margin) as total_margin,\n sum(total_quantity) as total_items_sold,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n sum(discount_amount) as total_discounts,\n avg(subtotal) as avg_order_value\n from orders\n\n {% if is_incremental() %}\n where order_date > (select max(order_date) from {{ this }})\n {% endif %}\n\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.int_daily_order_summary_order_date", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_daily_order_summary_order_count", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.int_daily_order_summary_unique_customers", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.int_daily_order_summary_total_revenue", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_daily_order_summary_total_cost", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_daily_order_summary_total_margin", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.int_daily_order_summary_total_items_sold", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "promoted_orders": { + "id": "model.jaffle_shop.int_daily_order_summary_promoted_orders", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "promoted_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.int_daily_order_summary_total_discounts", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_daily_order_summary_avg_order_value", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_supply_orders": { + "id": "model.jaffle_shop.stg_supply_orders", + "name": "stg_supply_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_supply_orders') }}\n),\n\nrenamed as (\n select\n id as supply_order_id,\n product_id,\n store_id,\n quantity,\n cast(order_date as date) as order_date,\n cast(delivered_date as date) as delivered_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "supply_order_id": { + "id": "model.jaffle_shop.stg_supply_orders_supply_order_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_supply_orders_product_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.stg_supply_orders_store_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.stg_supply_orders_quantity", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.stg_supply_orders_order_date", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "delivered_date": { + "id": "model.jaffle_shop.stg_supply_orders_delivered_date", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "item_count": { + "id": "model.jaffle_shop.int_order_totals_item_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_quantity": { + "id": "model.jaffle_shop.int_order_totals_total_quantity", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "subtotal": { + "id": "model.jaffle_shop.int_order_totals_subtotal", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_order_totals_total_cost", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_order_totals_total_margin", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "category_count": { + "id": "model.jaffle_shop.int_order_totals_category_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "category_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_weekly_sales": { + "id": "model.jaffle_shop.metric_weekly_sales", + "name": "metric_weekly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nweekly as (\n select\n {{ dbt.date_trunc('week', 'order_date') }} as week_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n sum(unique_customers) as total_customer_visits,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold\n from daily\n group by {{ dbt.date_trunc('week', 'order_date') }}\n)\n\nselect * from weekly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "week_start": { + "id": "model.jaffle_shop.metric_weekly_sales_week_start", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "week_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.metric_weekly_sales_total_orders", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.metric_weekly_sales_total_revenue", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.metric_weekly_sales_net_revenue", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.metric_weekly_sales_total_margin", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.metric_weekly_sales_total_discounts", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_customer_visits": { + "id": "model.jaffle_shop.metric_weekly_sales_total_customer_visits", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_customer_visits", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_daily_order_value": { + "id": "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.metric_weekly_sales_total_items_sold", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_employees": { + "id": "model.jaffle_shop.stg_employees", + "name": "stg_employees", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_employees') }}\n),\n\nrenamed as (\n select\n id as employee_id,\n store_id,\n first_name,\n last_name,\n role,\n cast(hired_at as date) as hired_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "employee_id": { + "id": "model.jaffle_shop.stg_employees_employee_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.stg_employees_store_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.stg_employees_first_name", + "table_id": "model.jaffle_shop.stg_employees", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.stg_employees_last_name", + "table_id": "model.jaffle_shop.stg_employees", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "role": { + "id": "model.jaffle_shop.stg_employees_role", + "table_id": "model.jaffle_shop.stg_employees", + "name": "role", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "hired_at": { + "id": "model.jaffle_shop.stg_employees_hired_at", + "table_id": "model.jaffle_shop.stg_employees", + "name": "hired_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_inventory_movements": { + "id": "model.jaffle_shop.int_inventory_movements", + "name": "int_inventory_movements", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_in as (\n select\n product_id,\n store_id,\n delivered_date as movement_date,\n quantity as quantity_in,\n 0 as quantity_out,\n 'supply' as movement_type\n from {{ ref('stg_supply_orders') }}\n),\n\norder_items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nstore_assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsales_out as (\n select\n oi.product_id,\n sa.store_id,\n sa.order_date as movement_date,\n 0 as quantity_in,\n oi.quantity as quantity_out,\n 'sale' as movement_type\n from order_items oi\n inner join store_assignments sa on oi.order_id = sa.order_id\n),\n\ncombined as (\n select * from supply_in\n union all\n select * from sales_out\n)\n\nselect * from combined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_inventory_movements_product_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_inventory_movements_store_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "movement_date": { + "id": "model.jaffle_shop.int_inventory_movements_movement_date", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "quantity_in": { + "id": "model.jaffle_shop.int_inventory_movements_quantity_in", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "quantity_in", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "quantity_out": { + "id": "model.jaffle_shop.int_inventory_movements_quantity_out", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "quantity_out", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "movement_type": { + "id": "model.jaffle_shop.int_inventory_movements_movement_type", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_type", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.promotion_roi": { + "id": "model.jaffle_shop.promotion_roi", + "name": "promotion_roi", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with effectiveness as (\n select * from {{ ref('int_promotion_effectiveness') }}\n),\n\ndiscounts as (\n select\n promotion_name,\n count(*) as usage_count,\n sum(discount_amount) as total_discount_given,\n sum(net_revenue) as total_net_revenue\n from {{ ref('order_discounts') }}\n group by promotion_name\n),\n\nroi as (\n select\n e.promotion_name,\n e.discount_type,\n e.order_count,\n e.avg_order_value,\n e.total_revenue,\n e.avg_margin,\n coalesce(d.total_discount_given, 0) as total_discount_given,\n coalesce(d.total_net_revenue, 0) as net_revenue_after_discount,\n case when coalesce(d.total_discount_given, 0) > 0\n then round(coalesce(d.total_net_revenue, 0) / d.total_discount_given, 2)\n else 0\n end as revenue_per_discount_dollar\n from effectiveness e\n left join discounts d on e.promotion_name = d.promotion_name\n where e.has_promotion = true\n)\n\nselect * from roi", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_name": { + "id": "model.jaffle_shop.promotion_roi_promotion_name", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.promotion_roi_discount_type", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.promotion_roi_order_count", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.promotion_roi_avg_order_value", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.promotion_roi_total_revenue", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_margin": { + "id": "model.jaffle_shop.promotion_roi_avg_margin", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "avg_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_discount_given": { + "id": "model.jaffle_shop.promotion_roi_total_discount_given", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "total_discount_given", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue_after_discount": { + "id": "model.jaffle_shop.promotion_roi_net_revenue_after_discount", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "net_revenue_after_discount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "revenue_per_discount_dollar": { + "id": "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "revenue_per_discount_dollar", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_reviews": { + "id": "model.jaffle_shop.stg_reviews", + "name": "stg_reviews", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_reviews') }}\n),\n\nrenamed as (\n select\n id as review_id,\n order_id,\n product_id,\n customer_id,\n rating,\n cast(review_date as date) as review_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "review_id": { + "id": "model.jaffle_shop.stg_reviews_review_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "review_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.stg_reviews_order_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_reviews_product_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.stg_reviews_customer_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rating": { + "id": "model.jaffle_shop.stg_reviews_rating", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "rating", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_date": { + "id": "model.jaffle_shop.stg_reviews_review_date", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.int_product_margins_price", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.int_product_margins_cost", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.int_product_margins_margin", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.int_product_margins_margin_pct", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_segments_final_customer_id", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.customer_segments_final_first_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.customer_segments_final_last_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "recency_score": { + "id": "model.jaffle_shop.customer_segments_final_recency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "frequency_score": { + "id": "model.jaffle_shop.customer_segments_final_frequency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "monetary_score": { + "id": "model.jaffle_shop.customer_segments_final_monetary_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "monetary_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.customer_segments_final_total_orders", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_spent": { + "id": "model.jaffle_shop.customer_segments_final_total_spent", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.customer_segments_final_days_since_last_order", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.int_store_order_assignments_customer_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_store_order_assignments_order_date", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_reviews": { + "id": "model.jaffle_shop.product_reviews", + "name": "product_reviews", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with ratings as (\n select * from {{ ref('int_product_ratings') }}\n),\n\nfinal as (\n select\n product_id,\n product_name,\n category_name,\n root_category,\n review_count,\n avg_rating,\n positive_reviews,\n negative_reviews,\n case\n when avg_rating >= 4.5 then 'excellent'\n when avg_rating >= 3.5 then 'good'\n when avg_rating >= 2.5 then 'average'\n when avg_rating >= 1.5 then 'poor'\n else 'terrible'\n end as rating_tier,\n case when review_count > 0\n then round(cast(positive_reviews as decimal) / review_count * 100, 1)\n else 0\n end as positive_pct\n from ratings\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.product_reviews_product_id", + "table_id": "model.jaffle_shop.product_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.product_reviews_product_name", + "table_id": "model.jaffle_shop.product_reviews", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.product_reviews_category_name", + "table_id": "model.jaffle_shop.product_reviews", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.product_reviews_root_category", + "table_id": "model.jaffle_shop.product_reviews", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.product_reviews_review_count", + "table_id": "model.jaffle_shop.product_reviews", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.product_reviews_avg_rating", + "table_id": "model.jaffle_shop.product_reviews", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "positive_reviews": { + "id": "model.jaffle_shop.product_reviews_positive_reviews", + "table_id": "model.jaffle_shop.product_reviews", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "negative_reviews": { + "id": "model.jaffle_shop.product_reviews_negative_reviews", + "table_id": "model.jaffle_shop.product_reviews", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rating_tier": { + "id": "model.jaffle_shop.product_reviews_rating_tier", + "table_id": "model.jaffle_shop.product_reviews", + "name": "rating_tier", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "positive_pct": { + "id": "model.jaffle_shop.product_reviews_positive_pct", + "table_id": "model.jaffle_shop.product_reviews", + "name": "positive_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_daily_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue", + "name": "metric_daily_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('int_daily_order_summary') }}\n),\n\nfinal as (\n select\n order_date,\n order_count,\n total_revenue,\n total_cost,\n total_margin,\n total_discounts,\n total_revenue - total_discounts as net_revenue,\n avg_order_value,\n unique_customers,\n total_items_sold\n from daily\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_daily_revenue_order_date", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.metric_daily_revenue_order_count", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue_total_revenue", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.metric_daily_revenue_total_cost", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.metric_daily_revenue_total_margin", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.metric_daily_revenue_total_discounts", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue_net_revenue", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.metric_daily_revenue_avg_order_value", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.metric_daily_revenue_unique_customers", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.metric_daily_revenue_total_items_sold", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.products": { + "id": "model.jaffle_shop.products", + "name": "products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nfinal as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n p.category_name,\n p.root_category,\n p.category_path,\n p.price,\n p.cost,\n m.margin,\n m.margin_pct,\n p.created_at\n from products p\n left join margins m on p.product_id = m.product_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.products_product_id", + "table_id": "model.jaffle_shop.products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.products_product_name", + "table_id": "model.jaffle_shop.products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.products_category_id", + "table_id": "model.jaffle_shop.products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.products_category_name", + "table_id": "model.jaffle_shop.products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.products_root_category", + "table_id": "model.jaffle_shop.products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.products_category_path", + "table_id": "model.jaffle_shop.products", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.products_price", + "table_id": "model.jaffle_shop.products", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.products_cost", + "table_id": "model.jaffle_shop.products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.products_margin", + "table_id": "model.jaffle_shop.products", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.products_margin_pct", + "table_id": "model.jaffle_shop.products", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "created_at": { + "id": "model.jaffle_shop.products_created_at", + "table_id": "model.jaffle_shop.products", + "name": "created_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_month": { + "id": "model.jaffle_shop.revenue_summary_order_month", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.revenue_summary_store_id", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.revenue_summary_order_count", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "revenue": { + "id": "model.jaffle_shop.revenue_summary_revenue", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.revenue_summary_cost", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.revenue_summary_margin", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "discounts": { + "id": "model.jaffle_shop.revenue_summary_discounts", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.revenue_summary_net_revenue", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stores": { + "id": "model.jaffle_shop.stores", + "name": "stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with staff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfinal as (\n select\n store_id,\n store_name,\n city,\n state,\n total_employees,\n manager_count,\n barista_count,\n cashier_count,\n cook_count,\n earliest_hire,\n latest_hire\n from staff\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.stores_store_id", + "table_id": "model.jaffle_shop.stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.stores_store_name", + "table_id": "model.jaffle_shop.stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.stores_city", + "table_id": "model.jaffle_shop.stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.stores_state", + "table_id": "model.jaffle_shop.stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_employees": { + "id": "model.jaffle_shop.stores_total_employees", + "table_id": "model.jaffle_shop.stores", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "manager_count": { + "id": "model.jaffle_shop.stores_manager_count", + "table_id": "model.jaffle_shop.stores", + "name": "manager_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "barista_count": { + "id": "model.jaffle_shop.stores_barista_count", + "table_id": "model.jaffle_shop.stores", + "name": "barista_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cashier_count": { + "id": "model.jaffle_shop.stores_cashier_count", + "table_id": "model.jaffle_shop.stores", + "name": "cashier_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cook_count": { + "id": "model.jaffle_shop.stores_cook_count", + "table_id": "model.jaffle_shop.stores", + "name": "cook_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "earliest_hire": { + "id": "model.jaffle_shop.stores_earliest_hire", + "table_id": "model.jaffle_shop.stores", + "name": "earliest_hire", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "latest_hire": { + "id": "model.jaffle_shop.stores_latest_hire", + "table_id": "model.jaffle_shop.stores", + "name": "latest_hire", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_customer_retention_monthly": { + "id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "metric_customer_retention_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with retention as (\n select * from {{ ref('customer_retention') }}\n),\n\ncohort_sizes as (\n select\n cohort_month,\n customers as cohort_size\n from retention\n where months_since_first = 0\n),\n\nrates as (\n select\n r.cohort_month,\n r.months_since_first,\n r.customers as retained_customers,\n cs.cohort_size,\n round(cast(r.customers as decimal) / cs.cohort_size * 100, 1) as retention_rate\n from retention r\n inner join cohort_sizes cs on r.cohort_month = cs.cohort_month\n)\n\nselect * from rates", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "months_since_first": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_months_since_first", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "retained_customers": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retained_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "cohort_size": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "retention_rate": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retention_rate", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_monthly_sales": { + "id": "model.jaffle_shop.metric_monthly_sales", + "name": "metric_monthly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nmonthly as (\n select\n {{ dbt.date_trunc('month', 'order_date') }} as month_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold,\n count(distinct order_date) as active_days\n from daily\n group by {{ dbt.date_trunc('month', 'order_date') }}\n)\n\nselect * from monthly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "month_start": { + "id": "model.jaffle_shop.metric_monthly_sales_month_start", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "month_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.metric_monthly_sales_total_orders", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.metric_monthly_sales_total_revenue", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.metric_monthly_sales_net_revenue", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.metric_monthly_sales_total_margin", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.metric_monthly_sales_total_discounts", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_daily_order_value": { + "id": "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.metric_monthly_sales_total_items_sold", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.metric_monthly_sales_active_days", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_retention": { + "id": "model.jaffle_shop.customer_retention", + "name": "customer_retention", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ncohort_orders as (\n select\n fl.customer_id,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as cohort_month,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n {{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }} as months_since_first\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n),\n\nretention as (\n select\n cohort_month,\n months_since_first,\n count(distinct customer_id) as customers\n from cohort_orders\n group by cohort_month, months_since_first\n)\n\nselect * from retention", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "cohort_month": { + "id": "model.jaffle_shop.customer_retention_cohort_month", + "table_id": "model.jaffle_shop.customer_retention", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "months_since_first": { + "id": "model.jaffle_shop.customer_retention_months_since_first", + "table_id": "model.jaffle_shop.customer_retention", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customers": { + "id": "model.jaffle_shop.customer_retention_customers", + "table_id": "model.jaffle_shop.customer_retention", + "name": "customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_supply_orders": { + "id": "seed.jaffle_shop.raw_supply_orders", + "name": "raw_supply_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_supply_orders_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_supply_orders_product_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "seed.jaffle_shop.raw_supply_orders_store_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "seed.jaffle_shop.raw_supply_orders_quantity", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "seed.jaffle_shop.raw_supply_orders_order_date", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "delivered_date": { + "id": "seed.jaffle_shop.raw_supply_orders_delivered_date", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.int_order_enriched_customer_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "item_count": { + "id": "model.jaffle_shop.int_order_enriched_item_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_quantity": { + "id": "model.jaffle_shop.int_order_enriched_total_quantity", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "subtotal": { + "id": "model.jaffle_shop.int_order_enriched_subtotal", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_order_enriched_total_cost", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_order_enriched_total_margin", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_count": { + "id": "model.jaffle_shop.int_order_enriched_category_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "category_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "has_promotion": { + "id": "model.jaffle_shop.int_order_enriched_has_promotion", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.int_order_enriched_promotion_name", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.int_order_enriched_discount_type", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "model.jaffle_shop.int_order_enriched_discount_value", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_paid": { + "id": "model.jaffle_shop.int_order_enriched_total_paid", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_count": { + "id": "model.jaffle_shop.int_order_enriched_payment_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_status": { + "id": "model.jaffle_shop.int_order_enriched_payment_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_amount": { + "id": "model.jaffle_shop.int_order_enriched_discount_amount", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_amount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_order_items_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "seed.jaffle_shop.raw_order_items_quantity", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "seed.jaffle_shop.raw_order_items_unit_price", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "unit_price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.payments_fact": { + "id": "model.jaffle_shop.payments_fact", + "name": "payments_fact", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('orders') }}\n),\n\nfinal as (\n select\n p.payment_id,\n p.order_id,\n o.customer_id,\n o.order_date,\n p.payment_method,\n p.amount,\n o.status as order_status\n from payments p\n left join orders o on p.order_id = o.order_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "payment_id": { + "id": "model.jaffle_shop.payments_fact_payment_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "payment_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.payments_fact_order_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.payments_fact_customer_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.payments_fact_order_date", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_method": { + "id": "model.jaffle_shop.payments_fact_payment_method", + "table_id": "model.jaffle_shop.payments_fact", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.payments_fact_amount", + "table_id": "model.jaffle_shop.payments_fact", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_status": { + "id": "model.jaffle_shop.payments_fact_order_status", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_status", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_fulfillment_order_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.order_fulfillment_customer_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.order_fulfillment_order_date", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.order_fulfillment_status", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.order_fulfillment_amount", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.order_fulfillment_store_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.order_fulfillment_store_name", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.order_fulfillment_city", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.order_fulfillment_state", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_employee_count": { + "id": "model.jaffle_shop.order_fulfillment_store_employee_count", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_employee_count", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_items": { + "id": "model.jaffle_shop.order_items", + "name": "order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_order_items_enriched') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_item_id": { + "id": "model.jaffle_shop.order_items_order_item_id", + "table_id": "model.jaffle_shop.order_items", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.order_items_order_id", + "table_id": "model.jaffle_shop.order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.order_items_product_id", + "table_id": "model.jaffle_shop.order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.order_items_product_name", + "table_id": "model.jaffle_shop.order_items", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.order_items_category_name", + "table_id": "model.jaffle_shop.order_items", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.order_items_root_category", + "table_id": "model.jaffle_shop.order_items", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.order_items_category_path", + "table_id": "model.jaffle_shop.order_items", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.order_items_quantity", + "table_id": "model.jaffle_shop.order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "model.jaffle_shop.order_items_unit_price", + "table_id": "model.jaffle_shop.order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_total": { + "id": "model.jaffle_shop.order_items_line_total", + "table_id": "model.jaffle_shop.order_items", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.order_items_cost", + "table_id": "model.jaffle_shop.order_items", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.order_items_margin_pct", + "table_id": "model.jaffle_shop.order_items", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_cost": { + "id": "model.jaffle_shop.order_items_line_cost", + "table_id": "model.jaffle_shop.order_items", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_margin": { + "id": "model.jaffle_shop.order_items_line_margin", + "table_id": "model.jaffle_shop.order_items", + "name": "line_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_supply_order_costs": { + "id": "model.jaffle_shop.int_supply_order_costs", + "name": "int_supply_order_costs", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_orders as (\n select * from {{ ref('stg_supply_orders') }}\n),\n\nproducts as (\n select * from {{ ref('stg_products') }}\n),\n\ncosted as (\n select\n so.supply_order_id,\n so.product_id,\n p.product_name,\n so.store_id,\n so.quantity,\n p.cost as unit_cost,\n so.quantity * p.cost as total_cost,\n so.order_date,\n so.delivered_date,\n {{ dbt.datediff('so.order_date', 'so.delivered_date', 'day') }} as lead_time_days\n from supply_orders so\n left join products p on so.product_id = p.product_id\n)\n\nselect * from costed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "supply_order_id": { + "id": "model.jaffle_shop.int_supply_order_costs_supply_order_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_supply_order_costs_product_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_supply_order_costs_product_name", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_supply_order_costs_store_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.int_supply_order_costs_quantity", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_cost": { + "id": "model.jaffle_shop.int_supply_order_costs_unit_cost", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "unit_cost", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_supply_order_costs_total_cost", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_supply_order_costs_order_date", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "delivered_date": { + "id": "model.jaffle_shop.int_supply_order_costs_delivered_date", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "lead_time_days": { + "id": "model.jaffle_shop.int_supply_order_costs_lead_time_days", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "lead_time_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_product_ratings": { + "id": "model.jaffle_shop.int_product_ratings", + "name": "int_product_ratings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with reviews as (\n select * from {{ ref('int_reviews_with_products') }}\n),\n\nratings as (\n select\n product_id,\n product_name,\n category_name,\n root_category,\n count(*) as review_count,\n round(avg(rating), 2) as avg_rating,\n sum(case when rating >= 4 then 1 else 0 end) as positive_reviews,\n sum(case when rating <= 2 then 1 else 0 end) as negative_reviews,\n min(rating) as min_rating,\n max(rating) as max_rating\n from reviews\n group by product_id, product_name, category_name, root_category\n)\n\nselect * from ratings", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_ratings_product_id", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_product_ratings_product_name", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_product_ratings_category_name", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_product_ratings_root_category", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.int_product_ratings_review_count", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.int_product_ratings_avg_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "positive_reviews": { + "id": "model.jaffle_shop.int_product_ratings_positive_reviews", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "negative_reviews": { + "id": "model.jaffle_shop.int_product_ratings_negative_reviews", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "min_rating": { + "id": "model.jaffle_shop.int_product_ratings_min_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "min_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "max_rating": { + "id": "model.jaffle_shop.int_product_ratings_max_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "max_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_item_id": { + "id": "model.jaffle_shop.stg_order_items_order_item_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.stg_order_items_quantity", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "model.jaffle_shop.stg_order_items_unit_price", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.store_staffing": { + "id": "model.jaffle_shop.store_staffing", + "name": "store_staffing", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstaffing as (\n select\n e.employee_id,\n e.first_name,\n e.last_name,\n e.role,\n e.hired_at,\n e.store_id,\n s.store_name,\n s.city,\n s.state\n from employees e\n left join stores s on e.store_id = s.store_id\n)\n\nselect * from staffing", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "employee_id": { + "id": "model.jaffle_shop.store_staffing_employee_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.store_staffing_first_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.store_staffing_last_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "role": { + "id": "model.jaffle_shop.store_staffing_role", + "table_id": "model.jaffle_shop.store_staffing", + "name": "role", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "hired_at": { + "id": "model.jaffle_shop.store_staffing_hired_at", + "table_id": "model.jaffle_shop.store_staffing", + "name": "hired_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.store_staffing_store_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.store_staffing_store_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.store_staffing_city", + "table_id": "model.jaffle_shop.store_staffing", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.store_staffing_state", + "table_id": "model.jaffle_shop.store_staffing", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_categories": { + "id": "model.jaffle_shop.product_categories", + "name": "product_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with hierarchy as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\nproduct_counts as (\n select\n category_id,\n count(*) as product_count\n from {{ ref('stg_products') }}\n group by category_id\n),\n\nfinal as (\n select\n h.category_id,\n h.category_name,\n h.parent_category_id,\n h.root_category,\n h.full_path,\n h.depth,\n coalesce(pc.product_count, 0) as product_count\n from hierarchy h\n left join product_counts pc on h.category_id = pc.category_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.product_categories_category_id", + "table_id": "model.jaffle_shop.product_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.product_categories_category_name", + "table_id": "model.jaffle_shop.product_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.product_categories_parent_category_id", + "table_id": "model.jaffle_shop.product_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.product_categories_root_category", + "table_id": "model.jaffle_shop.product_categories", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "full_path": { + "id": "model.jaffle_shop.product_categories_full_path", + "table_id": "model.jaffle_shop.product_categories", + "name": "full_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "depth": { + "id": "model.jaffle_shop.product_categories_depth", + "table_id": "model.jaffle_shop.product_categories", + "name": "depth", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_count": { + "id": "model.jaffle_shop.product_categories_product_count", + "table_id": "model.jaffle_shop.product_categories", + "name": "product_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_product_dashboard": { + "id": "model.jaffle_shop.rpt_product_dashboard", + "name": "rpt_product_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('product_performance') }}\n),\n\nsummary as (\n select\n count(*) as total_products,\n sum(total_revenue) as total_product_revenue,\n avg(avg_rating) as overall_avg_rating,\n sum(total_quantity_sold) as total_units_sold,\n count(case when times_ordered = 0 then 1 end) as never_ordered_products,\n max(total_revenue) as top_product_revenue,\n (select product_name from performance order by total_revenue desc limit 1) as top_product_name\n from performance\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "total_products": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_products", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_products", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_product_revenue": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_product_revenue", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_product_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "overall_avg_rating": { + "id": "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "overall_avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_units_sold": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_units_sold", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_units_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "never_ordered_products": { + "id": "model.jaffle_shop.rpt_product_dashboard_never_ordered_products", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "never_ordered_products", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "top_product_revenue": { + "id": "model.jaffle_shop.rpt_product_dashboard_top_product_revenue", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "top_product_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "top_product_name": { + "id": "model.jaffle_shop.rpt_product_dashboard_top_product_name", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "top_product_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_customer_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_promotion_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.int_orders_with_promotions_promotion_name", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.int_orders_with_promotions_discount_type", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "model.jaffle_shop.int_orders_with_promotions_discount_value", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "has_promotion": { + "id": "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.inventory_health": { + "id": "model.jaffle_shop.inventory_health", + "name": "inventory_health", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nmovements as (\n select\n product_id,\n store_id,\n sum(quantity_in) as total_inbound,\n sum(quantity_out) as total_outbound,\n count(case when movement_type = 'supply' then 1 end) as restock_events,\n count(case when movement_type = 'sale' then 1 end) as sale_events\n from {{ ref('int_inventory_movements') }}\n group by product_id, store_id\n),\n\nhealth as (\n select\n i.product_store_key,\n i.product_id,\n i.product_name,\n i.store_id,\n i.store_name,\n i.current_stock,\n i.stock_status,\n m.total_inbound,\n m.total_outbound,\n m.restock_events,\n m.sale_events,\n case\n when m.total_outbound > m.total_inbound then 'deficit'\n when i.current_stock > m.total_outbound * 2 then 'overstocked'\n else 'balanced'\n end as inventory_balance,\n case when m.sale_events > 0\n then round(cast(m.total_outbound as decimal) / m.sale_events, 1)\n else 0\n end as avg_units_per_sale\n from inventory i\n left join movements m on i.product_id = m.product_id and i.store_id = m.store_id\n)\n\nselect * from health", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_store_key": { + "id": "model.jaffle_shop.inventory_health_product_store_key", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.inventory_health_product_id", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.inventory_health_product_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.inventory_health_store_id", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.inventory_health_store_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "current_stock": { + "id": "model.jaffle_shop.inventory_health_current_stock", + "table_id": "model.jaffle_shop.inventory_health", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "stock_status": { + "id": "model.jaffle_shop.inventory_health_stock_status", + "table_id": "model.jaffle_shop.inventory_health", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_inbound": { + "id": "model.jaffle_shop.inventory_health_total_inbound", + "table_id": "model.jaffle_shop.inventory_health", + "name": "total_inbound", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_outbound": { + "id": "model.jaffle_shop.inventory_health_total_outbound", + "table_id": "model.jaffle_shop.inventory_health", + "name": "total_outbound", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "restock_events": { + "id": "model.jaffle_shop.inventory_health_restock_events", + "table_id": "model.jaffle_shop.inventory_health", + "name": "restock_events", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "sale_events": { + "id": "model.jaffle_shop.inventory_health_sale_events", + "table_id": "model.jaffle_shop.inventory_health", + "name": "sale_events", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "inventory_balance": { + "id": "model.jaffle_shop.inventory_health_inventory_balance", + "table_id": "model.jaffle_shop.inventory_health", + "name": "inventory_balance", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_units_per_sale": { + "id": "model.jaffle_shop.inventory_health_avg_units_per_sale", + "table_id": "model.jaffle_shop.inventory_health", + "name": "avg_units_per_sale", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.stg_categories_category_name", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.supplier_lead_times": { + "id": "model.jaffle_shop.supplier_lead_times", + "name": "supplier_lead_times", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply as (\n select * from {{ ref('int_supply_order_costs') }}\n),\n\nlead_times as (\n select\n product_id,\n product_name,\n store_id,\n count(*) as order_count,\n avg(lead_time_days) as avg_lead_time,\n min(lead_time_days) as min_lead_time,\n max(lead_time_days) as max_lead_time,\n sum(quantity) as total_quantity,\n sum(total_cost) as total_spend\n from supply\n group by product_id, product_name, store_id\n)\n\nselect * from lead_times", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.supplier_lead_times_product_id", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.supplier_lead_times_product_name", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.supplier_lead_times_store_id", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.supplier_lead_times_order_count", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_avg_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "avg_lead_time", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "min_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_min_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "min_lead_time", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "max_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_max_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "max_lead_time", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_quantity": { + "id": "model.jaffle_shop.supplier_lead_times_total_quantity", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_spend": { + "id": "model.jaffle_shop.supplier_lead_times_total_spend", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "total_spend", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_item_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_item_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_enriched_product_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_order_items_enriched_product_name", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_order_items_enriched_category_name", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_order_items_enriched_root_category", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.int_order_items_enriched_category_path", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.int_order_items_enriched_quantity", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "model.jaffle_shop.int_order_items_enriched_unit_price", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_total": { + "id": "model.jaffle_shop.int_order_items_enriched_line_total", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.int_order_items_enriched_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.int_order_items_enriched_margin_pct", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_cost": { + "id": "model.jaffle_shop.int_order_items_enriched_line_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "line_margin": { + "id": "model.jaffle_shop.int_order_items_enriched_line_margin", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_item_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_item_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_order_items_with_products_product_name", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_order_items_with_products_category_name", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_order_items_with_products_root_category", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.int_order_items_with_products_category_path", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.int_order_items_with_products_quantity", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_price": { + "id": "model.jaffle_shop.int_order_items_with_products_unit_price", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "line_total": { + "id": "model.jaffle_shop.int_order_items_with_products_line_total", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_products_name", + "table_id": "seed.jaffle_shop.raw_products", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "seed.jaffle_shop.raw_products_price", + "table_id": "seed.jaffle_shop.raw_products", + "name": "price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "seed.jaffle_shop.raw_products_cost", + "table_id": "seed.jaffle_shop.raw_products", + "name": "cost", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "created_at": { + "id": "seed.jaffle_shop.raw_products_created_at", + "table_id": "seed.jaffle_shop.raw_products", + "name": "created_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_payment_status": { + "id": "model.jaffle_shop.order_payment_status", + "name": "order_payment_status", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with matched as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nfinal as (\n select\n order_id,\n order_subtotal,\n total_paid,\n payment_count,\n payment_method_count,\n payment_status,\n coalesce(total_paid, 0) - coalesce(order_subtotal, 0) as payment_difference\n from matched\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_payment_status_order_id", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_subtotal": { + "id": "model.jaffle_shop.order_payment_status_order_subtotal", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "order_subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_paid": { + "id": "model.jaffle_shop.order_payment_status_total_paid", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_count": { + "id": "model.jaffle_shop.order_payment_status_payment_count", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_method_count": { + "id": "model.jaffle_shop.order_payment_status_payment_method_count", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_method_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_status": { + "id": "model.jaffle_shop.order_payment_status_payment_status", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_difference": { + "id": "model.jaffle_shop.order_payment_status_payment_difference", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_difference", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_order_history_customer_id", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.int_customer_order_history_first_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.int_customer_order_history_last_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.int_customer_order_history_total_orders", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_spent": { + "id": "model.jaffle_shop.int_customer_order_history_total_spent", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin_generated": { + "id": "model.jaffle_shop.int_customer_order_history_total_margin_generated", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_margin_generated", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_customer_order_history_avg_order_value", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_purchased": { + "id": "model.jaffle_shop.int_customer_order_history_total_items_purchased", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_items_purchased", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "distinct_order_days": { + "id": "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "distinct_order_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_performance_store_id", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.int_store_performance_store_name", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.int_store_performance_city", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.int_store_performance_state", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_employees": { + "id": "model.jaffle_shop.int_store_performance_total_employees", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_store_performance_order_count", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.int_store_performance_unique_customers", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.int_store_performance_total_revenue", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_store_performance_total_margin", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_store_performance_avg_order_value", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_per_employee": { + "id": "model.jaffle_shop.int_store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "orders_per_employee": { + "id": "model.jaffle_shop.int_store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_categories_name", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_profitability": { + "id": "model.jaffle_shop.product_profitability", + "name": "product_profitability", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('product_performance') }}\n),\n\nsupply_costs as (\n select\n product_id,\n sum(total_cost) as total_supply_cost,\n sum(quantity) as total_supplied\n from {{ ref('int_supply_order_costs') }}\n group by product_id\n),\n\nprofitability as (\n select\n p.product_id,\n p.product_name,\n p.category_name,\n p.total_revenue,\n p.total_margin as gross_margin,\n coalesce(sc.total_supply_cost, 0) as total_supply_cost,\n p.total_revenue - coalesce(sc.total_supply_cost, 0) as net_margin,\n case when p.total_revenue > 0\n then round(p.total_margin / p.total_revenue * 100, 1)\n else 0\n end as gross_margin_pct,\n p.total_quantity_sold,\n coalesce(sc.total_supplied, 0) as total_supplied,\n p.avg_rating\n from performance p\n left join supply_costs sc on p.product_id = sc.product_id\n)\n\nselect * from profitability", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.product_profitability_product_id", + "table_id": "model.jaffle_shop.product_profitability", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.product_profitability_product_name", + "table_id": "model.jaffle_shop.product_profitability", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.product_profitability_category_name", + "table_id": "model.jaffle_shop.product_profitability", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.product_profitability_total_revenue", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "gross_margin": { + "id": "model.jaffle_shop.product_profitability_gross_margin", + "table_id": "model.jaffle_shop.product_profitability", + "name": "gross_margin", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "total_supply_cost": { + "id": "model.jaffle_shop.product_profitability_total_supply_cost", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_supply_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "net_margin": { + "id": "model.jaffle_shop.product_profitability_net_margin", + "table_id": "model.jaffle_shop.product_profitability", + "name": "net_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "gross_margin_pct": { + "id": "model.jaffle_shop.product_profitability_gross_margin_pct", + "table_id": "model.jaffle_shop.product_profitability", + "name": "gross_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_quantity_sold": { + "id": "model.jaffle_shop.product_profitability_total_quantity_sold", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_supplied": { + "id": "model.jaffle_shop.product_profitability_total_supplied", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_supplied", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.product_profitability_avg_rating", + "table_id": "model.jaffle_shop.product_profitability", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.stg_promotions_promotion_name", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.stg_promotions_discount_type", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_value": { + "id": "model.jaffle_shop.stg_promotions_discount_value", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "start_date": { + "id": "model.jaffle_shop.stg_promotions_start_date", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "start_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "end_date": { + "id": "model.jaffle_shop.stg_promotions_end_date", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "end_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_month": { + "id": "model.jaffle_shop.gross_margin_order_month", + "table_id": "model.jaffle_shop.gross_margin", + "name": "order_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.gross_margin_store_id", + "table_id": "model.jaffle_shop.gross_margin", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.gross_margin_total_revenue", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.gross_margin_total_cost", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.gross_margin_total_margin", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.gross_margin_total_discounts", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_net_revenue": { + "id": "model.jaffle_shop.gross_margin_total_net_revenue", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "gross_margin_pct": { + "id": "model.jaffle_shop.gross_margin_gross_margin_pct", + "table_id": "model.jaffle_shop.gross_margin", + "name": "gross_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.gross_margin_total_orders", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.order_returns_order_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.order_returns_customer_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.order_returns_order_date", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "credit_card_amount": { + "id": "model.jaffle_shop.order_returns_credit_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "coupon_amount": { + "id": "model.jaffle_shop.order_returns_coupon_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "coupon_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "bank_transfer_amount": { + "id": "model.jaffle_shop.order_returns_bank_transfer_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "bank_transfer_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "gift_card_amount": { + "id": "model.jaffle_shop.order_returns_gift_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.order_returns_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_performance": { + "id": "model.jaffle_shop.product_performance", + "name": "product_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('products') }}\n),\n\nitems as (\n select\n product_id,\n count(*) as times_ordered,\n sum(quantity) as total_quantity_sold,\n sum(line_total) as total_revenue,\n sum(line_margin) as total_margin\n from {{ ref('order_items') }}\n group by product_id\n),\n\nratings as (\n select * from {{ ref('int_product_ratings') }}\n),\n\nperformance as (\n select\n p.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.price,\n p.cost,\n p.margin_pct,\n coalesce(i.times_ordered, 0) as times_ordered,\n coalesce(i.total_quantity_sold, 0) as total_quantity_sold,\n coalesce(i.total_revenue, 0) as total_revenue,\n coalesce(i.total_margin, 0) as total_margin,\n r.review_count,\n r.avg_rating,\n r.positive_reviews,\n r.negative_reviews\n from products p\n left join items i on p.product_id = i.product_id\n left join ratings r on p.product_id = r.product_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.product_performance_product_id", + "table_id": "model.jaffle_shop.product_performance", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.product_performance_product_name", + "table_id": "model.jaffle_shop.product_performance", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.product_performance_category_name", + "table_id": "model.jaffle_shop.product_performance", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.product_performance_root_category", + "table_id": "model.jaffle_shop.product_performance", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.product_performance_price", + "table_id": "model.jaffle_shop.product_performance", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.product_performance_cost", + "table_id": "model.jaffle_shop.product_performance", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "margin_pct": { + "id": "model.jaffle_shop.product_performance_margin_pct", + "table_id": "model.jaffle_shop.product_performance", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "times_ordered": { + "id": "model.jaffle_shop.product_performance_times_ordered", + "table_id": "model.jaffle_shop.product_performance", + "name": "times_ordered", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_quantity_sold": { + "id": "model.jaffle_shop.product_performance_total_quantity_sold", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.product_performance_total_revenue", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.product_performance_total_margin", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.product_performance_review_count", + "table_id": "model.jaffle_shop.product_performance", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_rating": { + "id": "model.jaffle_shop.product_performance_avg_rating", + "table_id": "model.jaffle_shop.product_performance", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "positive_reviews": { + "id": "model.jaffle_shop.product_performance_positive_reviews", + "table_id": "model.jaffle_shop.product_performance", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "negative_reviews": { + "id": "model.jaffle_shop.product_performance_negative_reviews", + "table_id": "model.jaffle_shop.product_performance", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_store_revenue_order_count", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.int_store_revenue_unique_customers", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.int_store_revenue_total_revenue", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.int_store_revenue_total_cost", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.int_store_revenue_total_margin", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_store_revenue_avg_order_value", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_rankings_store_id", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.store_rankings_store_name", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.store_rankings_city", + "table_id": "model.jaffle_shop.store_rankings", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.store_rankings_state", + "table_id": "model.jaffle_shop.store_rankings", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.store_rankings_total_revenue", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.store_rankings_total_margin", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.store_rankings_order_count", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.store_rankings_unique_customers", + "table_id": "model.jaffle_shop.store_rankings", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_per_employee": { + "id": "model.jaffle_shop.store_rankings_revenue_per_employee", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_rank": { + "id": "model.jaffle_shop.store_rankings_revenue_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "margin_rank": { + "id": "model.jaffle_shop.store_rankings_margin_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "margin_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_count_rank": { + "id": "model.jaffle_shop.store_rankings_order_count_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "efficiency_rank": { + "id": "model.jaffle_shop.store_rankings_efficiency_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_reach_rank": { + "id": "model.jaffle_shop.store_rankings_customer_reach_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "customer_reach_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_acquisition": { + "id": "model.jaffle_shop.customer_acquisition", + "name": "customer_acquisition", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_order_details as (\n select\n fl.customer_id,\n fl.first_order_date,\n o.has_promotion as acquired_via_promotion,\n o.promotion_name as acquisition_promotion,\n o.subtotal as first_order_value,\n o.item_count as first_order_items,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as acquisition_month\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n and fl.first_order_date = o.order_date\n)\n\nselect * from first_order_details", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_acquisition_customer_id", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_order_date": { + "id": "model.jaffle_shop.customer_acquisition_first_order_date", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "acquired_via_promotion": { + "id": "model.jaffle_shop.customer_acquisition_acquired_via_promotion", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquired_via_promotion", + "type": "BOOLEAN", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "acquisition_promotion": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_promotion", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_promotion", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "first_order_value": { + "id": "model.jaffle_shop.customer_acquisition_first_order_value", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_value", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "first_order_items": { + "id": "model.jaffle_shop.customer_acquisition_first_order_items", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_items", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "acquisition_month": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_month", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.supply_orders_fact": { + "id": "model.jaffle_shop.supply_orders_fact", + "name": "supply_orders_fact", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_supply_order_costs') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "supply_order_id": { + "id": "model.jaffle_shop.supply_orders_fact_supply_order_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.supply_orders_fact_product_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.supply_orders_fact_product_name", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.supply_orders_fact_store_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "quantity": { + "id": "model.jaffle_shop.supply_orders_fact_quantity", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unit_cost": { + "id": "model.jaffle_shop.supply_orders_fact_unit_cost", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "unit_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_cost": { + "id": "model.jaffle_shop.supply_orders_fact_total_cost", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.supply_orders_fact_order_date", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "delivered_date": { + "id": "model.jaffle_shop.supply_orders_fact_delivered_date", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "lead_time_days": { + "id": "model.jaffle_shop.supply_orders_fact_lead_time_days", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "lead_time_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.metric_product_sales_daily": { + "id": "model.jaffle_shop.metric_product_sales_daily", + "name": "metric_product_sales_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('order_items') }}\n),\n\norders as (\n select order_id, order_date from {{ ref('int_order_enriched') }}\n),\n\ndaily_product as (\n select\n o.order_date,\n i.product_id,\n i.product_name,\n i.category_name,\n sum(i.quantity) as units_sold,\n sum(i.line_total) as revenue,\n sum(i.line_margin) as margin,\n count(distinct o.order_id) as order_count\n from items i\n inner join orders o on i.order_id = o.order_id\n group by o.order_date, i.product_id, i.product_name, i.category_name\n)\n\nselect * from daily_product", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_date": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_date", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.metric_product_sales_daily_product_id", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.metric_product_sales_daily_product_name", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.metric_product_sales_daily_category_name", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "units_sold": { + "id": "model.jaffle_shop.metric_product_sales_daily_units_sold", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "units_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "revenue": { + "id": "model.jaffle_shop.metric_product_sales_daily_revenue", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "margin": { + "id": "model.jaffle_shop.metric_product_sales_daily_margin", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_count", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.product_inventory": { + "id": "model.jaffle_shop.product_inventory", + "name": "product_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('int_product_stock_levels') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nproducts as (\n select * from {{ ref('stg_products') }}\n),\n\nfinal as (\n select\n s.product_store_key,\n s.product_id,\n p.product_name,\n s.store_id,\n st.store_name,\n s.total_received,\n s.total_sold,\n s.current_stock,\n s.last_restock_date,\n s.last_sale_date,\n case\n when s.current_stock <= 0 then 'out_of_stock'\n when s.current_stock < 10 then 'low_stock'\n when s.current_stock < 50 then 'adequate'\n else 'well_stocked'\n end as stock_status\n from stock s\n left join products p on s.product_id = p.product_id\n left join stores st on s.store_id = st.store_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_store_key": { + "id": "model.jaffle_shop.product_inventory_product_store_key", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.product_inventory_product_id", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.product_inventory_product_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.product_inventory_store_id", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.product_inventory_store_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_received": { + "id": "model.jaffle_shop.product_inventory_total_received", + "table_id": "model.jaffle_shop.product_inventory", + "name": "total_received", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_sold": { + "id": "model.jaffle_shop.product_inventory_total_sold", + "table_id": "model.jaffle_shop.product_inventory", + "name": "total_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "current_stock": { + "id": "model.jaffle_shop.product_inventory_current_stock", + "table_id": "model.jaffle_shop.product_inventory", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_restock_date": { + "id": "model.jaffle_shop.product_inventory_last_restock_date", + "table_id": "model.jaffle_shop.product_inventory", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_sale_date": { + "id": "model.jaffle_shop.product_inventory_last_sale_date", + "table_id": "model.jaffle_shop.product_inventory", + "name": "last_sale_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "stock_status": { + "id": "model.jaffle_shop.product_inventory_stock_status", + "table_id": "model.jaffle_shop.product_inventory", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.new_orders": { + "id": "model.jaffle_shop.new_orders", + "name": "new_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select *\n from orders\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.new_orders_order_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.new_orders_customer_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.new_orders_order_date", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.new_orders_status", + "table_id": "model.jaffle_shop.new_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_employees": { + "id": "seed.jaffle_shop.raw_employees", + "name": "raw_employees", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_employees_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "seed.jaffle_shop.raw_employees_store_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "seed.jaffle_shop.raw_employees_first_name", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "seed.jaffle_shop.raw_employees_last_name", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "role": { + "id": "seed.jaffle_shop.raw_employees_role", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "role", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "hired_at": { + "id": "seed.jaffle_shop.raw_employees_hired_at", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "hired_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.reorder_recommendations": { + "id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_recommendations", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with stock as (\n select * from {{ ref('product_inventory') }}\n),\n\nperformance as (\n select * from {{ ref('product_performance') }}\n),\n\nrecommendations as (\n select\n s.product_id,\n s.product_name,\n s.store_id,\n s.store_name,\n s.current_stock,\n s.stock_status,\n s.last_restock_date,\n p.total_quantity_sold,\n p.times_ordered,\n case\n when s.stock_status = 'out_of_stock' then 'urgent'\n when s.stock_status = 'low_stock' then 'soon'\n when s.stock_status = 'adequate' and p.times_ordered > 5 then 'monitor'\n else 'ok'\n end as reorder_priority,\n greatest(50 - s.current_stock, 0) as suggested_reorder_qty\n from stock s\n left join performance p on s.product_id = p.product_id\n)\n\nselect * from recommendations", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.reorder_recommendations_product_id", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.reorder_recommendations_product_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.reorder_recommendations_store_id", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.reorder_recommendations_store_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "current_stock": { + "id": "model.jaffle_shop.reorder_recommendations_current_stock", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "stock_status": { + "id": "model.jaffle_shop.reorder_recommendations_stock_status", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_restock_date": { + "id": "model.jaffle_shop.reorder_recommendations_last_restock_date", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_quantity_sold": { + "id": "model.jaffle_shop.reorder_recommendations_total_quantity_sold", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "times_ordered": { + "id": "model.jaffle_shop.reorder_recommendations_times_ordered", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "times_ordered", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "reorder_priority": { + "id": "model.jaffle_shop.reorder_recommendations_reorder_priority", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_priority", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "suggested_reorder_qty": { + "id": "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "suggested_reorder_qty", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "payment_id": { + "id": "model.jaffle_shop.stg_payments_payment_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "payment_method": { + "id": "model.jaffle_shop.stg_payments_payment_method", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "model.jaffle_shop.stg_payments_amount", + "table_id": "model.jaffle_shop.stg_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customers": { + "id": "model.jaffle_shop.customers", + "name": "customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\ncustomer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n),\n\ncustomer_payments as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders on\n payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders\n on customers.customer_id = customer_orders.customer_id\n\n left join customer_payments\n on customers.customer_id = customer_payments.customer_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customers_customer_id", + "table_id": "model.jaffle_shop.customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.customers_first_name", + "table_id": "model.jaffle_shop.customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.customers_last_name", + "table_id": "model.jaffle_shop.customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_order": { + "id": "model.jaffle_shop.customers_first_order", + "table_id": "model.jaffle_shop.customers", + "name": "first_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "most_recent_order": { + "id": "model.jaffle_shop.customers_most_recent_order", + "table_id": "model.jaffle_shop.customers", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "number_of_orders": { + "id": "model.jaffle_shop.customers_number_of_orders", + "table_id": "model.jaffle_shop.customers", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "customer_lifetime_value": { + "id": "model.jaffle_shop.customers_customer_lifetime_value", + "table_id": "model.jaffle_shop.customers", + "name": "customer_lifetime_value", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.cost_analysis": { + "id": "model.jaffle_shop.cost_analysis", + "name": "cost_analysis", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with supply_costs as (\n select\n product_id,\n product_name,\n count(*) as supply_order_count,\n sum(quantity) as total_units_ordered,\n sum(total_cost) as total_supply_spend,\n avg(unit_cost) as avg_unit_cost,\n avg(lead_time_days) as avg_lead_time\n from {{ ref('int_supply_order_costs') }}\n group by product_id, product_name\n),\n\nproduct_prof as (\n select * from {{ ref('product_profitability') }}\n),\n\nanalysis as (\n select\n pp.product_id,\n pp.product_name,\n pp.category_name,\n pp.total_revenue,\n pp.gross_margin,\n sc.total_supply_spend,\n sc.avg_unit_cost,\n sc.avg_lead_time,\n sc.supply_order_count,\n pp.total_quantity_sold,\n case when pp.total_quantity_sold > 0\n then round(sc.total_supply_spend / pp.total_quantity_sold, 2)\n else 0\n end as supply_cost_per_unit_sold\n from product_prof pp\n left join supply_costs sc on pp.product_id = sc.product_id\n)\n\nselect * from analysis", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.cost_analysis_product_id", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.cost_analysis_product_name", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.cost_analysis_category_name", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.cost_analysis_total_revenue", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "gross_margin": { + "id": "model.jaffle_shop.cost_analysis_gross_margin", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "gross_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_supply_spend": { + "id": "model.jaffle_shop.cost_analysis_total_supply_spend", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_supply_spend", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_unit_cost": { + "id": "model.jaffle_shop.cost_analysis_avg_unit_cost", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "avg_unit_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_lead_time": { + "id": "model.jaffle_shop.cost_analysis_avg_lead_time", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "avg_lead_time", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "supply_order_count": { + "id": "model.jaffle_shop.cost_analysis_supply_order_count", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "supply_order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "total_quantity_sold": { + "id": "model.jaffle_shop.cost_analysis_total_quantity_sold", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "supply_cost_per_unit_sold": { + "id": "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "supply_cost_per_unit_sold", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n 'ORDER-' || status as status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "partial_breaking", + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_review_summary": { + "id": "model.jaffle_shop.customer_review_summary", + "name": "customer_review_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with reviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nratings as (\n select * from {{ ref('int_product_ratings') }}\n),\n\nsummary as (\n select\n r.customer_id,\n r.review_count,\n r.avg_rating as customer_avg_rating,\n r.products_reviewed,\n r.first_review_date,\n r.last_review_date,\n avg(pr.avg_rating) as avg_product_rating_of_reviewed,\n case when r.avg_rating > avg(pr.avg_rating) then 'above_average'\n when r.avg_rating < avg(pr.avg_rating) then 'below_average'\n else 'average'\n end as rating_tendency\n from reviews r\n left join {{ ref('stg_reviews') }} sr on r.customer_id = sr.customer_id\n left join ratings pr on sr.product_id = pr.product_id\n group by r.customer_id, r.review_count, r.avg_rating, r.products_reviewed,\n r.first_review_date, r.last_review_date\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_review_summary_customer_id", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.customer_review_summary_review_count", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_avg_rating": { + "id": "model.jaffle_shop.customer_review_summary_customer_avg_rating", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "customer_avg_rating", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "products_reviewed": { + "id": "model.jaffle_shop.customer_review_summary_products_reviewed", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "products_reviewed", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_review_date": { + "id": "model.jaffle_shop.customer_review_summary_first_review_date", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "first_review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_review_date": { + "id": "model.jaffle_shop.customer_review_summary_last_review_date", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "last_review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_product_rating_of_reviewed": { + "id": "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "avg_product_rating_of_reviewed", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "rating_tendency": { + "id": "model.jaffle_shop.customer_review_summary_rating_tendency", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "rating_tendency", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_customer_payment_methods": { + "id": "model.jaffle_shop.int_customer_payment_methods", + "name": "int_customer_payment_methods", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('stg_orders') }}\n),\n\ncustomer_payments as (\n select\n o.customer_id,\n p.payment_method,\n count(*) as usage_count,\n sum(p.amount) as total_amount\n from payments p\n inner join orders o on p.order_id = o.order_id\n group by o.customer_id, p.payment_method\n),\n\npreferred as (\n select\n customer_id,\n payment_method as preferred_payment_method,\n row_number() over (partition by customer_id order by usage_count desc) as rn\n from customer_payments\n),\n\npivoted as (\n select\n cp.customer_id,\n sum(case when cp.payment_method = 'credit_card' then cp.total_amount else 0 end) as credit_card_total,\n sum(case when cp.payment_method = 'bank_transfer' then cp.total_amount else 0 end) as bank_transfer_total,\n sum(case when cp.payment_method = 'coupon' then cp.total_amount else 0 end) as coupon_total,\n sum(case when cp.payment_method = 'gift_card' then cp.total_amount else 0 end) as gift_card_total,\n max(pref.preferred_payment_method) as preferred_payment_method\n from customer_payments cp\n left join preferred pref on cp.customer_id = pref.customer_id and pref.rn = 1\n group by cp.customer_id\n)\n\nselect * from pivoted", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.int_customer_payment_methods_customer_id", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "credit_card_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_credit_card_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "credit_card_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "bank_transfer_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "bank_transfer_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "coupon_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_coupon_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "coupon_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "gift_card_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_gift_card_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "gift_card_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "preferred_payment_method": { + "id": "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "preferred_payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.stg_stores_store_id", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.stg_stores_store_name", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.stg_stores_city", + "table_id": "model.jaffle_shop.stg_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.stg_stores_state", + "table_id": "model.jaffle_shop.stg_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "opened_at": { + "id": "model.jaffle_shop.stg_stores_opened_at", + "table_id": "model.jaffle_shop.stg_stores", + "name": "opened_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_customers": { + "id": "seed.jaffle_shop.raw_customers", + "name": "raw_customers", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_customers_id", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "seed.jaffle_shop.raw_customers_first_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "seed.jaffle_shop.raw_customers_last_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.int_store_employees_active_store_name", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.int_store_employees_active_city", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.int_store_employees_active_state", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_employees": { + "id": "model.jaffle_shop.int_store_employees_active_total_employees", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "manager_count": { + "id": "model.jaffle_shop.int_store_employees_active_manager_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "manager_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "barista_count": { + "id": "model.jaffle_shop.int_store_employees_active_barista_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "barista_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cashier_count": { + "id": "model.jaffle_shop.int_store_employees_active_cashier_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "cashier_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cook_count": { + "id": "model.jaffle_shop.int_store_employees_active_cook_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "cook_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "earliest_hire": { + "id": "model.jaffle_shop.int_store_employees_active_earliest_hire", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "earliest_hire", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "latest_hire": { + "id": "model.jaffle_shop.int_store_employees_active_latest_hire", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "latest_hire", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_customers": { + "id": "model.jaffle_shop.stg_customers", + "name": "stg_customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_customers') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n first_name || ' ' || last_name as full_name\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "non_breaking", + "columns": { + "customer_id": { + "id": "model.jaffle_shop.stg_customers_customer_id", + "table_id": "model.jaffle_shop.stg_customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.stg_customers_first_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.stg_customers_last_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "full_name": { + "id": "model.jaffle_shop.stg_customers_full_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "full_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "added", + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_payments_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "payment_method": { + "id": "seed.jaffle_shop.raw_payments_payment_method", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.stg_products_product_name", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "price_cents": { + "id": "model.jaffle_shop.stg_products_price_cents", + "table_id": "model.jaffle_shop.stg_products", + "name": "price_cents", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "cost_cents": { + "id": "model.jaffle_shop.stg_products_cost_cents", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost_cents", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.stg_products_price", + "table_id": "model.jaffle_shop.stg_products", + "name": "price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.stg_products_cost", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "created_at": { + "id": "model.jaffle_shop.stg_products_created_at", + "table_id": "model.jaffle_shop.stg_products", + "name": "created_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_id", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_name", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.rpt_store_dashboard_city", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.rpt_store_dashboard_state", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.rpt_store_dashboard_order_count", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_customers": { + "id": "model.jaffle_shop.rpt_store_dashboard_unique_customers", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_per_employee": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "revenue_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "efficiency_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_efficiency_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_stock_units": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_stock_units", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "out_of_stock_products": { + "id": "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "out_of_stock_products", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "low_stock_products": { + "id": "model.jaffle_shop.rpt_store_dashboard_low_stock_products", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "low_stock_products", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_daily_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "avg_daily_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.store_inventory": { + "id": "model.jaffle_shop.store_inventory", + "name": "store_inventory", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with inventory as (\n select * from {{ ref('product_inventory') }}\n),\n\nstore_level as (\n select\n store_id,\n store_name,\n count(distinct product_id) as unique_products,\n sum(current_stock) as total_stock_units,\n sum(case when stock_status = 'out_of_stock' then 1 else 0 end) as out_of_stock_products,\n sum(case when stock_status = 'low_stock' then 1 else 0 end) as low_stock_products,\n sum(case when stock_status = 'adequate' then 1 else 0 end) as adequate_stock_products,\n sum(case when stock_status = 'well_stocked' then 1 else 0 end) as well_stocked_products\n from inventory\n group by store_id, store_name\n)\n\nselect * from store_level", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.store_inventory_store_id", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.store_inventory_store_name", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "unique_products": { + "id": "model.jaffle_shop.store_inventory_unique_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "unique_products", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_stock_units": { + "id": "model.jaffle_shop.store_inventory_total_stock_units", + "table_id": "model.jaffle_shop.store_inventory", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "out_of_stock_products": { + "id": "model.jaffle_shop.store_inventory_out_of_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "out_of_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "low_stock_products": { + "id": "model.jaffle_shop.store_inventory_low_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "low_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "adequate_stock_products": { + "id": "model.jaffle_shop.store_inventory_adequate_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "adequate_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "well_stocked_products": { + "id": "model.jaffle_shop.store_inventory_well_stocked_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "well_stocked_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "month_start": { + "id": "model.jaffle_shop.rpt_executive_dashboard_month_start", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "month_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_orders", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.rpt_executive_dashboard_net_revenue", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "overall_margin_pct": { + "id": "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "overall_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_items_sold", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "active_days": { + "id": "model.jaffle_shop.rpt_executive_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "customer_id": { + "id": "model.jaffle_shop.customer_360_customer_id", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_name": { + "id": "model.jaffle_shop.customer_360_first_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "last_name": { + "id": "model.jaffle_shop.customer_360_last_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "first_order": { + "id": "model.jaffle_shop.customer_360_first_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "most_recent_order": { + "id": "model.jaffle_shop.customer_360_most_recent_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "number_of_orders": { + "id": "model.jaffle_shop.customer_360_number_of_orders", + "table_id": "model.jaffle_shop.customer_360", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_lifetime_value": { + "id": "model.jaffle_shop.customer_360_customer_lifetime_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_lifetime_value", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "monthly_value": { + "id": "model.jaffle_shop.customer_360_monthly_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.customer_360_avg_order_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_tenure_days": { + "id": "model.jaffle_shop.customer_360_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "days_since_last_order": { + "id": "model.jaffle_shop.customer_360_days_since_last_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "review_count": { + "id": "model.jaffle_shop.customer_360_review_count", + "table_id": "model.jaffle_shop.customer_360", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_review_rating": { + "id": "model.jaffle_shop.customer_360_avg_review_rating", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_review_rating", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "months_active": { + "id": "model.jaffle_shop.customer_360_months_active", + "table_id": "model.jaffle_shop.customer_360", + "name": "months_active", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_promotion_effectiveness": { + "id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "int_promotion_effectiveness", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders_with_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\neffectiveness as (\n select\n owp.has_promotion,\n owp.promotion_name,\n owp.discount_type,\n count(*) as order_count,\n avg(ot.subtotal) as avg_order_value,\n sum(ot.subtotal) as total_revenue,\n avg(ot.item_count) as avg_items_per_order,\n avg(ot.total_margin) as avg_margin\n from orders_with_promos owp\n left join order_totals ot on owp.order_id = ot.order_id\n group by owp.has_promotion, owp.promotion_name, owp.discount_type\n)\n\nselect * from effectiveness", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "has_promotion": { + "id": "model.jaffle_shop.int_promotion_effectiveness_has_promotion", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_name": { + "id": "model.jaffle_shop.int_promotion_effectiveness_promotion_name", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "discount_type": { + "id": "model.jaffle_shop.int_promotion_effectiveness_discount_type", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "order_count": { + "id": "model.jaffle_shop.int_promotion_effectiveness_order_count", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "avg_order_value": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_order_value", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.int_promotion_effectiveness_total_revenue", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_items_per_order": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "avg_margin": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_margin", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.rpt_sales_dashboard": { + "id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "rpt_sales_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with weekly as (\n select * from {{ ref('metric_weekly_sales') }}\n),\n\nfinal as (\n select\n w.week_start,\n w.total_orders,\n w.total_revenue,\n w.net_revenue,\n w.total_margin,\n w.total_discounts,\n w.total_items_sold,\n w.avg_daily_order_value,\n lag(w.total_revenue) over (order by w.week_start) as prev_week_revenue,\n case when lag(w.total_revenue) over (order by w.week_start) > 0\n then round((w.total_revenue - lag(w.total_revenue) over (order by w.week_start))\n / lag(w.total_revenue) over (order by w.week_start) * 100, 1)\n else null\n end as revenue_wow_growth_pct\n from weekly w\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "week_start": { + "id": "model.jaffle_shop.rpt_sales_dashboard_week_start", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "week_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_orders": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_orders", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "net_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_net_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_margin": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_discounts": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_discounts", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "total_items_sold": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_items_sold", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "avg_daily_order_value": { + "id": "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "prev_week_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "prev_week_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "revenue_wow_growth_pct": { + "id": "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "revenue_wow_growth_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_name": { + "id": "model.jaffle_shop.int_products_with_categories_product_name", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.int_products_with_categories_category_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_name": { + "id": "model.jaffle_shop.int_products_with_categories_category_name", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "root_category": { + "id": "model.jaffle_shop.int_products_with_categories_root_category", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "category_path": { + "id": "model.jaffle_shop.int_products_with_categories_category_path", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_depth": { + "id": "model.jaffle_shop.int_products_with_categories_category_depth", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_depth", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "price": { + "id": "model.jaffle_shop.int_products_with_categories_price", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "cost": { + "id": "model.jaffle_shop.int_products_with_categories_cost", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "created_at": { + "id": "model.jaffle_shop.int_products_with_categories_created_at", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "created_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + }, + "seed.jaffle_shop.raw_reviews": { + "id": "seed.jaffle_shop.raw_reviews", + "name": "raw_reviews", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_reviews_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "order_id": { + "id": "seed.jaffle_shop.raw_reviews_order_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_reviews_product_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "customer_id": { + "id": "seed.jaffle_shop.raw_reviews_customer_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "rating": { + "id": "seed.jaffle_shop.raw_reviews_rating", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "rating", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "review_date": { + "id": "seed.jaffle_shop.raw_reviews_review_date", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "review_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": null + } + }, + "columns": { + "model.jaffle_shop.rpt_customer_dashboard_total_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_total_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "total_customers", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_active_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "active_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_avg_clv": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_clv", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_clv", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_orders_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "champion_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "at_risk_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": { + "id": "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "lost_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer": { + "id": "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer", + "table_id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "avg_reviews_per_customer", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_order_date": { + "id": "model.jaffle_shop.metric_daily_orders_order_date", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_total_orders": { + "id": "model.jaffle_shop.metric_daily_orders_total_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_completed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_completed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "completed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_returned_orders": { + "id": "model.jaffle_shop.metric_daily_orders_returned_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "returned_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_shipped_orders": { + "id": "model.jaffle_shop.metric_daily_orders_shipped_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "shipped_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_placed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_placed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "placed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_promoted_orders": { + "id": "model.jaffle_shop.metric_daily_orders_promoted_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "promoted_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_avg_items_per_order": { + "id": "model.jaffle_shop.metric_daily_orders_avg_items_per_order", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_id": { + "id": "model.jaffle_shop.int_customer_segments_customer_id", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_first_name": { + "id": "model.jaffle_shop.int_customer_segments_first_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_last_name": { + "id": "model.jaffle_shop.int_customer_segments_last_name", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_total_orders": { + "id": "model.jaffle_shop.int_customer_segments_total_orders", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_total_spent": { + "id": "model.jaffle_shop.int_customer_segments_total_spent", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_days_since_last_order": { + "id": "model.jaffle_shop.int_customer_segments_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_recency_score": { + "id": "model.jaffle_shop.int_customer_segments_recency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_frequency_score": { + "id": "model.jaffle_shop.int_customer_segments_frequency_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_monetary_score": { + "id": "model.jaffle_shop.int_customer_segments_monetary_score", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "monetary_score", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_rfm_total": { + "id": "model.jaffle_shop.int_customer_segments_rfm_total", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_segments_customer_segment": { + "id": "model.jaffle_shop.int_customer_segments_customer_segment", + "table_id": "model.jaffle_shop.int_customer_segments", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_snapshot_date": { + "id": "model.jaffle_shop.metric_inventory_daily_snapshot_date", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "snapshot_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_total_products_tracked": { + "id": "model.jaffle_shop.metric_inventory_daily_total_products_tracked", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_products_tracked", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_total_stores": { + "id": "model.jaffle_shop.metric_inventory_daily_total_stores", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_stores", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_total_stock_units": { + "id": "model.jaffle_shop.metric_inventory_daily_total_stock_units", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_out_of_stock_count": { + "id": "model.jaffle_shop.metric_inventory_daily_out_of_stock_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "out_of_stock_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_low_stock_count": { + "id": "model.jaffle_shop.metric_inventory_daily_low_stock_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "low_stock_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_adequate_count": { + "id": "model.jaffle_shop.metric_inventory_daily_adequate_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "adequate_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_well_stocked_count": { + "id": "model.jaffle_shop.metric_inventory_daily_well_stocked_count", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "well_stocked_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store": { + "id": "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store", + "table_id": "model.jaffle_shop.metric_inventory_daily", + "name": "avg_stock_per_product_store", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_user_id": { + "id": "seed.jaffle_shop.raw_orders_user_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "user_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_order_date": { + "id": "seed.jaffle_shop.raw_orders_order_date", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_product_store_key": { + "id": "model.jaffle_shop.int_product_stock_levels_product_store_key", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_product_id": { + "id": "model.jaffle_shop.int_product_stock_levels_product_id", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_store_id": { + "id": "model.jaffle_shop.int_product_stock_levels_store_id", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_total_received": { + "id": "model.jaffle_shop.int_product_stock_levels_total_received", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "total_received", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_total_sold": { + "id": "model.jaffle_shop.int_product_stock_levels_total_sold", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "total_sold", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_current_stock": { + "id": "model.jaffle_shop.int_product_stock_levels_current_stock", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_last_restock_date": { + "id": "model.jaffle_shop.int_product_stock_levels_last_restock_date", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_stock_levels_last_sale_date": { + "id": "model.jaffle_shop.int_product_stock_levels_last_sale_date", + "table_id": "model.jaffle_shop.int_product_stock_levels", + "name": "last_sale_date", + "type": "DATE", + "transformation_type": "unknown", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_name": { + "id": "seed.jaffle_shop.raw_promotions_name", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_discount_type": { + "id": "seed.jaffle_shop.raw_promotions_discount_type", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_discount_value": { + "id": "seed.jaffle_shop.raw_promotions_discount_value", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "discount_value", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_start_date": { + "id": "seed.jaffle_shop.raw_promotions_start_date", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "start_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_end_date": { + "id": "seed.jaffle_shop.raw_promotions_end_date", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "end_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_order_id": { + "id": "model.jaffle_shop.order_discounts_order_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_customer_id": { + "id": "model.jaffle_shop.order_discounts_customer_id", + "table_id": "model.jaffle_shop.order_discounts", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_order_date": { + "id": "model.jaffle_shop.order_discounts_order_date", + "table_id": "model.jaffle_shop.order_discounts", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_subtotal": { + "id": "model.jaffle_shop.order_discounts_subtotal", + "table_id": "model.jaffle_shop.order_discounts", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_has_promotion": { + "id": "model.jaffle_shop.order_discounts_has_promotion", + "table_id": "model.jaffle_shop.order_discounts", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_promotion_name": { + "id": "model.jaffle_shop.order_discounts_promotion_name", + "table_id": "model.jaffle_shop.order_discounts", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_discount_type": { + "id": "model.jaffle_shop.order_discounts_discount_type", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_discount_value": { + "id": "model.jaffle_shop.order_discounts_discount_value", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_discount_amount": { + "id": "model.jaffle_shop.order_discounts_discount_amount", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_amount", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_discount_pct_of_order": { + "id": "model.jaffle_shop.order_discounts_discount_pct_of_order", + "table_id": "model.jaffle_shop.order_discounts", + "name": "discount_pct_of_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_discounts_net_revenue": { + "id": "model.jaffle_shop.order_discounts_net_revenue", + "table_id": "model.jaffle_shop.order_discounts", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_subtotal": { + "id": "model.jaffle_shop.int_order_payments_matched_order_subtotal", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_subtotal", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_total_paid": { + "id": "model.jaffle_shop.int_order_payments_matched_total_paid", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_payment_count": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_count", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_payment_method_count": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_method_count", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_method_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_payment_status": { + "id": "model.jaffle_shop.int_order_payments_matched_payment_status", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_customer_id": { + "id": "model.jaffle_shop.int_customer_review_activity_customer_id", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_review_count": { + "id": "model.jaffle_shop.int_customer_review_activity_review_count", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_avg_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_avg_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_min_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_min_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "min_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_max_rating": { + "id": "model.jaffle_shop.int_customer_review_activity_max_rating", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "max_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_first_review_date": { + "id": "model.jaffle_shop.int_customer_review_activity_first_review_date", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "first_review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_last_review_date": { + "id": "model.jaffle_shop.int_customer_review_activity_last_review_date", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "last_review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_review_activity_products_reviewed": { + "id": "model.jaffle_shop.int_customer_review_activity_products_reviewed", + "table_id": "model.jaffle_shop.int_customer_review_activity", + "name": "products_reviewed", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "new_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_lifetime_orders", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "table_id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "cumulative_customers", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_id": { + "id": "model.jaffle_shop.orders_order_id", + "table_id": "model.jaffle_shop.orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_customer_id": { + "id": "model.jaffle_shop.orders_customer_id", + "table_id": "model.jaffle_shop.orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_order_date": { + "id": "model.jaffle_shop.orders_order_date", + "table_id": "model.jaffle_shop.orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_credit_card_amount": { + "id": "model.jaffle_shop.orders_credit_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_coupon_amount": { + "id": "model.jaffle_shop.orders_coupon_amount", + "table_id": "model.jaffle_shop.orders", + "name": "coupon_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_bank_transfer_amount": { + "id": "model.jaffle_shop.orders_bank_transfer_amount", + "table_id": "model.jaffle_shop.orders", + "name": "bank_transfer_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_gift_card_amount": { + "id": "model.jaffle_shop.orders_gift_card_amount", + "table_id": "model.jaffle_shop.orders", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_amount": { + "id": "model.jaffle_shop.orders_amount", + "table_id": "model.jaffle_shop.orders", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_review_id": { + "id": "model.jaffle_shop.int_reviews_with_products_review_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "review_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_order_id": { + "id": "model.jaffle_shop.int_reviews_with_products_order_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_product_id": { + "id": "model.jaffle_shop.int_reviews_with_products_product_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_product_name": { + "id": "model.jaffle_shop.int_reviews_with_products_product_name", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_category_name": { + "id": "model.jaffle_shop.int_reviews_with_products_category_name", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_root_category": { + "id": "model.jaffle_shop.int_reviews_with_products_root_category", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_customer_id": { + "id": "model.jaffle_shop.int_reviews_with_products_customer_id", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_rating": { + "id": "model.jaffle_shop.int_reviews_with_products_rating", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "rating", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_reviews_with_products_review_date": { + "id": "model.jaffle_shop.int_reviews_with_products_review_date", + "table_id": "model.jaffle_shop.int_reviews_with_products", + "name": "review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_customer_id": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_id", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_first_name": { + "id": "model.jaffle_shop.customer_lifetime_value_first_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_last_name": { + "id": "model.jaffle_shop.customer_lifetime_value_last_name", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_number_of_orders": { + "id": "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_total_revenue": { + "id": "model.jaffle_shop.customer_lifetime_value_total_revenue", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "total_revenue", + "type": "HUGEINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_first_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_first_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_last_order_date": { + "id": "model.jaffle_shop.customer_lifetime_value_last_order_date", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": { + "id": "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": { + "id": "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_monthly_value": { + "id": "model.jaffle_shop.customer_lifetime_value_monthly_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_lifetime_value_avg_order_value": { + "id": "model.jaffle_shop.customer_lifetime_value_avg_order_value", + "table_id": "model.jaffle_shop.customer_lifetime_value", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_order_date": { + "id": "model.jaffle_shop.metric_promotion_daily_order_date", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_promotion_name": { + "id": "model.jaffle_shop.metric_promotion_daily_promotion_name", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_discount_type": { + "id": "model.jaffle_shop.metric_promotion_daily_discount_type", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_usage_count": { + "id": "model.jaffle_shop.metric_promotion_daily_usage_count", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "usage_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_total_discount": { + "id": "model.jaffle_shop.metric_promotion_daily_total_discount", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_discount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_total_order_value": { + "id": "model.jaffle_shop.metric_promotion_daily_total_order_value", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_total_net_revenue": { + "id": "model.jaffle_shop.metric_promotion_daily_total_net_revenue", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "total_net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_promotion_daily_avg_discount_pct": { + "id": "model.jaffle_shop.metric_promotion_daily_avg_discount_pct", + "table_id": "model.jaffle_shop.metric_promotion_daily", + "name": "avg_discount_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_name": { + "id": "model.jaffle_shop.int_category_hierarchy_category_name", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_parent_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_parent_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_root_category": { + "id": "model.jaffle_shop.int_category_hierarchy_root_category", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_full_path": { + "id": "model.jaffle_shop.int_category_hierarchy_full_path", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "full_path", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_depth": { + "id": "model.jaffle_shop.int_category_hierarchy_depth", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "depth", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_order_date": { + "id": "model.jaffle_shop.metric_store_daily_order_date", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_store_id": { + "id": "model.jaffle_shop.metric_store_daily_store_id", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_store_name": { + "id": "model.jaffle_shop.metric_store_daily_store_name", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_city": { + "id": "model.jaffle_shop.metric_store_daily_city", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_order_count": { + "id": "model.jaffle_shop.metric_store_daily_order_count", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_revenue": { + "id": "model.jaffle_shop.metric_store_daily_revenue", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_cost": { + "id": "model.jaffle_shop.metric_store_daily_cost", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_margin": { + "id": "model.jaffle_shop.metric_store_daily_margin", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_discounts": { + "id": "model.jaffle_shop.metric_store_daily_discounts", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_store_daily_net_revenue": { + "id": "model.jaffle_shop.metric_store_daily_net_revenue", + "table_id": "model.jaffle_shop.metric_store_daily", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_store_id": { + "id": "model.jaffle_shop.store_performance_store_id", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_store_name": { + "id": "model.jaffle_shop.store_performance_store_name", + "table_id": "model.jaffle_shop.store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_city": { + "id": "model.jaffle_shop.store_performance_city", + "table_id": "model.jaffle_shop.store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_state": { + "id": "model.jaffle_shop.store_performance_state", + "table_id": "model.jaffle_shop.store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_total_employees": { + "id": "model.jaffle_shop.store_performance_total_employees", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_order_count": { + "id": "model.jaffle_shop.store_performance_order_count", + "table_id": "model.jaffle_shop.store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_unique_customers": { + "id": "model.jaffle_shop.store_performance_unique_customers", + "table_id": "model.jaffle_shop.store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_total_revenue": { + "id": "model.jaffle_shop.store_performance_total_revenue", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_total_margin": { + "id": "model.jaffle_shop.store_performance_total_margin", + "table_id": "model.jaffle_shop.store_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_avg_order_value": { + "id": "model.jaffle_shop.store_performance_avg_order_value", + "table_id": "model.jaffle_shop.store_performance", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_revenue_per_employee": { + "id": "model.jaffle_shop.store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_performance_orders_per_employee": { + "id": "model.jaffle_shop.store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_id": { + "id": "seed.jaffle_shop.raw_stores_id", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_name": { + "id": "seed.jaffle_shop.raw_stores_name", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_city": { + "id": "seed.jaffle_shop.raw_stores_city", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_state": { + "id": "seed.jaffle_shop.raw_stores_state", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_opened_at": { + "id": "seed.jaffle_shop.raw_stores_opened_at", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "opened_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_cohort_month": { + "id": "model.jaffle_shop.customer_cohorts_cohort_month", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_cohort_size": { + "id": "model.jaffle_shop.customer_cohorts_cohort_size", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders": { + "id": "model.jaffle_shop.customer_cohorts_avg_lifetime_orders", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_lifetime_orders", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_cohorts_avg_tenure_days": { + "id": "model.jaffle_shop.customer_cohorts_avg_tenure_days", + "table_id": "model.jaffle_shop.customer_cohorts", + "name": "avg_tenure_days", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_customer_id": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": { + "id": "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "last_order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": { + "id": "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "lifetime_orders", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": { + "id": "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "table_id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_order_date": { + "id": "model.jaffle_shop.int_daily_order_summary_order_date", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_order_count": { + "id": "model.jaffle_shop.int_daily_order_summary_order_count", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_unique_customers": { + "id": "model.jaffle_shop.int_daily_order_summary_unique_customers", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_revenue": { + "id": "model.jaffle_shop.int_daily_order_summary_total_revenue", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_cost": { + "id": "model.jaffle_shop.int_daily_order_summary_total_cost", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_margin": { + "id": "model.jaffle_shop.int_daily_order_summary_total_margin", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_items_sold": { + "id": "model.jaffle_shop.int_daily_order_summary_total_items_sold", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_promoted_orders": { + "id": "model.jaffle_shop.int_daily_order_summary_promoted_orders", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "promoted_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_total_discounts": { + "id": "model.jaffle_shop.int_daily_order_summary_total_discounts", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_daily_order_summary_avg_order_value": { + "id": "model.jaffle_shop.int_daily_order_summary_avg_order_value", + "table_id": "model.jaffle_shop.int_daily_order_summary", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_supply_order_id": { + "id": "model.jaffle_shop.stg_supply_orders_supply_order_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_product_id": { + "id": "model.jaffle_shop.stg_supply_orders_product_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_store_id": { + "id": "model.jaffle_shop.stg_supply_orders_store_id", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_quantity": { + "id": "model.jaffle_shop.stg_supply_orders_quantity", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_order_date": { + "id": "model.jaffle_shop.stg_supply_orders_order_date", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_supply_orders_delivered_date": { + "id": "model.jaffle_shop.stg_supply_orders_delivered_date", + "table_id": "model.jaffle_shop.stg_supply_orders", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_item_count": { + "id": "model.jaffle_shop.int_order_totals_item_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_total_quantity": { + "id": "model.jaffle_shop.int_order_totals_total_quantity", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_subtotal": { + "id": "model.jaffle_shop.int_order_totals_subtotal", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_total_cost": { + "id": "model.jaffle_shop.int_order_totals_total_cost", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_total_margin": { + "id": "model.jaffle_shop.int_order_totals_total_margin", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_category_count": { + "id": "model.jaffle_shop.int_order_totals_category_count", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "category_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_week_start": { + "id": "model.jaffle_shop.metric_weekly_sales_week_start", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "week_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_orders": { + "id": "model.jaffle_shop.metric_weekly_sales_total_orders", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_revenue": { + "id": "model.jaffle_shop.metric_weekly_sales_total_revenue", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_net_revenue": { + "id": "model.jaffle_shop.metric_weekly_sales_net_revenue", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_margin": { + "id": "model.jaffle_shop.metric_weekly_sales_total_margin", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_discounts": { + "id": "model.jaffle_shop.metric_weekly_sales_total_discounts", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_customer_visits": { + "id": "model.jaffle_shop.metric_weekly_sales_total_customer_visits", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_customer_visits", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value": { + "id": "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_weekly_sales_total_items_sold": { + "id": "model.jaffle_shop.metric_weekly_sales_total_items_sold", + "table_id": "model.jaffle_shop.metric_weekly_sales", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_employee_id": { + "id": "model.jaffle_shop.stg_employees_employee_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_store_id": { + "id": "model.jaffle_shop.stg_employees_store_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_first_name": { + "id": "model.jaffle_shop.stg_employees_first_name", + "table_id": "model.jaffle_shop.stg_employees", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_last_name": { + "id": "model.jaffle_shop.stg_employees_last_name", + "table_id": "model.jaffle_shop.stg_employees", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_role": { + "id": "model.jaffle_shop.stg_employees_role", + "table_id": "model.jaffle_shop.stg_employees", + "name": "role", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_hired_at": { + "id": "model.jaffle_shop.stg_employees_hired_at", + "table_id": "model.jaffle_shop.stg_employees", + "name": "hired_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_product_id": { + "id": "model.jaffle_shop.int_inventory_movements_product_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_store_id": { + "id": "model.jaffle_shop.int_inventory_movements_store_id", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_movement_date": { + "id": "model.jaffle_shop.int_inventory_movements_movement_date", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_quantity_in": { + "id": "model.jaffle_shop.int_inventory_movements_quantity_in", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "quantity_in", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_quantity_out": { + "id": "model.jaffle_shop.int_inventory_movements_quantity_out", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "quantity_out", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_inventory_movements_movement_type": { + "id": "model.jaffle_shop.int_inventory_movements_movement_type", + "table_id": "model.jaffle_shop.int_inventory_movements", + "name": "movement_type", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_promotion_name": { + "id": "model.jaffle_shop.promotion_roi_promotion_name", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_discount_type": { + "id": "model.jaffle_shop.promotion_roi_discount_type", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_order_count": { + "id": "model.jaffle_shop.promotion_roi_order_count", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_avg_order_value": { + "id": "model.jaffle_shop.promotion_roi_avg_order_value", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_total_revenue": { + "id": "model.jaffle_shop.promotion_roi_total_revenue", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_avg_margin": { + "id": "model.jaffle_shop.promotion_roi_avg_margin", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "avg_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_total_discount_given": { + "id": "model.jaffle_shop.promotion_roi_total_discount_given", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "total_discount_given", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_net_revenue_after_discount": { + "id": "model.jaffle_shop.promotion_roi_net_revenue_after_discount", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "net_revenue_after_discount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar": { + "id": "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar", + "table_id": "model.jaffle_shop.promotion_roi", + "name": "revenue_per_discount_dollar", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_review_id": { + "id": "model.jaffle_shop.stg_reviews_review_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "review_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_order_id": { + "id": "model.jaffle_shop.stg_reviews_order_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_product_id": { + "id": "model.jaffle_shop.stg_reviews_product_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_customer_id": { + "id": "model.jaffle_shop.stg_reviews_customer_id", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_rating": { + "id": "model.jaffle_shop.stg_reviews_rating", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "rating", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_reviews_review_date": { + "id": "model.jaffle_shop.stg_reviews_review_date", + "table_id": "model.jaffle_shop.stg_reviews", + "name": "review_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_price": { + "id": "model.jaffle_shop.int_product_margins_price", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_cost": { + "id": "model.jaffle_shop.int_product_margins_cost", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_margin": { + "id": "model.jaffle_shop.int_product_margins_margin", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_margin_pct": { + "id": "model.jaffle_shop.int_product_margins_margin_pct", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_id": { + "id": "model.jaffle_shop.customer_segments_final_customer_id", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_first_name": { + "id": "model.jaffle_shop.customer_segments_final_first_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_last_name": { + "id": "model.jaffle_shop.customer_segments_final_last_name", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_customer_segment": { + "id": "model.jaffle_shop.customer_segments_final_customer_segment", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_recency_score": { + "id": "model.jaffle_shop.customer_segments_final_recency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "recency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_frequency_score": { + "id": "model.jaffle_shop.customer_segments_final_frequency_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "frequency_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_monetary_score": { + "id": "model.jaffle_shop.customer_segments_final_monetary_score", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "monetary_score", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_rfm_total": { + "id": "model.jaffle_shop.customer_segments_final_rfm_total", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_total_orders": { + "id": "model.jaffle_shop.customer_segments_final_total_orders", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_total_spent": { + "id": "model.jaffle_shop.customer_segments_final_total_spent", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_segments_final_days_since_last_order": { + "id": "model.jaffle_shop.customer_segments_final_days_since_last_order", + "table_id": "model.jaffle_shop.customer_segments_final", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_customer_id": { + "id": "model.jaffle_shop.int_store_order_assignments_customer_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_date": { + "id": "model.jaffle_shop.int_store_order_assignments_order_date", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_product_id": { + "id": "model.jaffle_shop.product_reviews_product_id", + "table_id": "model.jaffle_shop.product_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_product_name": { + "id": "model.jaffle_shop.product_reviews_product_name", + "table_id": "model.jaffle_shop.product_reviews", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_category_name": { + "id": "model.jaffle_shop.product_reviews_category_name", + "table_id": "model.jaffle_shop.product_reviews", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_root_category": { + "id": "model.jaffle_shop.product_reviews_root_category", + "table_id": "model.jaffle_shop.product_reviews", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_review_count": { + "id": "model.jaffle_shop.product_reviews_review_count", + "table_id": "model.jaffle_shop.product_reviews", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_avg_rating": { + "id": "model.jaffle_shop.product_reviews_avg_rating", + "table_id": "model.jaffle_shop.product_reviews", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_positive_reviews": { + "id": "model.jaffle_shop.product_reviews_positive_reviews", + "table_id": "model.jaffle_shop.product_reviews", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_negative_reviews": { + "id": "model.jaffle_shop.product_reviews_negative_reviews", + "table_id": "model.jaffle_shop.product_reviews", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_rating_tier": { + "id": "model.jaffle_shop.product_reviews_rating_tier", + "table_id": "model.jaffle_shop.product_reviews", + "name": "rating_tier", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_reviews_positive_pct": { + "id": "model.jaffle_shop.product_reviews_positive_pct", + "table_id": "model.jaffle_shop.product_reviews", + "name": "positive_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_order_date": { + "id": "model.jaffle_shop.metric_daily_revenue_order_date", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_order_count": { + "id": "model.jaffle_shop.metric_daily_revenue_order_count", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue_total_revenue", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_cost": { + "id": "model.jaffle_shop.metric_daily_revenue_total_cost", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_margin": { + "id": "model.jaffle_shop.metric_daily_revenue_total_margin", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_discounts": { + "id": "model.jaffle_shop.metric_daily_revenue_total_discounts", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_net_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue_net_revenue", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_avg_order_value": { + "id": "model.jaffle_shop.metric_daily_revenue_avg_order_value", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_unique_customers": { + "id": "model.jaffle_shop.metric_daily_revenue_unique_customers", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_revenue_total_items_sold": { + "id": "model.jaffle_shop.metric_daily_revenue_total_items_sold", + "table_id": "model.jaffle_shop.metric_daily_revenue", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_product_id": { + "id": "model.jaffle_shop.products_product_id", + "table_id": "model.jaffle_shop.products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_product_name": { + "id": "model.jaffle_shop.products_product_name", + "table_id": "model.jaffle_shop.products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_category_id": { + "id": "model.jaffle_shop.products_category_id", + "table_id": "model.jaffle_shop.products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_category_name": { + "id": "model.jaffle_shop.products_category_name", + "table_id": "model.jaffle_shop.products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_root_category": { + "id": "model.jaffle_shop.products_root_category", + "table_id": "model.jaffle_shop.products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_category_path": { + "id": "model.jaffle_shop.products_category_path", + "table_id": "model.jaffle_shop.products", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_price": { + "id": "model.jaffle_shop.products_price", + "table_id": "model.jaffle_shop.products", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_cost": { + "id": "model.jaffle_shop.products_cost", + "table_id": "model.jaffle_shop.products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_margin": { + "id": "model.jaffle_shop.products_margin", + "table_id": "model.jaffle_shop.products", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_margin_pct": { + "id": "model.jaffle_shop.products_margin_pct", + "table_id": "model.jaffle_shop.products", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.products_created_at": { + "id": "model.jaffle_shop.products_created_at", + "table_id": "model.jaffle_shop.products", + "name": "created_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_date": { + "id": "model.jaffle_shop.revenue_summary_order_date", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_week": { + "id": "model.jaffle_shop.revenue_summary_order_week", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_week", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_month": { + "id": "model.jaffle_shop.revenue_summary_order_month", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_store_id": { + "id": "model.jaffle_shop.revenue_summary_store_id", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_order_count": { + "id": "model.jaffle_shop.revenue_summary_order_count", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_revenue": { + "id": "model.jaffle_shop.revenue_summary_revenue", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_cost": { + "id": "model.jaffle_shop.revenue_summary_cost", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_margin": { + "id": "model.jaffle_shop.revenue_summary_margin", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_discounts": { + "id": "model.jaffle_shop.revenue_summary_discounts", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.revenue_summary_net_revenue": { + "id": "model.jaffle_shop.revenue_summary_net_revenue", + "table_id": "model.jaffle_shop.revenue_summary", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_store_id": { + "id": "model.jaffle_shop.stores_store_id", + "table_id": "model.jaffle_shop.stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_store_name": { + "id": "model.jaffle_shop.stores_store_name", + "table_id": "model.jaffle_shop.stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_city": { + "id": "model.jaffle_shop.stores_city", + "table_id": "model.jaffle_shop.stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_state": { + "id": "model.jaffle_shop.stores_state", + "table_id": "model.jaffle_shop.stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_total_employees": { + "id": "model.jaffle_shop.stores_total_employees", + "table_id": "model.jaffle_shop.stores", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_manager_count": { + "id": "model.jaffle_shop.stores_manager_count", + "table_id": "model.jaffle_shop.stores", + "name": "manager_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_barista_count": { + "id": "model.jaffle_shop.stores_barista_count", + "table_id": "model.jaffle_shop.stores", + "name": "barista_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_cashier_count": { + "id": "model.jaffle_shop.stores_cashier_count", + "table_id": "model.jaffle_shop.stores", + "name": "cashier_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_cook_count": { + "id": "model.jaffle_shop.stores_cook_count", + "table_id": "model.jaffle_shop.stores", + "name": "cook_count", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_earliest_hire": { + "id": "model.jaffle_shop.stores_earliest_hire", + "table_id": "model.jaffle_shop.stores", + "name": "earliest_hire", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stores_latest_hire": { + "id": "model.jaffle_shop.stores_latest_hire", + "table_id": "model.jaffle_shop.stores", + "name": "latest_hire", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_month", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_months_since_first", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retained_customers", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retained_customers", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "cohort_size", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate": { + "id": "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "table_id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "retention_rate", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_month_start": { + "id": "model.jaffle_shop.metric_monthly_sales_month_start", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "month_start", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_orders": { + "id": "model.jaffle_shop.metric_monthly_sales_total_orders", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_revenue": { + "id": "model.jaffle_shop.metric_monthly_sales_total_revenue", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_net_revenue": { + "id": "model.jaffle_shop.metric_monthly_sales_net_revenue", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_margin": { + "id": "model.jaffle_shop.metric_monthly_sales_total_margin", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_discounts": { + "id": "model.jaffle_shop.metric_monthly_sales_total_discounts", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value": { + "id": "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_total_items_sold": { + "id": "model.jaffle_shop.metric_monthly_sales_total_items_sold", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_monthly_sales_active_days": { + "id": "model.jaffle_shop.metric_monthly_sales_active_days", + "table_id": "model.jaffle_shop.metric_monthly_sales", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_cohort_month": { + "id": "model.jaffle_shop.customer_retention_cohort_month", + "table_id": "model.jaffle_shop.customer_retention", + "name": "cohort_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_months_since_first": { + "id": "model.jaffle_shop.customer_retention_months_since_first", + "table_id": "model.jaffle_shop.customer_retention", + "name": "months_since_first", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_retention_customers": { + "id": "model.jaffle_shop.customer_retention_customers", + "table_id": "model.jaffle_shop.customer_retention", + "name": "customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_id": { + "id": "seed.jaffle_shop.raw_supply_orders_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_product_id": { + "id": "seed.jaffle_shop.raw_supply_orders_product_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_store_id": { + "id": "seed.jaffle_shop.raw_supply_orders_store_id", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_quantity": { + "id": "seed.jaffle_shop.raw_supply_orders_quantity", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_order_date": { + "id": "seed.jaffle_shop.raw_supply_orders_order_date", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_supply_orders_delivered_date": { + "id": "seed.jaffle_shop.raw_supply_orders_delivered_date", + "table_id": "seed.jaffle_shop.raw_supply_orders", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_customer_id": { + "id": "model.jaffle_shop.int_order_enriched_customer_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_date": { + "id": "model.jaffle_shop.int_order_enriched_order_date", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_item_count": { + "id": "model.jaffle_shop.int_order_enriched_item_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "item_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_quantity": { + "id": "model.jaffle_shop.int_order_enriched_total_quantity", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_subtotal": { + "id": "model.jaffle_shop.int_order_enriched_subtotal", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_cost": { + "id": "model.jaffle_shop.int_order_enriched_total_cost", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_margin": { + "id": "model.jaffle_shop.int_order_enriched_total_margin", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_category_count": { + "id": "model.jaffle_shop.int_order_enriched_category_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "category_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_has_promotion": { + "id": "model.jaffle_shop.int_order_enriched_has_promotion", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_promotion_name": { + "id": "model.jaffle_shop.int_order_enriched_promotion_name", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_discount_type": { + "id": "model.jaffle_shop.int_order_enriched_discount_type", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_discount_value": { + "id": "model.jaffle_shop.int_order_enriched_discount_value", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_total_paid": { + "id": "model.jaffle_shop.int_order_enriched_total_paid", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_payment_count": { + "id": "model.jaffle_shop.int_order_enriched_payment_count", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_payment_status": { + "id": "model.jaffle_shop.int_order_enriched_payment_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_discount_amount": { + "id": "model.jaffle_shop.int_order_enriched_discount_amount", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "discount_amount", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_id": { + "id": "seed.jaffle_shop.raw_order_items_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_quantity": { + "id": "seed.jaffle_shop.raw_order_items_quantity", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_unit_price": { + "id": "seed.jaffle_shop.raw_order_items_unit_price", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "unit_price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_payment_id": { + "id": "model.jaffle_shop.payments_fact_payment_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "payment_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_id": { + "id": "model.jaffle_shop.payments_fact_order_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_customer_id": { + "id": "model.jaffle_shop.payments_fact_customer_id", + "table_id": "model.jaffle_shop.payments_fact", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_date": { + "id": "model.jaffle_shop.payments_fact_order_date", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_payment_method": { + "id": "model.jaffle_shop.payments_fact_payment_method", + "table_id": "model.jaffle_shop.payments_fact", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_amount": { + "id": "model.jaffle_shop.payments_fact_amount", + "table_id": "model.jaffle_shop.payments_fact", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_status": { + "id": "model.jaffle_shop.payments_fact_order_status", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_status", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_order_id": { + "id": "model.jaffle_shop.order_fulfillment_order_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_customer_id": { + "id": "model.jaffle_shop.order_fulfillment_customer_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_order_date": { + "id": "model.jaffle_shop.order_fulfillment_order_date", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_status": { + "id": "model.jaffle_shop.order_fulfillment_status", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_amount": { + "id": "model.jaffle_shop.order_fulfillment_amount", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_store_id": { + "id": "model.jaffle_shop.order_fulfillment_store_id", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_store_name": { + "id": "model.jaffle_shop.order_fulfillment_store_name", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_city": { + "id": "model.jaffle_shop.order_fulfillment_city", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_state": { + "id": "model.jaffle_shop.order_fulfillment_state", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_store_employee_count": { + "id": "model.jaffle_shop.order_fulfillment_store_employee_count", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "store_employee_count", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_order_item_id": { + "id": "model.jaffle_shop.order_items_order_item_id", + "table_id": "model.jaffle_shop.order_items", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_order_id": { + "id": "model.jaffle_shop.order_items_order_id", + "table_id": "model.jaffle_shop.order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_product_id": { + "id": "model.jaffle_shop.order_items_product_id", + "table_id": "model.jaffle_shop.order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_product_name": { + "id": "model.jaffle_shop.order_items_product_name", + "table_id": "model.jaffle_shop.order_items", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_category_name": { + "id": "model.jaffle_shop.order_items_category_name", + "table_id": "model.jaffle_shop.order_items", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_root_category": { + "id": "model.jaffle_shop.order_items_root_category", + "table_id": "model.jaffle_shop.order_items", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_category_path": { + "id": "model.jaffle_shop.order_items_category_path", + "table_id": "model.jaffle_shop.order_items", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_quantity": { + "id": "model.jaffle_shop.order_items_quantity", + "table_id": "model.jaffle_shop.order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_unit_price": { + "id": "model.jaffle_shop.order_items_unit_price", + "table_id": "model.jaffle_shop.order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_line_total": { + "id": "model.jaffle_shop.order_items_line_total", + "table_id": "model.jaffle_shop.order_items", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_cost": { + "id": "model.jaffle_shop.order_items_cost", + "table_id": "model.jaffle_shop.order_items", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_margin_pct": { + "id": "model.jaffle_shop.order_items_margin_pct", + "table_id": "model.jaffle_shop.order_items", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_line_cost": { + "id": "model.jaffle_shop.order_items_line_cost", + "table_id": "model.jaffle_shop.order_items", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_items_line_margin": { + "id": "model.jaffle_shop.order_items_line_margin", + "table_id": "model.jaffle_shop.order_items", + "name": "line_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_supply_order_id": { + "id": "model.jaffle_shop.int_supply_order_costs_supply_order_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_product_id": { + "id": "model.jaffle_shop.int_supply_order_costs_product_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_product_name": { + "id": "model.jaffle_shop.int_supply_order_costs_product_name", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_store_id": { + "id": "model.jaffle_shop.int_supply_order_costs_store_id", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_quantity": { + "id": "model.jaffle_shop.int_supply_order_costs_quantity", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_unit_cost": { + "id": "model.jaffle_shop.int_supply_order_costs_unit_cost", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "unit_cost", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_total_cost": { + "id": "model.jaffle_shop.int_supply_order_costs_total_cost", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_order_date": { + "id": "model.jaffle_shop.int_supply_order_costs_order_date", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_delivered_date": { + "id": "model.jaffle_shop.int_supply_order_costs_delivered_date", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_supply_order_costs_lead_time_days": { + "id": "model.jaffle_shop.int_supply_order_costs_lead_time_days", + "table_id": "model.jaffle_shop.int_supply_order_costs", + "name": "lead_time_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_product_id": { + "id": "model.jaffle_shop.int_product_ratings_product_id", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_product_name": { + "id": "model.jaffle_shop.int_product_ratings_product_name", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_category_name": { + "id": "model.jaffle_shop.int_product_ratings_category_name", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_root_category": { + "id": "model.jaffle_shop.int_product_ratings_root_category", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_review_count": { + "id": "model.jaffle_shop.int_product_ratings_review_count", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_avg_rating": { + "id": "model.jaffle_shop.int_product_ratings_avg_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_positive_reviews": { + "id": "model.jaffle_shop.int_product_ratings_positive_reviews", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_negative_reviews": { + "id": "model.jaffle_shop.int_product_ratings_negative_reviews", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_min_rating": { + "id": "model.jaffle_shop.int_product_ratings_min_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "min_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_ratings_max_rating": { + "id": "model.jaffle_shop.int_product_ratings_max_rating", + "table_id": "model.jaffle_shop.int_product_ratings", + "name": "max_rating", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_item_id": { + "id": "model.jaffle_shop.stg_order_items_order_item_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_quantity": { + "id": "model.jaffle_shop.stg_order_items_quantity", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_unit_price": { + "id": "model.jaffle_shop.stg_order_items_unit_price", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_employee_id": { + "id": "model.jaffle_shop.store_staffing_employee_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "employee_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_first_name": { + "id": "model.jaffle_shop.store_staffing_first_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_last_name": { + "id": "model.jaffle_shop.store_staffing_last_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_role": { + "id": "model.jaffle_shop.store_staffing_role", + "table_id": "model.jaffle_shop.store_staffing", + "name": "role", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_hired_at": { + "id": "model.jaffle_shop.store_staffing_hired_at", + "table_id": "model.jaffle_shop.store_staffing", + "name": "hired_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_store_id": { + "id": "model.jaffle_shop.store_staffing_store_id", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_store_name": { + "id": "model.jaffle_shop.store_staffing_store_name", + "table_id": "model.jaffle_shop.store_staffing", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_city": { + "id": "model.jaffle_shop.store_staffing_city", + "table_id": "model.jaffle_shop.store_staffing", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_staffing_state": { + "id": "model.jaffle_shop.store_staffing_state", + "table_id": "model.jaffle_shop.store_staffing", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_category_id": { + "id": "model.jaffle_shop.product_categories_category_id", + "table_id": "model.jaffle_shop.product_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_category_name": { + "id": "model.jaffle_shop.product_categories_category_name", + "table_id": "model.jaffle_shop.product_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_parent_category_id": { + "id": "model.jaffle_shop.product_categories_parent_category_id", + "table_id": "model.jaffle_shop.product_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_root_category": { + "id": "model.jaffle_shop.product_categories_root_category", + "table_id": "model.jaffle_shop.product_categories", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_full_path": { + "id": "model.jaffle_shop.product_categories_full_path", + "table_id": "model.jaffle_shop.product_categories", + "name": "full_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_depth": { + "id": "model.jaffle_shop.product_categories_depth", + "table_id": "model.jaffle_shop.product_categories", + "name": "depth", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_categories_product_count": { + "id": "model.jaffle_shop.product_categories_product_count", + "table_id": "model.jaffle_shop.product_categories", + "name": "product_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_total_products": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_products", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_products", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_total_product_revenue": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_product_revenue", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_product_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating": { + "id": "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "overall_avg_rating", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_total_units_sold": { + "id": "model.jaffle_shop.rpt_product_dashboard_total_units_sold", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "total_units_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_never_ordered_products": { + "id": "model.jaffle_shop.rpt_product_dashboard_never_ordered_products", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "never_ordered_products", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_top_product_revenue": { + "id": "model.jaffle_shop.rpt_product_dashboard_top_product_revenue", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "top_product_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_product_dashboard_top_product_name": { + "id": "model.jaffle_shop.rpt_product_dashboard_top_product_name", + "table_id": "model.jaffle_shop.rpt_product_dashboard", + "name": "top_product_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_customer_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_customer_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_date": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_date", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_promotion_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_promotion_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_promotion_name": { + "id": "model.jaffle_shop.int_orders_with_promotions_promotion_name", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_discount_type": { + "id": "model.jaffle_shop.int_orders_with_promotions_discount_type", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_discount_value": { + "id": "model.jaffle_shop.int_orders_with_promotions_discount_value", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_has_promotion": { + "id": "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_product_store_key": { + "id": "model.jaffle_shop.inventory_health_product_store_key", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_product_id": { + "id": "model.jaffle_shop.inventory_health_product_id", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_product_name": { + "id": "model.jaffle_shop.inventory_health_product_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_store_id": { + "id": "model.jaffle_shop.inventory_health_store_id", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_store_name": { + "id": "model.jaffle_shop.inventory_health_store_name", + "table_id": "model.jaffle_shop.inventory_health", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_current_stock": { + "id": "model.jaffle_shop.inventory_health_current_stock", + "table_id": "model.jaffle_shop.inventory_health", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_stock_status": { + "id": "model.jaffle_shop.inventory_health_stock_status", + "table_id": "model.jaffle_shop.inventory_health", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_total_inbound": { + "id": "model.jaffle_shop.inventory_health_total_inbound", + "table_id": "model.jaffle_shop.inventory_health", + "name": "total_inbound", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_total_outbound": { + "id": "model.jaffle_shop.inventory_health_total_outbound", + "table_id": "model.jaffle_shop.inventory_health", + "name": "total_outbound", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_restock_events": { + "id": "model.jaffle_shop.inventory_health_restock_events", + "table_id": "model.jaffle_shop.inventory_health", + "name": "restock_events", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_sale_events": { + "id": "model.jaffle_shop.inventory_health_sale_events", + "table_id": "model.jaffle_shop.inventory_health", + "name": "sale_events", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_inventory_balance": { + "id": "model.jaffle_shop.inventory_health_inventory_balance", + "table_id": "model.jaffle_shop.inventory_health", + "name": "inventory_balance", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.inventory_health_avg_units_per_sale": { + "id": "model.jaffle_shop.inventory_health_avg_units_per_sale", + "table_id": "model.jaffle_shop.inventory_health", + "name": "avg_units_per_sale", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_name": { + "id": "model.jaffle_shop.stg_categories_category_name", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_product_id": { + "id": "model.jaffle_shop.supplier_lead_times_product_id", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_product_name": { + "id": "model.jaffle_shop.supplier_lead_times_product_name", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_store_id": { + "id": "model.jaffle_shop.supplier_lead_times_store_id", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_order_count": { + "id": "model.jaffle_shop.supplier_lead_times_order_count", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_avg_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_avg_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "avg_lead_time", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_min_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_min_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "min_lead_time", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_max_lead_time": { + "id": "model.jaffle_shop.supplier_lead_times_max_lead_time", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "max_lead_time", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_total_quantity": { + "id": "model.jaffle_shop.supplier_lead_times_total_quantity", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "total_quantity", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supplier_lead_times_total_spend": { + "id": "model.jaffle_shop.supplier_lead_times_total_spend", + "table_id": "model.jaffle_shop.supplier_lead_times", + "name": "total_spend", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_item_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_item_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_product_id": { + "id": "model.jaffle_shop.int_order_items_enriched_product_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_product_name": { + "id": "model.jaffle_shop.int_order_items_enriched_product_name", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_category_name": { + "id": "model.jaffle_shop.int_order_items_enriched_category_name", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_root_category": { + "id": "model.jaffle_shop.int_order_items_enriched_root_category", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_category_path": { + "id": "model.jaffle_shop.int_order_items_enriched_category_path", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_quantity": { + "id": "model.jaffle_shop.int_order_items_enriched_quantity", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_unit_price": { + "id": "model.jaffle_shop.int_order_items_enriched_unit_price", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_total": { + "id": "model.jaffle_shop.int_order_items_enriched_line_total", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_cost": { + "id": "model.jaffle_shop.int_order_items_enriched_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_margin_pct": { + "id": "model.jaffle_shop.int_order_items_enriched_margin_pct", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_cost": { + "id": "model.jaffle_shop.int_order_items_enriched_line_cost", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_line_margin": { + "id": "model.jaffle_shop.int_order_items_enriched_line_margin", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "line_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_item_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_item_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_item_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_name": { + "id": "model.jaffle_shop.int_order_items_with_products_product_name", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_category_name": { + "id": "model.jaffle_shop.int_order_items_with_products_category_name", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_root_category": { + "id": "model.jaffle_shop.int_order_items_with_products_root_category", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_category_path": { + "id": "model.jaffle_shop.int_order_items_with_products_category_path", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_quantity": { + "id": "model.jaffle_shop.int_order_items_with_products_quantity", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_unit_price": { + "id": "model.jaffle_shop.int_order_items_with_products_unit_price", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "unit_price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_line_total": { + "id": "model.jaffle_shop.int_order_items_with_products_line_total", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "line_total", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_name": { + "id": "seed.jaffle_shop.raw_products_name", + "table_id": "seed.jaffle_shop.raw_products", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_price": { + "id": "seed.jaffle_shop.raw_products_price", + "table_id": "seed.jaffle_shop.raw_products", + "name": "price", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_cost": { + "id": "seed.jaffle_shop.raw_products_cost", + "table_id": "seed.jaffle_shop.raw_products", + "name": "cost", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_created_at": { + "id": "seed.jaffle_shop.raw_products_created_at", + "table_id": "seed.jaffle_shop.raw_products", + "name": "created_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_order_id": { + "id": "model.jaffle_shop.order_payment_status_order_id", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_order_subtotal": { + "id": "model.jaffle_shop.order_payment_status_order_subtotal", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "order_subtotal", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_total_paid": { + "id": "model.jaffle_shop.order_payment_status_total_paid", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "total_paid", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_payment_count": { + "id": "model.jaffle_shop.order_payment_status_payment_count", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_payment_method_count": { + "id": "model.jaffle_shop.order_payment_status_payment_method_count", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_method_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_payment_status": { + "id": "model.jaffle_shop.order_payment_status_payment_status", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_payment_status_payment_difference": { + "id": "model.jaffle_shop.order_payment_status_payment_difference", + "table_id": "model.jaffle_shop.order_payment_status", + "name": "payment_difference", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_customer_id": { + "id": "model.jaffle_shop.int_customer_order_history_customer_id", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_first_name": { + "id": "model.jaffle_shop.int_customer_order_history_first_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_last_name": { + "id": "model.jaffle_shop.int_customer_order_history_last_name", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_orders": { + "id": "model.jaffle_shop.int_customer_order_history_total_orders", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_spent": { + "id": "model.jaffle_shop.int_customer_order_history_total_spent", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_spent", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_margin_generated": { + "id": "model.jaffle_shop.int_customer_order_history_total_margin_generated", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_margin_generated", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_avg_order_value": { + "id": "model.jaffle_shop.int_customer_order_history_avg_order_value", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_total_items_purchased": { + "id": "model.jaffle_shop.int_customer_order_history_total_items_purchased", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "total_items_purchased", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_order_history_distinct_order_days": { + "id": "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "table_id": "model.jaffle_shop.int_customer_order_history", + "name": "distinct_order_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_store_id": { + "id": "model.jaffle_shop.int_store_performance_store_id", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_store_name": { + "id": "model.jaffle_shop.int_store_performance_store_name", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_city": { + "id": "model.jaffle_shop.int_store_performance_city", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_state": { + "id": "model.jaffle_shop.int_store_performance_state", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_total_employees": { + "id": "model.jaffle_shop.int_store_performance_total_employees", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_order_count": { + "id": "model.jaffle_shop.int_store_performance_order_count", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_unique_customers": { + "id": "model.jaffle_shop.int_store_performance_unique_customers", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_total_revenue": { + "id": "model.jaffle_shop.int_store_performance_total_revenue", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_total_margin": { + "id": "model.jaffle_shop.int_store_performance_total_margin", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_avg_order_value": { + "id": "model.jaffle_shop.int_store_performance_avg_order_value", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_revenue_per_employee": { + "id": "model.jaffle_shop.int_store_performance_revenue_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_performance_orders_per_employee": { + "id": "model.jaffle_shop.int_store_performance_orders_per_employee", + "table_id": "model.jaffle_shop.int_store_performance", + "name": "orders_per_employee", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_name": { + "id": "seed.jaffle_shop.raw_categories_name", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_product_id": { + "id": "model.jaffle_shop.product_profitability_product_id", + "table_id": "model.jaffle_shop.product_profitability", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_product_name": { + "id": "model.jaffle_shop.product_profitability_product_name", + "table_id": "model.jaffle_shop.product_profitability", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_category_name": { + "id": "model.jaffle_shop.product_profitability_category_name", + "table_id": "model.jaffle_shop.product_profitability", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_total_revenue": { + "id": "model.jaffle_shop.product_profitability_total_revenue", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_gross_margin": { + "id": "model.jaffle_shop.product_profitability_gross_margin", + "table_id": "model.jaffle_shop.product_profitability", + "name": "gross_margin", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_total_supply_cost": { + "id": "model.jaffle_shop.product_profitability_total_supply_cost", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_supply_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_net_margin": { + "id": "model.jaffle_shop.product_profitability_net_margin", + "table_id": "model.jaffle_shop.product_profitability", + "name": "net_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_gross_margin_pct": { + "id": "model.jaffle_shop.product_profitability_gross_margin_pct", + "table_id": "model.jaffle_shop.product_profitability", + "name": "gross_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_total_quantity_sold": { + "id": "model.jaffle_shop.product_profitability_total_quantity_sold", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_total_supplied": { + "id": "model.jaffle_shop.product_profitability_total_supplied", + "table_id": "model.jaffle_shop.product_profitability", + "name": "total_supplied", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_profitability_avg_rating": { + "id": "model.jaffle_shop.product_profitability_avg_rating", + "table_id": "model.jaffle_shop.product_profitability", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_name": { + "id": "model.jaffle_shop.stg_promotions_promotion_name", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_discount_type": { + "id": "model.jaffle_shop.stg_promotions_discount_type", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_discount_value": { + "id": "model.jaffle_shop.stg_promotions_discount_value", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "discount_value", + "type": "DECIMAL(18,3)", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_start_date": { + "id": "model.jaffle_shop.stg_promotions_start_date", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "start_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_end_date": { + "id": "model.jaffle_shop.stg_promotions_end_date", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "end_date", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_order_month": { + "id": "model.jaffle_shop.gross_margin_order_month", + "table_id": "model.jaffle_shop.gross_margin", + "name": "order_month", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_store_id": { + "id": "model.jaffle_shop.gross_margin_store_id", + "table_id": "model.jaffle_shop.gross_margin", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_revenue": { + "id": "model.jaffle_shop.gross_margin_total_revenue", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_cost": { + "id": "model.jaffle_shop.gross_margin_total_cost", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_margin": { + "id": "model.jaffle_shop.gross_margin_total_margin", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_discounts": { + "id": "model.jaffle_shop.gross_margin_total_discounts", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_net_revenue": { + "id": "model.jaffle_shop.gross_margin_total_net_revenue", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_net_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_gross_margin_pct": { + "id": "model.jaffle_shop.gross_margin_gross_margin_pct", + "table_id": "model.jaffle_shop.gross_margin", + "name": "gross_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.gross_margin_total_orders": { + "id": "model.jaffle_shop.gross_margin_total_orders", + "table_id": "model.jaffle_shop.gross_margin", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_id": { + "id": "model.jaffle_shop.order_returns_order_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_customer_id": { + "id": "model.jaffle_shop.order_returns_customer_id", + "table_id": "model.jaffle_shop.order_returns", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_order_date": { + "id": "model.jaffle_shop.order_returns_order_date", + "table_id": "model.jaffle_shop.order_returns", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_credit_card_amount": { + "id": "model.jaffle_shop.order_returns_credit_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "credit_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_coupon_amount": { + "id": "model.jaffle_shop.order_returns_coupon_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "coupon_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_bank_transfer_amount": { + "id": "model.jaffle_shop.order_returns_bank_transfer_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "bank_transfer_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_gift_card_amount": { + "id": "model.jaffle_shop.order_returns_gift_card_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "gift_card_amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_amount": { + "id": "model.jaffle_shop.order_returns_amount", + "table_id": "model.jaffle_shop.order_returns", + "name": "amount", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_product_id": { + "id": "model.jaffle_shop.product_performance_product_id", + "table_id": "model.jaffle_shop.product_performance", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_product_name": { + "id": "model.jaffle_shop.product_performance_product_name", + "table_id": "model.jaffle_shop.product_performance", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_category_name": { + "id": "model.jaffle_shop.product_performance_category_name", + "table_id": "model.jaffle_shop.product_performance", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_root_category": { + "id": "model.jaffle_shop.product_performance_root_category", + "table_id": "model.jaffle_shop.product_performance", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_price": { + "id": "model.jaffle_shop.product_performance_price", + "table_id": "model.jaffle_shop.product_performance", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_cost": { + "id": "model.jaffle_shop.product_performance_cost", + "table_id": "model.jaffle_shop.product_performance", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_margin_pct": { + "id": "model.jaffle_shop.product_performance_margin_pct", + "table_id": "model.jaffle_shop.product_performance", + "name": "margin_pct", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_times_ordered": { + "id": "model.jaffle_shop.product_performance_times_ordered", + "table_id": "model.jaffle_shop.product_performance", + "name": "times_ordered", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_total_quantity_sold": { + "id": "model.jaffle_shop.product_performance_total_quantity_sold", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_total_revenue": { + "id": "model.jaffle_shop.product_performance_total_revenue", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_total_margin": { + "id": "model.jaffle_shop.product_performance_total_margin", + "table_id": "model.jaffle_shop.product_performance", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_review_count": { + "id": "model.jaffle_shop.product_performance_review_count", + "table_id": "model.jaffle_shop.product_performance", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_avg_rating": { + "id": "model.jaffle_shop.product_performance_avg_rating", + "table_id": "model.jaffle_shop.product_performance", + "name": "avg_rating", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_positive_reviews": { + "id": "model.jaffle_shop.product_performance_positive_reviews", + "table_id": "model.jaffle_shop.product_performance", + "name": "positive_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_performance_negative_reviews": { + "id": "model.jaffle_shop.product_performance_negative_reviews", + "table_id": "model.jaffle_shop.product_performance", + "name": "negative_reviews", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_order_count": { + "id": "model.jaffle_shop.int_store_revenue_order_count", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_unique_customers": { + "id": "model.jaffle_shop.int_store_revenue_unique_customers", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_revenue": { + "id": "model.jaffle_shop.int_store_revenue_total_revenue", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_cost": { + "id": "model.jaffle_shop.int_store_revenue_total_cost", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_total_margin": { + "id": "model.jaffle_shop.int_store_revenue_total_margin", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_avg_order_value": { + "id": "model.jaffle_shop.int_store_revenue_avg_order_value", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_store_id": { + "id": "model.jaffle_shop.store_rankings_store_id", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_store_name": { + "id": "model.jaffle_shop.store_rankings_store_name", + "table_id": "model.jaffle_shop.store_rankings", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_city": { + "id": "model.jaffle_shop.store_rankings_city", + "table_id": "model.jaffle_shop.store_rankings", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_state": { + "id": "model.jaffle_shop.store_rankings_state", + "table_id": "model.jaffle_shop.store_rankings", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_total_revenue": { + "id": "model.jaffle_shop.store_rankings_total_revenue", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_total_margin": { + "id": "model.jaffle_shop.store_rankings_total_margin", + "table_id": "model.jaffle_shop.store_rankings", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count": { + "id": "model.jaffle_shop.store_rankings_order_count", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_unique_customers": { + "id": "model.jaffle_shop.store_rankings_unique_customers", + "table_id": "model.jaffle_shop.store_rankings", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_revenue_per_employee": { + "id": "model.jaffle_shop.store_rankings_revenue_per_employee", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_revenue_rank": { + "id": "model.jaffle_shop.store_rankings_revenue_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_margin_rank": { + "id": "model.jaffle_shop.store_rankings_margin_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "margin_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_order_count_rank": { + "id": "model.jaffle_shop.store_rankings_order_count_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "order_count_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_efficiency_rank": { + "id": "model.jaffle_shop.store_rankings_efficiency_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_rankings_customer_reach_rank": { + "id": "model.jaffle_shop.store_rankings_customer_reach_rank", + "table_id": "model.jaffle_shop.store_rankings", + "name": "customer_reach_rank", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_customer_id": { + "id": "model.jaffle_shop.customer_acquisition_customer_id", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_date": { + "id": "model.jaffle_shop.customer_acquisition_first_order_date", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_acquired_via_promotion": { + "id": "model.jaffle_shop.customer_acquisition_acquired_via_promotion", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquired_via_promotion", + "type": "BOOLEAN", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_acquisition_promotion": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_promotion", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_promotion", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_value": { + "id": "model.jaffle_shop.customer_acquisition_first_order_value", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_value", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_first_order_items": { + "id": "model.jaffle_shop.customer_acquisition_first_order_items", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "first_order_items", + "type": "BIGINT", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_acquisition_acquisition_month": { + "id": "model.jaffle_shop.customer_acquisition_acquisition_month", + "table_id": "model.jaffle_shop.customer_acquisition", + "name": "acquisition_month", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_supply_order_id": { + "id": "model.jaffle_shop.supply_orders_fact_supply_order_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "supply_order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_product_id": { + "id": "model.jaffle_shop.supply_orders_fact_product_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_product_name": { + "id": "model.jaffle_shop.supply_orders_fact_product_name", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_store_id": { + "id": "model.jaffle_shop.supply_orders_fact_store_id", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_quantity": { + "id": "model.jaffle_shop.supply_orders_fact_quantity", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "quantity", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_unit_cost": { + "id": "model.jaffle_shop.supply_orders_fact_unit_cost", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "unit_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_total_cost": { + "id": "model.jaffle_shop.supply_orders_fact_total_cost", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "total_cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_order_date": { + "id": "model.jaffle_shop.supply_orders_fact_order_date", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_delivered_date": { + "id": "model.jaffle_shop.supply_orders_fact_delivered_date", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "delivered_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.supply_orders_fact_lead_time_days": { + "id": "model.jaffle_shop.supply_orders_fact_lead_time_days", + "table_id": "model.jaffle_shop.supply_orders_fact", + "name": "lead_time_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_order_date": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_date", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_product_id": { + "id": "model.jaffle_shop.metric_product_sales_daily_product_id", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_product_name": { + "id": "model.jaffle_shop.metric_product_sales_daily_product_name", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_category_name": { + "id": "model.jaffle_shop.metric_product_sales_daily_category_name", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_units_sold": { + "id": "model.jaffle_shop.metric_product_sales_daily_units_sold", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "units_sold", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_revenue": { + "id": "model.jaffle_shop.metric_product_sales_daily_revenue", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_margin": { + "id": "model.jaffle_shop.metric_product_sales_daily_margin", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_product_sales_daily_order_count": { + "id": "model.jaffle_shop.metric_product_sales_daily_order_count", + "table_id": "model.jaffle_shop.metric_product_sales_daily", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_product_store_key": { + "id": "model.jaffle_shop.product_inventory_product_store_key", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_store_key", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_product_id": { + "id": "model.jaffle_shop.product_inventory_product_id", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_product_name": { + "id": "model.jaffle_shop.product_inventory_product_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_store_id": { + "id": "model.jaffle_shop.product_inventory_store_id", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_store_name": { + "id": "model.jaffle_shop.product_inventory_store_name", + "table_id": "model.jaffle_shop.product_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_total_received": { + "id": "model.jaffle_shop.product_inventory_total_received", + "table_id": "model.jaffle_shop.product_inventory", + "name": "total_received", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_total_sold": { + "id": "model.jaffle_shop.product_inventory_total_sold", + "table_id": "model.jaffle_shop.product_inventory", + "name": "total_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_current_stock": { + "id": "model.jaffle_shop.product_inventory_current_stock", + "table_id": "model.jaffle_shop.product_inventory", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_last_restock_date": { + "id": "model.jaffle_shop.product_inventory_last_restock_date", + "table_id": "model.jaffle_shop.product_inventory", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_last_sale_date": { + "id": "model.jaffle_shop.product_inventory_last_sale_date", + "table_id": "model.jaffle_shop.product_inventory", + "name": "last_sale_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.product_inventory_stock_status": { + "id": "model.jaffle_shop.product_inventory_stock_status", + "table_id": "model.jaffle_shop.product_inventory", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_order_id": { + "id": "model.jaffle_shop.new_orders_order_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_customer_id": { + "id": "model.jaffle_shop.new_orders_customer_id", + "table_id": "model.jaffle_shop.new_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_order_date": { + "id": "model.jaffle_shop.new_orders_order_date", + "table_id": "model.jaffle_shop.new_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_status": { + "id": "model.jaffle_shop.new_orders_status", + "table_id": "model.jaffle_shop.new_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_id": { + "id": "seed.jaffle_shop.raw_employees_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_store_id": { + "id": "seed.jaffle_shop.raw_employees_store_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_first_name": { + "id": "seed.jaffle_shop.raw_employees_first_name", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_last_name": { + "id": "seed.jaffle_shop.raw_employees_last_name", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_role": { + "id": "seed.jaffle_shop.raw_employees_role", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "role", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_hired_at": { + "id": "seed.jaffle_shop.raw_employees_hired_at", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "hired_at", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_product_id": { + "id": "model.jaffle_shop.reorder_recommendations_product_id", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_product_name": { + "id": "model.jaffle_shop.reorder_recommendations_product_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_store_id": { + "id": "model.jaffle_shop.reorder_recommendations_store_id", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_store_name": { + "id": "model.jaffle_shop.reorder_recommendations_store_name", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_current_stock": { + "id": "model.jaffle_shop.reorder_recommendations_current_stock", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "current_stock", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_stock_status": { + "id": "model.jaffle_shop.reorder_recommendations_stock_status", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "stock_status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_last_restock_date": { + "id": "model.jaffle_shop.reorder_recommendations_last_restock_date", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "last_restock_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_total_quantity_sold": { + "id": "model.jaffle_shop.reorder_recommendations_total_quantity_sold", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_times_ordered": { + "id": "model.jaffle_shop.reorder_recommendations_times_ordered", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "times_ordered", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_reorder_priority": { + "id": "model.jaffle_shop.reorder_recommendations_reorder_priority", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "reorder_priority", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty": { + "id": "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty", + "table_id": "model.jaffle_shop.reorder_recommendations", + "name": "suggested_reorder_qty", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_payment_id": { + "id": "model.jaffle_shop.stg_payments_payment_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_payment_method": { + "id": "model.jaffle_shop.stg_payments_payment_method", + "table_id": "model.jaffle_shop.stg_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_amount": { + "id": "model.jaffle_shop.stg_payments_amount", + "table_id": "model.jaffle_shop.stg_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_customer_id": { + "id": "model.jaffle_shop.customers_customer_id", + "table_id": "model.jaffle_shop.customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_first_name": { + "id": "model.jaffle_shop.customers_first_name", + "table_id": "model.jaffle_shop.customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_last_name": { + "id": "model.jaffle_shop.customers_last_name", + "table_id": "model.jaffle_shop.customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_first_order": { + "id": "model.jaffle_shop.customers_first_order", + "table_id": "model.jaffle_shop.customers", + "name": "first_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_most_recent_order": { + "id": "model.jaffle_shop.customers_most_recent_order", + "table_id": "model.jaffle_shop.customers", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_number_of_orders": { + "id": "model.jaffle_shop.customers_number_of_orders", + "table_id": "model.jaffle_shop.customers", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customers_customer_lifetime_value": { + "id": "model.jaffle_shop.customers_customer_lifetime_value", + "table_id": "model.jaffle_shop.customers", + "name": "customer_lifetime_value", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_product_id": { + "id": "model.jaffle_shop.cost_analysis_product_id", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_product_name": { + "id": "model.jaffle_shop.cost_analysis_product_name", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_category_name": { + "id": "model.jaffle_shop.cost_analysis_category_name", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_total_revenue": { + "id": "model.jaffle_shop.cost_analysis_total_revenue", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_gross_margin": { + "id": "model.jaffle_shop.cost_analysis_gross_margin", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "gross_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_total_supply_spend": { + "id": "model.jaffle_shop.cost_analysis_total_supply_spend", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_supply_spend", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_avg_unit_cost": { + "id": "model.jaffle_shop.cost_analysis_avg_unit_cost", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "avg_unit_cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_avg_lead_time": { + "id": "model.jaffle_shop.cost_analysis_avg_lead_time", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "avg_lead_time", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_supply_order_count": { + "id": "model.jaffle_shop.cost_analysis_supply_order_count", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "supply_order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_total_quantity_sold": { + "id": "model.jaffle_shop.cost_analysis_total_quantity_sold", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "total_quantity_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold": { + "id": "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold", + "table_id": "model.jaffle_shop.cost_analysis", + "name": "supply_cost_per_unit_sold", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_customer_id": { + "id": "model.jaffle_shop.stg_orders_customer_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_date": { + "id": "model.jaffle_shop.stg_orders_order_date", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_customer_id": { + "id": "model.jaffle_shop.customer_review_summary_customer_id", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_review_count": { + "id": "model.jaffle_shop.customer_review_summary_review_count", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_customer_avg_rating": { + "id": "model.jaffle_shop.customer_review_summary_customer_avg_rating", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "customer_avg_rating", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_products_reviewed": { + "id": "model.jaffle_shop.customer_review_summary_products_reviewed", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "products_reviewed", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_first_review_date": { + "id": "model.jaffle_shop.customer_review_summary_first_review_date", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "first_review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_last_review_date": { + "id": "model.jaffle_shop.customer_review_summary_last_review_date", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "last_review_date", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed": { + "id": "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "avg_product_rating_of_reviewed", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_review_summary_rating_tendency": { + "id": "model.jaffle_shop.customer_review_summary_rating_tendency", + "table_id": "model.jaffle_shop.customer_review_summary", + "name": "rating_tendency", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_customer_id": { + "id": "model.jaffle_shop.int_customer_payment_methods_customer_id", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_credit_card_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_credit_card_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "credit_card_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "bank_transfer_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_coupon_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_coupon_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "coupon_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_gift_card_total": { + "id": "model.jaffle_shop.int_customer_payment_methods_gift_card_total", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "gift_card_total", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method": { + "id": "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method", + "table_id": "model.jaffle_shop.int_customer_payment_methods", + "name": "preferred_payment_method", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_store_id": { + "id": "model.jaffle_shop.stg_stores_store_id", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_store_name": { + "id": "model.jaffle_shop.stg_stores_store_name", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_city": { + "id": "model.jaffle_shop.stg_stores_city", + "table_id": "model.jaffle_shop.stg_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_state": { + "id": "model.jaffle_shop.stg_stores_state", + "table_id": "model.jaffle_shop.stg_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_opened_at": { + "id": "model.jaffle_shop.stg_stores_opened_at", + "table_id": "model.jaffle_shop.stg_stores", + "name": "opened_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_id": { + "id": "seed.jaffle_shop.raw_customers_id", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_first_name": { + "id": "seed.jaffle_shop.raw_customers_first_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_last_name": { + "id": "seed.jaffle_shop.raw_customers_last_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_name": { + "id": "model.jaffle_shop.int_store_employees_active_store_name", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_city": { + "id": "model.jaffle_shop.int_store_employees_active_city", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_state": { + "id": "model.jaffle_shop.int_store_employees_active_state", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_total_employees": { + "id": "model.jaffle_shop.int_store_employees_active_total_employees", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "total_employees", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_manager_count": { + "id": "model.jaffle_shop.int_store_employees_active_manager_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "manager_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_barista_count": { + "id": "model.jaffle_shop.int_store_employees_active_barista_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "barista_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_cashier_count": { + "id": "model.jaffle_shop.int_store_employees_active_cashier_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "cashier_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_cook_count": { + "id": "model.jaffle_shop.int_store_employees_active_cook_count", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "cook_count", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_earliest_hire": { + "id": "model.jaffle_shop.int_store_employees_active_earliest_hire", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "earliest_hire", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_latest_hire": { + "id": "model.jaffle_shop.int_store_employees_active_latest_hire", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "latest_hire", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_customer_id": { + "id": "model.jaffle_shop.stg_customers_customer_id", + "table_id": "model.jaffle_shop.stg_customers", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_first_name": { + "id": "model.jaffle_shop.stg_customers_first_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_last_name": { + "id": "model.jaffle_shop.stg_customers_last_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_full_name": { + "id": "model.jaffle_shop.stg_customers_full_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "full_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "added", + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_id": { + "id": "seed.jaffle_shop.raw_payments_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_payment_method": { + "id": "seed.jaffle_shop.raw_payments_payment_method", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "payment_method", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_name": { + "id": "model.jaffle_shop.stg_products_product_name", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_price_cents": { + "id": "model.jaffle_shop.stg_products_price_cents", + "table_id": "model.jaffle_shop.stg_products", + "name": "price_cents", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_cost_cents": { + "id": "model.jaffle_shop.stg_products_cost_cents", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost_cents", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_price": { + "id": "model.jaffle_shop.stg_products_price", + "table_id": "model.jaffle_shop.stg_products", + "name": "price", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_cost": { + "id": "model.jaffle_shop.stg_products_cost", + "table_id": "model.jaffle_shop.stg_products", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_created_at": { + "id": "model.jaffle_shop.stg_products_created_at", + "table_id": "model.jaffle_shop.stg_products", + "name": "created_at", + "type": "DATE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_store_id": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_id", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_store_name": { + "id": "model.jaffle_shop.rpt_store_dashboard_store_name", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_city": { + "id": "model.jaffle_shop.rpt_store_dashboard_city", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_state": { + "id": "model.jaffle_shop.rpt_store_dashboard_state", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_total_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_total_margin": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_order_count": { + "id": "model.jaffle_shop.rpt_store_dashboard_order_count", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_unique_customers": { + "id": "model.jaffle_shop.rpt_store_dashboard_unique_customers", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "unique_customers", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_per_employee", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_revenue_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_revenue_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "revenue_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank": { + "id": "model.jaffle_shop.rpt_store_dashboard_efficiency_rank", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "efficiency_rank", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_total_stock_units": { + "id": "model.jaffle_shop.rpt_store_dashboard_total_stock_units", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products": { + "id": "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "out_of_stock_products", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_low_stock_products": { + "id": "model.jaffle_shop.rpt_store_dashboard_low_stock_products", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "low_stock_products", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_store_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue": { + "id": "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue", + "table_id": "model.jaffle_shop.rpt_store_dashboard", + "name": "avg_daily_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_store_id": { + "id": "model.jaffle_shop.store_inventory_store_id", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_store_name": { + "id": "model.jaffle_shop.store_inventory_store_name", + "table_id": "model.jaffle_shop.store_inventory", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_unique_products": { + "id": "model.jaffle_shop.store_inventory_unique_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "unique_products", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_total_stock_units": { + "id": "model.jaffle_shop.store_inventory_total_stock_units", + "table_id": "model.jaffle_shop.store_inventory", + "name": "total_stock_units", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_out_of_stock_products": { + "id": "model.jaffle_shop.store_inventory_out_of_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "out_of_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_low_stock_products": { + "id": "model.jaffle_shop.store_inventory_low_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "low_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_adequate_stock_products": { + "id": "model.jaffle_shop.store_inventory_adequate_stock_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "adequate_stock_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.store_inventory_well_stocked_products": { + "id": "model.jaffle_shop.store_inventory_well_stocked_products", + "table_id": "model.jaffle_shop.store_inventory", + "name": "well_stocked_products", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_month_start": { + "id": "model.jaffle_shop.rpt_executive_dashboard_month_start", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "month_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_total_orders": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_orders", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_total_revenue": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_net_revenue": { + "id": "model.jaffle_shop.rpt_executive_dashboard_net_revenue", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_total_margin": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct": { + "id": "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "overall_margin_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_total_items_sold": { + "id": "model.jaffle_shop.rpt_executive_dashboard_total_items_sold", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_executive_dashboard_active_days": { + "id": "model.jaffle_shop.rpt_executive_dashboard_active_days", + "table_id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "active_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_id": { + "id": "model.jaffle_shop.customer_360_customer_id", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_first_name": { + "id": "model.jaffle_shop.customer_360_first_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_last_name": { + "id": "model.jaffle_shop.customer_360_last_name", + "table_id": "model.jaffle_shop.customer_360", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_first_order": { + "id": "model.jaffle_shop.customer_360_first_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "first_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_most_recent_order": { + "id": "model.jaffle_shop.customer_360_most_recent_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "most_recent_order", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_number_of_orders": { + "id": "model.jaffle_shop.customer_360_number_of_orders", + "table_id": "model.jaffle_shop.customer_360", + "name": "number_of_orders", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_lifetime_value": { + "id": "model.jaffle_shop.customer_360_customer_lifetime_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_lifetime_value", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_monthly_value": { + "id": "model.jaffle_shop.customer_360_monthly_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "monthly_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_avg_order_value": { + "id": "model.jaffle_shop.customer_360_avg_order_value", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_tenure_days": { + "id": "model.jaffle_shop.customer_360_customer_tenure_days", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_tenure_days", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_days_since_last_order": { + "id": "model.jaffle_shop.customer_360_days_since_last_order", + "table_id": "model.jaffle_shop.customer_360", + "name": "days_since_last_order", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_customer_segment": { + "id": "model.jaffle_shop.customer_360_customer_segment", + "table_id": "model.jaffle_shop.customer_360", + "name": "customer_segment", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_rfm_total": { + "id": "model.jaffle_shop.customer_360_rfm_total", + "table_id": "model.jaffle_shop.customer_360", + "name": "rfm_total", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_review_count": { + "id": "model.jaffle_shop.customer_360_review_count", + "table_id": "model.jaffle_shop.customer_360", + "name": "review_count", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_avg_review_rating": { + "id": "model.jaffle_shop.customer_360_avg_review_rating", + "table_id": "model.jaffle_shop.customer_360", + "name": "avg_review_rating", + "type": "DOUBLE", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.customer_360_months_active": { + "id": "model.jaffle_shop.customer_360_months_active", + "table_id": "model.jaffle_shop.customer_360", + "name": "months_active", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_has_promotion": { + "id": "model.jaffle_shop.int_promotion_effectiveness_has_promotion", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "has_promotion", + "type": "BOOLEAN", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_promotion_name": { + "id": "model.jaffle_shop.int_promotion_effectiveness_promotion_name", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "promotion_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_discount_type": { + "id": "model.jaffle_shop.int_promotion_effectiveness_discount_type", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "discount_type", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_order_count": { + "id": "model.jaffle_shop.int_promotion_effectiveness_order_count", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "order_count", + "type": "BIGINT", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_order_value", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_order_value", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_total_revenue": { + "id": "model.jaffle_shop.int_promotion_effectiveness_total_revenue", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_items_per_order", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_promotion_effectiveness_avg_margin": { + "id": "model.jaffle_shop.int_promotion_effectiveness_avg_margin", + "table_id": "model.jaffle_shop.int_promotion_effectiveness", + "name": "avg_margin", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_week_start": { + "id": "model.jaffle_shop.rpt_sales_dashboard_week_start", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "week_start", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_orders": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_orders", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_orders", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_net_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_net_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "net_revenue", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_margin": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_margin", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_margin", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_discounts": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_discounts", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_discounts", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_total_items_sold": { + "id": "model.jaffle_shop.rpt_sales_dashboard_total_items_sold", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "total_items_sold", + "type": "HUGEINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value": { + "id": "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "avg_daily_order_value", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue": { + "id": "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "prev_week_revenue", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct": { + "id": "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "table_id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "revenue_wow_growth_pct", + "type": "DOUBLE", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_name": { + "id": "model.jaffle_shop.int_products_with_categories_product_name", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_category_id": { + "id": "model.jaffle_shop.int_products_with_categories_category_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_category_name": { + "id": "model.jaffle_shop.int_products_with_categories_category_name", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_name", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_root_category": { + "id": "model.jaffle_shop.int_products_with_categories_root_category", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "root_category", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_category_path": { + "id": "model.jaffle_shop.int_products_with_categories_category_path", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_path", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_category_depth": { + "id": "model.jaffle_shop.int_products_with_categories_category_depth", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "category_depth", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_price": { + "id": "model.jaffle_shop.int_products_with_categories_price", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "price", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_cost": { + "id": "model.jaffle_shop.int_products_with_categories_cost", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "cost", + "type": "DOUBLE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_created_at": { + "id": "model.jaffle_shop.int_products_with_categories_created_at", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "created_at", + "type": "DATE", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_id": { + "id": "seed.jaffle_shop.raw_reviews_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_order_id": { + "id": "seed.jaffle_shop.raw_reviews_order_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_product_id": { + "id": "seed.jaffle_shop.raw_reviews_product_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_customer_id": { + "id": "seed.jaffle_shop.raw_reviews_customer_id", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "customer_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_rating": { + "id": "seed.jaffle_shop.raw_reviews_rating", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "rating", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_reviews_review_date": { + "id": "seed.jaffle_shop.raw_reviews_review_date", + "table_id": "seed.jaffle_shop.raw_reviews", + "name": "review_date", + "type": "DATE", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.rpt_customer_dashboard_total_customers": [], + "model.jaffle_shop.rpt_customer_dashboard_active_customers": [ + "model.jaffle_shop.customer_360_number_of_orders" + ], + "model.jaffle_shop.rpt_customer_dashboard_avg_clv": [ + "model.jaffle_shop.customer_360_customer_lifetime_value" + ], + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer": [ + "model.jaffle_shop.customer_360_number_of_orders" + ], + "model.jaffle_shop.rpt_customer_dashboard_champion_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_lost_customers": [ + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer": [ + "model.jaffle_shop.customer_360_review_count" + ], + "model.jaffle_shop.metric_daily_orders": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.metric_daily_orders_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_daily_orders_total_orders": [], + "model.jaffle_shop.metric_daily_orders_completed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_returned_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_shipped_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_placed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_promoted_orders": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.metric_daily_orders_avg_items_per_order": [ + "model.jaffle_shop.int_order_enriched_item_count" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_customer_order_history_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_customer_id": [ + "model.jaffle_shop.int_customer_order_history_customer_id" + ], + "model.jaffle_shop.int_customer_segments_first_name": [ + "model.jaffle_shop.int_customer_order_history_first_name" + ], + "model.jaffle_shop.int_customer_segments_last_name": [ + "model.jaffle_shop.int_customer_order_history_last_name" + ], + "model.jaffle_shop.int_customer_segments_total_orders": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_total_spent": [ + "model.jaffle_shop.int_customer_order_history_total_spent" + ], + "model.jaffle_shop.int_customer_segments_days_since_last_order": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_recency_score": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_frequency_score": [ + "model.jaffle_shop.int_customer_order_history_total_orders" + ], + "model.jaffle_shop.int_customer_segments_monetary_score": [ + "model.jaffle_shop.int_customer_order_history_total_spent" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_customer_order_history_total_spent", + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_customer_order_history_total_spent", + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.metric_inventory_daily": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.metric_inventory_daily_snapshot_date": [], + "model.jaffle_shop.metric_inventory_daily_total_products_tracked": [ + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.metric_inventory_daily_total_stores": [ + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.metric_inventory_daily_total_stock_units": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.metric_inventory_daily_out_of_stock_count": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.metric_inventory_daily_low_stock_count": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.metric_inventory_daily_adequate_count": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.metric_inventory_daily_well_stocked_count": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_orders_user_id": [], + "seed.jaffle_shop.raw_orders_order_date": [], + "seed.jaffle_shop.raw_orders_status": [], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.int_inventory_movements" + ], + "model.jaffle_shop.int_product_stock_levels_product_store_key": [], + "model.jaffle_shop.int_product_stock_levels_product_id": [], + "model.jaffle_shop.int_product_stock_levels_store_id": [], + "model.jaffle_shop.int_product_stock_levels_total_received": [], + "model.jaffle_shop.int_product_stock_levels_total_sold": [], + "model.jaffle_shop.int_product_stock_levels_current_stock": [], + "model.jaffle_shop.int_product_stock_levels_last_restock_date": [], + "model.jaffle_shop.int_product_stock_levels_last_sale_date": [], + "seed.jaffle_shop.raw_promotions": [], + "seed.jaffle_shop.raw_promotions_id": [], + "seed.jaffle_shop.raw_promotions_name": [], + "seed.jaffle_shop.raw_promotions_discount_type": [], + "seed.jaffle_shop.raw_promotions_discount_value": [], + "seed.jaffle_shop.raw_promotions_start_date": [], + "seed.jaffle_shop.raw_promotions_end_date": [], + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.int_order_enriched_has_promotion", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.order_discounts_order_id": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.order_discounts_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.order_discounts_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.order_discounts_subtotal": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.order_discounts_has_promotion": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.order_discounts_promotion_name": [ + "model.jaffle_shop.int_order_enriched_promotion_name" + ], + "model.jaffle_shop.order_discounts_discount_type": [ + "model.jaffle_shop.int_order_enriched_discount_type" + ], + "model.jaffle_shop.order_discounts_discount_value": [ + "model.jaffle_shop.int_order_enriched_discount_value" + ], + "model.jaffle_shop.order_discounts_discount_amount": [ + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.order_discounts_discount_pct_of_order": [ + "model.jaffle_shop.int_order_enriched_subtotal", + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.order_discounts_net_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal", + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.stg_payments_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_subtotal": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_order_payments_matched_total_paid": [ + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.int_order_payments_matched_payment_count": [], + "model.jaffle_shop.int_order_payments_matched_payment_method_count": [ + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.int_order_payments_matched_payment_status": [ + "model.jaffle_shop.int_order_totals_subtotal", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.int_customer_review_activity": [ + "model.jaffle_shop.stg_reviews_customer_id", + "model.jaffle_shop.stg_reviews" + ], + "model.jaffle_shop.int_customer_review_activity_customer_id": [ + "model.jaffle_shop.stg_reviews_customer_id" + ], + "model.jaffle_shop.int_customer_review_activity_review_count": [], + "model.jaffle_shop.int_customer_review_activity_avg_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "model.jaffle_shop.int_customer_review_activity_min_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "model.jaffle_shop.int_customer_review_activity_max_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "model.jaffle_shop.int_customer_review_activity_first_review_date": [ + "model.jaffle_shop.stg_reviews_review_date" + ], + "model.jaffle_shop.int_customer_review_activity_last_review_date": [ + "model.jaffle_shop.stg_reviews_review_date" + ], + "model.jaffle_shop.int_customer_review_activity_products_reviewed": [ + "model.jaffle_shop.stg_reviews_product_id" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly": [ + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month": [ + "model.jaffle_shop.customer_cohorts_cohort_month" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers": [ + "model.jaffle_shop.customer_cohorts_cohort_size" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders": [ + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days": [ + "model.jaffle_shop.customer_cohorts_avg_tenure_days" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers": [ + "model.jaffle_shop.customer_cohorts_cohort_month", + "model.jaffle_shop.customer_cohorts_cohort_size" + ], + "model.jaffle_shop.orders": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.orders_credit_card_amount": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.orders_coupon_amount": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.orders_bank_transfer_amount": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.orders_gift_card_amount": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.orders_amount": [ + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.int_reviews_with_products": [ + "model.jaffle_shop.int_products_with_categories", + "model.jaffle_shop.stg_reviews_product_id", + "model.jaffle_shop.stg_reviews", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.int_reviews_with_products_review_id": [ + "model.jaffle_shop.stg_reviews_review_id" + ], + "model.jaffle_shop.int_reviews_with_products_order_id": [ + "model.jaffle_shop.stg_reviews_order_id" + ], + "model.jaffle_shop.int_reviews_with_products_product_id": [ + "model.jaffle_shop.stg_reviews_product_id" + ], + "model.jaffle_shop.int_reviews_with_products_product_name": [ + "model.jaffle_shop.int_products_with_categories_product_name" + ], + "model.jaffle_shop.int_reviews_with_products_category_name": [ + "model.jaffle_shop.int_products_with_categories_category_name" + ], + "model.jaffle_shop.int_reviews_with_products_root_category": [ + "model.jaffle_shop.int_products_with_categories_root_category" + ], + "model.jaffle_shop.int_reviews_with_products_customer_id": [ + "model.jaffle_shop.stg_reviews_customer_id" + ], + "model.jaffle_shop.int_reviews_with_products_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "model.jaffle_shop.int_reviews_with_products_review_date": [ + "model.jaffle_shop.stg_reviews_review_date" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_lifetime_value_customer_id": [ + "model.jaffle_shop.customers_customer_id" + ], + "model.jaffle_shop.customer_lifetime_value_first_name": [ + "model.jaffle_shop.customers_first_name" + ], + "model.jaffle_shop.customer_lifetime_value_last_name": [ + "model.jaffle_shop.customers_last_name" + ], + "model.jaffle_shop.customer_lifetime_value_number_of_orders": [ + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.customer_lifetime_value_total_revenue": [ + "model.jaffle_shop.customers_customer_lifetime_value" + ], + "model.jaffle_shop.customer_lifetime_value_first_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_last_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_last_order_date" + ], + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": [ + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order" + ], + "model.jaffle_shop.customer_lifetime_value_monthly_value": [ + "model.jaffle_shop.customers_customer_lifetime_value", + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_avg_order_value": [ + "model.jaffle_shop.customers_number_of_orders", + "model.jaffle_shop.customers_customer_lifetime_value" + ], + "model.jaffle_shop.metric_promotion_daily": [ + "model.jaffle_shop.order_discounts_order_date", + "model.jaffle_shop.order_discounts_promotion_name", + "model.jaffle_shop.order_discounts", + "model.jaffle_shop.order_discounts_discount_type" + ], + "model.jaffle_shop.metric_promotion_daily_order_date": [ + "model.jaffle_shop.order_discounts_order_date" + ], + "model.jaffle_shop.metric_promotion_daily_promotion_name": [ + "model.jaffle_shop.order_discounts_promotion_name" + ], + "model.jaffle_shop.metric_promotion_daily_discount_type": [ + "model.jaffle_shop.order_discounts_discount_type" + ], + "model.jaffle_shop.metric_promotion_daily_usage_count": [], + "model.jaffle_shop.metric_promotion_daily_total_discount": [ + "model.jaffle_shop.order_discounts_discount_amount" + ], + "model.jaffle_shop.metric_promotion_daily_total_order_value": [ + "model.jaffle_shop.order_discounts_subtotal" + ], + "model.jaffle_shop.metric_promotion_daily_total_net_revenue": [ + "model.jaffle_shop.order_discounts_net_revenue" + ], + "model.jaffle_shop.metric_promotion_daily_avg_discount_pct": [ + "model.jaffle_shop.order_discounts_discount_pct_of_order" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_name": [ + "model.jaffle_shop.stg_categories_category_name" + ], + "model.jaffle_shop.int_category_hierarchy_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_root_category": [ + "model.jaffle_shop.stg_categories_category_name" + ], + "model.jaffle_shop.int_category_hierarchy_full_path": [ + "model.jaffle_shop.stg_categories_category_name" + ], + "model.jaffle_shop.int_category_hierarchy_depth": [], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.stores", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.revenue_summary_store_id", + "model.jaffle_shop.stores_store_id" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.revenue_summary_order_date" + ], + "model.jaffle_shop.metric_store_daily_store_id": [ + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.metric_store_daily_store_name": [ + "model.jaffle_shop.stores_store_name" + ], + "model.jaffle_shop.metric_store_daily_city": [ + "model.jaffle_shop.stores_city" + ], + "model.jaffle_shop.metric_store_daily_order_count": [ + "model.jaffle_shop.revenue_summary_order_count" + ], + "model.jaffle_shop.metric_store_daily_revenue": [ + "model.jaffle_shop.revenue_summary_revenue" + ], + "model.jaffle_shop.metric_store_daily_cost": [ + "model.jaffle_shop.revenue_summary_cost" + ], + "model.jaffle_shop.metric_store_daily_margin": [ + "model.jaffle_shop.revenue_summary_margin" + ], + "model.jaffle_shop.metric_store_daily_discounts": [ + "model.jaffle_shop.revenue_summary_discounts" + ], + "model.jaffle_shop.metric_store_daily_net_revenue": [ + "model.jaffle_shop.revenue_summary_net_revenue" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.store_performance_store_id": [ + "model.jaffle_shop.int_store_performance_store_id" + ], + "model.jaffle_shop.store_performance_store_name": [ + "model.jaffle_shop.int_store_performance_store_name" + ], + "model.jaffle_shop.store_performance_city": [ + "model.jaffle_shop.int_store_performance_city" + ], + "model.jaffle_shop.store_performance_state": [ + "model.jaffle_shop.int_store_performance_state" + ], + "model.jaffle_shop.store_performance_total_employees": [ + "model.jaffle_shop.int_store_performance_total_employees" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.int_store_performance_order_count" + ], + "model.jaffle_shop.store_performance_unique_customers": [ + "model.jaffle_shop.int_store_performance_unique_customers" + ], + "model.jaffle_shop.store_performance_total_revenue": [ + "model.jaffle_shop.int_store_performance_total_revenue" + ], + "model.jaffle_shop.store_performance_total_margin": [ + "model.jaffle_shop.int_store_performance_total_margin" + ], + "model.jaffle_shop.store_performance_avg_order_value": [ + "model.jaffle_shop.int_store_performance_avg_order_value" + ], + "model.jaffle_shop.store_performance_revenue_per_employee": [ + "model.jaffle_shop.int_store_performance_revenue_per_employee" + ], + "model.jaffle_shop.store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "seed.jaffle_shop.raw_stores": [], + "seed.jaffle_shop.raw_stores_id": [], + "seed.jaffle_shop.raw_stores_name": [], + "seed.jaffle_shop.raw_stores_city": [], + "seed.jaffle_shop.raw_stores_state": [], + "seed.jaffle_shop.raw_stores_opened_at": [], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_cohorts_cohort_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_cohorts_cohort_size": [], + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders": [ + "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders" + ], + "model.jaffle_shop.customer_cohorts_avg_tenure_days": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders": [], + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_daily_order_summary_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_daily_order_summary_order_count": [], + "model.jaffle_shop.int_daily_order_summary_unique_customers": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_daily_order_summary_total_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_daily_order_summary_total_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "model.jaffle_shop.int_daily_order_summary_total_margin": [ + "model.jaffle_shop.int_order_enriched_total_margin" + ], + "model.jaffle_shop.int_daily_order_summary_total_items_sold": [ + "model.jaffle_shop.int_order_enriched_total_quantity" + ], + "model.jaffle_shop.int_daily_order_summary_promoted_orders": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.int_daily_order_summary_total_discounts": [ + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.int_daily_order_summary_avg_order_value": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.stg_supply_orders": [ + "seed.jaffle_shop.raw_supply_orders" + ], + "model.jaffle_shop.stg_supply_orders_supply_order_id": [ + "seed.jaffle_shop.raw_supply_orders_id" + ], + "model.jaffle_shop.stg_supply_orders_product_id": [ + "seed.jaffle_shop.raw_supply_orders_product_id" + ], + "model.jaffle_shop.stg_supply_orders_store_id": [ + "seed.jaffle_shop.raw_supply_orders_store_id" + ], + "model.jaffle_shop.stg_supply_orders_quantity": [ + "seed.jaffle_shop.raw_supply_orders_quantity" + ], + "model.jaffle_shop.stg_supply_orders_order_date": [ + "seed.jaffle_shop.raw_supply_orders_order_date" + ], + "model.jaffle_shop.stg_supply_orders_delivered_date": [ + "seed.jaffle_shop.raw_supply_orders_delivered_date" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched_order_id", + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_totals_item_count": [], + "model.jaffle_shop.int_order_totals_total_quantity": [ + "model.jaffle_shop.int_order_items_enriched_quantity" + ], + "model.jaffle_shop.int_order_totals_subtotal": [ + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.int_order_totals_total_cost": [ + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.int_order_totals_total_margin": [ + "model.jaffle_shop.int_order_items_enriched_line_margin" + ], + "model.jaffle_shop.int_order_totals_category_count": [ + "model.jaffle_shop.int_order_items_enriched_root_category" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.metric_daily_revenue_order_date", + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_week_start": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.metric_weekly_sales_total_orders": [ + "model.jaffle_shop.metric_daily_revenue_order_count" + ], + "model.jaffle_shop.metric_weekly_sales_total_revenue": [ + "model.jaffle_shop.metric_daily_revenue_total_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_net_revenue": [ + "model.jaffle_shop.metric_daily_revenue_net_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_total_margin": [ + "model.jaffle_shop.metric_daily_revenue_total_margin" + ], + "model.jaffle_shop.metric_weekly_sales_total_discounts": [ + "model.jaffle_shop.metric_daily_revenue_total_discounts" + ], + "model.jaffle_shop.metric_weekly_sales_total_customer_visits": [ + "model.jaffle_shop.metric_daily_revenue_unique_customers" + ], + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value": [ + "model.jaffle_shop.metric_daily_revenue_avg_order_value" + ], + "model.jaffle_shop.metric_weekly_sales_total_items_sold": [ + "model.jaffle_shop.metric_daily_revenue_total_items_sold" + ], + "model.jaffle_shop.stg_employees": ["seed.jaffle_shop.raw_employees"], + "model.jaffle_shop.stg_employees_employee_id": [ + "seed.jaffle_shop.raw_employees_id" + ], + "model.jaffle_shop.stg_employees_store_id": [ + "seed.jaffle_shop.raw_employees_store_id" + ], + "model.jaffle_shop.stg_employees_first_name": [ + "seed.jaffle_shop.raw_employees_first_name" + ], + "model.jaffle_shop.stg_employees_last_name": [ + "seed.jaffle_shop.raw_employees_last_name" + ], + "model.jaffle_shop.stg_employees_role": [ + "seed.jaffle_shop.raw_employees_role" + ], + "model.jaffle_shop.stg_employees_hired_at": [ + "seed.jaffle_shop.raw_employees_hired_at" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.int_order_items_with_products_order_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.stg_supply_orders", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_inventory_movements_product_id": [ + "model.jaffle_shop.stg_supply_orders_product_id", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_inventory_movements_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.stg_supply_orders_store_id" + ], + "model.jaffle_shop.int_inventory_movements_movement_date": [ + "model.jaffle_shop.int_store_order_assignments_order_date", + "model.jaffle_shop.stg_supply_orders_delivered_date" + ], + "model.jaffle_shop.int_inventory_movements_quantity_in": [ + "model.jaffle_shop.stg_supply_orders_quantity" + ], + "model.jaffle_shop.int_inventory_movements_quantity_out": [ + "model.jaffle_shop.int_order_items_with_products_quantity" + ], + "model.jaffle_shop.int_inventory_movements_movement_type": [], + "model.jaffle_shop.promotion_roi": [ + "model.jaffle_shop.order_discounts_promotion_name", + "model.jaffle_shop.int_promotion_effectiveness_promotion_name", + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_promotion_effectiveness_has_promotion", + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.promotion_roi_promotion_name": [ + "model.jaffle_shop.int_promotion_effectiveness_promotion_name" + ], + "model.jaffle_shop.promotion_roi_discount_type": [ + "model.jaffle_shop.int_promotion_effectiveness_discount_type" + ], + "model.jaffle_shop.promotion_roi_order_count": [ + "model.jaffle_shop.int_promotion_effectiveness_order_count" + ], + "model.jaffle_shop.promotion_roi_avg_order_value": [ + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value" + ], + "model.jaffle_shop.promotion_roi_total_revenue": [ + "model.jaffle_shop.int_promotion_effectiveness_total_revenue" + ], + "model.jaffle_shop.promotion_roi_avg_margin": [ + "model.jaffle_shop.int_promotion_effectiveness_avg_margin" + ], + "model.jaffle_shop.promotion_roi_total_discount_given": [ + "model.jaffle_shop.order_discounts_discount_amount" + ], + "model.jaffle_shop.promotion_roi_net_revenue_after_discount": [ + "model.jaffle_shop.order_discounts_net_revenue" + ], + "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar": [ + "model.jaffle_shop.order_discounts_discount_amount", + "model.jaffle_shop.order_discounts_net_revenue" + ], + "model.jaffle_shop.stg_reviews": ["seed.jaffle_shop.raw_reviews"], + "model.jaffle_shop.stg_reviews_review_id": [ + "seed.jaffle_shop.raw_reviews_id" + ], + "model.jaffle_shop.stg_reviews_order_id": [ + "seed.jaffle_shop.raw_reviews_order_id" + ], + "model.jaffle_shop.stg_reviews_product_id": [ + "seed.jaffle_shop.raw_reviews_product_id" + ], + "model.jaffle_shop.stg_reviews_customer_id": [ + "seed.jaffle_shop.raw_reviews_customer_id" + ], + "model.jaffle_shop.stg_reviews_rating": [ + "seed.jaffle_shop.raw_reviews_rating" + ], + "model.jaffle_shop.stg_reviews_review_date": [ + "seed.jaffle_shop.raw_reviews_review_date" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_product_margins_price": [ + "model.jaffle_shop.stg_products_price" + ], + "model.jaffle_shop.int_product_margins_cost": [ + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_product_margins_margin": [ + "model.jaffle_shop.stg_products_cost", + "model.jaffle_shop.stg_products_price" + ], + "model.jaffle_shop.int_product_margins_margin_pct": [ + "model.jaffle_shop.stg_products_cost", + "model.jaffle_shop.stg_products_price" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.customer_segments_final_customer_id": [ + "model.jaffle_shop.int_customer_segments_customer_id" + ], + "model.jaffle_shop.customer_segments_final_first_name": [ + "model.jaffle_shop.int_customer_segments_first_name" + ], + "model.jaffle_shop.customer_segments_final_last_name": [ + "model.jaffle_shop.int_customer_segments_last_name" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.customer_segments_final_recency_score": [ + "model.jaffle_shop.int_customer_segments_recency_score" + ], + "model.jaffle_shop.customer_segments_final_frequency_score": [ + "model.jaffle_shop.int_customer_segments_frequency_score" + ], + "model.jaffle_shop.customer_segments_final_monetary_score": [ + "model.jaffle_shop.int_customer_segments_monetary_score" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.int_customer_segments_rfm_total" + ], + "model.jaffle_shop.customer_segments_final_total_orders": [ + "model.jaffle_shop.int_customer_segments_total_orders" + ], + "model.jaffle_shop.customer_segments_final_total_spent": [ + "model.jaffle_shop.int_customer_segments_total_spent" + ], + "model.jaffle_shop.customer_segments_final_days_since_last_order": [ + "model.jaffle_shop.int_customer_segments_days_since_last_order" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_stores" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.product_reviews": [ + "model.jaffle_shop.int_product_ratings" + ], + "model.jaffle_shop.product_reviews_product_id": [ + "model.jaffle_shop.int_product_ratings_product_id" + ], + "model.jaffle_shop.product_reviews_product_name": [ + "model.jaffle_shop.int_product_ratings_product_name" + ], + "model.jaffle_shop.product_reviews_category_name": [ + "model.jaffle_shop.int_product_ratings_category_name" + ], + "model.jaffle_shop.product_reviews_root_category": [ + "model.jaffle_shop.int_product_ratings_root_category" + ], + "model.jaffle_shop.product_reviews_review_count": [ + "model.jaffle_shop.int_product_ratings_review_count" + ], + "model.jaffle_shop.product_reviews_avg_rating": [ + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.product_reviews_positive_reviews": [ + "model.jaffle_shop.int_product_ratings_positive_reviews" + ], + "model.jaffle_shop.product_reviews_negative_reviews": [ + "model.jaffle_shop.int_product_ratings_negative_reviews" + ], + "model.jaffle_shop.product_reviews_rating_tier": [ + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.product_reviews_positive_pct": [ + "model.jaffle_shop.int_product_ratings_positive_reviews", + "model.jaffle_shop.int_product_ratings_review_count" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.metric_daily_revenue_order_date": [ + "model.jaffle_shop.int_daily_order_summary_order_date" + ], + "model.jaffle_shop.metric_daily_revenue_order_count": [ + "model.jaffle_shop.int_daily_order_summary_order_count" + ], + "model.jaffle_shop.metric_daily_revenue_total_revenue": [ + "model.jaffle_shop.int_daily_order_summary_total_revenue" + ], + "model.jaffle_shop.metric_daily_revenue_total_cost": [ + "model.jaffle_shop.int_daily_order_summary_total_cost" + ], + "model.jaffle_shop.metric_daily_revenue_total_margin": [ + "model.jaffle_shop.int_daily_order_summary_total_margin" + ], + "model.jaffle_shop.metric_daily_revenue_total_discounts": [ + "model.jaffle_shop.int_daily_order_summary_total_discounts" + ], + "model.jaffle_shop.metric_daily_revenue_net_revenue": [ + "model.jaffle_shop.int_daily_order_summary_total_discounts", + "model.jaffle_shop.int_daily_order_summary_total_revenue" + ], + "model.jaffle_shop.metric_daily_revenue_avg_order_value": [ + "model.jaffle_shop.int_daily_order_summary_avg_order_value" + ], + "model.jaffle_shop.metric_daily_revenue_unique_customers": [ + "model.jaffle_shop.int_daily_order_summary_unique_customers" + ], + "model.jaffle_shop.metric_daily_revenue_total_items_sold": [ + "model.jaffle_shop.int_daily_order_summary_total_items_sold" + ], + "model.jaffle_shop.products": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.products_product_id": [ + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.products_product_name": [ + "model.jaffle_shop.int_products_with_categories_product_name" + ], + "model.jaffle_shop.products_category_id": [ + "model.jaffle_shop.int_products_with_categories_category_id" + ], + "model.jaffle_shop.products_category_name": [ + "model.jaffle_shop.int_products_with_categories_category_name" + ], + "model.jaffle_shop.products_root_category": [ + "model.jaffle_shop.int_products_with_categories_root_category" + ], + "model.jaffle_shop.products_category_path": [ + "model.jaffle_shop.int_products_with_categories_category_path" + ], + "model.jaffle_shop.products_price": [ + "model.jaffle_shop.int_products_with_categories_price" + ], + "model.jaffle_shop.products_cost": [ + "model.jaffle_shop.int_products_with_categories_cost" + ], + "model.jaffle_shop.products_margin": [ + "model.jaffle_shop.int_product_margins_margin" + ], + "model.jaffle_shop.products_margin_pct": [ + "model.jaffle_shop.int_product_margins_margin_pct" + ], + "model.jaffle_shop.products_created_at": [ + "model.jaffle_shop.int_products_with_categories_created_at" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_week": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_order_month": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.revenue_summary_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.revenue_summary_order_count": [], + "model.jaffle_shop.revenue_summary_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.revenue_summary_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "model.jaffle_shop.revenue_summary_margin": [ + "model.jaffle_shop.int_order_enriched_total_margin" + ], + "model.jaffle_shop.revenue_summary_discounts": [ + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.revenue_summary_net_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal", + "model.jaffle_shop.int_order_enriched_discount_amount" + ], + "model.jaffle_shop.stores": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stores_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id" + ], + "model.jaffle_shop.stores_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.stores_city": [ + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.stores_state": [ + "model.jaffle_shop.int_store_employees_active_state" + ], + "model.jaffle_shop.stores_total_employees": [ + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "model.jaffle_shop.stores_manager_count": [ + "model.jaffle_shop.int_store_employees_active_manager_count" + ], + "model.jaffle_shop.stores_barista_count": [ + "model.jaffle_shop.int_store_employees_active_barista_count" + ], + "model.jaffle_shop.stores_cashier_count": [ + "model.jaffle_shop.int_store_employees_active_cashier_count" + ], + "model.jaffle_shop.stores_cook_count": [ + "model.jaffle_shop.int_store_employees_active_cook_count" + ], + "model.jaffle_shop.stores_earliest_hire": [ + "model.jaffle_shop.int_store_employees_active_earliest_hire" + ], + "model.jaffle_shop.stores_latest_hire": [ + "model.jaffle_shop.int_store_employees_active_latest_hire" + ], + "model.jaffle_shop.metric_customer_retention_monthly": [ + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_retention_cohort_month", + "model.jaffle_shop.customer_retention_months_since_first" + ], + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month": [ + "model.jaffle_shop.customer_retention_cohort_month" + ], + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first": [ + "model.jaffle_shop.customer_retention_months_since_first" + ], + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate": [ + "model.jaffle_shop.customer_retention_customers" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.metric_daily_revenue_order_date", + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_month_start": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.metric_monthly_sales_total_orders": [ + "model.jaffle_shop.metric_daily_revenue_order_count" + ], + "model.jaffle_shop.metric_monthly_sales_total_revenue": [ + "model.jaffle_shop.metric_daily_revenue_total_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_net_revenue": [ + "model.jaffle_shop.metric_daily_revenue_net_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_total_margin": [ + "model.jaffle_shop.metric_daily_revenue_total_margin" + ], + "model.jaffle_shop.metric_monthly_sales_total_discounts": [ + "model.jaffle_shop.metric_daily_revenue_total_discounts" + ], + "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value": [ + "model.jaffle_shop.metric_daily_revenue_avg_order_value" + ], + "model.jaffle_shop.metric_monthly_sales_total_items_sold": [ + "model.jaffle_shop.metric_daily_revenue_total_items_sold" + ], + "model.jaffle_shop.metric_monthly_sales_active_days": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_cohort_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_months_since_first": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_retention_customers": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "seed.jaffle_shop.raw_supply_orders": [], + "seed.jaffle_shop.raw_supply_orders_id": [], + "seed.jaffle_shop.raw_supply_orders_product_id": [], + "seed.jaffle_shop.raw_supply_orders_store_id": [], + "seed.jaffle_shop.raw_supply_orders_quantity": [], + "seed.jaffle_shop.raw_supply_orders_order_date": [], + "seed.jaffle_shop.raw_supply_orders_delivered_date": [], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.int_orders_with_promotions_customer_id" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.int_order_enriched_item_count": [ + "model.jaffle_shop.int_order_totals_item_count" + ], + "model.jaffle_shop.int_order_enriched_total_quantity": [ + "model.jaffle_shop.int_order_totals_total_quantity" + ], + "model.jaffle_shop.int_order_enriched_subtotal": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_order_enriched_total_cost": [ + "model.jaffle_shop.int_order_totals_total_cost" + ], + "model.jaffle_shop.int_order_enriched_total_margin": [ + "model.jaffle_shop.int_order_totals_total_margin" + ], + "model.jaffle_shop.int_order_enriched_category_count": [ + "model.jaffle_shop.int_order_totals_category_count" + ], + "model.jaffle_shop.int_order_enriched_has_promotion": [ + "model.jaffle_shop.int_orders_with_promotions_has_promotion" + ], + "model.jaffle_shop.int_order_enriched_promotion_name": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_name" + ], + "model.jaffle_shop.int_order_enriched_discount_type": [ + "model.jaffle_shop.int_orders_with_promotions_discount_type" + ], + "model.jaffle_shop.int_order_enriched_discount_value": [ + "model.jaffle_shop.int_orders_with_promotions_discount_value" + ], + "model.jaffle_shop.int_order_enriched_total_paid": [ + "model.jaffle_shop.int_order_payments_matched_total_paid" + ], + "model.jaffle_shop.int_order_enriched_payment_count": [ + "model.jaffle_shop.int_order_payments_matched_payment_count" + ], + "model.jaffle_shop.int_order_enriched_payment_status": [ + "model.jaffle_shop.int_order_payments_matched_payment_status" + ], + "model.jaffle_shop.int_order_enriched_discount_amount": [ + "model.jaffle_shop.int_order_totals_subtotal", + "model.jaffle_shop.int_orders_with_promotions_discount_value", + "model.jaffle_shop.int_orders_with_promotions_discount_type" + ], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_order_items_id": [], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "seed.jaffle_shop.raw_order_items_quantity": [], + "seed.jaffle_shop.raw_order_items_unit_price": [], + "model.jaffle_shop.payments_fact": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.orders", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.payments_fact_payment_id": [ + "model.jaffle_shop.stg_payments_payment_id" + ], + "model.jaffle_shop.payments_fact_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "model.jaffle_shop.payments_fact_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.payments_fact_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.payments_fact_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.payments_fact_amount": [ + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.payments_fact_order_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_fulfillment": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.orders", + "model.jaffle_shop.orders_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.order_fulfillment_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.order_fulfillment_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.order_fulfillment_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.order_fulfillment_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_fulfillment_amount": [ + "model.jaffle_shop.orders_amount" + ], + "model.jaffle_shop.order_fulfillment_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.order_fulfillment_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.order_fulfillment_city": [ + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.order_fulfillment_state": [ + "model.jaffle_shop.int_store_employees_active_state" + ], + "model.jaffle_shop.order_fulfillment_store_employee_count": [ + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "model.jaffle_shop.order_items": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.order_items_order_item_id": [ + "model.jaffle_shop.int_order_items_enriched_order_item_id" + ], + "model.jaffle_shop.order_items_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.order_items_product_id": [ + "model.jaffle_shop.int_order_items_enriched_product_id" + ], + "model.jaffle_shop.order_items_product_name": [ + "model.jaffle_shop.int_order_items_enriched_product_name" + ], + "model.jaffle_shop.order_items_category_name": [ + "model.jaffle_shop.int_order_items_enriched_category_name" + ], + "model.jaffle_shop.order_items_root_category": [ + "model.jaffle_shop.int_order_items_enriched_root_category" + ], + "model.jaffle_shop.order_items_category_path": [ + "model.jaffle_shop.int_order_items_enriched_category_path" + ], + "model.jaffle_shop.order_items_quantity": [ + "model.jaffle_shop.int_order_items_enriched_quantity" + ], + "model.jaffle_shop.order_items_unit_price": [ + "model.jaffle_shop.int_order_items_enriched_unit_price" + ], + "model.jaffle_shop.order_items_line_total": [ + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.order_items_cost": [ + "model.jaffle_shop.int_order_items_enriched_cost" + ], + "model.jaffle_shop.order_items_margin_pct": [ + "model.jaffle_shop.int_order_items_enriched_margin_pct" + ], + "model.jaffle_shop.order_items_line_cost": [ + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.order_items_line_margin": [ + "model.jaffle_shop.int_order_items_enriched_line_margin" + ], + "model.jaffle_shop.int_supply_order_costs": [ + "model.jaffle_shop.stg_products", + "model.jaffle_shop.stg_supply_orders", + "model.jaffle_shop.stg_products_product_id", + "model.jaffle_shop.stg_supply_orders_product_id" + ], + "model.jaffle_shop.int_supply_order_costs_supply_order_id": [ + "model.jaffle_shop.stg_supply_orders_supply_order_id" + ], + "model.jaffle_shop.int_supply_order_costs_product_id": [ + "model.jaffle_shop.stg_supply_orders_product_id" + ], + "model.jaffle_shop.int_supply_order_costs_product_name": [ + "model.jaffle_shop.stg_products_product_name" + ], + "model.jaffle_shop.int_supply_order_costs_store_id": [ + "model.jaffle_shop.stg_supply_orders_store_id" + ], + "model.jaffle_shop.int_supply_order_costs_quantity": [ + "model.jaffle_shop.stg_supply_orders_quantity" + ], + "model.jaffle_shop.int_supply_order_costs_unit_cost": [ + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_supply_order_costs_total_cost": [ + "model.jaffle_shop.stg_supply_orders_quantity", + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_supply_order_costs_order_date": [ + "model.jaffle_shop.stg_supply_orders_order_date" + ], + "model.jaffle_shop.int_supply_order_costs_delivered_date": [ + "model.jaffle_shop.stg_supply_orders_delivered_date" + ], + "model.jaffle_shop.int_supply_order_costs_lead_time_days": [ + "model.jaffle_shop.stg_supply_orders_order_date", + "model.jaffle_shop.stg_supply_orders_delivered_date" + ], + "model.jaffle_shop.int_product_ratings": [ + "model.jaffle_shop.int_reviews_with_products_category_name", + "model.jaffle_shop.int_reviews_with_products_product_name", + "model.jaffle_shop.int_reviews_with_products_product_id", + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.int_reviews_with_products_root_category" + ], + "model.jaffle_shop.int_product_ratings_product_id": [ + "model.jaffle_shop.int_reviews_with_products_product_id" + ], + "model.jaffle_shop.int_product_ratings_product_name": [ + "model.jaffle_shop.int_reviews_with_products_product_name" + ], + "model.jaffle_shop.int_product_ratings_category_name": [ + "model.jaffle_shop.int_reviews_with_products_category_name" + ], + "model.jaffle_shop.int_product_ratings_root_category": [ + "model.jaffle_shop.int_reviews_with_products_root_category" + ], + "model.jaffle_shop.int_product_ratings_review_count": [], + "model.jaffle_shop.int_product_ratings_avg_rating": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_product_ratings_positive_reviews": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_product_ratings_negative_reviews": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_product_ratings_min_rating": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.int_product_ratings_max_rating": [ + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_order_items_order_item_id": [ + "seed.jaffle_shop.raw_order_items_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.stg_order_items_quantity": [ + "seed.jaffle_shop.raw_order_items_quantity" + ], + "model.jaffle_shop.stg_order_items_unit_price": [ + "seed.jaffle_shop.raw_order_items_unit_price" + ], + "model.jaffle_shop.store_staffing": [ + "model.jaffle_shop.stg_stores_store_id", + "model.jaffle_shop.stg_employees_store_id", + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_employees" + ], + "model.jaffle_shop.store_staffing_employee_id": [ + "model.jaffle_shop.stg_employees_employee_id" + ], + "model.jaffle_shop.store_staffing_first_name": [ + "model.jaffle_shop.stg_employees_first_name" + ], + "model.jaffle_shop.store_staffing_last_name": [ + "model.jaffle_shop.stg_employees_last_name" + ], + "model.jaffle_shop.store_staffing_role": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.store_staffing_hired_at": [ + "model.jaffle_shop.stg_employees_hired_at" + ], + "model.jaffle_shop.store_staffing_store_id": [ + "model.jaffle_shop.stg_employees_store_id" + ], + "model.jaffle_shop.store_staffing_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.store_staffing_city": [ + "model.jaffle_shop.stg_stores_city" + ], + "model.jaffle_shop.store_staffing_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "model.jaffle_shop.product_categories": [ + "model.jaffle_shop.stg_products", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.product_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy_category_id" + ], + "model.jaffle_shop.product_categories_category_name": [ + "model.jaffle_shop.int_category_hierarchy_category_name" + ], + "model.jaffle_shop.product_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy_parent_category_id" + ], + "model.jaffle_shop.product_categories_root_category": [ + "model.jaffle_shop.int_category_hierarchy_root_category" + ], + "model.jaffle_shop.product_categories_full_path": [ + "model.jaffle_shop.int_category_hierarchy_full_path" + ], + "model.jaffle_shop.product_categories_depth": [ + "model.jaffle_shop.int_category_hierarchy_depth" + ], + "model.jaffle_shop.product_categories_product_count": [], + "model.jaffle_shop.rpt_product_dashboard": [ + "model.jaffle_shop.product_performance" + ], + "model.jaffle_shop.rpt_product_dashboard_total_products": [], + "model.jaffle_shop.rpt_product_dashboard_total_product_revenue": [ + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating": [ + "model.jaffle_shop.product_performance_avg_rating" + ], + "model.jaffle_shop.rpt_product_dashboard_total_units_sold": [ + "model.jaffle_shop.product_performance_total_quantity_sold" + ], + "model.jaffle_shop.rpt_product_dashboard_never_ordered_products": [ + "model.jaffle_shop.product_performance_times_ordered" + ], + "model.jaffle_shop.rpt_product_dashboard_top_product_revenue": [ + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.rpt_product_dashboard_top_product_name": [ + "model.jaffle_shop.product_performance_product_name", + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_promotion_id", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.int_orders_with_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_orders_with_promotions_promotion_name": [ + "model.jaffle_shop.stg_promotions_promotion_name" + ], + "model.jaffle_shop.int_orders_with_promotions_discount_type": [ + "model.jaffle_shop.stg_promotions_discount_type" + ], + "model.jaffle_shop.int_orders_with_promotions_discount_value": [ + "model.jaffle_shop.stg_promotions_discount_value" + ], + "model.jaffle_shop.int_orders_with_promotions_has_promotion": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.inventory_health": [ + "model.jaffle_shop.product_inventory_store_id", + "model.jaffle_shop.int_inventory_movements_store_id", + "model.jaffle_shop.product_inventory_product_id", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.int_inventory_movements_product_id" + ], + "model.jaffle_shop.inventory_health_product_store_key": [ + "model.jaffle_shop.product_inventory_product_store_key" + ], + "model.jaffle_shop.inventory_health_product_id": [ + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.inventory_health_product_name": [ + "model.jaffle_shop.product_inventory_product_name" + ], + "model.jaffle_shop.inventory_health_store_id": [ + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.inventory_health_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.inventory_health_current_stock": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.inventory_health_stock_status": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.inventory_health_total_inbound": [ + "model.jaffle_shop.int_inventory_movements_quantity_in" + ], + "model.jaffle_shop.inventory_health_total_outbound": [ + "model.jaffle_shop.int_inventory_movements_quantity_out" + ], + "model.jaffle_shop.inventory_health_restock_events": [ + "model.jaffle_shop.int_inventory_movements_movement_type" + ], + "model.jaffle_shop.inventory_health_sale_events": [ + "model.jaffle_shop.int_inventory_movements_movement_type" + ], + "model.jaffle_shop.inventory_health_inventory_balance": [ + "model.jaffle_shop.product_inventory_current_stock", + "model.jaffle_shop.int_inventory_movements_quantity_out", + "model.jaffle_shop.int_inventory_movements_quantity_in" + ], + "model.jaffle_shop.inventory_health_avg_units_per_sale": [ + "model.jaffle_shop.int_inventory_movements_quantity_out", + "model.jaffle_shop.int_inventory_movements_movement_type" + ], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_category_name": [ + "seed.jaffle_shop.raw_categories_name" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.supplier_lead_times": [ + "model.jaffle_shop.int_supply_order_costs_store_id", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.int_supply_order_costs_product_id", + "model.jaffle_shop.int_supply_order_costs_product_name" + ], + "model.jaffle_shop.supplier_lead_times_product_id": [ + "model.jaffle_shop.int_supply_order_costs_product_id" + ], + "model.jaffle_shop.supplier_lead_times_product_name": [ + "model.jaffle_shop.int_supply_order_costs_product_name" + ], + "model.jaffle_shop.supplier_lead_times_store_id": [ + "model.jaffle_shop.int_supply_order_costs_store_id" + ], + "model.jaffle_shop.supplier_lead_times_order_count": [], + "model.jaffle_shop.supplier_lead_times_avg_lead_time": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.supplier_lead_times_min_lead_time": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.supplier_lead_times_max_lead_time": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.supplier_lead_times_total_quantity": [ + "model.jaffle_shop.int_supply_order_costs_quantity" + ], + "model.jaffle_shop.supplier_lead_times_total_spend": [ + "model.jaffle_shop.int_supply_order_costs_total_cost" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_items_with_products_product_id", + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_order_items_enriched_order_item_id": [ + "model.jaffle_shop.int_order_items_with_products_order_item_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_order_items_enriched_product_id": [ + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_product_name": [ + "model.jaffle_shop.int_order_items_with_products_product_name" + ], + "model.jaffle_shop.int_order_items_enriched_category_name": [ + "model.jaffle_shop.int_order_items_with_products_category_name" + ], + "model.jaffle_shop.int_order_items_enriched_root_category": [ + "model.jaffle_shop.int_order_items_with_products_root_category" + ], + "model.jaffle_shop.int_order_items_enriched_category_path": [ + "model.jaffle_shop.int_order_items_with_products_category_path" + ], + "model.jaffle_shop.int_order_items_enriched_quantity": [ + "model.jaffle_shop.int_order_items_with_products_quantity" + ], + "model.jaffle_shop.int_order_items_enriched_unit_price": [ + "model.jaffle_shop.int_order_items_with_products_unit_price" + ], + "model.jaffle_shop.int_order_items_enriched_line_total": [ + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_order_items_enriched_cost": [ + "model.jaffle_shop.int_product_margins_cost" + ], + "model.jaffle_shop.int_order_items_enriched_margin_pct": [ + "model.jaffle_shop.int_product_margins_margin_pct" + ], + "model.jaffle_shop.int_order_items_enriched_line_cost": [ + "model.jaffle_shop.int_order_items_with_products_quantity", + "model.jaffle_shop.int_product_margins_cost" + ], + "model.jaffle_shop.int_order_items_enriched_line_margin": [ + "model.jaffle_shop.int_order_items_with_products_quantity", + "model.jaffle_shop.int_product_margins_cost", + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_item_id": [ + "model.jaffle_shop.stg_order_items_order_item_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_name": [ + "model.jaffle_shop.int_products_with_categories_product_name" + ], + "model.jaffle_shop.int_order_items_with_products_category_name": [ + "model.jaffle_shop.int_products_with_categories_category_name" + ], + "model.jaffle_shop.int_order_items_with_products_root_category": [ + "model.jaffle_shop.int_products_with_categories_root_category" + ], + "model.jaffle_shop.int_order_items_with_products_category_path": [ + "model.jaffle_shop.int_products_with_categories_category_path" + ], + "model.jaffle_shop.int_order_items_with_products_quantity": [ + "model.jaffle_shop.stg_order_items_quantity" + ], + "model.jaffle_shop.int_order_items_with_products_unit_price": [ + "model.jaffle_shop.stg_order_items_unit_price" + ], + "model.jaffle_shop.int_order_items_with_products_line_total": [ + "model.jaffle_shop.stg_order_items_unit_price", + "model.jaffle_shop.stg_order_items_quantity" + ], + "seed.jaffle_shop.raw_products": [], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_name": [], + "seed.jaffle_shop.raw_products_category_id": [], + "seed.jaffle_shop.raw_products_price": [], + "seed.jaffle_shop.raw_products_cost": [], + "seed.jaffle_shop.raw_products_created_at": [], + "model.jaffle_shop.order_payment_status": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.order_payment_status_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id" + ], + "model.jaffle_shop.order_payment_status_order_subtotal": [ + "model.jaffle_shop.int_order_payments_matched_order_subtotal" + ], + "model.jaffle_shop.order_payment_status_total_paid": [ + "model.jaffle_shop.int_order_payments_matched_total_paid" + ], + "model.jaffle_shop.order_payment_status_payment_count": [ + "model.jaffle_shop.int_order_payments_matched_payment_count" + ], + "model.jaffle_shop.order_payment_status_payment_method_count": [ + "model.jaffle_shop.int_order_payments_matched_payment_method_count" + ], + "model.jaffle_shop.order_payment_status_payment_status": [ + "model.jaffle_shop.int_order_payments_matched_payment_status" + ], + "model.jaffle_shop.order_payment_status_payment_difference": [ + "model.jaffle_shop.int_order_payments_matched_total_paid", + "model.jaffle_shop.int_order_payments_matched_order_subtotal" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.stg_customers_first_name", + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.stg_customers", + "model.jaffle_shop.stg_customers_customer_id", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.stg_customers_last_name" + ], + "model.jaffle_shop.int_customer_order_history_customer_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.int_customer_order_history_first_name": [ + "model.jaffle_shop.stg_customers_first_name" + ], + "model.jaffle_shop.int_customer_order_history_last_name": [ + "model.jaffle_shop.stg_customers_last_name" + ], + "model.jaffle_shop.int_customer_order_history_total_orders": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_customer_order_history_total_spent": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_customer_order_history_total_margin_generated": [ + "model.jaffle_shop.int_order_enriched_total_margin" + ], + "model.jaffle_shop.int_customer_order_history_avg_order_value": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_customer_order_history_total_items_purchased": [ + "model.jaffle_shop.int_order_enriched_total_quantity" + ], + "model.jaffle_shop.int_customer_order_history_distinct_order_days": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_revenue_store_id" + ], + "model.jaffle_shop.int_store_performance_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id" + ], + "model.jaffle_shop.int_store_performance_store_name": [ + "model.jaffle_shop.int_store_employees_active_store_name" + ], + "model.jaffle_shop.int_store_performance_city": [ + "model.jaffle_shop.int_store_employees_active_city" + ], + "model.jaffle_shop.int_store_performance_state": [ + "model.jaffle_shop.int_store_employees_active_state" + ], + "model.jaffle_shop.int_store_performance_total_employees": [ + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.int_store_revenue_order_count" + ], + "model.jaffle_shop.int_store_performance_unique_customers": [ + "model.jaffle_shop.int_store_revenue_unique_customers" + ], + "model.jaffle_shop.int_store_performance_total_revenue": [ + "model.jaffle_shop.int_store_revenue_total_revenue" + ], + "model.jaffle_shop.int_store_performance_total_margin": [ + "model.jaffle_shop.int_store_revenue_total_margin" + ], + "model.jaffle_shop.int_store_performance_avg_order_value": [ + "model.jaffle_shop.int_store_revenue_avg_order_value" + ], + "model.jaffle_shop.int_store_performance_revenue_per_employee": [ + "model.jaffle_shop.int_store_revenue_total_revenue", + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.int_store_revenue_order_count", + "model.jaffle_shop.int_store_employees_active_total_employees" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "seed.jaffle_shop.raw_categories": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_name": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.product_profitability": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.product_performance_product_id", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.int_supply_order_costs_product_id" + ], + "model.jaffle_shop.product_profitability_product_id": [ + "model.jaffle_shop.product_performance_product_id" + ], + "model.jaffle_shop.product_profitability_product_name": [ + "model.jaffle_shop.product_performance_product_name" + ], + "model.jaffle_shop.product_profitability_category_name": [ + "model.jaffle_shop.product_performance_category_name" + ], + "model.jaffle_shop.product_profitability_total_revenue": [ + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.product_profitability_gross_margin": [ + "model.jaffle_shop.product_performance_total_margin" + ], + "model.jaffle_shop.product_profitability_total_supply_cost": [ + "model.jaffle_shop.int_supply_order_costs_total_cost" + ], + "model.jaffle_shop.product_profitability_net_margin": [ + "model.jaffle_shop.int_supply_order_costs_total_cost", + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.product_profitability_gross_margin_pct": [ + "model.jaffle_shop.product_performance_total_margin", + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.product_profitability_total_quantity_sold": [ + "model.jaffle_shop.product_performance_total_quantity_sold" + ], + "model.jaffle_shop.product_profitability_total_supplied": [ + "model.jaffle_shop.int_supply_order_costs_quantity" + ], + "model.jaffle_shop.product_profitability_avg_rating": [ + "model.jaffle_shop.product_performance_avg_rating" + ], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.stg_promotions_promotion_name": [ + "seed.jaffle_shop.raw_promotions_name" + ], + "model.jaffle_shop.stg_promotions_discount_type": [ + "seed.jaffle_shop.raw_promotions_discount_type" + ], + "model.jaffle_shop.stg_promotions_discount_value": [ + "seed.jaffle_shop.raw_promotions_discount_value" + ], + "model.jaffle_shop.stg_promotions_start_date": [ + "seed.jaffle_shop.raw_promotions_start_date" + ], + "model.jaffle_shop.stg_promotions_end_date": [ + "seed.jaffle_shop.raw_promotions_end_date" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.revenue_summary_order_month", + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.gross_margin_order_month": [ + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.gross_margin_store_id": [ + "model.jaffle_shop.revenue_summary_store_id" + ], + "model.jaffle_shop.gross_margin_total_revenue": [ + "model.jaffle_shop.revenue_summary_revenue" + ], + "model.jaffle_shop.gross_margin_total_cost": [ + "model.jaffle_shop.revenue_summary_cost" + ], + "model.jaffle_shop.gross_margin_total_margin": [ + "model.jaffle_shop.revenue_summary_margin" + ], + "model.jaffle_shop.gross_margin_total_discounts": [ + "model.jaffle_shop.revenue_summary_discounts" + ], + "model.jaffle_shop.gross_margin_total_net_revenue": [ + "model.jaffle_shop.revenue_summary_net_revenue" + ], + "model.jaffle_shop.gross_margin_gross_margin_pct": [ + "model.jaffle_shop.revenue_summary_margin", + "model.jaffle_shop.revenue_summary_revenue" + ], + "model.jaffle_shop.gross_margin_total_orders": [ + "model.jaffle_shop.revenue_summary_order_count" + ], + "model.jaffle_shop.order_returns": [ + "model.jaffle_shop.orders", + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_returns_order_id": [ + "model.jaffle_shop.orders_order_id" + ], + "model.jaffle_shop.order_returns_customer_id": [ + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.order_returns_order_date": [ + "model.jaffle_shop.orders_order_date" + ], + "model.jaffle_shop.order_returns_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_returns_credit_card_amount": [ + "model.jaffle_shop.orders_credit_card_amount" + ], + "model.jaffle_shop.order_returns_coupon_amount": [ + "model.jaffle_shop.orders_coupon_amount" + ], + "model.jaffle_shop.order_returns_bank_transfer_amount": [ + "model.jaffle_shop.orders_bank_transfer_amount" + ], + "model.jaffle_shop.order_returns_gift_card_amount": [ + "model.jaffle_shop.orders_gift_card_amount" + ], + "model.jaffle_shop.order_returns_amount": [ + "model.jaffle_shop.orders_amount" + ], + "model.jaffle_shop.order_returns_return_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.product_performance": [ + "model.jaffle_shop.products", + "model.jaffle_shop.products_product_id", + "model.jaffle_shop.order_items", + "model.jaffle_shop.int_product_ratings", + "model.jaffle_shop.order_items_product_id", + "model.jaffle_shop.int_product_ratings_product_id" + ], + "model.jaffle_shop.product_performance_product_id": [ + "model.jaffle_shop.products_product_id" + ], + "model.jaffle_shop.product_performance_product_name": [ + "model.jaffle_shop.products_product_name" + ], + "model.jaffle_shop.product_performance_category_name": [ + "model.jaffle_shop.products_category_name" + ], + "model.jaffle_shop.product_performance_root_category": [ + "model.jaffle_shop.products_root_category" + ], + "model.jaffle_shop.product_performance_price": [ + "model.jaffle_shop.products_price" + ], + "model.jaffle_shop.product_performance_cost": [ + "model.jaffle_shop.products_cost" + ], + "model.jaffle_shop.product_performance_margin_pct": [ + "model.jaffle_shop.products_margin_pct" + ], + "model.jaffle_shop.product_performance_times_ordered": [], + "model.jaffle_shop.product_performance_total_quantity_sold": [ + "model.jaffle_shop.order_items_quantity" + ], + "model.jaffle_shop.product_performance_total_revenue": [ + "model.jaffle_shop.order_items_line_total" + ], + "model.jaffle_shop.product_performance_total_margin": [ + "model.jaffle_shop.order_items_line_margin" + ], + "model.jaffle_shop.product_performance_review_count": [ + "model.jaffle_shop.int_product_ratings_review_count" + ], + "model.jaffle_shop.product_performance_avg_rating": [ + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.product_performance_positive_reviews": [ + "model.jaffle_shop.int_product_ratings_positive_reviews" + ], + "model.jaffle_shop.product_performance_negative_reviews": [ + "model.jaffle_shop.int_product_ratings_negative_reviews" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_order_enriched_status", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_order_assignments_order_id" + ], + "model.jaffle_shop.int_store_revenue_unique_customers": [ + "model.jaffle_shop.int_store_order_assignments_customer_id" + ], + "model.jaffle_shop.int_store_revenue_total_revenue": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.int_store_revenue_total_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "model.jaffle_shop.int_store_revenue_total_margin": [ + "model.jaffle_shop.int_order_enriched_total_margin" + ], + "model.jaffle_shop.int_store_revenue_avg_order_value": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.store_rankings_store_id": [ + "model.jaffle_shop.store_performance_store_id" + ], + "model.jaffle_shop.store_rankings_store_name": [ + "model.jaffle_shop.store_performance_store_name" + ], + "model.jaffle_shop.store_rankings_city": [ + "model.jaffle_shop.store_performance_city" + ], + "model.jaffle_shop.store_rankings_state": [ + "model.jaffle_shop.store_performance_state" + ], + "model.jaffle_shop.store_rankings_total_revenue": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.store_rankings_total_margin": [ + "model.jaffle_shop.store_performance_total_margin" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.store_rankings_unique_customers": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.store_rankings_revenue_per_employee": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_revenue_rank": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.store_rankings_margin_rank": [ + "model.jaffle_shop.store_performance_total_margin" + ], + "model.jaffle_shop.store_rankings_order_count_rank": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.store_rankings_efficiency_rank": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_customer_reach_rank": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.customer_acquisition": [ + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_acquisition_customer_id": [ + "model.jaffle_shop.int_customer_first_last_orders_customer_id" + ], + "model.jaffle_shop.customer_acquisition_first_order_date": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.customer_acquisition_acquired_via_promotion": [ + "model.jaffle_shop.int_order_enriched_has_promotion" + ], + "model.jaffle_shop.customer_acquisition_acquisition_promotion": [ + "model.jaffle_shop.int_order_enriched_promotion_name" + ], + "model.jaffle_shop.customer_acquisition_first_order_value": [ + "model.jaffle_shop.int_order_enriched_subtotal" + ], + "model.jaffle_shop.customer_acquisition_first_order_items": [ + "model.jaffle_shop.int_order_enriched_item_count" + ], + "model.jaffle_shop.customer_acquisition_acquisition_month": [ + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.supply_orders_fact": [ + "model.jaffle_shop.int_supply_order_costs" + ], + "model.jaffle_shop.supply_orders_fact_supply_order_id": [ + "model.jaffle_shop.int_supply_order_costs_supply_order_id" + ], + "model.jaffle_shop.supply_orders_fact_product_id": [ + "model.jaffle_shop.int_supply_order_costs_product_id" + ], + "model.jaffle_shop.supply_orders_fact_product_name": [ + "model.jaffle_shop.int_supply_order_costs_product_name" + ], + "model.jaffle_shop.supply_orders_fact_store_id": [ + "model.jaffle_shop.int_supply_order_costs_store_id" + ], + "model.jaffle_shop.supply_orders_fact_quantity": [ + "model.jaffle_shop.int_supply_order_costs_quantity" + ], + "model.jaffle_shop.supply_orders_fact_unit_cost": [ + "model.jaffle_shop.int_supply_order_costs_unit_cost" + ], + "model.jaffle_shop.supply_orders_fact_total_cost": [ + "model.jaffle_shop.int_supply_order_costs_total_cost" + ], + "model.jaffle_shop.supply_orders_fact_order_date": [ + "model.jaffle_shop.int_supply_order_costs_order_date" + ], + "model.jaffle_shop.supply_orders_fact_delivered_date": [ + "model.jaffle_shop.int_supply_order_costs_delivered_date" + ], + "model.jaffle_shop.supply_orders_fact_lead_time_days": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.metric_product_sales_daily": [ + "model.jaffle_shop.order_items_product_name", + "model.jaffle_shop.order_items_order_id", + "model.jaffle_shop.order_items", + "model.jaffle_shop.order_items_category_name", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id", + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.order_items_product_id" + ], + "model.jaffle_shop.metric_product_sales_daily_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.metric_product_sales_daily_product_id": [ + "model.jaffle_shop.order_items_product_id" + ], + "model.jaffle_shop.metric_product_sales_daily_product_name": [ + "model.jaffle_shop.order_items_product_name" + ], + "model.jaffle_shop.metric_product_sales_daily_category_name": [ + "model.jaffle_shop.order_items_category_name" + ], + "model.jaffle_shop.metric_product_sales_daily_units_sold": [ + "model.jaffle_shop.order_items_quantity" + ], + "model.jaffle_shop.metric_product_sales_daily_revenue": [ + "model.jaffle_shop.order_items_line_total" + ], + "model.jaffle_shop.metric_product_sales_daily_margin": [ + "model.jaffle_shop.order_items_line_margin" + ], + "model.jaffle_shop.metric_product_sales_daily_order_count": [ + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.int_product_stock_levels_store_id", + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_stores_store_id", + "model.jaffle_shop.stg_products_product_id", + "model.jaffle_shop.int_product_stock_levels", + "model.jaffle_shop.int_product_stock_levels_product_id", + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.product_inventory_product_store_key": [ + "model.jaffle_shop.int_product_stock_levels_product_store_key" + ], + "model.jaffle_shop.product_inventory_product_id": [ + "model.jaffle_shop.int_product_stock_levels_product_id" + ], + "model.jaffle_shop.product_inventory_product_name": [ + "model.jaffle_shop.stg_products_product_name" + ], + "model.jaffle_shop.product_inventory_store_id": [ + "model.jaffle_shop.int_product_stock_levels_store_id" + ], + "model.jaffle_shop.product_inventory_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.product_inventory_total_received": [ + "model.jaffle_shop.int_product_stock_levels_total_received" + ], + "model.jaffle_shop.product_inventory_total_sold": [ + "model.jaffle_shop.int_product_stock_levels_total_sold" + ], + "model.jaffle_shop.product_inventory_current_stock": [ + "model.jaffle_shop.int_product_stock_levels_current_stock" + ], + "model.jaffle_shop.product_inventory_last_restock_date": [ + "model.jaffle_shop.int_product_stock_levels_last_restock_date" + ], + "model.jaffle_shop.product_inventory_last_sale_date": [ + "model.jaffle_shop.int_product_stock_levels_last_sale_date" + ], + "model.jaffle_shop.product_inventory_stock_status": [ + "model.jaffle_shop.int_product_stock_levels_current_stock" + ], + "model.jaffle_shop.new_orders": ["model.jaffle_shop.stg_orders"], + "model.jaffle_shop.new_orders_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.new_orders_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.new_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.new_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "seed.jaffle_shop.raw_employees": [], + "seed.jaffle_shop.raw_employees_id": [], + "seed.jaffle_shop.raw_employees_store_id": [], + "seed.jaffle_shop.raw_employees_first_name": [], + "seed.jaffle_shop.raw_employees_last_name": [], + "seed.jaffle_shop.raw_employees_role": [], + "seed.jaffle_shop.raw_employees_hired_at": [], + "model.jaffle_shop.reorder_recommendations": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.product_performance_product_id", + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.reorder_recommendations_product_id": [ + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.reorder_recommendations_product_name": [ + "model.jaffle_shop.product_inventory_product_name" + ], + "model.jaffle_shop.reorder_recommendations_store_id": [ + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.reorder_recommendations_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.reorder_recommendations_current_stock": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.reorder_recommendations_stock_status": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.reorder_recommendations_last_restock_date": [ + "model.jaffle_shop.product_inventory_last_restock_date" + ], + "model.jaffle_shop.reorder_recommendations_total_quantity_sold": [ + "model.jaffle_shop.product_performance_total_quantity_sold" + ], + "model.jaffle_shop.reorder_recommendations_times_ordered": [ + "model.jaffle_shop.product_performance_times_ordered" + ], + "model.jaffle_shop.reorder_recommendations_reorder_priority": [ + "model.jaffle_shop.product_performance_times_ordered", + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_payments_payment_id": [ + "seed.jaffle_shop.raw_payments_id" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "seed.jaffle_shop.raw_payments_payment_method" + ], + "model.jaffle_shop.stg_payments_amount": [ + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.stg_customers", + "model.jaffle_shop.stg_customers_customer_id", + "model.jaffle_shop.stg_orders_customer_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.customers_customer_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "model.jaffle_shop.customers_first_name": [ + "model.jaffle_shop.stg_customers_first_name" + ], + "model.jaffle_shop.customers_last_name": [ + "model.jaffle_shop.stg_customers_last_name" + ], + "model.jaffle_shop.customers_first_order": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.customers_most_recent_order": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "model.jaffle_shop.customers_number_of_orders": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.customers_customer_lifetime_value": [ + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.cost_analysis": [ + "model.jaffle_shop.product_profitability_product_id", + "model.jaffle_shop.int_supply_order_costs_product_name", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.product_profitability", + "model.jaffle_shop.int_supply_order_costs_product_id" + ], + "model.jaffle_shop.cost_analysis_product_id": [ + "model.jaffle_shop.product_profitability_product_id" + ], + "model.jaffle_shop.cost_analysis_product_name": [ + "model.jaffle_shop.product_profitability_product_name" + ], + "model.jaffle_shop.cost_analysis_category_name": [ + "model.jaffle_shop.product_profitability_category_name" + ], + "model.jaffle_shop.cost_analysis_total_revenue": [ + "model.jaffle_shop.product_profitability_total_revenue" + ], + "model.jaffle_shop.cost_analysis_gross_margin": [ + "model.jaffle_shop.product_profitability_gross_margin" + ], + "model.jaffle_shop.cost_analysis_total_supply_spend": [ + "model.jaffle_shop.int_supply_order_costs_total_cost" + ], + "model.jaffle_shop.cost_analysis_avg_unit_cost": [ + "model.jaffle_shop.int_supply_order_costs_unit_cost" + ], + "model.jaffle_shop.cost_analysis_avg_lead_time": [ + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.cost_analysis_supply_order_count": [], + "model.jaffle_shop.cost_analysis_total_quantity_sold": [ + "model.jaffle_shop.product_profitability_total_quantity_sold" + ], + "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold": [ + "model.jaffle_shop.int_supply_order_costs_total_cost", + "model.jaffle_shop.product_profitability_total_quantity_sold" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "seed.jaffle_shop.raw_orders_user_id" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "seed.jaffle_shop.raw_orders_order_date" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.customer_review_summary": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating", + "model.jaffle_shop.stg_reviews", + "model.jaffle_shop.int_customer_review_activity_last_review_date", + "model.jaffle_shop.int_customer_review_activity_first_review_date", + "model.jaffle_shop.int_customer_review_activity_products_reviewed", + "model.jaffle_shop.int_product_ratings", + "model.jaffle_shop.int_customer_review_activity_customer_id", + "model.jaffle_shop.stg_reviews_product_id", + "model.jaffle_shop.int_customer_review_activity_review_count", + "model.jaffle_shop.int_product_ratings_product_id", + "model.jaffle_shop.int_customer_review_activity", + "model.jaffle_shop.stg_reviews_customer_id" + ], + "model.jaffle_shop.customer_review_summary_customer_id": [ + "model.jaffle_shop.int_customer_review_activity_customer_id" + ], + "model.jaffle_shop.customer_review_summary_review_count": [ + "model.jaffle_shop.int_customer_review_activity_review_count" + ], + "model.jaffle_shop.customer_review_summary_customer_avg_rating": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating" + ], + "model.jaffle_shop.customer_review_summary_products_reviewed": [ + "model.jaffle_shop.int_customer_review_activity_products_reviewed" + ], + "model.jaffle_shop.customer_review_summary_first_review_date": [ + "model.jaffle_shop.int_customer_review_activity_first_review_date" + ], + "model.jaffle_shop.customer_review_summary_last_review_date": [ + "model.jaffle_shop.int_customer_review_activity_last_review_date" + ], + "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed": [ + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.customer_review_summary_rating_tendency": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating", + "model.jaffle_shop.int_product_ratings_avg_rating" + ], + "model.jaffle_shop.int_customer_payment_methods": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_orders_customer_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.int_customer_payment_methods_customer_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "model.jaffle_shop.int_customer_payment_methods_credit_card_total": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.int_customer_payment_methods_coupon_total": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.int_customer_payment_methods_gift_card_total": [ + "model.jaffle_shop.stg_payments_payment_method", + "model.jaffle_shop.stg_payments_amount" + ], + "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "model.jaffle_shop.stg_stores_store_id": [ + "seed.jaffle_shop.raw_stores_id" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "seed.jaffle_shop.raw_stores_name" + ], + "model.jaffle_shop.stg_stores_city": ["seed.jaffle_shop.raw_stores_city"], + "model.jaffle_shop.stg_stores_state": [ + "seed.jaffle_shop.raw_stores_state" + ], + "model.jaffle_shop.stg_stores_opened_at": [ + "seed.jaffle_shop.raw_stores_opened_at" + ], + "seed.jaffle_shop.raw_customers": [], + "seed.jaffle_shop.raw_customers_id": [], + "seed.jaffle_shop.raw_customers_first_name": [], + "seed.jaffle_shop.raw_customers_last_name": [], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_stores_store_name", + "model.jaffle_shop.stg_employees_store_id", + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_stores_store_id", + "model.jaffle_shop.stg_employees", + "model.jaffle_shop.stg_stores_state", + "model.jaffle_shop.stg_stores_city" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "model.jaffle_shop.int_store_employees_active_store_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "model.jaffle_shop.int_store_employees_active_city": [ + "model.jaffle_shop.stg_stores_city" + ], + "model.jaffle_shop.int_store_employees_active_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "model.jaffle_shop.int_store_employees_active_total_employees": [], + "model.jaffle_shop.int_store_employees_active_manager_count": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.int_store_employees_active_barista_count": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.int_store_employees_active_cashier_count": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.int_store_employees_active_cook_count": [ + "model.jaffle_shop.stg_employees_role" + ], + "model.jaffle_shop.int_store_employees_active_earliest_hire": [ + "model.jaffle_shop.stg_employees_hired_at" + ], + "model.jaffle_shop.int_store_employees_active_latest_hire": [ + "model.jaffle_shop.stg_employees_hired_at" + ], + "model.jaffle_shop.stg_customers": ["seed.jaffle_shop.raw_customers"], + "model.jaffle_shop.stg_customers_customer_id": [ + "seed.jaffle_shop.raw_customers_id" + ], + "model.jaffle_shop.stg_customers_first_name": [ + "seed.jaffle_shop.raw_customers_first_name" + ], + "model.jaffle_shop.stg_customers_last_name": [ + "seed.jaffle_shop.raw_customers_last_name" + ], + "model.jaffle_shop.stg_customers_full_name": [ + "seed.jaffle_shop.raw_customers_first_name", + "seed.jaffle_shop.raw_customers_last_name" + ], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_payments_id": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_payment_method": [], + "seed.jaffle_shop.raw_payments_amount": [], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_product_name": [ + "seed.jaffle_shop.raw_products_name" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.stg_products_price_cents": [ + "seed.jaffle_shop.raw_products_price" + ], + "model.jaffle_shop.stg_products_cost_cents": [ + "seed.jaffle_shop.raw_products_cost" + ], + "model.jaffle_shop.stg_products_price": [ + "seed.jaffle_shop.raw_products_price" + ], + "model.jaffle_shop.stg_products_cost": [ + "seed.jaffle_shop.raw_products_cost" + ], + "model.jaffle_shop.stg_products_created_at": [ + "seed.jaffle_shop.raw_products_created_at" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.store_rankings_store_id", + "model.jaffle_shop.metric_store_daily_store_id", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_inventory_store_id", + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.rpt_store_dashboard_store_id": [ + "model.jaffle_shop.store_rankings_store_id" + ], + "model.jaffle_shop.rpt_store_dashboard_store_name": [ + "model.jaffle_shop.store_rankings_store_name" + ], + "model.jaffle_shop.rpt_store_dashboard_city": [ + "model.jaffle_shop.store_rankings_city" + ], + "model.jaffle_shop.rpt_store_dashboard_state": [ + "model.jaffle_shop.store_rankings_state" + ], + "model.jaffle_shop.rpt_store_dashboard_total_revenue": [ + "model.jaffle_shop.store_rankings_total_revenue" + ], + "model.jaffle_shop.rpt_store_dashboard_total_margin": [ + "model.jaffle_shop.store_rankings_total_margin" + ], + "model.jaffle_shop.rpt_store_dashboard_order_count": [ + "model.jaffle_shop.store_rankings_order_count" + ], + "model.jaffle_shop.rpt_store_dashboard_unique_customers": [ + "model.jaffle_shop.store_rankings_unique_customers" + ], + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee": [ + "model.jaffle_shop.store_rankings_revenue_per_employee" + ], + "model.jaffle_shop.rpt_store_dashboard_revenue_rank": [ + "model.jaffle_shop.store_rankings_revenue_rank" + ], + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank": [ + "model.jaffle_shop.store_rankings_efficiency_rank" + ], + "model.jaffle_shop.rpt_store_dashboard_total_stock_units": [ + "model.jaffle_shop.store_inventory_total_stock_units" + ], + "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products": [ + "model.jaffle_shop.store_inventory_out_of_stock_products" + ], + "model.jaffle_shop.rpt_store_dashboard_low_stock_products": [ + "model.jaffle_shop.store_inventory_low_stock_products" + ], + "model.jaffle_shop.rpt_store_dashboard_active_days": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue": [ + "model.jaffle_shop.metric_store_daily_revenue" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.product_inventory_store_id", + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.store_inventory_store_id": [ + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.store_inventory_store_name": [ + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.store_inventory_unique_products": [ + "model.jaffle_shop.product_inventory_product_id" + ], + "model.jaffle_shop.store_inventory_total_stock_units": [ + "model.jaffle_shop.product_inventory_current_stock" + ], + "model.jaffle_shop.store_inventory_out_of_stock_products": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.store_inventory_low_stock_products": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.store_inventory_adequate_stock_products": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.store_inventory_well_stocked_products": [ + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.rpt_executive_dashboard_month_start": [ + "model.jaffle_shop.metric_monthly_sales_month_start" + ], + "model.jaffle_shop.rpt_executive_dashboard_total_orders": [ + "model.jaffle_shop.metric_monthly_sales_total_orders" + ], + "model.jaffle_shop.rpt_executive_dashboard_total_revenue": [ + "model.jaffle_shop.metric_monthly_sales_total_revenue" + ], + "model.jaffle_shop.rpt_executive_dashboard_net_revenue": [ + "model.jaffle_shop.metric_monthly_sales_net_revenue" + ], + "model.jaffle_shop.rpt_executive_dashboard_total_margin": [ + "model.jaffle_shop.metric_monthly_sales_total_margin" + ], + "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct": [ + "model.jaffle_shop.gross_margin_total_margin", + "model.jaffle_shop.gross_margin_total_revenue" + ], + "model.jaffle_shop.rpt_executive_dashboard_total_items_sold": [ + "model.jaffle_shop.metric_monthly_sales_total_items_sold" + ], + "model.jaffle_shop.rpt_executive_dashboard_active_days": [ + "model.jaffle_shop.metric_monthly_sales_active_days" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.int_order_enriched_customer_id", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customer_lifetime_value_customer_id", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_customer_review_activity_customer_id", + "model.jaffle_shop.customer_segments_final_customer_id", + "model.jaffle_shop.int_customer_review_activity" + ], + "model.jaffle_shop.customer_360_customer_id": [ + "model.jaffle_shop.customers_customer_id" + ], + "model.jaffle_shop.customer_360_first_name": [ + "model.jaffle_shop.customers_first_name" + ], + "model.jaffle_shop.customer_360_last_name": [ + "model.jaffle_shop.customers_last_name" + ], + "model.jaffle_shop.customer_360_first_order": [ + "model.jaffle_shop.customers_first_order" + ], + "model.jaffle_shop.customer_360_most_recent_order": [ + "model.jaffle_shop.customers_most_recent_order" + ], + "model.jaffle_shop.customer_360_number_of_orders": [ + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.customer_360_customer_lifetime_value": [ + "model.jaffle_shop.customers_customer_lifetime_value" + ], + "model.jaffle_shop.customer_360_monthly_value": [ + "model.jaffle_shop.customer_lifetime_value_monthly_value" + ], + "model.jaffle_shop.customer_360_avg_order_value": [ + "model.jaffle_shop.customer_lifetime_value_avg_order_value" + ], + "model.jaffle_shop.customer_360_customer_tenure_days": [ + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days" + ], + "model.jaffle_shop.customer_360_days_since_last_order": [ + "model.jaffle_shop.customer_lifetime_value_days_since_last_order" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.customer_360_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.customer_360_review_count": [ + "model.jaffle_shop.int_customer_review_activity_review_count" + ], + "model.jaffle_shop.customer_360_avg_review_rating": [ + "model.jaffle_shop.int_customer_review_activity_avg_rating" + ], + "model.jaffle_shop.customer_360_months_active": [ + "model.jaffle_shop.int_order_enriched_order_date", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date" + ], + "model.jaffle_shop.int_promotion_effectiveness": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_name", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions_discount_type", + "model.jaffle_shop.int_orders_with_promotions_has_promotion" + ], + "model.jaffle_shop.int_promotion_effectiveness_has_promotion": [ + "model.jaffle_shop.int_orders_with_promotions_has_promotion" + ], + "model.jaffle_shop.int_promotion_effectiveness_promotion_name": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_name" + ], + "model.jaffle_shop.int_promotion_effectiveness_discount_type": [ + "model.jaffle_shop.int_orders_with_promotions_discount_type" + ], + "model.jaffle_shop.int_promotion_effectiveness_order_count": [], + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_promotion_effectiveness_total_revenue": [ + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order": [ + "model.jaffle_shop.int_order_totals_item_count" + ], + "model.jaffle_shop.int_promotion_effectiveness_avg_margin": [ + "model.jaffle_shop.int_order_totals_total_margin" + ], + "model.jaffle_shop.rpt_sales_dashboard": [ + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.rpt_sales_dashboard_week_start": [ + "model.jaffle_shop.metric_weekly_sales_week_start" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_orders": [ + "model.jaffle_shop.metric_weekly_sales_total_orders" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_revenue": [ + "model.jaffle_shop.metric_weekly_sales_total_revenue" + ], + "model.jaffle_shop.rpt_sales_dashboard_net_revenue": [ + "model.jaffle_shop.metric_weekly_sales_net_revenue" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_margin": [ + "model.jaffle_shop.metric_weekly_sales_total_margin" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_discounts": [ + "model.jaffle_shop.metric_weekly_sales_total_discounts" + ], + "model.jaffle_shop.rpt_sales_dashboard_total_items_sold": [ + "model.jaffle_shop.metric_weekly_sales_total_items_sold" + ], + "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value": [ + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value" + ], + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue": [ + "model.jaffle_shop.metric_weekly_sales_total_revenue", + "model.jaffle_shop.metric_weekly_sales_week_start" + ], + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct": [ + "model.jaffle_shop.metric_weekly_sales_total_revenue", + "model.jaffle_shop.metric_weekly_sales_week_start" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_products_with_categories_product_name": [ + "model.jaffle_shop.stg_products_product_name" + ], + "model.jaffle_shop.int_products_with_categories_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_category_name": [ + "model.jaffle_shop.int_category_hierarchy_category_name" + ], + "model.jaffle_shop.int_products_with_categories_root_category": [ + "model.jaffle_shop.int_category_hierarchy_root_category" + ], + "model.jaffle_shop.int_products_with_categories_category_path": [ + "model.jaffle_shop.int_category_hierarchy_full_path" + ], + "model.jaffle_shop.int_products_with_categories_category_depth": [ + "model.jaffle_shop.int_category_hierarchy_depth" + ], + "model.jaffle_shop.int_products_with_categories_price": [ + "model.jaffle_shop.stg_products_price" + ], + "model.jaffle_shop.int_products_with_categories_cost": [ + "model.jaffle_shop.stg_products_cost" + ], + "model.jaffle_shop.int_products_with_categories_created_at": [ + "model.jaffle_shop.stg_products_created_at" + ], + "seed.jaffle_shop.raw_reviews": [], + "seed.jaffle_shop.raw_reviews_id": [], + "seed.jaffle_shop.raw_reviews_order_id": [], + "seed.jaffle_shop.raw_reviews_product_id": [], + "seed.jaffle_shop.raw_reviews_customer_id": [], + "seed.jaffle_shop.raw_reviews_rating": [], + "seed.jaffle_shop.raw_reviews_review_date": [] + }, + "child_map": { + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.customer_360_number_of_orders": [ + "model.jaffle_shop.rpt_customer_dashboard_active_customers", + "model.jaffle_shop.rpt_customer_dashboard_avg_orders_per_customer" + ], + "model.jaffle_shop.customer_360_customer_lifetime_value": [ + "model.jaffle_shop.rpt_customer_dashboard_avg_clv" + ], + "model.jaffle_shop.customer_360_customer_segment": [ + "model.jaffle_shop.rpt_customer_dashboard_lost_customers", + "model.jaffle_shop.rpt_customer_dashboard_champion_customers", + "model.jaffle_shop.rpt_customer_dashboard_at_risk_customers" + ], + "model.jaffle_shop.customer_360_review_count": [ + "model.jaffle_shop.rpt_customer_dashboard_avg_reviews_per_customer" + ], + "model.jaffle_shop.int_order_enriched_order_date": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.metric_daily_orders", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.int_customer_order_history_distinct_order_days", + "model.jaffle_shop.revenue_summary_order_week", + "model.jaffle_shop.int_customer_first_last_orders_first_order_date", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.customer_retention_months_since_first", + "model.jaffle_shop.int_customer_first_last_orders_last_order_date", + "model.jaffle_shop.int_daily_order_summary_order_date", + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.metric_product_sales_daily_order_date", + "model.jaffle_shop.customer_360_months_active", + "model.jaffle_shop.int_daily_order_summary", + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order", + "model.jaffle_shop.revenue_summary_order_date", + "model.jaffle_shop.order_discounts_order_date", + "model.jaffle_shop.metric_daily_orders_order_date", + "model.jaffle_shop.revenue_summary_order_month" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.metric_daily_orders", + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.order_discounts", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.metric_daily_orders_shipped_orders", + "model.jaffle_shop.metric_daily_orders_returned_orders", + "model.jaffle_shop.metric_daily_orders_completed_orders", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.metric_daily_orders_placed_orders" + ], + "model.jaffle_shop.int_order_enriched_has_promotion": [ + "model.jaffle_shop.order_discounts_has_promotion", + "model.jaffle_shop.metric_daily_orders_promoted_orders", + "model.jaffle_shop.customer_acquisition_acquired_via_promotion", + "model.jaffle_shop.int_daily_order_summary_promoted_orders", + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.int_order_enriched_item_count": [ + "model.jaffle_shop.metric_daily_orders_avg_items_per_order", + "model.jaffle_shop.customer_acquisition_first_order_items" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_id": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_retention_customers", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_acquisition_customer_id" + ], + "model.jaffle_shop.int_customer_order_history_customer_id": [ + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.int_customer_segments_customer_id" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_cohorts", + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.int_customer_order_history_total_orders": [ + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_total_orders", + "model.jaffle_shop.int_customer_segments_customer_segment", + "model.jaffle_shop.int_customer_segments_frequency_score" + ], + "model.jaffle_shop.int_customer_order_history_first_name": [ + "model.jaffle_shop.int_customer_segments_first_name" + ], + "model.jaffle_shop.int_customer_order_history_last_name": [ + "model.jaffle_shop.int_customer_segments_last_name" + ], + "model.jaffle_shop.int_customer_order_history_total_spent": [ + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_total_spent", + "model.jaffle_shop.int_customer_segments_customer_segment", + "model.jaffle_shop.int_customer_segments_monetary_score" + ], + "model.jaffle_shop.int_customer_first_last_orders_days_since_last_order": [ + "model.jaffle_shop.int_customer_segments_days_since_last_order", + "model.jaffle_shop.int_customer_segments_recency_score", + "model.jaffle_shop.customer_lifetime_value_days_since_last_order", + "model.jaffle_shop.int_customer_segments_rfm_total", + "model.jaffle_shop.int_customer_segments_customer_segment" + ], + "model.jaffle_shop.product_inventory": [ + "model.jaffle_shop.inventory_health", + "model.jaffle_shop.metric_inventory_daily", + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.store_inventory" + ], + "model.jaffle_shop.product_inventory_product_id": [ + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.reorder_recommendations_product_id", + "model.jaffle_shop.metric_inventory_daily_total_products_tracked", + "model.jaffle_shop.inventory_health", + "model.jaffle_shop.inventory_health_product_id", + "model.jaffle_shop.store_inventory_unique_products" + ], + "model.jaffle_shop.product_inventory_store_id": [ + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.reorder_recommendations_store_id", + "model.jaffle_shop.inventory_health_store_id", + "model.jaffle_shop.inventory_health", + "model.jaffle_shop.store_inventory_store_id", + "model.jaffle_shop.metric_inventory_daily_total_stores" + ], + "model.jaffle_shop.product_inventory_current_stock": [ + "model.jaffle_shop.metric_inventory_daily_total_stock_units", + "model.jaffle_shop.metric_inventory_daily_avg_stock_per_product_store", + "model.jaffle_shop.inventory_health_inventory_balance", + "model.jaffle_shop.store_inventory_total_stock_units", + "model.jaffle_shop.inventory_health_current_stock", + "model.jaffle_shop.reorder_recommendations_current_stock", + "model.jaffle_shop.reorder_recommendations_suggested_reorder_qty" + ], + "model.jaffle_shop.product_inventory_stock_status": [ + "model.jaffle_shop.store_inventory_out_of_stock_products", + "model.jaffle_shop.metric_inventory_daily_out_of_stock_count", + "model.jaffle_shop.reorder_recommendations_reorder_priority", + "model.jaffle_shop.metric_inventory_daily_well_stocked_count", + "model.jaffle_shop.reorder_recommendations_stock_status", + "model.jaffle_shop.metric_inventory_daily_low_stock_count", + "model.jaffle_shop.metric_inventory_daily_adequate_count", + "model.jaffle_shop.store_inventory_low_stock_products", + "model.jaffle_shop.store_inventory_adequate_stock_products", + "model.jaffle_shop.inventory_health_stock_status", + "model.jaffle_shop.store_inventory_well_stocked_products" + ], + "model.jaffle_shop.int_inventory_movements": [ + "model.jaffle_shop.inventory_health", + "model.jaffle_shop.int_product_stock_levels" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.metric_product_sales_daily_order_count", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.order_discounts_order_id", + "model.jaffle_shop.int_customer_order_history_total_orders", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_customer_id": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_first_last_orders_customer_id", + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_daily_order_summary_unique_customers", + "model.jaffle_shop.order_discounts_customer_id" + ], + "model.jaffle_shop.int_order_enriched_subtotal": [ + "model.jaffle_shop.order_discounts_discount_pct_of_order", + "model.jaffle_shop.int_customer_order_history_total_spent", + "model.jaffle_shop.int_daily_order_summary_total_revenue", + "model.jaffle_shop.int_store_revenue_avg_order_value", + "model.jaffle_shop.int_customer_order_history_avg_order_value", + "model.jaffle_shop.int_daily_order_summary_avg_order_value", + "model.jaffle_shop.order_discounts_net_revenue", + "model.jaffle_shop.int_store_revenue_total_revenue", + "model.jaffle_shop.revenue_summary_revenue", + "model.jaffle_shop.customer_acquisition_first_order_value", + "model.jaffle_shop.revenue_summary_net_revenue", + "model.jaffle_shop.order_discounts_subtotal" + ], + "model.jaffle_shop.int_order_enriched_promotion_name": [ + "model.jaffle_shop.order_discounts_promotion_name", + "model.jaffle_shop.customer_acquisition_acquisition_promotion" + ], + "model.jaffle_shop.int_order_enriched_discount_type": [ + "model.jaffle_shop.order_discounts_discount_type" + ], + "model.jaffle_shop.int_order_enriched_discount_value": [ + "model.jaffle_shop.order_discounts_discount_value" + ], + "model.jaffle_shop.int_order_enriched_discount_amount": [ + "model.jaffle_shop.order_discounts_discount_amount", + "model.jaffle_shop.order_discounts_discount_pct_of_order", + "model.jaffle_shop.order_discounts_net_revenue", + "model.jaffle_shop.revenue_summary_discounts", + "model.jaffle_shop.int_daily_order_summary_total_discounts", + "model.jaffle_shop.revenue_summary_net_revenue" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.orders", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.payments_fact" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.payments_fact_order_id", + "model.jaffle_shop.orders", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_order_payments_matched", + "model.jaffle_shop.payments_fact" + ], + "model.jaffle_shop.int_order_totals_subtotal": [ + "model.jaffle_shop.int_order_payments_matched_payment_status", + "model.jaffle_shop.int_order_enriched_discount_amount", + "model.jaffle_shop.int_order_payments_matched_order_subtotal", + "model.jaffle_shop.int_order_enriched_subtotal", + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value", + "model.jaffle_shop.int_promotion_effectiveness_total_revenue" + ], + "model.jaffle_shop.stg_payments_amount": [ + "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total", + "model.jaffle_shop.orders_gift_card_amount", + "model.jaffle_shop.payments_fact_amount", + "model.jaffle_shop.int_customer_payment_methods_credit_card_total", + "model.jaffle_shop.int_order_payments_matched_total_paid", + "model.jaffle_shop.int_order_payments_matched_payment_status", + "model.jaffle_shop.int_customer_payment_methods_gift_card_total", + "model.jaffle_shop.orders_credit_card_amount", + "model.jaffle_shop.orders_bank_transfer_amount", + "model.jaffle_shop.int_customer_payment_methods_coupon_total", + "model.jaffle_shop.orders_coupon_amount", + "model.jaffle_shop.customers_customer_lifetime_value", + "model.jaffle_shop.orders_amount" + ], + "model.jaffle_shop.stg_payments_payment_method": [ + "model.jaffle_shop.int_customer_payment_methods_bank_transfer_total", + "model.jaffle_shop.orders_gift_card_amount", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.int_customer_payment_methods_credit_card_total", + "model.jaffle_shop.int_order_payments_matched_payment_method_count", + "model.jaffle_shop.int_customer_payment_methods_preferred_payment_method", + "model.jaffle_shop.int_customer_payment_methods_gift_card_total", + "model.jaffle_shop.payments_fact_payment_method", + "model.jaffle_shop.orders_credit_card_amount", + "model.jaffle_shop.orders_bank_transfer_amount", + "model.jaffle_shop.int_customer_payment_methods_coupon_total", + "model.jaffle_shop.orders_coupon_amount" + ], + "model.jaffle_shop.stg_reviews": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.int_customer_review_activity" + ], + "model.jaffle_shop.stg_reviews_customer_id": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.int_customer_review_activity", + "model.jaffle_shop.int_reviews_with_products_customer_id", + "model.jaffle_shop.int_customer_review_activity_customer_id" + ], + "model.jaffle_shop.stg_reviews_rating": [ + "model.jaffle_shop.int_customer_review_activity_max_rating", + "model.jaffle_shop.int_customer_review_activity_min_rating", + "model.jaffle_shop.int_customer_review_activity_avg_rating", + "model.jaffle_shop.int_reviews_with_products_rating" + ], + "model.jaffle_shop.stg_reviews_review_date": [ + "model.jaffle_shop.int_customer_review_activity_first_review_date", + "model.jaffle_shop.int_customer_review_activity_last_review_date", + "model.jaffle_shop.int_reviews_with_products_review_date" + ], + "model.jaffle_shop.stg_reviews_product_id": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.int_customer_review_activity_products_reviewed", + "model.jaffle_shop.int_reviews_with_products_product_id" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.metric_customer_acquisition_monthly" + ], + "model.jaffle_shop.customer_cohorts_cohort_month": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_cohort_month", + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers" + ], + "model.jaffle_shop.customer_cohorts_cohort_size": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_cumulative_customers", + "model.jaffle_shop.metric_customer_acquisition_monthly_new_customers" + ], + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_lifetime_orders" + ], + "model.jaffle_shop.customer_cohorts_avg_tenure_days": [ + "model.jaffle_shop.metric_customer_acquisition_monthly_avg_tenure_days" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.orders", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.new_orders" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.orders", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.orders_order_id", + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.new_orders_order_id", + "model.jaffle_shop.customers_number_of_orders" + ], + "model.jaffle_shop.stg_orders_customer_id": [ + "model.jaffle_shop.int_customer_payment_methods", + "model.jaffle_shop.int_store_order_assignments_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.new_orders_customer_id", + "model.jaffle_shop.int_customer_payment_methods_customer_id", + "model.jaffle_shop.int_orders_with_promotions_customer_id", + "model.jaffle_shop.orders_customer_id" + ], + "model.jaffle_shop.stg_orders_order_date": [ + "model.jaffle_shop.customers_most_recent_order", + "model.jaffle_shop.orders_order_date", + "model.jaffle_shop.new_orders_order_date", + "model.jaffle_shop.customers_first_order", + "model.jaffle_shop.int_store_order_assignments_order_date", + "model.jaffle_shop.int_orders_with_promotions_order_date" + ], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.int_orders_with_promotions_status", + "model.jaffle_shop.new_orders_status", + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.products", + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_reviews_with_products", + "model.jaffle_shop.products", + "model.jaffle_shop.products_product_id", + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_reviews_review_id": [ + "model.jaffle_shop.int_reviews_with_products_review_id" + ], + "model.jaffle_shop.stg_reviews_order_id": [ + "model.jaffle_shop.int_reviews_with_products_order_id" + ], + "model.jaffle_shop.int_products_with_categories_product_name": [ + "model.jaffle_shop.products_product_name", + "model.jaffle_shop.int_order_items_with_products_product_name", + "model.jaffle_shop.int_reviews_with_products_product_name" + ], + "model.jaffle_shop.int_products_with_categories_category_name": [ + "model.jaffle_shop.int_reviews_with_products_category_name", + "model.jaffle_shop.int_order_items_with_products_category_name", + "model.jaffle_shop.products_category_name" + ], + "model.jaffle_shop.int_products_with_categories_root_category": [ + "model.jaffle_shop.products_root_category", + "model.jaffle_shop.int_reviews_with_products_root_category", + "model.jaffle_shop.int_order_items_with_products_root_category" + ], + "model.jaffle_shop.customers_customer_id": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_lifetime_value_customer_id", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.customer_360_customer_id" + ], + "model.jaffle_shop.customers": [ + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customers_first_name": [ + "model.jaffle_shop.customer_360_first_name", + "model.jaffle_shop.customer_lifetime_value_first_name" + ], + "model.jaffle_shop.customers_last_name": [ + "model.jaffle_shop.customer_360_last_name", + "model.jaffle_shop.customer_lifetime_value_last_name" + ], + "model.jaffle_shop.customers_number_of_orders": [ + "model.jaffle_shop.customer_lifetime_value_number_of_orders", + "model.jaffle_shop.customer_360_number_of_orders", + "model.jaffle_shop.customer_lifetime_value_avg_order_value" + ], + "model.jaffle_shop.customers_customer_lifetime_value": [ + "model.jaffle_shop.customer_lifetime_value_total_revenue", + "model.jaffle_shop.customer_lifetime_value_monthly_value", + "model.jaffle_shop.customer_360_customer_lifetime_value", + "model.jaffle_shop.customer_lifetime_value_avg_order_value" + ], + "model.jaffle_shop.int_customer_first_last_orders_first_order_date": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_retention_cohort_month", + "model.jaffle_shop.customer_retention_months_since_first", + "model.jaffle_shop.customer_acquisition_acquisition_month", + "model.jaffle_shop.customer_360_months_active", + "model.jaffle_shop.customer_cohorts_cohort_month", + "model.jaffle_shop.customer_cohorts", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.customer_lifetime_value_first_order_date", + "model.jaffle_shop.customer_acquisition_first_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_last_order_date": [ + "model.jaffle_shop.customer_lifetime_value_last_order_date" + ], + "model.jaffle_shop.int_customer_first_last_orders_customer_tenure_days": [ + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days", + "model.jaffle_shop.customer_lifetime_value_monthly_value", + "model.jaffle_shop.customer_cohorts_avg_tenure_days" + ], + "model.jaffle_shop.order_discounts_order_date": [ + "model.jaffle_shop.metric_promotion_daily_order_date", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.order_discounts_promotion_name": [ + "model.jaffle_shop.metric_promotion_daily_promotion_name", + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.order_discounts_discount_type": [ + "model.jaffle_shop.metric_promotion_daily_discount_type", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.order_discounts_discount_amount": [ + "model.jaffle_shop.metric_promotion_daily_total_discount", + "model.jaffle_shop.promotion_roi_total_discount_given", + "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar" + ], + "model.jaffle_shop.order_discounts_subtotal": [ + "model.jaffle_shop.metric_promotion_daily_total_order_value" + ], + "model.jaffle_shop.order_discounts_net_revenue": [ + "model.jaffle_shop.metric_promotion_daily_total_net_revenue", + "model.jaffle_shop.promotion_roi_net_revenue_after_discount", + "model.jaffle_shop.promotion_roi_revenue_per_discount_dollar" + ], + "model.jaffle_shop.order_discounts_discount_pct_of_order": [ + "model.jaffle_shop.metric_promotion_daily_avg_discount_pct" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_parent_category_id" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id" + ], + "model.jaffle_shop.stg_categories_category_name": [ + "model.jaffle_shop.int_category_hierarchy_category_name", + "model.jaffle_shop.int_category_hierarchy_root_category", + "model.jaffle_shop.int_category_hierarchy_full_path" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.stores": ["model.jaffle_shop.metric_store_daily"], + "model.jaffle_shop.revenue_summary_store_id": [ + "model.jaffle_shop.metric_store_daily_store_id", + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.gross_margin_store_id" + ], + "model.jaffle_shop.stores_store_id": [ + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.revenue_summary_order_date": [ + "model.jaffle_shop.metric_store_daily_order_date" + ], + "model.jaffle_shop.stores_store_name": [ + "model.jaffle_shop.metric_store_daily_store_name" + ], + "model.jaffle_shop.stores_city": [ + "model.jaffle_shop.metric_store_daily_city" + ], + "model.jaffle_shop.revenue_summary_order_count": [ + "model.jaffle_shop.metric_store_daily_order_count", + "model.jaffle_shop.gross_margin_total_orders" + ], + "model.jaffle_shop.revenue_summary_revenue": [ + "model.jaffle_shop.gross_margin_gross_margin_pct", + "model.jaffle_shop.metric_store_daily_revenue", + "model.jaffle_shop.gross_margin_total_revenue" + ], + "model.jaffle_shop.revenue_summary_cost": [ + "model.jaffle_shop.gross_margin_total_cost", + "model.jaffle_shop.metric_store_daily_cost" + ], + "model.jaffle_shop.revenue_summary_margin": [ + "model.jaffle_shop.metric_store_daily_margin", + "model.jaffle_shop.gross_margin_gross_margin_pct", + "model.jaffle_shop.gross_margin_total_margin" + ], + "model.jaffle_shop.revenue_summary_discounts": [ + "model.jaffle_shop.metric_store_daily_discounts", + "model.jaffle_shop.gross_margin_total_discounts" + ], + "model.jaffle_shop.revenue_summary_net_revenue": [ + "model.jaffle_shop.gross_margin_total_net_revenue", + "model.jaffle_shop.metric_store_daily_net_revenue" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_store_performance_store_id": [ + "model.jaffle_shop.store_performance_store_id" + ], + "model.jaffle_shop.int_store_performance_store_name": [ + "model.jaffle_shop.store_performance_store_name" + ], + "model.jaffle_shop.int_store_performance_city": [ + "model.jaffle_shop.store_performance_city" + ], + "model.jaffle_shop.int_store_performance_state": [ + "model.jaffle_shop.store_performance_state" + ], + "model.jaffle_shop.int_store_performance_total_employees": [ + "model.jaffle_shop.store_performance_total_employees" + ], + "model.jaffle_shop.int_store_performance_order_count": [ + "model.jaffle_shop.store_performance_order_count" + ], + "model.jaffle_shop.int_store_performance_unique_customers": [ + "model.jaffle_shop.store_performance_unique_customers" + ], + "model.jaffle_shop.int_store_performance_total_revenue": [ + "model.jaffle_shop.store_performance_total_revenue" + ], + "model.jaffle_shop.int_store_performance_total_margin": [ + "model.jaffle_shop.store_performance_total_margin" + ], + "model.jaffle_shop.int_store_performance_avg_order_value": [ + "model.jaffle_shop.store_performance_avg_order_value" + ], + "model.jaffle_shop.int_store_performance_revenue_per_employee": [ + "model.jaffle_shop.store_performance_revenue_per_employee" + ], + "model.jaffle_shop.int_store_performance_orders_per_employee": [ + "model.jaffle_shop.store_performance_orders_per_employee" + ], + "model.jaffle_shop.int_customer_first_last_orders_lifetime_orders": [ + "model.jaffle_shop.customer_cohorts_avg_lifetime_orders" + ], + "model.jaffle_shop.int_order_enriched_total_cost": [ + "model.jaffle_shop.revenue_summary_cost", + "model.jaffle_shop.int_store_revenue_total_cost", + "model.jaffle_shop.int_daily_order_summary_total_cost" + ], + "model.jaffle_shop.int_order_enriched_total_margin": [ + "model.jaffle_shop.int_store_revenue_total_margin", + "model.jaffle_shop.int_daily_order_summary_total_margin", + "model.jaffle_shop.revenue_summary_margin", + "model.jaffle_shop.int_customer_order_history_total_margin_generated" + ], + "model.jaffle_shop.int_order_enriched_total_quantity": [ + "model.jaffle_shop.int_customer_order_history_total_items_purchased", + "model.jaffle_shop.int_daily_order_summary_total_items_sold" + ], + "seed.jaffle_shop.raw_supply_orders": [ + "model.jaffle_shop.stg_supply_orders" + ], + "seed.jaffle_shop.raw_supply_orders_id": [ + "model.jaffle_shop.stg_supply_orders_supply_order_id" + ], + "seed.jaffle_shop.raw_supply_orders_product_id": [ + "model.jaffle_shop.stg_supply_orders_product_id" + ], + "seed.jaffle_shop.raw_supply_orders_store_id": [ + "model.jaffle_shop.stg_supply_orders_store_id" + ], + "seed.jaffle_shop.raw_supply_orders_quantity": [ + "model.jaffle_shop.stg_supply_orders_quantity" + ], + "seed.jaffle_shop.raw_supply_orders_order_date": [ + "model.jaffle_shop.stg_supply_orders_order_date" + ], + "seed.jaffle_shop.raw_supply_orders_delivered_date": [ + "model.jaffle_shop.stg_supply_orders_delivered_date" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.order_items_order_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.order_items" + ], + "model.jaffle_shop.int_order_items_enriched_quantity": [ + "model.jaffle_shop.order_items_quantity", + "model.jaffle_shop.int_order_totals_total_quantity" + ], + "model.jaffle_shop.int_order_items_enriched_line_total": [ + "model.jaffle_shop.order_items_line_total", + "model.jaffle_shop.int_order_totals_subtotal" + ], + "model.jaffle_shop.int_order_items_enriched_line_cost": [ + "model.jaffle_shop.order_items_line_cost", + "model.jaffle_shop.int_order_totals_total_cost" + ], + "model.jaffle_shop.int_order_items_enriched_line_margin": [ + "model.jaffle_shop.order_items_line_margin", + "model.jaffle_shop.int_order_totals_total_margin" + ], + "model.jaffle_shop.int_order_items_enriched_root_category": [ + "model.jaffle_shop.order_items_root_category", + "model.jaffle_shop.int_order_totals_category_count" + ], + "model.jaffle_shop.metric_daily_revenue_order_date": [ + "model.jaffle_shop.metric_monthly_sales_active_days", + "model.jaffle_shop.metric_monthly_sales_month_start", + "model.jaffle_shop.metric_weekly_sales", + "model.jaffle_shop.metric_weekly_sales_week_start", + "model.jaffle_shop.metric_monthly_sales" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.metric_daily_revenue_order_count": [ + "model.jaffle_shop.metric_weekly_sales_total_orders", + "model.jaffle_shop.metric_monthly_sales_total_orders" + ], + "model.jaffle_shop.metric_daily_revenue_total_revenue": [ + "model.jaffle_shop.metric_monthly_sales_total_revenue", + "model.jaffle_shop.metric_weekly_sales_total_revenue" + ], + "model.jaffle_shop.metric_daily_revenue_net_revenue": [ + "model.jaffle_shop.metric_monthly_sales_net_revenue", + "model.jaffle_shop.metric_weekly_sales_net_revenue" + ], + "model.jaffle_shop.metric_daily_revenue_total_margin": [ + "model.jaffle_shop.metric_weekly_sales_total_margin", + "model.jaffle_shop.metric_monthly_sales_total_margin" + ], + "model.jaffle_shop.metric_daily_revenue_total_discounts": [ + "model.jaffle_shop.metric_monthly_sales_total_discounts", + "model.jaffle_shop.metric_weekly_sales_total_discounts" + ], + "model.jaffle_shop.metric_daily_revenue_unique_customers": [ + "model.jaffle_shop.metric_weekly_sales_total_customer_visits" + ], + "model.jaffle_shop.metric_daily_revenue_avg_order_value": [ + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value", + "model.jaffle_shop.metric_monthly_sales_avg_daily_order_value" + ], + "model.jaffle_shop.metric_daily_revenue_total_items_sold": [ + "model.jaffle_shop.metric_monthly_sales_total_items_sold", + "model.jaffle_shop.metric_weekly_sales_total_items_sold" + ], + "seed.jaffle_shop.raw_employees": ["model.jaffle_shop.stg_employees"], + "seed.jaffle_shop.raw_employees_id": [ + "model.jaffle_shop.stg_employees_employee_id" + ], + "seed.jaffle_shop.raw_employees_store_id": [ + "model.jaffle_shop.stg_employees_store_id" + ], + "seed.jaffle_shop.raw_employees_first_name": [ + "model.jaffle_shop.stg_employees_first_name" + ], + "seed.jaffle_shop.raw_employees_last_name": [ + "model.jaffle_shop.stg_employees_last_name" + ], + "seed.jaffle_shop.raw_employees_role": [ + "model.jaffle_shop.stg_employees_role" + ], + "seed.jaffle_shop.raw_employees_hired_at": [ + "model.jaffle_shop.stg_employees_hired_at" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.int_store_revenue_order_count", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_supply_orders": [ + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.int_supply_order_costs" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.order_fulfillment" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_inventory_movements", + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.stg_supply_orders_product_id": [ + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.int_supply_order_costs_product_id", + "model.jaffle_shop.int_inventory_movements_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched_product_id", + "model.jaffle_shop.int_order_items_enriched", + "model.jaffle_shop.int_inventory_movements_product_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.int_store_revenue_store_id", + "model.jaffle_shop.int_inventory_movements_store_id", + "model.jaffle_shop.order_fulfillment_store_id", + "model.jaffle_shop.revenue_summary_store_id", + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_supply_orders_store_id": [ + "model.jaffle_shop.int_inventory_movements_store_id", + "model.jaffle_shop.int_supply_order_costs_store_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_date": [ + "model.jaffle_shop.int_inventory_movements_movement_date" + ], + "model.jaffle_shop.stg_supply_orders_delivered_date": [ + "model.jaffle_shop.int_supply_order_costs_delivered_date", + "model.jaffle_shop.int_inventory_movements_movement_date", + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.stg_supply_orders_quantity": [ + "model.jaffle_shop.int_supply_order_costs_total_cost", + "model.jaffle_shop.int_supply_order_costs_quantity", + "model.jaffle_shop.int_inventory_movements_quantity_in" + ], + "model.jaffle_shop.int_order_items_with_products_quantity": [ + "model.jaffle_shop.int_order_items_enriched_quantity", + "model.jaffle_shop.int_inventory_movements_quantity_out", + "model.jaffle_shop.int_order_items_enriched_line_margin", + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.int_promotion_effectiveness_promotion_name": [ + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.promotion_roi_promotion_name" + ], + "model.jaffle_shop.int_promotion_effectiveness": [ + "model.jaffle_shop.promotion_roi" + ], + "model.jaffle_shop.int_promotion_effectiveness_has_promotion": [ + "model.jaffle_shop.promotion_roi" + ], + "model.jaffle_shop.int_promotion_effectiveness_discount_type": [ + "model.jaffle_shop.promotion_roi_discount_type" + ], + "model.jaffle_shop.int_promotion_effectiveness_order_count": [ + "model.jaffle_shop.promotion_roi_order_count" + ], + "model.jaffle_shop.int_promotion_effectiveness_avg_order_value": [ + "model.jaffle_shop.promotion_roi_avg_order_value" + ], + "model.jaffle_shop.int_promotion_effectiveness_total_revenue": [ + "model.jaffle_shop.promotion_roi_total_revenue" + ], + "model.jaffle_shop.int_promotion_effectiveness_avg_margin": [ + "model.jaffle_shop.promotion_roi_avg_margin" + ], + "seed.jaffle_shop.raw_reviews": ["model.jaffle_shop.stg_reviews"], + "seed.jaffle_shop.raw_reviews_id": [ + "model.jaffle_shop.stg_reviews_review_id" + ], + "seed.jaffle_shop.raw_reviews_order_id": [ + "model.jaffle_shop.stg_reviews_order_id" + ], + "seed.jaffle_shop.raw_reviews_product_id": [ + "model.jaffle_shop.stg_reviews_product_id" + ], + "seed.jaffle_shop.raw_reviews_customer_id": [ + "model.jaffle_shop.stg_reviews_customer_id" + ], + "seed.jaffle_shop.raw_reviews_rating": [ + "model.jaffle_shop.stg_reviews_rating" + ], + "seed.jaffle_shop.raw_reviews_review_date": [ + "model.jaffle_shop.stg_reviews_review_date" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.product_categories", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_supply_order_costs", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.stg_products_price": [ + "model.jaffle_shop.int_product_margins_price", + "model.jaffle_shop.int_product_margins_margin", + "model.jaffle_shop.int_products_with_categories_price", + "model.jaffle_shop.int_product_margins_margin_pct" + ], + "model.jaffle_shop.stg_products_cost": [ + "model.jaffle_shop.int_product_margins_margin_pct", + "model.jaffle_shop.int_product_margins_cost", + "model.jaffle_shop.int_supply_order_costs_total_cost", + "model.jaffle_shop.int_product_margins_margin", + "model.jaffle_shop.int_supply_order_costs_unit_cost", + "model.jaffle_shop.int_products_with_categories_cost" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_customer_segments_customer_id": [ + "model.jaffle_shop.customer_segments_final_customer_id" + ], + "model.jaffle_shop.int_customer_segments_first_name": [ + "model.jaffle_shop.customer_segments_final_first_name" + ], + "model.jaffle_shop.int_customer_segments_last_name": [ + "model.jaffle_shop.customer_segments_final_last_name" + ], + "model.jaffle_shop.int_customer_segments_customer_segment": [ + "model.jaffle_shop.customer_segments_final_customer_segment" + ], + "model.jaffle_shop.int_customer_segments_recency_score": [ + "model.jaffle_shop.customer_segments_final_recency_score" + ], + "model.jaffle_shop.int_customer_segments_frequency_score": [ + "model.jaffle_shop.customer_segments_final_frequency_score" + ], + "model.jaffle_shop.int_customer_segments_monetary_score": [ + "model.jaffle_shop.customer_segments_final_monetary_score" + ], + "model.jaffle_shop.int_customer_segments_rfm_total": [ + "model.jaffle_shop.customer_segments_final_rfm_total" + ], + "model.jaffle_shop.int_customer_segments_total_orders": [ + "model.jaffle_shop.customer_segments_final_total_orders" + ], + "model.jaffle_shop.int_customer_segments_total_spent": [ + "model.jaffle_shop.customer_segments_final_total_spent" + ], + "model.jaffle_shop.int_customer_segments_days_since_last_order": [ + "model.jaffle_shop.customer_segments_final_days_since_last_order" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.store_staffing", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.int_product_ratings": [ + "model.jaffle_shop.product_reviews", + "model.jaffle_shop.product_performance", + "model.jaffle_shop.customer_review_summary" + ], + "model.jaffle_shop.int_product_ratings_product_id": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.product_reviews_product_id", + "model.jaffle_shop.customer_review_summary" + ], + "model.jaffle_shop.int_product_ratings_product_name": [ + "model.jaffle_shop.product_reviews_product_name" + ], + "model.jaffle_shop.int_product_ratings_category_name": [ + "model.jaffle_shop.product_reviews_category_name" + ], + "model.jaffle_shop.int_product_ratings_root_category": [ + "model.jaffle_shop.product_reviews_root_category" + ], + "model.jaffle_shop.int_product_ratings_review_count": [ + "model.jaffle_shop.product_performance_review_count", + "model.jaffle_shop.product_reviews_positive_pct", + "model.jaffle_shop.product_reviews_review_count" + ], + "model.jaffle_shop.int_product_ratings_avg_rating": [ + "model.jaffle_shop.customer_review_summary_rating_tendency", + "model.jaffle_shop.product_reviews_rating_tier", + "model.jaffle_shop.customer_review_summary_avg_product_rating_of_reviewed", + "model.jaffle_shop.product_performance_avg_rating", + "model.jaffle_shop.product_reviews_avg_rating" + ], + "model.jaffle_shop.int_product_ratings_positive_reviews": [ + "model.jaffle_shop.product_performance_positive_reviews", + "model.jaffle_shop.product_reviews_positive_reviews", + "model.jaffle_shop.product_reviews_positive_pct" + ], + "model.jaffle_shop.int_product_ratings_negative_reviews": [ + "model.jaffle_shop.product_reviews_negative_reviews", + "model.jaffle_shop.product_performance_negative_reviews" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.int_daily_order_summary_order_date": [ + "model.jaffle_shop.metric_daily_revenue_order_date" + ], + "model.jaffle_shop.int_daily_order_summary_order_count": [ + "model.jaffle_shop.metric_daily_revenue_order_count" + ], + "model.jaffle_shop.int_daily_order_summary_total_revenue": [ + "model.jaffle_shop.metric_daily_revenue_total_revenue", + "model.jaffle_shop.metric_daily_revenue_net_revenue" + ], + "model.jaffle_shop.int_daily_order_summary_total_cost": [ + "model.jaffle_shop.metric_daily_revenue_total_cost" + ], + "model.jaffle_shop.int_daily_order_summary_total_margin": [ + "model.jaffle_shop.metric_daily_revenue_total_margin" + ], + "model.jaffle_shop.int_daily_order_summary_total_discounts": [ + "model.jaffle_shop.metric_daily_revenue_total_discounts", + "model.jaffle_shop.metric_daily_revenue_net_revenue" + ], + "model.jaffle_shop.int_daily_order_summary_avg_order_value": [ + "model.jaffle_shop.metric_daily_revenue_avg_order_value" + ], + "model.jaffle_shop.int_daily_order_summary_unique_customers": [ + "model.jaffle_shop.metric_daily_revenue_unique_customers" + ], + "model.jaffle_shop.int_daily_order_summary_total_items_sold": [ + "model.jaffle_shop.metric_daily_revenue_total_items_sold" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.products", + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.products", + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_products_with_categories_category_id": [ + "model.jaffle_shop.products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_category_path": [ + "model.jaffle_shop.int_order_items_with_products_category_path", + "model.jaffle_shop.products_category_path" + ], + "model.jaffle_shop.int_products_with_categories_price": [ + "model.jaffle_shop.products_price" + ], + "model.jaffle_shop.int_products_with_categories_cost": [ + "model.jaffle_shop.products_cost" + ], + "model.jaffle_shop.int_product_margins_margin": [ + "model.jaffle_shop.products_margin" + ], + "model.jaffle_shop.int_product_margins_margin_pct": [ + "model.jaffle_shop.int_order_items_enriched_margin_pct", + "model.jaffle_shop.products_margin_pct" + ], + "model.jaffle_shop.int_products_with_categories_created_at": [ + "model.jaffle_shop.products_created_at" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stores", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.int_store_performance", + "model.jaffle_shop.stores_store_id", + "model.jaffle_shop.int_store_performance_store_id" + ], + "model.jaffle_shop.int_store_employees_active_store_name": [ + "model.jaffle_shop.int_store_performance_store_name", + "model.jaffle_shop.stores_store_name", + "model.jaffle_shop.order_fulfillment_store_name" + ], + "model.jaffle_shop.int_store_employees_active_city": [ + "model.jaffle_shop.int_store_performance_city", + "model.jaffle_shop.stores_city", + "model.jaffle_shop.order_fulfillment_city" + ], + "model.jaffle_shop.int_store_employees_active_state": [ + "model.jaffle_shop.order_fulfillment_state", + "model.jaffle_shop.stores_state", + "model.jaffle_shop.int_store_performance_state" + ], + "model.jaffle_shop.int_store_employees_active_total_employees": [ + "model.jaffle_shop.int_store_performance_revenue_per_employee", + "model.jaffle_shop.stores_total_employees", + "model.jaffle_shop.int_store_performance_total_employees", + "model.jaffle_shop.int_store_performance_orders_per_employee", + "model.jaffle_shop.order_fulfillment_store_employee_count" + ], + "model.jaffle_shop.int_store_employees_active_manager_count": [ + "model.jaffle_shop.stores_manager_count" + ], + "model.jaffle_shop.int_store_employees_active_barista_count": [ + "model.jaffle_shop.stores_barista_count" + ], + "model.jaffle_shop.int_store_employees_active_cashier_count": [ + "model.jaffle_shop.stores_cashier_count" + ], + "model.jaffle_shop.int_store_employees_active_cook_count": [ + "model.jaffle_shop.stores_cook_count" + ], + "model.jaffle_shop.int_store_employees_active_earliest_hire": [ + "model.jaffle_shop.stores_earliest_hire" + ], + "model.jaffle_shop.int_store_employees_active_latest_hire": [ + "model.jaffle_shop.stores_latest_hire" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.metric_customer_retention_monthly" + ], + "model.jaffle_shop.customer_retention_cohort_month": [ + "model.jaffle_shop.metric_customer_retention_monthly", + "model.jaffle_shop.metric_customer_retention_monthly_cohort_month" + ], + "model.jaffle_shop.customer_retention_months_since_first": [ + "model.jaffle_shop.metric_customer_retention_monthly", + "model.jaffle_shop.metric_customer_retention_monthly_months_since_first" + ], + "model.jaffle_shop.customer_retention_customers": [ + "model.jaffle_shop.metric_customer_retention_monthly_cohort_size", + "model.jaffle_shop.metric_customer_retention_monthly_retention_rate", + "model.jaffle_shop.metric_customer_retention_monthly_retained_customers" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.order_payment_status_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.order_payment_status", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_customer_id": [ + "model.jaffle_shop.int_order_enriched_customer_id" + ], + "model.jaffle_shop.int_orders_with_promotions_order_date": [ + "model.jaffle_shop.int_order_enriched_order_date" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.int_order_totals_item_count": [ + "model.jaffle_shop.int_order_enriched_item_count", + "model.jaffle_shop.int_promotion_effectiveness_avg_items_per_order" + ], + "model.jaffle_shop.int_order_totals_total_quantity": [ + "model.jaffle_shop.int_order_enriched_total_quantity" + ], + "model.jaffle_shop.int_order_totals_total_cost": [ + "model.jaffle_shop.int_order_enriched_total_cost" + ], + "model.jaffle_shop.int_order_totals_total_margin": [ + "model.jaffle_shop.int_order_enriched_total_margin", + "model.jaffle_shop.int_promotion_effectiveness_avg_margin" + ], + "model.jaffle_shop.int_order_totals_category_count": [ + "model.jaffle_shop.int_order_enriched_category_count" + ], + "model.jaffle_shop.int_orders_with_promotions_has_promotion": [ + "model.jaffle_shop.int_order_enriched_has_promotion", + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_promotion_effectiveness_has_promotion" + ], + "model.jaffle_shop.int_orders_with_promotions_promotion_name": [ + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_promotion_effectiveness_promotion_name", + "model.jaffle_shop.int_order_enriched_promotion_name" + ], + "model.jaffle_shop.int_orders_with_promotions_discount_type": [ + "model.jaffle_shop.int_promotion_effectiveness", + "model.jaffle_shop.int_order_enriched_discount_amount", + "model.jaffle_shop.int_promotion_effectiveness_discount_type", + "model.jaffle_shop.int_order_enriched_discount_type" + ], + "model.jaffle_shop.int_orders_with_promotions_discount_value": [ + "model.jaffle_shop.int_order_enriched_discount_amount", + "model.jaffle_shop.int_order_enriched_discount_value" + ], + "model.jaffle_shop.int_order_payments_matched_total_paid": [ + "model.jaffle_shop.int_order_enriched_total_paid", + "model.jaffle_shop.order_payment_status_total_paid", + "model.jaffle_shop.order_payment_status_payment_difference" + ], + "model.jaffle_shop.int_order_payments_matched_payment_count": [ + "model.jaffle_shop.int_order_enriched_payment_count", + "model.jaffle_shop.order_payment_status_payment_count" + ], + "model.jaffle_shop.int_order_payments_matched_payment_status": [ + "model.jaffle_shop.int_order_enriched_payment_status", + "model.jaffle_shop.order_payment_status_payment_status" + ], + "model.jaffle_shop.orders": [ + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.order_returns" + ], + "model.jaffle_shop.orders_order_id": [ + "model.jaffle_shop.order_returns_order_id", + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.order_fulfillment_order_id" + ], + "model.jaffle_shop.stg_payments_payment_id": [ + "model.jaffle_shop.payments_fact_payment_id" + ], + "model.jaffle_shop.orders_customer_id": [ + "model.jaffle_shop.payments_fact_customer_id", + "model.jaffle_shop.order_returns_customer_id", + "model.jaffle_shop.order_fulfillment_customer_id" + ], + "model.jaffle_shop.orders_order_date": [ + "model.jaffle_shop.order_fulfillment_order_date", + "model.jaffle_shop.payments_fact_order_date", + "model.jaffle_shop.order_returns_order_date" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.order_fulfillment_status", + "model.jaffle_shop.order_returns_status", + "model.jaffle_shop.order_returns_return_status", + "model.jaffle_shop.order_returns", + "model.jaffle_shop.payments_fact_order_status" + ], + "model.jaffle_shop.orders_amount": [ + "model.jaffle_shop.order_fulfillment_amount", + "model.jaffle_shop.order_returns_amount" + ], + "model.jaffle_shop.int_order_items_enriched_order_item_id": [ + "model.jaffle_shop.order_items_order_item_id" + ], + "model.jaffle_shop.int_order_items_enriched_product_id": [ + "model.jaffle_shop.order_items_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_product_name": [ + "model.jaffle_shop.order_items_product_name" + ], + "model.jaffle_shop.int_order_items_enriched_category_name": [ + "model.jaffle_shop.order_items_category_name" + ], + "model.jaffle_shop.int_order_items_enriched_category_path": [ + "model.jaffle_shop.order_items_category_path" + ], + "model.jaffle_shop.int_order_items_enriched_unit_price": [ + "model.jaffle_shop.order_items_unit_price" + ], + "model.jaffle_shop.int_order_items_enriched_cost": [ + "model.jaffle_shop.order_items_cost" + ], + "model.jaffle_shop.int_order_items_enriched_margin_pct": [ + "model.jaffle_shop.order_items_margin_pct" + ], + "model.jaffle_shop.stg_supply_orders_supply_order_id": [ + "model.jaffle_shop.int_supply_order_costs_supply_order_id" + ], + "model.jaffle_shop.stg_products_product_name": [ + "model.jaffle_shop.product_inventory_product_name", + "model.jaffle_shop.int_supply_order_costs_product_name", + "model.jaffle_shop.int_products_with_categories_product_name" + ], + "model.jaffle_shop.stg_supply_orders_order_date": [ + "model.jaffle_shop.int_supply_order_costs_order_date", + "model.jaffle_shop.int_supply_order_costs_lead_time_days" + ], + "model.jaffle_shop.int_reviews_with_products_category_name": [ + "model.jaffle_shop.int_product_ratings", + "model.jaffle_shop.int_product_ratings_category_name" + ], + "model.jaffle_shop.int_reviews_with_products_product_name": [ + "model.jaffle_shop.int_product_ratings", + "model.jaffle_shop.int_product_ratings_product_name" + ], + "model.jaffle_shop.int_reviews_with_products_product_id": [ + "model.jaffle_shop.int_product_ratings", + "model.jaffle_shop.int_product_ratings_product_id" + ], + "model.jaffle_shop.int_reviews_with_products": [ + "model.jaffle_shop.int_product_ratings" + ], + "model.jaffle_shop.int_reviews_with_products_root_category": [ + "model.jaffle_shop.int_product_ratings_root_category", + "model.jaffle_shop.int_product_ratings" + ], + "model.jaffle_shop.int_reviews_with_products_rating": [ + "model.jaffle_shop.int_product_ratings_positive_reviews", + "model.jaffle_shop.int_product_ratings_avg_rating", + "model.jaffle_shop.int_product_ratings_min_rating", + "model.jaffle_shop.int_product_ratings_max_rating", + "model.jaffle_shop.int_product_ratings_negative_reviews" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_order_items_id": [ + "model.jaffle_shop.stg_order_items_order_item_id" + ], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_order_items_quantity": [ + "model.jaffle_shop.stg_order_items_quantity" + ], + "seed.jaffle_shop.raw_order_items_unit_price": [ + "model.jaffle_shop.stg_order_items_unit_price" + ], + "model.jaffle_shop.stg_stores_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.store_staffing", + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_employees_store_id": [ + "model.jaffle_shop.store_staffing", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing_store_id" + ], + "model.jaffle_shop.stg_employees": [ + "model.jaffle_shop.store_staffing", + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_employees_employee_id": [ + "model.jaffle_shop.store_staffing_employee_id" + ], + "model.jaffle_shop.stg_employees_first_name": [ + "model.jaffle_shop.store_staffing_first_name" + ], + "model.jaffle_shop.stg_employees_last_name": [ + "model.jaffle_shop.store_staffing_last_name" + ], + "model.jaffle_shop.stg_employees_role": [ + "model.jaffle_shop.int_store_employees_active_manager_count", + "model.jaffle_shop.store_staffing_role", + "model.jaffle_shop.int_store_employees_active_cook_count", + "model.jaffle_shop.int_store_employees_active_barista_count", + "model.jaffle_shop.int_store_employees_active_cashier_count" + ], + "model.jaffle_shop.stg_employees_hired_at": [ + "model.jaffle_shop.int_store_employees_active_latest_hire", + "model.jaffle_shop.int_store_employees_active_earliest_hire", + "model.jaffle_shop.store_staffing_hired_at" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_employees_active_store_name", + "model.jaffle_shop.store_staffing_store_name", + "model.jaffle_shop.product_inventory_store_name" + ], + "model.jaffle_shop.stg_stores_city": [ + "model.jaffle_shop.int_store_employees_active_city", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing_city" + ], + "model.jaffle_shop.stg_stores_state": [ + "model.jaffle_shop.int_store_employees_active_state", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.store_staffing_state" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.product_categories", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.product_categories", + "model.jaffle_shop.int_products_with_categories", + "model.jaffle_shop.product_categories_category_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.product_categories", + "model.jaffle_shop.int_products_with_categories_category_id", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_name": [ + "model.jaffle_shop.int_products_with_categories_category_name", + "model.jaffle_shop.product_categories_category_name" + ], + "model.jaffle_shop.int_category_hierarchy_parent_category_id": [ + "model.jaffle_shop.product_categories_parent_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_root_category": [ + "model.jaffle_shop.product_categories_root_category", + "model.jaffle_shop.int_products_with_categories_root_category" + ], + "model.jaffle_shop.int_category_hierarchy_full_path": [ + "model.jaffle_shop.product_categories_full_path", + "model.jaffle_shop.int_products_with_categories_category_path" + ], + "model.jaffle_shop.int_category_hierarchy_depth": [ + "model.jaffle_shop.product_categories_depth", + "model.jaffle_shop.int_products_with_categories_category_depth" + ], + "model.jaffle_shop.product_performance": [ + "model.jaffle_shop.rpt_product_dashboard", + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.product_profitability" + ], + "model.jaffle_shop.product_performance_total_revenue": [ + "model.jaffle_shop.product_profitability_gross_margin_pct", + "model.jaffle_shop.rpt_product_dashboard_top_product_name", + "model.jaffle_shop.rpt_product_dashboard_top_product_revenue", + "model.jaffle_shop.product_profitability_total_revenue", + "model.jaffle_shop.product_profitability_net_margin", + "model.jaffle_shop.rpt_product_dashboard_total_product_revenue" + ], + "model.jaffle_shop.product_performance_avg_rating": [ + "model.jaffle_shop.product_profitability_avg_rating", + "model.jaffle_shop.rpt_product_dashboard_overall_avg_rating" + ], + "model.jaffle_shop.product_performance_total_quantity_sold": [ + "model.jaffle_shop.product_profitability_total_quantity_sold", + "model.jaffle_shop.reorder_recommendations_total_quantity_sold", + "model.jaffle_shop.rpt_product_dashboard_total_units_sold" + ], + "model.jaffle_shop.product_performance_times_ordered": [ + "model.jaffle_shop.reorder_recommendations_times_ordered", + "model.jaffle_shop.reorder_recommendations_reorder_priority", + "model.jaffle_shop.rpt_product_dashboard_never_ordered_products" + ], + "model.jaffle_shop.product_performance_product_name": [ + "model.jaffle_shop.product_profitability_product_name", + "model.jaffle_shop.rpt_product_dashboard_top_product_name" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_id", + "model.jaffle_shop.int_orders_with_promotions_has_promotion", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_name": [ + "model.jaffle_shop.int_orders_with_promotions_promotion_name" + ], + "model.jaffle_shop.stg_promotions_discount_type": [ + "model.jaffle_shop.int_orders_with_promotions_discount_type" + ], + "model.jaffle_shop.stg_promotions_discount_value": [ + "model.jaffle_shop.int_orders_with_promotions_discount_value" + ], + "model.jaffle_shop.int_inventory_movements_store_id": [ + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.int_inventory_movements_product_id": [ + "model.jaffle_shop.inventory_health" + ], + "model.jaffle_shop.product_inventory_product_store_key": [ + "model.jaffle_shop.inventory_health_product_store_key" + ], + "model.jaffle_shop.product_inventory_product_name": [ + "model.jaffle_shop.reorder_recommendations_product_name", + "model.jaffle_shop.inventory_health_product_name" + ], + "model.jaffle_shop.product_inventory_store_name": [ + "model.jaffle_shop.store_inventory", + "model.jaffle_shop.store_inventory_store_name", + "model.jaffle_shop.inventory_health_store_name", + "model.jaffle_shop.reorder_recommendations_store_name" + ], + "model.jaffle_shop.int_inventory_movements_quantity_in": [ + "model.jaffle_shop.inventory_health_inventory_balance", + "model.jaffle_shop.inventory_health_total_inbound" + ], + "model.jaffle_shop.int_inventory_movements_quantity_out": [ + "model.jaffle_shop.inventory_health_avg_units_per_sale", + "model.jaffle_shop.inventory_health_inventory_balance", + "model.jaffle_shop.inventory_health_total_outbound" + ], + "model.jaffle_shop.int_inventory_movements_movement_type": [ + "model.jaffle_shop.inventory_health_restock_events", + "model.jaffle_shop.inventory_health_sale_events", + "model.jaffle_shop.inventory_health_avg_units_per_sale" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_name": [ + "model.jaffle_shop.stg_categories_category_name" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.int_supply_order_costs": [ + "model.jaffle_shop.supplier_lead_times", + "model.jaffle_shop.cost_analysis", + "model.jaffle_shop.supply_orders_fact", + "model.jaffle_shop.product_profitability" + ], + "model.jaffle_shop.int_supply_order_costs_store_id": [ + "model.jaffle_shop.supplier_lead_times_store_id", + "model.jaffle_shop.supplier_lead_times", + "model.jaffle_shop.supply_orders_fact_store_id" + ], + "model.jaffle_shop.int_supply_order_costs_product_id": [ + "model.jaffle_shop.supply_orders_fact_product_id", + "model.jaffle_shop.product_profitability", + "model.jaffle_shop.supplier_lead_times", + "model.jaffle_shop.cost_analysis", + "model.jaffle_shop.supplier_lead_times_product_id" + ], + "model.jaffle_shop.int_supply_order_costs_product_name": [ + "model.jaffle_shop.supplier_lead_times", + "model.jaffle_shop.cost_analysis", + "model.jaffle_shop.supply_orders_fact_product_name", + "model.jaffle_shop.supplier_lead_times_product_name" + ], + "model.jaffle_shop.int_supply_order_costs_lead_time_days": [ + "model.jaffle_shop.supplier_lead_times_max_lead_time", + "model.jaffle_shop.supply_orders_fact_lead_time_days", + "model.jaffle_shop.cost_analysis_avg_lead_time", + "model.jaffle_shop.supplier_lead_times_avg_lead_time", + "model.jaffle_shop.supplier_lead_times_min_lead_time" + ], + "model.jaffle_shop.int_supply_order_costs_quantity": [ + "model.jaffle_shop.supply_orders_fact_quantity", + "model.jaffle_shop.supplier_lead_times_total_quantity", + "model.jaffle_shop.product_profitability_total_supplied" + ], + "model.jaffle_shop.int_supply_order_costs_total_cost": [ + "model.jaffle_shop.product_profitability_total_supply_cost", + "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold", + "model.jaffle_shop.supply_orders_fact_total_cost", + "model.jaffle_shop.supplier_lead_times_total_spend", + "model.jaffle_shop.cost_analysis_total_supply_spend", + "model.jaffle_shop.product_profitability_net_margin" + ], + "model.jaffle_shop.int_order_items_with_products_order_item_id": [ + "model.jaffle_shop.int_order_items_enriched_order_item_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_name": [ + "model.jaffle_shop.int_order_items_enriched_product_name" + ], + "model.jaffle_shop.int_order_items_with_products_category_name": [ + "model.jaffle_shop.int_order_items_enriched_category_name" + ], + "model.jaffle_shop.int_order_items_with_products_root_category": [ + "model.jaffle_shop.int_order_items_enriched_root_category" + ], + "model.jaffle_shop.int_order_items_with_products_category_path": [ + "model.jaffle_shop.int_order_items_enriched_category_path" + ], + "model.jaffle_shop.int_order_items_with_products_unit_price": [ + "model.jaffle_shop.int_order_items_enriched_unit_price" + ], + "model.jaffle_shop.int_order_items_with_products_line_total": [ + "model.jaffle_shop.int_order_items_enriched_line_margin", + "model.jaffle_shop.int_order_items_enriched_line_total" + ], + "model.jaffle_shop.int_product_margins_cost": [ + "model.jaffle_shop.int_order_items_enriched_line_margin", + "model.jaffle_shop.int_order_items_enriched_cost", + "model.jaffle_shop.int_order_items_enriched_line_cost" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items_order_item_id": [ + "model.jaffle_shop.int_order_items_with_products_order_item_id" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.stg_order_items_quantity": [ + "model.jaffle_shop.int_order_items_with_products_quantity", + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.stg_order_items_unit_price": [ + "model.jaffle_shop.int_order_items_with_products_unit_price", + "model.jaffle_shop.int_order_items_with_products_line_total" + ], + "model.jaffle_shop.int_order_payments_matched_order_subtotal": [ + "model.jaffle_shop.order_payment_status_payment_difference", + "model.jaffle_shop.order_payment_status_order_subtotal" + ], + "model.jaffle_shop.int_order_payments_matched_payment_method_count": [ + "model.jaffle_shop.order_payment_status_payment_method_count" + ], + "model.jaffle_shop.stg_customers_first_name": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.customers_first_name", + "model.jaffle_shop.int_customer_order_history_first_name" + ], + "model.jaffle_shop.stg_customers": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.customers" + ], + "model.jaffle_shop.stg_customers_customer_id": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.customers_customer_id", + "model.jaffle_shop.customers", + "model.jaffle_shop.int_customer_order_history_customer_id" + ], + "model.jaffle_shop.stg_customers_last_name": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_order_history_last_name", + "model.jaffle_shop.customers_last_name" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue_order_count": [ + "model.jaffle_shop.int_store_performance_order_count", + "model.jaffle_shop.int_store_performance_orders_per_employee" + ], + "model.jaffle_shop.int_store_revenue_unique_customers": [ + "model.jaffle_shop.int_store_performance_unique_customers" + ], + "model.jaffle_shop.int_store_revenue_total_revenue": [ + "model.jaffle_shop.int_store_performance_total_revenue", + "model.jaffle_shop.int_store_performance_revenue_per_employee" + ], + "model.jaffle_shop.int_store_revenue_total_margin": [ + "model.jaffle_shop.int_store_performance_total_margin" + ], + "model.jaffle_shop.int_store_revenue_avg_order_value": [ + "model.jaffle_shop.int_store_performance_avg_order_value" + ], + "model.jaffle_shop.product_performance_product_id": [ + "model.jaffle_shop.reorder_recommendations", + "model.jaffle_shop.product_profitability_product_id", + "model.jaffle_shop.product_profitability" + ], + "model.jaffle_shop.product_performance_category_name": [ + "model.jaffle_shop.product_profitability_category_name" + ], + "model.jaffle_shop.product_performance_total_margin": [ + "model.jaffle_shop.product_profitability_gross_margin_pct", + "model.jaffle_shop.product_profitability_gross_margin" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "seed.jaffle_shop.raw_promotions_name": [ + "model.jaffle_shop.stg_promotions_promotion_name" + ], + "seed.jaffle_shop.raw_promotions_discount_type": [ + "model.jaffle_shop.stg_promotions_discount_type" + ], + "seed.jaffle_shop.raw_promotions_discount_value": [ + "model.jaffle_shop.stg_promotions_discount_value" + ], + "seed.jaffle_shop.raw_promotions_start_date": [ + "model.jaffle_shop.stg_promotions_start_date" + ], + "seed.jaffle_shop.raw_promotions_end_date": [ + "model.jaffle_shop.stg_promotions_end_date" + ], + "model.jaffle_shop.revenue_summary_order_month": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.gross_margin_order_month" + ], + "model.jaffle_shop.orders_credit_card_amount": [ + "model.jaffle_shop.order_returns_credit_card_amount" + ], + "model.jaffle_shop.orders_coupon_amount": [ + "model.jaffle_shop.order_returns_coupon_amount" + ], + "model.jaffle_shop.orders_bank_transfer_amount": [ + "model.jaffle_shop.order_returns_bank_transfer_amount" + ], + "model.jaffle_shop.orders_gift_card_amount": [ + "model.jaffle_shop.order_returns_gift_card_amount" + ], + "model.jaffle_shop.products": ["model.jaffle_shop.product_performance"], + "model.jaffle_shop.products_product_id": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.product_performance_product_id" + ], + "model.jaffle_shop.order_items": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.metric_product_sales_daily" + ], + "model.jaffle_shop.order_items_product_id": [ + "model.jaffle_shop.product_performance", + "model.jaffle_shop.metric_product_sales_daily_product_id", + "model.jaffle_shop.metric_product_sales_daily" + ], + "model.jaffle_shop.products_product_name": [ + "model.jaffle_shop.product_performance_product_name" + ], + "model.jaffle_shop.products_category_name": [ + "model.jaffle_shop.product_performance_category_name" + ], + "model.jaffle_shop.products_root_category": [ + "model.jaffle_shop.product_performance_root_category" + ], + "model.jaffle_shop.products_price": [ + "model.jaffle_shop.product_performance_price" + ], + "model.jaffle_shop.products_cost": [ + "model.jaffle_shop.product_performance_cost" + ], + "model.jaffle_shop.products_margin_pct": [ + "model.jaffle_shop.product_performance_margin_pct" + ], + "model.jaffle_shop.order_items_quantity": [ + "model.jaffle_shop.product_performance_total_quantity_sold", + "model.jaffle_shop.metric_product_sales_daily_units_sold" + ], + "model.jaffle_shop.order_items_line_total": [ + "model.jaffle_shop.metric_product_sales_daily_revenue", + "model.jaffle_shop.product_performance_total_revenue" + ], + "model.jaffle_shop.order_items_line_margin": [ + "model.jaffle_shop.product_performance_total_margin", + "model.jaffle_shop.metric_product_sales_daily_margin" + ], + "model.jaffle_shop.int_store_order_assignments_customer_id": [ + "model.jaffle_shop.int_store_revenue_unique_customers" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.store_performance_store_id": [ + "model.jaffle_shop.store_rankings_store_id" + ], + "model.jaffle_shop.store_performance_store_name": [ + "model.jaffle_shop.store_rankings_store_name" + ], + "model.jaffle_shop.store_performance_city": [ + "model.jaffle_shop.store_rankings_city" + ], + "model.jaffle_shop.store_performance_state": [ + "model.jaffle_shop.store_rankings_state" + ], + "model.jaffle_shop.store_performance_total_revenue": [ + "model.jaffle_shop.store_rankings_total_revenue", + "model.jaffle_shop.store_rankings_revenue_rank" + ], + "model.jaffle_shop.store_performance_total_margin": [ + "model.jaffle_shop.store_rankings_margin_rank", + "model.jaffle_shop.store_rankings_total_margin" + ], + "model.jaffle_shop.store_performance_order_count": [ + "model.jaffle_shop.store_rankings_order_count_rank", + "model.jaffle_shop.store_rankings_order_count" + ], + "model.jaffle_shop.store_performance_unique_customers": [ + "model.jaffle_shop.store_rankings_customer_reach_rank", + "model.jaffle_shop.store_rankings_unique_customers" + ], + "model.jaffle_shop.store_performance_revenue_per_employee": [ + "model.jaffle_shop.store_rankings_efficiency_rank", + "model.jaffle_shop.store_rankings_revenue_per_employee" + ], + "model.jaffle_shop.int_supply_order_costs_supply_order_id": [ + "model.jaffle_shop.supply_orders_fact_supply_order_id" + ], + "model.jaffle_shop.int_supply_order_costs_unit_cost": [ + "model.jaffle_shop.supply_orders_fact_unit_cost", + "model.jaffle_shop.cost_analysis_avg_unit_cost" + ], + "model.jaffle_shop.int_supply_order_costs_order_date": [ + "model.jaffle_shop.supply_orders_fact_order_date" + ], + "model.jaffle_shop.int_supply_order_costs_delivered_date": [ + "model.jaffle_shop.supply_orders_fact_delivered_date" + ], + "model.jaffle_shop.order_items_product_name": [ + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.metric_product_sales_daily_product_name" + ], + "model.jaffle_shop.order_items_order_id": [ + "model.jaffle_shop.metric_product_sales_daily" + ], + "model.jaffle_shop.order_items_category_name": [ + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.metric_product_sales_daily_category_name" + ], + "model.jaffle_shop.int_product_stock_levels_store_id": [ + "model.jaffle_shop.product_inventory", + "model.jaffle_shop.product_inventory_store_id" + ], + "model.jaffle_shop.int_product_stock_levels": [ + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_product_stock_levels_product_id": [ + "model.jaffle_shop.product_inventory_product_id", + "model.jaffle_shop.product_inventory" + ], + "model.jaffle_shop.int_product_stock_levels_product_store_key": [ + "model.jaffle_shop.product_inventory_product_store_key" + ], + "model.jaffle_shop.int_product_stock_levels_total_received": [ + "model.jaffle_shop.product_inventory_total_received" + ], + "model.jaffle_shop.int_product_stock_levels_total_sold": [ + "model.jaffle_shop.product_inventory_total_sold" + ], + "model.jaffle_shop.int_product_stock_levels_current_stock": [ + "model.jaffle_shop.product_inventory_current_stock", + "model.jaffle_shop.product_inventory_stock_status" + ], + "model.jaffle_shop.int_product_stock_levels_last_restock_date": [ + "model.jaffle_shop.product_inventory_last_restock_date" + ], + "model.jaffle_shop.int_product_stock_levels_last_sale_date": [ + "model.jaffle_shop.product_inventory_last_sale_date" + ], + "model.jaffle_shop.product_inventory_last_restock_date": [ + "model.jaffle_shop.reorder_recommendations_last_restock_date" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_payments_amount" + ], + "seed.jaffle_shop.raw_payments_id": [ + "model.jaffle_shop.stg_payments_payment_id" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_payments_payment_method": [ + "model.jaffle_shop.stg_payments_payment_method" + ], + "model.jaffle_shop.product_profitability_product_id": [ + "model.jaffle_shop.cost_analysis", + "model.jaffle_shop.cost_analysis_product_id" + ], + "model.jaffle_shop.product_profitability": [ + "model.jaffle_shop.cost_analysis" + ], + "model.jaffle_shop.product_profitability_product_name": [ + "model.jaffle_shop.cost_analysis_product_name" + ], + "model.jaffle_shop.product_profitability_category_name": [ + "model.jaffle_shop.cost_analysis_category_name" + ], + "model.jaffle_shop.product_profitability_total_revenue": [ + "model.jaffle_shop.cost_analysis_total_revenue" + ], + "model.jaffle_shop.product_profitability_gross_margin": [ + "model.jaffle_shop.cost_analysis_gross_margin" + ], + "model.jaffle_shop.product_profitability_total_quantity_sold": [ + "model.jaffle_shop.cost_analysis_supply_cost_per_unit_sold", + "model.jaffle_shop.cost_analysis_total_quantity_sold" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_user_id": [ + "model.jaffle_shop.stg_orders_customer_id" + ], + "seed.jaffle_shop.raw_orders_order_date": [ + "model.jaffle_shop.stg_orders_order_date" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.int_customer_review_activity_avg_rating": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_customer_avg_rating", + "model.jaffle_shop.customer_review_summary_rating_tendency", + "model.jaffle_shop.customer_360_avg_review_rating" + ], + "model.jaffle_shop.int_customer_review_activity_last_review_date": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_last_review_date" + ], + "model.jaffle_shop.int_customer_review_activity_first_review_date": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_first_review_date" + ], + "model.jaffle_shop.int_customer_review_activity": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.int_customer_review_activity_customer_id": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_customer_id", + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.int_customer_review_activity_review_count": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_review_count", + "model.jaffle_shop.customer_360_review_count" + ], + "model.jaffle_shop.int_customer_review_activity_products_reviewed": [ + "model.jaffle_shop.customer_review_summary", + "model.jaffle_shop.customer_review_summary_products_reviewed" + ], + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "seed.jaffle_shop.raw_stores_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "seed.jaffle_shop.raw_stores_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "seed.jaffle_shop.raw_stores_city": ["model.jaffle_shop.stg_stores_city"], + "seed.jaffle_shop.raw_stores_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "seed.jaffle_shop.raw_stores_opened_at": [ + "model.jaffle_shop.stg_stores_opened_at" + ], + "seed.jaffle_shop.raw_customers": ["model.jaffle_shop.stg_customers"], + "seed.jaffle_shop.raw_customers_id": [ + "model.jaffle_shop.stg_customers_customer_id" + ], + "seed.jaffle_shop.raw_customers_first_name": [ + "model.jaffle_shop.stg_customers_full_name", + "model.jaffle_shop.stg_customers_first_name" + ], + "seed.jaffle_shop.raw_customers_last_name": [ + "model.jaffle_shop.stg_customers_full_name", + "model.jaffle_shop.stg_customers_last_name" + ], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_name": [ + "model.jaffle_shop.stg_products_product_name" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "seed.jaffle_shop.raw_products_price": [ + "model.jaffle_shop.stg_products_price_cents", + "model.jaffle_shop.stg_products_price" + ], + "seed.jaffle_shop.raw_products_cost": [ + "model.jaffle_shop.stg_products_cost_cents", + "model.jaffle_shop.stg_products_cost" + ], + "seed.jaffle_shop.raw_products_created_at": [ + "model.jaffle_shop.stg_products_created_at" + ], + "model.jaffle_shop.store_inventory": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings_store_id": [ + "model.jaffle_shop.rpt_store_dashboard_store_id", + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily_store_id": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_inventory_store_id": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings_store_name": [ + "model.jaffle_shop.rpt_store_dashboard_store_name" + ], + "model.jaffle_shop.store_rankings_city": [ + "model.jaffle_shop.rpt_store_dashboard_city" + ], + "model.jaffle_shop.store_rankings_state": [ + "model.jaffle_shop.rpt_store_dashboard_state" + ], + "model.jaffle_shop.store_rankings_total_revenue": [ + "model.jaffle_shop.rpt_store_dashboard_total_revenue" + ], + "model.jaffle_shop.store_rankings_total_margin": [ + "model.jaffle_shop.rpt_store_dashboard_total_margin" + ], + "model.jaffle_shop.store_rankings_order_count": [ + "model.jaffle_shop.rpt_store_dashboard_order_count" + ], + "model.jaffle_shop.store_rankings_unique_customers": [ + "model.jaffle_shop.rpt_store_dashboard_unique_customers" + ], + "model.jaffle_shop.store_rankings_revenue_per_employee": [ + "model.jaffle_shop.rpt_store_dashboard_revenue_per_employee" + ], + "model.jaffle_shop.store_rankings_revenue_rank": [ + "model.jaffle_shop.rpt_store_dashboard_revenue_rank" + ], + "model.jaffle_shop.store_rankings_efficiency_rank": [ + "model.jaffle_shop.rpt_store_dashboard_efficiency_rank" + ], + "model.jaffle_shop.store_inventory_total_stock_units": [ + "model.jaffle_shop.rpt_store_dashboard_total_stock_units" + ], + "model.jaffle_shop.store_inventory_out_of_stock_products": [ + "model.jaffle_shop.rpt_store_dashboard_out_of_stock_products" + ], + "model.jaffle_shop.store_inventory_low_stock_products": [ + "model.jaffle_shop.rpt_store_dashboard_low_stock_products" + ], + "model.jaffle_shop.metric_store_daily_order_date": [ + "model.jaffle_shop.rpt_store_dashboard_active_days" + ], + "model.jaffle_shop.metric_store_daily_revenue": [ + "model.jaffle_shop.rpt_store_dashboard_avg_daily_revenue" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.customer_segments_final_customer_segment": [ + "model.jaffle_shop.rpt_executive_dashboard", + "model.jaffle_shop.customer_360_customer_segment" + ], + "model.jaffle_shop.metric_monthly_sales_month_start": [ + "model.jaffle_shop.rpt_executive_dashboard_month_start" + ], + "model.jaffle_shop.metric_monthly_sales_total_orders": [ + "model.jaffle_shop.rpt_executive_dashboard_total_orders" + ], + "model.jaffle_shop.metric_monthly_sales_total_revenue": [ + "model.jaffle_shop.rpt_executive_dashboard_total_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_net_revenue": [ + "model.jaffle_shop.rpt_executive_dashboard_net_revenue" + ], + "model.jaffle_shop.metric_monthly_sales_total_margin": [ + "model.jaffle_shop.rpt_executive_dashboard_total_margin" + ], + "model.jaffle_shop.gross_margin_total_margin": [ + "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct" + ], + "model.jaffle_shop.gross_margin_total_revenue": [ + "model.jaffle_shop.rpt_executive_dashboard_overall_margin_pct" + ], + "model.jaffle_shop.metric_monthly_sales_total_items_sold": [ + "model.jaffle_shop.rpt_executive_dashboard_total_items_sold" + ], + "model.jaffle_shop.metric_monthly_sales_active_days": [ + "model.jaffle_shop.rpt_executive_dashboard_active_days" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_lifetime_value_customer_id": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_segments_final_customer_id": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customers_first_order": [ + "model.jaffle_shop.customer_360_first_order" + ], + "model.jaffle_shop.customers_most_recent_order": [ + "model.jaffle_shop.customer_360_most_recent_order" + ], + "model.jaffle_shop.customer_lifetime_value_monthly_value": [ + "model.jaffle_shop.customer_360_monthly_value" + ], + "model.jaffle_shop.customer_lifetime_value_avg_order_value": [ + "model.jaffle_shop.customer_360_avg_order_value" + ], + "model.jaffle_shop.customer_lifetime_value_customer_tenure_days": [ + "model.jaffle_shop.customer_360_customer_tenure_days" + ], + "model.jaffle_shop.customer_lifetime_value_days_since_last_order": [ + "model.jaffle_shop.customer_360_days_since_last_order" + ], + "model.jaffle_shop.customer_segments_final_rfm_total": [ + "model.jaffle_shop.customer_360_rfm_total" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.rpt_sales_dashboard" + ], + "model.jaffle_shop.metric_weekly_sales_week_start": [ + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "model.jaffle_shop.rpt_sales_dashboard_week_start" + ], + "model.jaffle_shop.metric_weekly_sales_total_orders": [ + "model.jaffle_shop.rpt_sales_dashboard_total_orders" + ], + "model.jaffle_shop.metric_weekly_sales_total_revenue": [ + "model.jaffle_shop.rpt_sales_dashboard_revenue_wow_growth_pct", + "model.jaffle_shop.rpt_sales_dashboard_prev_week_revenue", + "model.jaffle_shop.rpt_sales_dashboard_total_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_net_revenue": [ + "model.jaffle_shop.rpt_sales_dashboard_net_revenue" + ], + "model.jaffle_shop.metric_weekly_sales_total_margin": [ + "model.jaffle_shop.rpt_sales_dashboard_total_margin" + ], + "model.jaffle_shop.metric_weekly_sales_total_discounts": [ + "model.jaffle_shop.rpt_sales_dashboard_total_discounts" + ], + "model.jaffle_shop.metric_weekly_sales_total_items_sold": [ + "model.jaffle_shop.rpt_sales_dashboard_total_items_sold" + ], + "model.jaffle_shop.metric_weekly_sales_avg_daily_order_value": [ + "model.jaffle_shop.rpt_sales_dashboard_avg_daily_order_value" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ], + "model.jaffle_shop.stg_products_created_at": [ + "model.jaffle_shop.int_products_with_categories_created_at" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-impact-overview.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-impact-overview.json new file mode 100644 index 000000000..39efcad99 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-impact-overview.json @@ -0,0 +1,1733 @@ +{ + "current": { + "nodes": { + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n 'ORDER-' || status as status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "partial_breaking", + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_customers": { + "id": "model.jaffle_shop.stg_customers", + "name": "stg_customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_customers') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n first_name || ' ' || last_name as full_name\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "non_breaking", + "columns": { + "full_name": { + "id": "model.jaffle_shop.stg_customers_full_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "full_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "added", + "depends_on": [] + } + }, + "impacted": false + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.metric_daily_orders_completed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_completed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "completed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_returned_orders": { + "id": "model.jaffle_shop.metric_daily_orders_returned_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "returned_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_shipped_orders": { + "id": "model.jaffle_shop.metric_daily_orders_shipped_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "shipped_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_placed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_placed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "placed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_status": { + "id": "model.jaffle_shop.payments_fact_order_status", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_status", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_status": { + "id": "model.jaffle_shop.order_fulfillment_status", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_status": { + "id": "model.jaffle_shop.new_orders_status", + "table_id": "model.jaffle_shop.new_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_first_name": { + "id": "seed.jaffle_shop.raw_customers_first_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_last_name": { + "id": "seed.jaffle_shop.raw_customers_last_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_full_name": { + "id": "model.jaffle_shop.stg_customers_full_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "full_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "added", + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.metric_daily_orders_completed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_returned_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_shipped_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_placed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_orders_status": [], + "seed.jaffle_shop.raw_promotions": [], + "seed.jaffle_shop.raw_promotions_id": [], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.stg_payments_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_stores": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched_order_id", + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_stores" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "model.jaffle_shop.payments_fact_order_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_fulfillment_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_promotion_id", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_products": [], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "seed.jaffle_shop.raw_categories": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.order_returns": ["model.jaffle_shop.orders_status"], + "model.jaffle_shop.order_returns_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_returns_return_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_order_enriched_status", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.new_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "seed.jaffle_shop.raw_customers_first_name": [], + "seed.jaffle_shop.raw_customers_last_name": [], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "model.jaffle_shop.stg_customers_full_name": [ + "seed.jaffle_shop.raw_customers_first_name", + "seed.jaffle_shop.raw_customers_last_name" + ], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.metric_daily_orders_shipped_orders", + "model.jaffle_shop.metric_daily_orders_returned_orders", + "model.jaffle_shop.metric_daily_orders_completed_orders", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.metric_daily_orders_placed_orders" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.int_orders_with_promotions_status", + "model.jaffle_shop.new_orders_status", + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.order_fulfillment_status", + "model.jaffle_shop.order_returns_status", + "model.jaffle_shop.order_returns_return_status", + "model.jaffle_shop.order_returns", + "model.jaffle_shop.payments_fact_order_status" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products_product_id", + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "seed.jaffle_shop.raw_customers_first_name": [ + "model.jaffle_shop.stg_customers_full_name" + ], + "seed.jaffle_shop.raw_customers_last_name": [ + "model.jaffle_shop.stg_customers_full_name" + ], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_int_order_enriched.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_int_order_enriched.json new file mode 100644 index 000000000..0e058b1c0 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_int_order_enriched.json @@ -0,0 +1,1743 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.rpt_customer_dashboard": { + "id": "model.jaffle_shop.rpt_customer_dashboard", + "name": "rpt_customer_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customer_360 as (\n select * from {{ ref('customer_360') }}\n),\n\nsummary as (\n select\n count(*) as total_customers,\n count(case when number_of_orders > 0 then 1 end) as active_customers,\n avg(customer_lifetime_value) as avg_clv,\n avg(number_of_orders) as avg_orders_per_customer,\n count(case when customer_segment = 'Champion' then 1 end) as champion_customers,\n count(case when customer_segment = 'At Risk' then 1 end) as at_risk_customers,\n count(case when customer_segment = 'Lost' then 1 end) as lost_customers,\n avg(review_count) as avg_reviews_per_customer\n from customer_360\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_daily_orders": { + "id": "model.jaffle_shop.metric_daily_orders", + "name": "metric_daily_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as total_orders,\n sum(case when status in ('completed', 'Scompleted') then 1 else 0 end) as completed_orders,\n sum(case when status in ('returned', 'Sreturned', 'return_pending', 'Sreturn_pending') then 1 else 0 end) as returned_orders,\n sum(case when status in ('shipped', 'Sshipped') then 1 else 0 end) as shipped_orders,\n sum(case when status in ('placed', 'Splaced') then 1 else 0 end) as placed_orders,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n avg(item_count) as avg_items_per_order\n from orders\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_segments": { + "id": "model.jaffle_shop.int_customer_segments", + "name": "int_customer_segments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_history as (\n select * from {{ ref('int_customer_order_history') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nrfm as (\n select\n oh.customer_id,\n oh.first_name,\n oh.last_name,\n oh.total_orders,\n oh.total_spent,\n fl.days_since_last_order,\n ntile(5) over (order by fl.days_since_last_order desc) as recency_score,\n ntile(5) over (order by oh.total_orders) as frequency_score,\n ntile(5) over (order by oh.total_spent) as monetary_score\n from order_history oh\n inner join first_last fl on oh.customer_id = fl.customer_id\n where oh.total_orders > 0\n),\n\nsegmented as (\n select\n *,\n recency_score + frequency_score + monetary_score as rfm_total,\n case\n when recency_score >= 4 and frequency_score >= 4 and monetary_score >= 4 then 'Champion'\n when recency_score >= 4 and frequency_score >= 3 then 'Loyal'\n when recency_score >= 4 and frequency_score <= 2 then 'New Customer'\n when recency_score <= 2 and frequency_score >= 3 then 'At Risk'\n when recency_score <= 2 and frequency_score <= 2 and monetary_score >= 3 then 'Cant Lose'\n when recency_score <= 2 then 'Lost'\n else 'Potential'\n end as customer_segment\n from rfm\n)\n\nselect * from segmented", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.order_discounts": { + "id": "model.jaffle_shop.order_discounts", + "name": "order_discounts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndiscounts as (\n select\n order_id,\n customer_id,\n order_date,\n subtotal,\n has_promotion,\n promotion_name,\n discount_type,\n discount_value,\n discount_amount,\n case when subtotal > 0\n then round(discount_amount / subtotal * 100, 1)\n else 0\n end as discount_pct_of_order,\n subtotal - discount_amount as net_revenue\n from orders\n where has_promotion = true\n)\n\nselect * from discounts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_customer_acquisition_monthly": { + "id": "model.jaffle_shop.metric_customer_acquisition_monthly", + "name": "metric_customer_acquisition_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with cohorts as (\n select * from {{ ref('customer_cohorts') }}\n),\n\nfinal as (\n select\n cohort_month,\n cohort_size as new_customers,\n avg_lifetime_orders,\n avg_tenure_days,\n sum(cohort_size) over (order by cohort_month) as cumulative_customers\n from cohorts\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_lifetime_value": { + "id": "model.jaffle_shop.customer_lifetime_value", + "name": "customer_lifetime_value", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nclv as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.number_of_orders,\n c.customer_lifetime_value as total_revenue,\n fl.first_order_date,\n fl.last_order_date,\n fl.customer_tenure_days,\n fl.days_since_last_order,\n case when fl.customer_tenure_days > 0\n then round(c.customer_lifetime_value / (fl.customer_tenure_days / 30.0), 2)\n else c.customer_lifetime_value\n end as monthly_value,\n case when c.number_of_orders > 0\n then round(c.customer_lifetime_value / c.number_of_orders, 2)\n else 0\n end as avg_order_value\n from customers c\n left join first_last fl on c.customer_id = fl.customer_id\n)\n\nselect * from clv", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_promotion_daily": { + "id": "model.jaffle_shop.metric_promotion_daily", + "name": "metric_promotion_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with discounts as (\n select * from {{ ref('order_discounts') }}\n),\n\ndaily as (\n select\n order_date,\n promotion_name,\n discount_type,\n count(*) as usage_count,\n sum(discount_amount) as total_discount,\n sum(subtotal) as total_order_value,\n sum(net_revenue) as total_net_revenue,\n avg(discount_pct_of_order) as avg_discount_pct\n from discounts\n group by order_date, promotion_name, discount_type\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_store_daily": { + "id": "model.jaffle_shop.metric_store_daily", + "name": "metric_store_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nstores as (\n select * from {{ ref('stores') }}\n),\n\ndaily as (\n select\n r.order_date,\n r.store_id,\n s.store_name,\n s.city,\n r.order_count,\n r.revenue,\n r.cost,\n r.margin,\n r.discounts,\n r.net_revenue\n from revenue r\n left join stores s on r.store_id = s.store_id\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_cohorts": { + "id": "model.jaffle_shop.customer_cohorts", + "name": "customer_cohorts", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\ncohorts as (\n select\n {{ dbt.date_trunc('month', 'first_order_date') }} as cohort_month,\n count(*) as cohort_size,\n avg(lifetime_orders) as avg_lifetime_orders,\n avg(customer_tenure_days) as avg_tenure_days\n from first_last\n group by {{ dbt.date_trunc('month', 'first_order_date') }}\n)\n\nselect * from cohorts", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_customer_first_last_orders": { + "id": "model.jaffle_shop.int_customer_first_last_orders", + "name": "int_customer_first_last_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_last as (\n select\n customer_id,\n min(order_date) as first_order_date,\n max(order_date) as last_order_date,\n {{ dbt.datediff('min(order_date)', 'max(order_date)', 'day') }} as customer_tenure_days,\n count(*) as lifetime_orders,\n {{ dbt.datediff('max(order_date)', '(select max(order_date) from orders)', 'day') }} as days_since_last_order\n from orders\n group by customer_id\n)\n\nselect * from first_last", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_daily_order_summary": { + "id": "model.jaffle_shop.int_daily_order_summary", + "name": "int_daily_order_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='order_date'\n )\n}}\n\nwith orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ndaily as (\n select\n order_date,\n count(*) as order_count,\n count(distinct customer_id) as unique_customers,\n sum(subtotal) as total_revenue,\n sum(total_cost) as total_cost,\n sum(total_margin) as total_margin,\n sum(total_quantity) as total_items_sold,\n sum(case when has_promotion then 1 else 0 end) as promoted_orders,\n sum(discount_amount) as total_discounts,\n avg(subtotal) as avg_order_value\n from orders\n\n {% if is_incremental() %}\n where order_date > (select max(order_date) from {{ this }})\n {% endif %}\n\n group by order_date\n)\n\nselect * from daily", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.metric_weekly_sales": { + "id": "model.jaffle_shop.metric_weekly_sales", + "name": "metric_weekly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nweekly as (\n select\n {{ dbt.date_trunc('week', 'order_date') }} as week_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n sum(unique_customers) as total_customer_visits,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold\n from daily\n group by {{ dbt.date_trunc('week', 'order_date') }}\n)\n\nselect * from weekly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.promotion_roi": { + "id": "model.jaffle_shop.promotion_roi", + "name": "promotion_roi", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with effectiveness as (\n select * from {{ ref('int_promotion_effectiveness') }}\n),\n\ndiscounts as (\n select\n promotion_name,\n count(*) as usage_count,\n sum(discount_amount) as total_discount_given,\n sum(net_revenue) as total_net_revenue\n from {{ ref('order_discounts') }}\n group by promotion_name\n),\n\nroi as (\n select\n e.promotion_name,\n e.discount_type,\n e.order_count,\n e.avg_order_value,\n e.total_revenue,\n e.avg_margin,\n coalesce(d.total_discount_given, 0) as total_discount_given,\n coalesce(d.total_net_revenue, 0) as net_revenue_after_discount,\n case when coalesce(d.total_discount_given, 0) > 0\n then round(coalesce(d.total_net_revenue, 0) / d.total_discount_given, 2)\n else 0\n end as revenue_per_discount_dollar\n from effectiveness e\n left join discounts d on e.promotion_name = d.promotion_name\n where e.has_promotion = true\n)\n\nselect * from roi", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.customer_segments_final": { + "id": "model.jaffle_shop.customer_segments_final", + "name": "customer_segments_final", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with segments as (\n select * from {{ ref('int_customer_segments') }}\n),\n\nfinal as (\n select\n customer_id,\n first_name,\n last_name,\n customer_segment,\n recency_score,\n frequency_score,\n monetary_score,\n rfm_total,\n total_orders,\n total_spent,\n days_since_last_order\n from segments\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_daily_revenue": { + "id": "model.jaffle_shop.metric_daily_revenue", + "name": "metric_daily_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('int_daily_order_summary') }}\n),\n\nfinal as (\n select\n order_date,\n order_count,\n total_revenue,\n total_cost,\n total_margin,\n total_discounts,\n total_revenue - total_discounts as net_revenue,\n avg_order_value,\n unique_customers,\n total_items_sold\n from daily\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.revenue_summary": { + "id": "model.jaffle_shop.revenue_summary", + "name": "revenue_summary", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nsummary as (\n select\n o.order_date,\n {{ dbt.date_trunc('week', 'o.order_date') }} as order_week,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n a.store_id,\n count(*) as order_count,\n sum(o.subtotal) as revenue,\n sum(o.total_cost) as cost,\n sum(o.total_margin) as margin,\n sum(o.discount_amount) as discounts,\n sum(o.subtotal) - sum(o.discount_amount) as net_revenue\n from orders o\n left join assignments a on o.order_id = a.order_id\n group by o.order_date, {{ dbt.date_trunc('week', 'o.order_date') }},\n {{ dbt.date_trunc('month', 'o.order_date') }}, a.store_id\n)\n\nselect * from summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_customer_retention_monthly": { + "id": "model.jaffle_shop.metric_customer_retention_monthly", + "name": "metric_customer_retention_monthly", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with retention as (\n select * from {{ ref('customer_retention') }}\n),\n\ncohort_sizes as (\n select\n cohort_month,\n customers as cohort_size\n from retention\n where months_since_first = 0\n),\n\nrates as (\n select\n r.cohort_month,\n r.months_since_first,\n r.customers as retained_customers,\n cs.cohort_size,\n round(cast(r.customers as decimal) / cs.cohort_size * 100, 1) as retention_rate\n from retention r\n inner join cohort_sizes cs on r.cohort_month = cs.cohort_month\n)\n\nselect * from rates", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_retention": { + "id": "model.jaffle_shop.customer_retention", + "name": "customer_retention", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\ncohort_orders as (\n select\n fl.customer_id,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as cohort_month,\n {{ dbt.date_trunc('month', 'o.order_date') }} as order_month,\n {{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }} as months_since_first\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n),\n\nretention as (\n select\n cohort_month,\n months_since_first,\n count(distinct customer_id) as customers\n from cohort_orders\n group by cohort_month, months_since_first\n)\n\nselect * from retention", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_monthly_sales": { + "id": "model.jaffle_shop.metric_monthly_sales", + "name": "metric_monthly_sales", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with daily as (\n select * from {{ ref('metric_daily_revenue') }}\n),\n\nmonthly as (\n select\n {{ dbt.date_trunc('month', 'order_date') }} as month_start,\n sum(order_count) as total_orders,\n sum(total_revenue) as total_revenue,\n sum(net_revenue) as net_revenue,\n sum(total_margin) as total_margin,\n sum(total_discounts) as total_discounts,\n avg(avg_order_value) as avg_daily_order_value,\n sum(total_items_sold) as total_items_sold,\n count(distinct order_date) as active_days\n from daily\n group by {{ dbt.date_trunc('month', 'order_date') }}\n)\n\nselect * from monthly", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_customer_order_history": { + "id": "model.jaffle_shop.int_customer_order_history", + "name": "int_customer_order_history", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('stg_customers') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nhistory as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n count(o.order_id) as total_orders,\n coalesce(sum(o.subtotal), 0) as total_spent,\n coalesce(sum(o.total_margin), 0) as total_margin_generated,\n coalesce(avg(o.subtotal), 0) as avg_order_value,\n coalesce(sum(o.total_quantity), 0) as total_items_purchased,\n count(distinct o.order_date) as distinct_order_days\n from customers c\n left join orders o on c.customer_id = o.customer_id\n group by c.customer_id, c.first_name, c.last_name\n)\n\nselect * from history", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.gross_margin": { + "id": "model.jaffle_shop.gross_margin", + "name": "gross_margin", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('revenue_summary') }}\n),\n\nmargin_summary as (\n select\n order_month,\n store_id,\n sum(revenue) as total_revenue,\n sum(cost) as total_cost,\n sum(margin) as total_margin,\n sum(discounts) as total_discounts,\n sum(net_revenue) as total_net_revenue,\n case when sum(revenue) > 0\n then round(sum(margin) / sum(revenue) * 100, 1)\n else 0\n end as gross_margin_pct,\n sum(order_count) as total_orders\n from revenue\n group by order_month, store_id\n)\n\nselect * from margin_summary", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_acquisition": { + "id": "model.jaffle_shop.customer_acquisition", + "name": "customer_acquisition", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with first_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nfirst_order_details as (\n select\n fl.customer_id,\n fl.first_order_date,\n o.has_promotion as acquired_via_promotion,\n o.promotion_name as acquisition_promotion,\n o.subtotal as first_order_value,\n o.item_count as first_order_items,\n {{ dbt.date_trunc('month', 'fl.first_order_date') }} as acquisition_month\n from first_last fl\n inner join orders o on fl.customer_id = o.customer_id\n and fl.first_order_date = o.order_date\n)\n\nselect * from first_order_details", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.metric_product_sales_daily": { + "id": "model.jaffle_shop.metric_product_sales_daily", + "name": "metric_product_sales_daily", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('order_items') }}\n),\n\norders as (\n select order_id, order_date from {{ ref('int_order_enriched') }}\n),\n\ndaily_product as (\n select\n o.order_date,\n i.product_id,\n i.product_name,\n i.category_name,\n sum(i.quantity) as units_sold,\n sum(i.line_total) as revenue,\n sum(i.line_margin) as margin,\n count(distinct o.order_id) as order_count\n from items i\n inner join orders o on i.order_id = o.order_id\n group by o.order_date, i.product_id, i.product_name, i.category_name\n)\n\nselect * from daily_product", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n 'ORDER-' || status as status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "partial_breaking", + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.customer_360": { + "id": "model.jaffle_shop.customer_360", + "name": "customer_360", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with customers as (\n select * from {{ ref('customers') }}\n),\n\nclv as (\n select * from {{ ref('customer_lifetime_value') }}\n),\n\nfirst_last as (\n select * from {{ ref('int_customer_first_last_orders') }}\n),\n\nenriched_orders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nretention as (\n select\n fl.customer_id,\n max({{ dbt.datediff('fl.first_order_date', 'o.order_date', 'month') }}) as months_active\n from first_last fl\n inner join enriched_orders o on fl.customer_id = o.customer_id\n group by fl.customer_id\n),\n\nreviews as (\n select * from {{ ref('int_customer_review_activity') }}\n),\n\nsegments as (\n select * from {{ ref('customer_segments_final') }}\n),\n\nunified as (\n select\n c.customer_id,\n c.first_name,\n c.last_name,\n c.first_order,\n c.most_recent_order,\n c.number_of_orders,\n c.customer_lifetime_value,\n clv.monthly_value,\n clv.avg_order_value,\n clv.customer_tenure_days,\n clv.days_since_last_order,\n s.customer_segment,\n s.rfm_total,\n coalesce(r.review_count, 0) as review_count,\n r.avg_rating as avg_review_rating,\n coalesce(ret.months_active, 0) as months_active\n from customers c\n left join clv on c.customer_id = clv.customer_id\n left join segments s on c.customer_id = s.customer_id\n left join reviews r on c.customer_id = r.customer_id\n left join retention ret on c.customer_id = ret.customer_id\n)\n\nselect * from unified", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_executive_dashboard": { + "id": "model.jaffle_shop.rpt_executive_dashboard", + "name": "rpt_executive_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with monthly_sales as (\n select * from {{ ref('metric_monthly_sales') }}\n),\n\nsegments as (\n select\n customer_segment,\n count(*) as customer_count,\n sum(total_spent) as segment_revenue\n from {{ ref('customer_segments_final') }}\n group by customer_segment\n),\n\nmargin as (\n select\n sum(total_revenue) as total_revenue,\n sum(total_margin) as total_margin,\n sum(total_net_revenue) as total_net_revenue,\n round(sum(total_margin) / nullif(sum(total_revenue), 0) * 100, 1) as overall_margin_pct\n from {{ ref('gross_margin') }}\n),\n\nfinal as (\n select\n ms.month_start,\n ms.total_orders,\n ms.total_revenue,\n ms.net_revenue,\n ms.total_margin,\n m.overall_margin_pct,\n ms.total_items_sold,\n ms.active_days\n from monthly_sales ms\n cross join margin m\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.rpt_sales_dashboard": { + "id": "model.jaffle_shop.rpt_sales_dashboard", + "name": "rpt_sales_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with weekly as (\n select * from {{ ref('metric_weekly_sales') }}\n),\n\nfinal as (\n select\n w.week_start,\n w.total_orders,\n w.total_revenue,\n w.net_revenue,\n w.total_margin,\n w.total_discounts,\n w.total_items_sold,\n w.avg_daily_order_value,\n lag(w.total_revenue) over (order by w.week_start) as prev_week_revenue,\n case when lag(w.total_revenue) over (order by w.week_start) > 0\n then round((w.total_revenue - lag(w.total_revenue) over (order by w.week_start))\n / lag(w.total_revenue) over (order by w.week_start) * 100, 1)\n else null\n end as revenue_wow_growth_pct\n from weekly w\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.rpt_customer_dashboard": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.metric_daily_orders": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.int_customer_first_last_orders" + ], + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_promotions": [], + "seed.jaffle_shop.raw_promotions_id": [], + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.stg_payments_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.metric_customer_acquisition_monthly": [ + "model.jaffle_shop.customer_cohorts" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.metric_promotion_daily": [ + "model.jaffle_shop.order_discounts" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.revenue_summary" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.int_customer_first_last_orders" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched_order_id", + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.promotion_roi": ["model.jaffle_shop.order_discounts"], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.metric_customer_retention_monthly": [ + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_promotion_id", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_products": [], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "seed.jaffle_shop.raw_categories": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.gross_margin": ["model.jaffle_shop.revenue_summary"], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.customer_acquisition": [ + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.metric_product_sales_daily": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.metric_store_daily", + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.rpt_executive_dashboard": [ + "model.jaffle_shop.customer_segments_final", + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.gross_margin" + ], + "model.jaffle_shop.rpt_sales_dashboard": [ + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ] + }, + "child_map": { + "model.jaffle_shop.customer_360": [ + "model.jaffle_shop.rpt_customer_dashboard" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.revenue_summary", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.metric_daily_orders", + "model.jaffle_shop.int_customer_order_history", + "model.jaffle_shop.metric_product_sales_daily", + "model.jaffle_shop.customer_retention", + "model.jaffle_shop.int_customer_first_last_orders", + "model.jaffle_shop.order_discounts", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.int_daily_order_summary" + ], + "model.jaffle_shop.int_customer_order_history": [ + "model.jaffle_shop.int_customer_segments" + ], + "model.jaffle_shop.int_customer_first_last_orders": [ + "model.jaffle_shop.customer_acquisition", + "model.jaffle_shop.customer_lifetime_value", + "model.jaffle_shop.customer_360", + "model.jaffle_shop.int_customer_segments", + "model.jaffle_shop.customer_cohorts", + "model.jaffle_shop.customer_retention" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.customer_cohorts": [ + "model.jaffle_shop.metric_customer_acquisition_monthly" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.order_discounts": [ + "model.jaffle_shop.promotion_roi", + "model.jaffle_shop.metric_promotion_daily" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id" + ], + "model.jaffle_shop.revenue_summary": [ + "model.jaffle_shop.gross_margin", + "model.jaffle_shop.metric_store_daily" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.metric_daily_revenue": [ + "model.jaffle_shop.metric_monthly_sales", + "model.jaffle_shop.metric_weekly_sales" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.int_customer_segments": [ + "model.jaffle_shop.customer_segments_final" + ], + "model.jaffle_shop.int_daily_order_summary": [ + "model.jaffle_shop.metric_daily_revenue" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.customer_retention": [ + "model.jaffle_shop.metric_customer_retention_monthly" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products_product_id", + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.metric_store_daily": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "model.jaffle_shop.customer_lifetime_value": [ + "model.jaffle_shop.customer_360" + ], + "model.jaffle_shop.customer_segments_final": [ + "model.jaffle_shop.customer_360", + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.metric_monthly_sales": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.gross_margin": [ + "model.jaffle_shop.rpt_executive_dashboard" + ], + "model.jaffle_shop.metric_weekly_sales": [ + "model.jaffle_shop.rpt_sales_dashboard" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_int_store_revenue.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_int_store_revenue.json new file mode 100644 index 000000000..332f91dd9 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_int_store_revenue.json @@ -0,0 +1,1507 @@ +{ + "current": { + "nodes": { + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n 'ORDER-' || status as status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "partial_breaking", + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_orders_status": [], + "seed.jaffle_shop.raw_promotions": [], + "seed.jaffle_shop.raw_promotions_id": [], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.stg_payments_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_stores": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched_order_id", + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_stores" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_promotion_id", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_products": [], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "seed.jaffle_shop.raw_categories": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_order_enriched_status", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_order_assignments" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products_product_id", + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_order_returns.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_order_returns.json new file mode 100644 index 000000000..50c5f7c03 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_order_returns.json @@ -0,0 +1,289 @@ +{ + "current": { + "nodes": { + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.orders": { + "id": "model.jaffle_shop.orders", + "name": "orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norder_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(case when payment_method = '{{ payment_method }}' then amount else 0 end) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n),\n\nfinal as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n\n left join order_payments\n on orders.order_id = order_payments.order_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n 'ORDER-' || status as status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "partial_breaking", + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_orders_status": [], + "model.jaffle_shop.orders": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.order_returns": [ + "model.jaffle_shop.orders", + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [] + }, + "child_map": { + "model.jaffle_shop.stg_payments": ["model.jaffle_shop.orders"], + "model.jaffle_shop.stg_payments_order_id": ["model.jaffle_shop.orders"], + "model.jaffle_shop.stg_orders": ["model.jaffle_shop.orders"], + "model.jaffle_shop.stg_orders_order_id": ["model.jaffle_shop.orders"], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.orders": ["model.jaffle_shop.order_returns"], + "model.jaffle_shop.orders_status": ["model.jaffle_shop.order_returns"], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_orders.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_orders.json new file mode 100644 index 000000000..4ff21fc8d --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_orders.json @@ -0,0 +1,257 @@ +{ + "current": { + "nodes": { + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.orders": { + "id": "model.jaffle_shop.orders", + "name": "orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norder_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(case when payment_method = '{{ payment_method }}' then amount else 0 end) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n),\n\nfinal as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n\n left join order_payments\n on orders.order_id = order_payments.order_id\n\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.payments_fact": { + "id": "model.jaffle_shop.payments_fact", + "name": "payments_fact", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select * from {{ ref('stg_payments') }}\n),\n\norders as (\n select * from {{ ref('orders') }}\n),\n\nfinal as (\n select\n p.payment_id,\n p.order_id,\n o.customer_id,\n o.order_date,\n p.payment_method,\n p.amount,\n o.status as order_status\n from payments p\n left join orders o on p.order_id = o.order_id\n)\n\nselect * from final", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n 'ORDER-' || status as status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "partial_breaking", + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.order_fulfillment": { + "id": "model.jaffle_shop.order_fulfillment", + "name": "order_fulfillment", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nassignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nfulfillment as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n o.amount,\n a.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees as store_employee_count\n from orders o\n left join assignments a on o.order_id = a.order_id\n left join staff s on a.store_id = s.store_id\n)\n\nselect * from fulfillment", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_orders_id": [], + "model.jaffle_shop.orders": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.order_returns": ["model.jaffle_shop.orders"], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.payments_fact": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.orders", + "model.jaffle_shop.stg_payments_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.order_fulfillment": ["model.jaffle_shop.orders"], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [] + }, + "child_map": { + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.orders" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.orders" + ], + "model.jaffle_shop.stg_orders": ["model.jaffle_shop.orders"], + "model.jaffle_shop.stg_orders_order_id": ["model.jaffle_shop.orders"], + "model.jaffle_shop.orders": [ + "model.jaffle_shop.payments_fact", + "model.jaffle_shop.order_fulfillment", + "model.jaffle_shop.order_returns" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_stg_customers.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_stg_customers.json new file mode 100644 index 000000000..99924e10b --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_stg_customers.json @@ -0,0 +1,73 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.stg_customers": { + "id": "model.jaffle_shop.stg_customers", + "name": "stg_customers", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_customers') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n first_name || ' ' || last_name as full_name\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "non_breaking", + "columns": { + "full_name": { + "id": "model.jaffle_shop.stg_customers_full_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "full_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "added", + "depends_on": [] + } + }, + "impacted": false + } + }, + "columns": { + "seed.jaffle_shop.raw_customers_first_name": { + "id": "seed.jaffle_shop.raw_customers_first_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "first_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_customers_last_name": { + "id": "seed.jaffle_shop.raw_customers_last_name", + "table_id": "seed.jaffle_shop.raw_customers", + "name": "last_name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_customers_full_name": { + "id": "model.jaffle_shop.stg_customers_full_name", + "table_id": "model.jaffle_shop.stg_customers", + "name": "full_name", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "added", + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_customers_first_name": [], + "seed.jaffle_shop.raw_customers_last_name": [], + "model.jaffle_shop.stg_customers_full_name": [ + "seed.jaffle_shop.raw_customers_first_name", + "seed.jaffle_shop.raw_customers_last_name" + ] + }, + "child_map": { + "seed.jaffle_shop.raw_customers_first_name": [ + "model.jaffle_shop.stg_customers_full_name" + ], + "seed.jaffle_shop.raw_customers_last_name": [ + "model.jaffle_shop.stg_customers_full_name" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_stg_orders.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_stg_orders.json new file mode 100644 index 000000000..aabbe6bb9 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_stg_orders.json @@ -0,0 +1,344 @@ +{ + "current": { + "nodes": { + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.order_returns": { + "id": "model.jaffle_shop.order_returns", + "name": "order_returns", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('orders') }}\n),\n\nreturns as (\n select\n *,\n case\n when status in ('returned', 'Sreturned') then 'completed_return'\n when status in ('return_pending', 'Sreturn_pending') then 'pending_return'\n end as return_status\n from orders\n where status in ('returned', 'return_pending', 'Sreturned', 'Sreturn_pending')\n)\n\nselect * from returns", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n 'ORDER-' || status as status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "partial_breaking", + "columns": { + "status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + } + }, + "impacted": false + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + } + }, + "columns": { + "model.jaffle_shop.metric_daily_orders_completed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_completed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "completed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_returned_orders": { + "id": "model.jaffle_shop.metric_daily_orders_returned_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "returned_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_shipped_orders": { + "id": "model.jaffle_shop.metric_daily_orders_shipped_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "shipped_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.metric_daily_orders_placed_orders": { + "id": "model.jaffle_shop.metric_daily_orders_placed_orders", + "table_id": "model.jaffle_shop.metric_daily_orders", + "name": "placed_orders", + "type": "HUGEINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.orders_status": { + "id": "model.jaffle_shop.orders_status", + "table_id": "model.jaffle_shop.orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_status": { + "id": "model.jaffle_shop.order_returns_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.order_returns_return_status": { + "id": "model.jaffle_shop.order_returns_return_status", + "table_id": "model.jaffle_shop.order_returns", + "name": "return_status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.new_orders_status": { + "id": "model.jaffle_shop.new_orders_status", + "table_id": "model.jaffle_shop.new_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.payments_fact_order_status": { + "id": "model.jaffle_shop.payments_fact_order_status", + "table_id": "model.jaffle_shop.payments_fact", + "name": "order_status", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + }, + "model.jaffle_shop.order_fulfillment_status": { + "id": "model.jaffle_shop.order_fulfillment_status", + "table_id": "model.jaffle_shop.order_fulfillment", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "model.jaffle_shop.metric_daily_orders_completed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_returned_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_shipped_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.metric_daily_orders_placed_orders": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "seed.jaffle_shop.raw_orders_status": [], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.order_returns": ["model.jaffle_shop.orders_status"], + "model.jaffle_shop.order_returns_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.order_returns_return_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.new_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.payments_fact_order_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.order_fulfillment_status": [ + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.stg_orders_status" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.metric_daily_orders_shipped_orders", + "model.jaffle_shop.metric_daily_orders_returned_orders", + "model.jaffle_shop.metric_daily_orders_completed_orders", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.metric_daily_orders_placed_orders" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.int_orders_with_promotions_status", + "model.jaffle_shop.new_orders_status", + "model.jaffle_shop.orders_status" + ], + "model.jaffle_shop.orders_status": [ + "model.jaffle_shop.order_fulfillment_status", + "model.jaffle_shop.order_returns_status", + "model.jaffle_shop.order_returns_return_status", + "model.jaffle_shop.order_returns", + "model.jaffle_shop.payments_fact_order_status" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_store_rankings.json b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_store_rankings.json new file mode 100644 index 000000000..cf7a2f7f0 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/fixtures/diff/cll-diff-node-model_jaffle_shop_store_rankings.json @@ -0,0 +1,1847 @@ +{ + "current": { + "nodes": { + "seed.jaffle_shop.raw_orders": { + "id": "seed.jaffle_shop.raw_orders", + "name": "raw_orders", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_promotions": { + "id": "seed.jaffle_shop.raw_promotions", + "name": "raw_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_payments_matched": { + "id": "model.jaffle_shop.int_order_payments_matched", + "name": "int_order_payments_matched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with payments as (\n select\n order_id,\n sum(amount) as total_paid,\n count(*) as payment_count,\n count(distinct payment_method) as payment_method_count\n from {{ ref('stg_payments') }}\n group by order_id\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\nmatched as (\n select\n coalesce(ot.order_id, p.order_id) as order_id,\n ot.subtotal as order_subtotal,\n p.total_paid,\n p.payment_count,\n p.payment_method_count,\n case\n when p.total_paid is null then 'unpaid'\n when abs(coalesce(ot.subtotal, 0) - p.total_paid) < 0.01 then 'matched'\n when p.total_paid < coalesce(ot.subtotal, 0) then 'underpaid'\n else 'overpaid'\n end as payment_status\n from order_totals ot\n full outer join payments p on ot.order_id = p.order_id\n)\n\nselect * from matched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_category_hierarchy": { + "id": "model.jaffle_shop.int_category_hierarchy", + "name": "int_category_hierarchy", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with recursive category_tree as (\n select\n category_id,\n category_name,\n parent_category_id,\n category_name as root_category,\n category_name as full_path,\n 0 as depth\n from {{ ref('stg_categories') }}\n where parent_category_id is null\n\n union all\n\n select\n c.category_id,\n c.category_name,\n c.parent_category_id,\n ct.root_category,\n ct.full_path || ' > ' || c.category_name as full_path,\n ct.depth + 1 as depth\n from {{ ref('stg_categories') }} c\n inner join category_tree ct on c.parent_category_id = ct.category_id\n)\n\nselect * from category_tree", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_performance": { + "id": "model.jaffle_shop.store_performance", + "name": "store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "select * from {{ ref('int_store_performance') }}", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_stores": { + "id": "seed.jaffle_shop.raw_stores", + "name": "raw_stores", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_stores_id", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "name": { + "id": "seed.jaffle_shop.raw_stores_name", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "seed.jaffle_shop.raw_stores_city", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "seed.jaffle_shop.raw_stores_state", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_totals": { + "id": "model.jaffle_shop.int_order_totals", + "name": "int_order_totals", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with enriched_items as (\n select * from {{ ref('int_order_items_enriched') }}\n),\n\norder_aggs as (\n select\n order_id,\n count(*) as item_count,\n sum(quantity) as total_quantity,\n sum(line_total) as subtotal,\n sum(line_cost) as total_cost,\n sum(line_margin) as total_margin,\n count(distinct root_category) as category_count\n from enriched_items\n group by order_id\n)\n\nselect * from order_aggs", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_employees": { + "id": "model.jaffle_shop.stg_employees", + "name": "stg_employees", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_employees') }}\n),\n\nrenamed as (\n select\n id as employee_id,\n store_id,\n first_name,\n last_name,\n role,\n cast(hired_at as date) as hired_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.stg_employees_store_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_product_margins": { + "id": "model.jaffle_shop.int_product_margins", + "name": "int_product_margins", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\nmargins as (\n select\n product_id,\n price,\n cost,\n price - cost as margin,\n case when price > 0\n then round((price - cost) / price * 100, 1)\n else 0\n end as margin_pct\n from products\n)\n\nselect * from margins", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_order_assignments": { + "id": "model.jaffle_shop.int_store_order_assignments", + "name": "int_store_order_assignments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nassigned as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n ((o.order_id - 1) % (select count(*) from stores)) + 1 as store_id\n from orders o\n)\n\nselect * from assigned", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_enriched": { + "id": "model.jaffle_shop.int_order_enriched", + "name": "int_order_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n\nwith orders_promos as (\n select * from {{ ref('int_orders_with_promotions') }}\n),\n\norder_totals as (\n select * from {{ ref('int_order_totals') }}\n),\n\npayment_status as (\n select * from {{ ref('int_order_payments_matched') }}\n),\n\nenriched as (\n select\n op.order_id,\n op.customer_id,\n op.order_date,\n op.status,\n ot.item_count,\n ot.total_quantity,\n ot.subtotal,\n ot.total_cost,\n ot.total_margin,\n ot.category_count,\n op.has_promotion,\n op.promotion_name,\n op.discount_type,\n op.discount_value,\n ps.total_paid,\n ps.payment_count,\n ps.payment_status,\n case\n when op.discount_type = 'percentage' then round(ot.subtotal * op.discount_value / 100, 2)\n when op.discount_type = 'fixed' then op.discount_value / 100.0\n else 0\n end as discount_amount\n from orders_promos op\n left join order_totals ot on op.order_id = ot.order_id\n left join payment_status ps on op.order_id = ps.order_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_order_items": { + "id": "seed.jaffle_shop.raw_order_items", + "name": "raw_order_items", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_order_items": { + "id": "model.jaffle_shop.stg_order_items", + "name": "stg_order_items", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_items') }}\n),\n\nrenamed as (\n select\n id as order_item_id,\n order_id,\n product_id,\n quantity,\n cast(unit_price as decimal) / 100 as unit_price\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_orders_with_promotions": { + "id": "model.jaffle_shop.int_orders_with_promotions", + "name": "int_orders_with_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with orders as (\n select * from {{ ref('stg_orders') }}\n),\n\norder_promotions as (\n select * from {{ ref('stg_order_promotions') }}\n),\n\npromotions as (\n select * from {{ ref('stg_promotions') }}\n),\n\njoined as (\n select\n o.order_id,\n o.customer_id,\n o.order_date,\n o.status,\n op.promotion_id,\n p.promotion_name,\n p.discount_type,\n p.discount_value,\n case when op.promotion_id is not null then true else false end as has_promotion\n from orders o\n left join order_promotions op on o.order_id = op.order_id\n left join promotions p on op.promotion_id = p.promotion_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_categories": { + "id": "model.jaffle_shop.stg_categories", + "name": "stg_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_categories') }}\n),\n\nrenamed as (\n select\n id as category_id,\n name as category_name,\n parent_category_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_enriched": { + "id": "model.jaffle_shop.int_order_items_enriched", + "name": "int_order_items_enriched", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with items as (\n select * from {{ ref('int_order_items_with_products') }}\n),\n\nmargins as (\n select * from {{ ref('int_product_margins') }}\n),\n\nenriched as (\n select\n i.order_item_id,\n i.order_id,\n i.product_id,\n i.product_name,\n i.category_name,\n i.root_category,\n i.category_path,\n i.quantity,\n i.unit_price,\n i.line_total,\n m.cost,\n m.margin_pct,\n i.quantity * m.cost as line_cost,\n i.line_total - (i.quantity * m.cost) as line_margin\n from items i\n left join margins m on i.product_id = m.product_id\n)\n\nselect * from enriched", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_order_items_with_products": { + "id": "model.jaffle_shop.int_order_items_with_products", + "name": "int_order_items_with_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with order_items as (\n select * from {{ ref('stg_order_items') }}\n),\n\nproducts as (\n select * from {{ ref('int_products_with_categories') }}\n),\n\njoined as (\n select\n oi.order_item_id,\n oi.order_id,\n oi.product_id,\n p.product_name,\n p.category_name,\n p.root_category,\n p.category_path,\n oi.quantity,\n oi.unit_price,\n oi.quantity * oi.unit_price as line_total\n from order_items oi\n left join products p on oi.product_id = p.product_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_products": { + "id": "seed.jaffle_shop.raw_products", + "name": "raw_products", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_performance": { + "id": "model.jaffle_shop.int_store_performance", + "name": "int_store_performance", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with revenue as (\n select * from {{ ref('int_store_revenue') }}\n),\n\nstaff as (\n select * from {{ ref('int_store_employees_active') }}\n),\n\nperformance as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n s.total_employees,\n r.order_count,\n r.unique_customers,\n r.total_revenue,\n r.total_margin,\n r.avg_order_value,\n case when s.total_employees > 0\n then round(r.total_revenue / s.total_employees, 2)\n else 0\n end as revenue_per_employee,\n case when s.total_employees > 0\n then round(cast(r.order_count as decimal) / s.total_employees, 1)\n else 0\n end as orders_per_employee\n from staff s\n left join revenue r on s.store_id = r.store_id\n)\n\nselect * from performance", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_order_promotions": { + "id": "seed.jaffle_shop.raw_order_promotions", + "name": "raw_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_categories": { + "id": "seed.jaffle_shop.raw_categories", + "name": "raw_categories", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_promotions": { + "id": "model.jaffle_shop.stg_promotions", + "name": "stg_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_promotions') }}\n),\n\nrenamed as (\n select\n id as promotion_id,\n name as promotion_name,\n discount_type,\n cast(discount_value as decimal) as discount_value,\n cast(start_date as date) as start_date,\n cast(end_date as date) as end_date\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_revenue": { + "id": "model.jaffle_shop.int_store_revenue", + "name": "int_store_revenue", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with assignments as (\n select * from {{ ref('int_store_order_assignments') }}\n),\n\norders as (\n select * from {{ ref('int_order_enriched') }}\n),\n\nstore_rev as (\n select\n a.store_id,\n count(distinct a.order_id) as order_count,\n count(distinct a.customer_id) as unique_customers,\n sum(o.subtotal) as total_revenue,\n sum(o.total_cost) as total_cost,\n sum(o.total_margin) as total_margin,\n avg(o.subtotal) as avg_order_value\n from assignments a\n inner join orders o on a.order_id = o.order_id\n where o.status != 'returned'\n group by a.store_id\n)\n\nselect * from store_rev", + "source_name": null, + "change_status": "modified", + "change_category": "breaking", + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.store_rankings": { + "id": "model.jaffle_shop.store_rankings", + "name": "store_rankings", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with performance as (\n select * from {{ ref('store_performance') }}\n),\n\nranked as (\n select\n store_id,\n store_name,\n city,\n state,\n total_revenue,\n total_margin,\n order_count,\n unique_customers,\n revenue_per_employee,\n rank() over (order by total_revenue desc) as revenue_rank,\n rank() over (order by total_margin desc) as margin_rank,\n rank() over (order by order_count desc) as order_count_rank,\n rank() over (order by revenue_per_employee desc) as efficiency_rank,\n rank() over (order by unique_customers desc) as customer_reach_rank\n from performance\n)\n\nselect * from ranked", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "seed.jaffle_shop.raw_employees": { + "id": "seed.jaffle_shop.raw_employees", + "name": "raw_employees", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "seed.jaffle_shop.raw_employees_store_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_payments": { + "id": "model.jaffle_shop.stg_payments", + "name": "stg_payments", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "{{ config(materialized='table') }}\n \n with source as (\n \n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n CAST(payment_method as varchar(74)) as payment_method, -- Cast to varchar to ensure consistent data type\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount as amount\n\n from source\n where amount > 0 -- We only want to include payments with a positive amount\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_orders": { + "id": "model.jaffle_shop.stg_orders", + "name": "stg_orders", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n 'ORDER-' || status as status\n\n from source\n\n)\n\nselect * from renamed", + "source_name": null, + "change_status": "modified", + "change_category": "partial_breaking", + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_stores": { + "id": "model.jaffle_shop.stg_stores", + "name": "stg_stores", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_stores') }}\n),\n\nrenamed as (\n select\n id as store_id,\n name as store_name,\n city,\n state,\n cast(opened_at as date) as opened_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.stg_stores_store_id", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "store_name": { + "id": "model.jaffle_shop.stg_stores_store_name", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "city": { + "id": "model.jaffle_shop.stg_stores_city", + "table_id": "model.jaffle_shop.stg_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "state": { + "id": "model.jaffle_shop.stg_stores_state", + "table_id": "model.jaffle_shop.stg_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_store_employees_active": { + "id": "model.jaffle_shop.int_store_employees_active", + "name": "int_store_employees_active", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with employees as (\n select * from {{ ref('stg_employees') }}\n),\n\nstores as (\n select * from {{ ref('stg_stores') }}\n),\n\nstore_staff as (\n select\n s.store_id,\n s.store_name,\n s.city,\n s.state,\n count(*) as total_employees,\n sum(case when e.role = 'manager' then 1 else 0 end) as manager_count,\n sum(case when e.role = 'barista' then 1 else 0 end) as barista_count,\n sum(case when e.role = 'cashier' then 1 else 0 end) as cashier_count,\n sum(case when e.role = 'cook' then 1 else 0 end) as cook_count,\n min(e.hired_at) as earliest_hire,\n max(e.hired_at) as latest_hire\n from stores s\n left join employees e on s.store_id = e.store_id\n group by s.store_id, s.store_name, s.city, s.state\n)\n\nselect * from store_staff", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "seed.jaffle_shop.raw_payments": { + "id": "seed.jaffle_shop.raw_payments", + "name": "raw_payments", + "package_name": "jaffle_shop", + "resource_type": "seed", + "raw_code": "", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.stg_products": { + "id": "model.jaffle_shop.stg_products", + "name": "stg_products", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_products') }}\n),\n\nrenamed as (\n select\n id as product_id,\n name as product_name,\n category_id,\n price as price_cents,\n cost as cost_cents,\n cast(price as decimal) / 100 as price,\n cast(cost as decimal) / 100 as cost,\n cast(created_at as date) as created_at\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.rpt_store_dashboard": { + "id": "model.jaffle_shop.rpt_store_dashboard", + "name": "rpt_store_dashboard", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with rankings as (\n select * from {{ ref('store_rankings') }}\n),\n\ninventory as (\n select * from {{ ref('store_inventory') }}\n),\n\ndaily as (\n select\n store_id,\n count(distinct order_date) as active_days,\n avg(revenue) as avg_daily_revenue\n from {{ ref('metric_store_daily') }}\n group by store_id\n),\n\ndashboard as (\n select\n r.store_id,\n r.store_name,\n r.city,\n r.state,\n r.total_revenue,\n r.total_margin,\n r.order_count,\n r.unique_customers,\n r.revenue_per_employee,\n r.revenue_rank,\n r.efficiency_rank,\n i.total_stock_units,\n i.out_of_stock_products,\n i.low_stock_products,\n d.active_days,\n d.avg_daily_revenue\n from rankings r\n left join inventory i on r.store_id = i.store_id\n left join daily d on r.store_id = d.store_id\n)\n\nselect * from dashboard", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": {}, + "impacted": true + }, + "model.jaffle_shop.stg_order_promotions": { + "id": "model.jaffle_shop.stg_order_promotions", + "name": "stg_order_promotions", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with source as (\n select * from {{ ref('raw_order_promotions') }}\n),\n\nrenamed as (\n select\n order_id,\n promotion_id\n from source\n)\n\nselect * from renamed", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + }, + "model.jaffle_shop.int_products_with_categories": { + "id": "model.jaffle_shop.int_products_with_categories", + "name": "int_products_with_categories", + "package_name": "jaffle_shop", + "resource_type": "model", + "raw_code": "with products as (\n select * from {{ ref('stg_products') }}\n),\n\ncategories as (\n select * from {{ ref('int_category_hierarchy') }}\n),\n\njoined as (\n select\n p.product_id,\n p.product_name,\n p.category_id,\n c.category_name,\n c.root_category,\n c.full_path as category_path,\n c.depth as category_depth,\n p.price,\n p.cost,\n p.created_at\n from products p\n left join categories c on p.category_id = c.category_id\n)\n\nselect * from joined", + "source_name": null, + "change_status": null, + "change_category": null, + "columns": { + "product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "impacted": true + } + }, + "columns": { + "seed.jaffle_shop.raw_orders_id": { + "id": "seed.jaffle_shop.raw_orders_id", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_orders_status": { + "id": "seed.jaffle_shop.raw_orders_status", + "table_id": "seed.jaffle_shop.raw_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_promotions_id": { + "id": "seed.jaffle_shop.raw_promotions_id", + "table_id": "seed.jaffle_shop.raw_promotions", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_payments_matched_order_id": { + "id": "model.jaffle_shop.int_order_payments_matched_order_id", + "table_id": "model.jaffle_shop.int_order_payments_matched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_category_hierarchy_category_id": { + "id": "model.jaffle_shop.int_category_hierarchy_category_id", + "table_id": "model.jaffle_shop.int_category_hierarchy", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_id": { + "id": "seed.jaffle_shop.raw_stores_id", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_name": { + "id": "seed.jaffle_shop.raw_stores_name", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "name", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_city": { + "id": "seed.jaffle_shop.raw_stores_city", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_stores_state": { + "id": "seed.jaffle_shop.raw_stores_state", + "table_id": "seed.jaffle_shop.raw_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_totals_order_id": { + "id": "model.jaffle_shop.int_order_totals_order_id", + "table_id": "model.jaffle_shop.int_order_totals", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_employees_store_id": { + "id": "model.jaffle_shop.stg_employees_store_id", + "table_id": "model.jaffle_shop.stg_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_product_margins_product_id": { + "id": "model.jaffle_shop.int_product_margins_product_id", + "table_id": "model.jaffle_shop.int_product_margins", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_order_id": { + "id": "model.jaffle_shop.int_store_order_assignments_order_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_order_assignments_store_id": { + "id": "model.jaffle_shop.int_store_order_assignments_store_id", + "table_id": "model.jaffle_shop.int_store_order_assignments", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "derived", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_order_id": { + "id": "model.jaffle_shop.int_order_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_enriched_status": { + "id": "model.jaffle_shop.int_order_enriched_status", + "table_id": "model.jaffle_shop.int_order_enriched", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_order_id": { + "id": "seed.jaffle_shop.raw_order_items_order_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_items_product_id": { + "id": "seed.jaffle_shop.raw_order_items_product_id", + "table_id": "seed.jaffle_shop.raw_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_order_id": { + "id": "model.jaffle_shop.stg_order_items_order_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_items_product_id": { + "id": "model.jaffle_shop.stg_order_items_product_id", + "table_id": "model.jaffle_shop.stg_order_items", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_order_id": { + "id": "model.jaffle_shop.int_orders_with_promotions_order_id", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_orders_with_promotions_status": { + "id": "model.jaffle_shop.int_orders_with_promotions_status", + "table_id": "model.jaffle_shop.int_orders_with_promotions", + "name": "status", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_category_id": { + "id": "model.jaffle_shop.stg_categories_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_categories_parent_category_id": { + "id": "model.jaffle_shop.stg_categories_parent_category_id", + "table_id": "model.jaffle_shop.stg_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_enriched_order_id": { + "id": "model.jaffle_shop.int_order_items_enriched_order_id", + "table_id": "model.jaffle_shop.int_order_items_enriched", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_order_id": { + "id": "model.jaffle_shop.int_order_items_with_products_order_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_order_items_with_products_product_id": { + "id": "model.jaffle_shop.int_order_items_with_products_product_id", + "table_id": "model.jaffle_shop.int_order_items_with_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_id": { + "id": "seed.jaffle_shop.raw_products_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_products_category_id": { + "id": "seed.jaffle_shop.raw_products_category_id", + "table_id": "seed.jaffle_shop.raw_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_order_id": { + "id": "seed.jaffle_shop.raw_order_promotions_order_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_order_promotions_promotion_id": { + "id": "seed.jaffle_shop.raw_order_promotions_promotion_id", + "table_id": "seed.jaffle_shop.raw_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_id": { + "id": "seed.jaffle_shop.raw_categories_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_categories_parent_category_id": { + "id": "seed.jaffle_shop.raw_categories_parent_category_id", + "table_id": "seed.jaffle_shop.raw_categories", + "name": "parent_category_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_revenue_store_id": { + "id": "model.jaffle_shop.int_store_revenue_store_id", + "table_id": "model.jaffle_shop.int_store_revenue", + "name": "store_id", + "type": "BIGINT", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_employees_store_id": { + "id": "seed.jaffle_shop.raw_employees_store_id", + "table_id": "seed.jaffle_shop.raw_employees", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_payments_order_id": { + "id": "model.jaffle_shop.stg_payments_order_id", + "table_id": "model.jaffle_shop.stg_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_order_id": { + "id": "model.jaffle_shop.stg_orders_order_id", + "table_id": "model.jaffle_shop.stg_orders", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_orders_status": { + "id": "model.jaffle_shop.stg_orders_status", + "table_id": "model.jaffle_shop.stg_orders", + "name": "status", + "type": "VARCHAR", + "transformation_type": "derived", + "change_status": "modified", + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_store_id": { + "id": "model.jaffle_shop.stg_stores_store_id", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_store_name": { + "id": "model.jaffle_shop.stg_stores_store_name", + "table_id": "model.jaffle_shop.stg_stores", + "name": "store_name", + "type": "VARCHAR", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_city": { + "id": "model.jaffle_shop.stg_stores_city", + "table_id": "model.jaffle_shop.stg_stores", + "name": "city", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_stores_state": { + "id": "model.jaffle_shop.stg_stores_state", + "table_id": "model.jaffle_shop.stg_stores", + "name": "state", + "type": "VARCHAR", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_store_employees_active_store_id": { + "id": "model.jaffle_shop.int_store_employees_active_store_id", + "table_id": "model.jaffle_shop.int_store_employees_active", + "name": "store_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_order_id": { + "id": "seed.jaffle_shop.raw_payments_order_id", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "seed.jaffle_shop.raw_payments_amount": { + "id": "seed.jaffle_shop.raw_payments_amount", + "table_id": "seed.jaffle_shop.raw_payments", + "name": "amount", + "type": "INTEGER", + "transformation_type": "source", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_product_id": { + "id": "model.jaffle_shop.stg_products_product_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "renamed", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_products_category_id": { + "id": "model.jaffle_shop.stg_products_category_id", + "table_id": "model.jaffle_shop.stg_products", + "name": "category_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_order_id": { + "id": "model.jaffle_shop.stg_order_promotions_order_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "order_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.stg_order_promotions_promotion_id": { + "id": "model.jaffle_shop.stg_order_promotions_promotion_id", + "table_id": "model.jaffle_shop.stg_order_promotions", + "name": "promotion_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + }, + "model.jaffle_shop.int_products_with_categories_product_id": { + "id": "model.jaffle_shop.int_products_with_categories_product_id", + "table_id": "model.jaffle_shop.int_products_with_categories", + "name": "product_id", + "type": "INTEGER", + "transformation_type": "passthrough", + "change_status": null, + "depends_on": [] + } + }, + "parent_map": { + "seed.jaffle_shop.raw_orders": [], + "seed.jaffle_shop.raw_orders_id": [], + "seed.jaffle_shop.raw_orders_status": [], + "seed.jaffle_shop.raw_promotions": [], + "seed.jaffle_shop.raw_promotions_id": [], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.stg_payments", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.stg_payments_order_id" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.stg_payments_order_id", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.stg_categories", + "model.jaffle_shop.stg_categories_parent_category_id", + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_stores": [], + "seed.jaffle_shop.raw_stores_id": [], + "seed.jaffle_shop.raw_stores_name": [], + "seed.jaffle_shop.raw_stores_city": [], + "seed.jaffle_shop.raw_stores_state": [], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_items_enriched_order_id", + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.stg_employees": ["seed.jaffle_shop.raw_employees"], + "model.jaffle_shop.stg_employees_store_id": [ + "seed.jaffle_shop.raw_employees_store_id" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.stg_products" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.stg_orders", + "model.jaffle_shop.stg_stores" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_orders_with_promotions", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_order_totals_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_orders_with_promotions_order_id" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "seed.jaffle_shop.raw_order_items": [], + "seed.jaffle_shop.raw_order_items_order_id": [], + "seed.jaffle_shop.raw_order_items_product_id": [], + "model.jaffle_shop.stg_order_items": ["seed.jaffle_shop.raw_order_items"], + "model.jaffle_shop.stg_order_items_order_id": [ + "seed.jaffle_shop.raw_order_items_order_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "seed.jaffle_shop.raw_order_items_product_id" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.stg_order_promotions_promotion_id", + "model.jaffle_shop.stg_promotions", + "model.jaffle_shop.stg_order_promotions", + "model.jaffle_shop.stg_promotions_promotion_id", + "model.jaffle_shop.stg_orders_order_id", + "model.jaffle_shop.stg_order_promotions_order_id", + "model.jaffle_shop.stg_orders" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "model.jaffle_shop.stg_categories": ["seed.jaffle_shop.raw_categories"], + "model.jaffle_shop.stg_categories_category_id": [ + "seed.jaffle_shop.raw_categories_id" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "seed.jaffle_shop.raw_categories_parent_category_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_order_items_with_products", + "model.jaffle_shop.int_order_items_with_products_product_id" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.stg_order_items_product_id", + "model.jaffle_shop.stg_order_items", + "model.jaffle_shop.int_products_with_categories", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "seed.jaffle_shop.raw_products": [], + "seed.jaffle_shop.raw_products_id": [], + "seed.jaffle_shop.raw_products_category_id": [], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.int_store_employees_active", + "model.jaffle_shop.int_store_revenue_store_id" + ], + "seed.jaffle_shop.raw_order_promotions": [], + "seed.jaffle_shop.raw_order_promotions_order_id": [], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [], + "seed.jaffle_shop.raw_categories": [], + "seed.jaffle_shop.raw_categories_id": [], + "seed.jaffle_shop.raw_categories_parent_category_id": [], + "model.jaffle_shop.stg_promotions": ["seed.jaffle_shop.raw_promotions"], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "seed.jaffle_shop.raw_promotions_id" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_order_enriched_status", + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.store_performance" + ], + "seed.jaffle_shop.raw_employees": [], + "seed.jaffle_shop.raw_employees_store_id": [], + "model.jaffle_shop.stg_payments": [ + "seed.jaffle_shop.raw_payments", + "seed.jaffle_shop.raw_payments_amount" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "seed.jaffle_shop.raw_payments_order_id" + ], + "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], + "model.jaffle_shop.stg_orders_order_id": [ + "seed.jaffle_shop.raw_orders_id" + ], + "model.jaffle_shop.stg_orders_status": [ + "seed.jaffle_shop.raw_orders_status" + ], + "model.jaffle_shop.stg_stores": ["seed.jaffle_shop.raw_stores"], + "model.jaffle_shop.stg_stores_store_id": [ + "seed.jaffle_shop.raw_stores_id" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "seed.jaffle_shop.raw_stores_name" + ], + "model.jaffle_shop.stg_stores_city": ["seed.jaffle_shop.raw_stores_city"], + "model.jaffle_shop.stg_stores_state": [ + "seed.jaffle_shop.raw_stores_state" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.stg_stores_store_name", + "model.jaffle_shop.stg_employees_store_id", + "model.jaffle_shop.stg_stores", + "model.jaffle_shop.stg_stores_store_id", + "model.jaffle_shop.stg_employees", + "model.jaffle_shop.stg_stores_state", + "model.jaffle_shop.stg_stores_city" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "seed.jaffle_shop.raw_payments": [], + "seed.jaffle_shop.raw_payments_order_id": [], + "seed.jaffle_shop.raw_payments_amount": [], + "model.jaffle_shop.stg_products": ["seed.jaffle_shop.raw_products"], + "model.jaffle_shop.stg_products_product_id": [ + "seed.jaffle_shop.raw_products_id" + ], + "model.jaffle_shop.stg_products_category_id": [ + "seed.jaffle_shop.raw_products_category_id" + ], + "model.jaffle_shop.rpt_store_dashboard": [ + "model.jaffle_shop.store_rankings" + ], + "model.jaffle_shop.stg_order_promotions": [ + "seed.jaffle_shop.raw_order_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "seed.jaffle_shop.raw_order_promotions_order_id" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "seed.jaffle_shop.raw_order_promotions_promotion_id" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.stg_products", + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id", + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.stg_products_product_id" + ] + }, + "child_map": { + "model.jaffle_shop.int_order_enriched": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_status": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_enriched_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.stg_payments": [ + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.int_order_totals_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_payments_order_id": [ + "model.jaffle_shop.int_order_payments_matched_order_id", + "model.jaffle_shop.int_order_payments_matched" + ], + "model.jaffle_shop.stg_orders": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_order_id": [ + "model.jaffle_shop.int_store_order_assignments_store_id", + "model.jaffle_shop.int_store_order_assignments_order_id", + "model.jaffle_shop.int_orders_with_promotions_order_id", + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_orders_status": [ + "model.jaffle_shop.int_orders_with_promotions_status" + ], + "model.jaffle_shop.int_products_with_categories": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.int_products_with_categories_product_id": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_categories": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_parent_category_id": [ + "model.jaffle_shop.int_category_hierarchy" + ], + "model.jaffle_shop.stg_categories_category_id": [ + "model.jaffle_shop.int_category_hierarchy", + "model.jaffle_shop.int_category_hierarchy_category_id" + ], + "model.jaffle_shop.int_store_performance": [ + "model.jaffle_shop.store_performance" + ], + "model.jaffle_shop.int_order_items_enriched_order_id": [ + "model.jaffle_shop.int_order_totals", + "model.jaffle_shop.int_order_totals_order_id" + ], + "model.jaffle_shop.int_order_items_enriched": [ + "model.jaffle_shop.int_order_totals" + ], + "seed.jaffle_shop.raw_employees": ["model.jaffle_shop.stg_employees"], + "seed.jaffle_shop.raw_employees_store_id": [ + "model.jaffle_shop.stg_employees_store_id" + ], + "model.jaffle_shop.int_order_items_with_products_order_id": [ + "model.jaffle_shop.int_order_items_enriched_order_id" + ], + "model.jaffle_shop.int_store_order_assignments_order_id": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_store_order_assignments": [ + "model.jaffle_shop.int_store_revenue" + ], + "model.jaffle_shop.int_order_items_with_products": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_order_items_with_products_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_store_order_assignments_store_id": [ + "model.jaffle_shop.int_store_revenue", + "model.jaffle_shop.int_store_revenue_store_id" + ], + "model.jaffle_shop.stg_products": [ + "model.jaffle_shop.int_product_margins", + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_product_id": [ + "model.jaffle_shop.int_product_margins_product_id", + "model.jaffle_shop.int_products_with_categories_product_id" + ], + "model.jaffle_shop.stg_stores": [ + "model.jaffle_shop.int_store_order_assignments", + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.int_product_margins_product_id": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_product_margins": [ + "model.jaffle_shop.int_order_items_enriched" + ], + "model.jaffle_shop.int_store_employees_active": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_employees_active_store_id": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_order_payments_matched_order_id": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_order_id": [ + "model.jaffle_shop.int_order_enriched", + "model.jaffle_shop.int_order_enriched_order_id" + ], + "model.jaffle_shop.int_order_payments_matched": [ + "model.jaffle_shop.int_order_enriched" + ], + "model.jaffle_shop.int_orders_with_promotions_status": [ + "model.jaffle_shop.int_order_enriched_status" + ], + "seed.jaffle_shop.raw_order_items": ["model.jaffle_shop.stg_order_items"], + "seed.jaffle_shop.raw_order_items_order_id": [ + "model.jaffle_shop.stg_order_items_order_id" + ], + "seed.jaffle_shop.raw_order_items_product_id": [ + "model.jaffle_shop.stg_order_items_product_id" + ], + "model.jaffle_shop.stg_stores_store_id": [ + "model.jaffle_shop.int_store_employees_active_store_id", + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_employees_store_id": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_employees": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_stores_store_name": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_stores_city": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.stg_stores_state": [ + "model.jaffle_shop.int_store_employees_active" + ], + "model.jaffle_shop.int_category_hierarchy": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.int_category_hierarchy_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_products_category_id": [ + "model.jaffle_shop.int_products_with_categories" + ], + "model.jaffle_shop.stg_order_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_promotions_promotion_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "model.jaffle_shop.stg_order_promotions_order_id": [ + "model.jaffle_shop.int_orders_with_promotions" + ], + "seed.jaffle_shop.raw_categories": ["model.jaffle_shop.stg_categories"], + "seed.jaffle_shop.raw_categories_id": [ + "model.jaffle_shop.stg_categories_category_id" + ], + "seed.jaffle_shop.raw_categories_parent_category_id": [ + "model.jaffle_shop.stg_categories_parent_category_id" + ], + "model.jaffle_shop.stg_order_items_product_id": [ + "model.jaffle_shop.int_order_items_with_products_product_id", + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items": [ + "model.jaffle_shop.int_order_items_with_products" + ], + "model.jaffle_shop.stg_order_items_order_id": [ + "model.jaffle_shop.int_order_items_with_products_order_id" + ], + "model.jaffle_shop.int_store_revenue": [ + "model.jaffle_shop.int_store_performance" + ], + "model.jaffle_shop.int_store_revenue_store_id": [ + "model.jaffle_shop.int_store_performance" + ], + "seed.jaffle_shop.raw_promotions": ["model.jaffle_shop.stg_promotions"], + "seed.jaffle_shop.raw_promotions_id": [ + "model.jaffle_shop.stg_promotions_promotion_id" + ], + "model.jaffle_shop.store_performance": [ + "model.jaffle_shop.store_rankings" + ], + "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], + "seed.jaffle_shop.raw_payments_amount": [ + "model.jaffle_shop.stg_payments" + ], + "seed.jaffle_shop.raw_payments_order_id": [ + "model.jaffle_shop.stg_payments_order_id" + ], + "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], + "seed.jaffle_shop.raw_orders_id": [ + "model.jaffle_shop.stg_orders_order_id" + ], + "seed.jaffle_shop.raw_orders_status": [ + "model.jaffle_shop.stg_orders_status" + ], + "seed.jaffle_shop.raw_stores": ["model.jaffle_shop.stg_stores"], + "seed.jaffle_shop.raw_stores_id": [ + "model.jaffle_shop.stg_stores_store_id" + ], + "seed.jaffle_shop.raw_stores_name": [ + "model.jaffle_shop.stg_stores_store_name" + ], + "seed.jaffle_shop.raw_stores_city": ["model.jaffle_shop.stg_stores_city"], + "seed.jaffle_shop.raw_stores_state": [ + "model.jaffle_shop.stg_stores_state" + ], + "seed.jaffle_shop.raw_products": ["model.jaffle_shop.stg_products"], + "seed.jaffle_shop.raw_products_id": [ + "model.jaffle_shop.stg_products_product_id" + ], + "seed.jaffle_shop.raw_products_category_id": [ + "model.jaffle_shop.stg_products_category_id" + ], + "model.jaffle_shop.store_rankings": [ + "model.jaffle_shop.rpt_store_dashboard" + ], + "seed.jaffle_shop.raw_order_promotions": [ + "model.jaffle_shop.stg_order_promotions" + ], + "seed.jaffle_shop.raw_order_promotions_order_id": [ + "model.jaffle_shop.stg_order_promotions_order_id" + ], + "seed.jaffle_shop.raw_order_promotions_promotion_id": [ + "model.jaffle_shop.stg_order_promotions_promotion_id" + ] + } + } +} diff --git a/js/packages/ui/src/components/lineage/__tests__/sliceCllMap.equivalence.test.ts b/js/packages/ui/src/components/lineage/__tests__/sliceCllMap.equivalence.test.ts new file mode 100644 index 000000000..a7fe54048 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/sliceCllMap.equivalence.test.ts @@ -0,0 +1,412 @@ +/** + * Equivalence test: sliceCllMap() vs backend API responses + * + * Compares sliceCllMap(fullMap, params) against pre-captured backend responses + * for the same params. Fixtures were captured from a running recce server + * against jaffle_shop_duckdb. + * + * To regenerate fixtures: run /tmp/capture_cll_fixtures.py with a running server. + */ + +import { readFileSync } from "node:fs"; +import { join } from "node:path"; +import { describe, expect, it } from "vitest"; +import type { CllInput, ColumnLineageData } from "../../../api/cll"; +import { sliceCllMap } from "../sliceCllMap"; + +const FIXTURES = join(__dirname, "fixtures"); + +function loadFixture(name: string): ColumnLineageData { + return JSON.parse(readFileSync(join(FIXTURES, `${name}.json`), "utf-8")); +} + +function sortedKeys(obj: Record): string[] { + return Object.keys(obj).sort(); +} + +function sortMapValues( + map: Record, +): Record { + const result: Record = {}; + for (const [key, val] of Object.entries(map)) { + result[key] = [...val].sort(); + } + return result; +} + +/** + * Compare sliceCllMap output against a server fixture. + * + * Checks: same nodes, same columns, same parent_map keys+values, same child_map keys+values. + */ +function assertEquivalent( + label: string, + client: ColumnLineageData, + server: ColumnLineageData, +) { + const clientNodes = sortedKeys(client.current.nodes); + const serverNodes = sortedKeys(server.current.nodes); + expect(clientNodes, `${label}: nodes`).toEqual(serverNodes); + + const clientCols = sortedKeys(client.current.columns); + const serverCols = sortedKeys(server.current.columns); + expect(clientCols, `${label}: columns`).toEqual(serverCols); + + // Check node metadata: impacted flag and node.columns + for (const nid of serverNodes) { + const cn = client.current.nodes[nid]; + const sn = server.current.nodes[nid]; + expect(cn.impacted, `${label}: ${nid}.impacted`).toEqual(sn.impacted); + expect(sortedKeys(cn.columns ?? {}), `${label}: ${nid}.columns`).toEqual( + sortedKeys(sn.columns ?? {}), + ); + } + + const clientParent = sortMapValues(client.current.parent_map); + const serverParent = sortMapValues(server.current.parent_map); + expect(sortedKeys(clientParent), `${label}: parent_map keys`).toEqual( + sortedKeys(serverParent), + ); + for (const key of Object.keys(serverParent)) { + expect(clientParent[key], `${label}: parent_map[${key}]`).toEqual( + serverParent[key], + ); + } + + const clientChild = sortMapValues(client.current.child_map); + const serverChild = sortMapValues(server.current.child_map); + expect(sortedKeys(clientChild), `${label}: child_map keys`).toEqual( + sortedKeys(serverChild), + ); + for (const key of Object.keys(serverChild)) { + expect(clientChild[key], `${label}: child_map[${key}]`).toEqual( + serverChild[key], + ); + } +} + +const fullMap = loadFixture("cll-full-map"); + +interface TestCase { + label: string; + fixture: string; + params: CllInput; +} + +const NODE_TESTS: TestCase[] = [ + { + label: "order_discounts", + fixture: "cll-node-model_jaffle_shop_order_discounts", + params: { + node_id: "model.jaffle_shop.order_discounts", + change_analysis: true, + }, + }, + { + label: "order_discounts no_upstream", + fixture: "cll-node-model_jaffle_shop_order_discounts-no-upstream", + params: { + node_id: "model.jaffle_shop.order_discounts", + change_analysis: true, + no_upstream: true, + }, + }, + { + label: "order_discounts no_downstream", + fixture: "cll-node-model_jaffle_shop_order_discounts-no-downstream", + params: { + node_id: "model.jaffle_shop.order_discounts", + change_analysis: true, + no_downstream: true, + }, + }, + { + label: "stg_employees", + fixture: "cll-node-model_jaffle_shop_stg_employees", + params: { + node_id: "model.jaffle_shop.stg_employees", + change_analysis: true, + }, + }, + { + label: "stg_employees no_upstream", + fixture: "cll-node-model_jaffle_shop_stg_employees-no-upstream", + params: { + node_id: "model.jaffle_shop.stg_employees", + change_analysis: true, + no_upstream: true, + }, + }, + { + label: "stg_employees no_downstream", + fixture: "cll-node-model_jaffle_shop_stg_employees-no-downstream", + params: { + node_id: "model.jaffle_shop.stg_employees", + change_analysis: true, + no_downstream: true, + }, + }, + { + label: "revenue_summary", + fixture: "cll-node-model_jaffle_shop_revenue_summary", + params: { + node_id: "model.jaffle_shop.revenue_summary", + change_analysis: true, + }, + }, + { + label: "raw_stores", + fixture: "cll-node-seed_jaffle_shop_raw_stores", + params: { + node_id: "seed.jaffle_shop.raw_stores", + change_analysis: true, + }, + }, + { + label: "int_store_revenue", + fixture: "cll-node-model_jaffle_shop_int_store_revenue", + params: { + node_id: "model.jaffle_shop.int_store_revenue", + change_analysis: true, + }, + }, +]; + +const COLUMN_TESTS: TestCase[] = [ + { + label: "order_discounts.order_id", + fixture: "cll-col-model_jaffle_shop_order_discounts-order_id", + params: { + node_id: "model.jaffle_shop.order_discounts", + column: "order_id", + change_analysis: true, + }, + }, + { + label: "order_discounts.customer_id", + fixture: "cll-col-model_jaffle_shop_order_discounts-customer_id", + params: { + node_id: "model.jaffle_shop.order_discounts", + column: "customer_id", + change_analysis: true, + }, + }, + { + label: "stg_employees.employee_id", + fixture: "cll-col-model_jaffle_shop_stg_employees-employee_id", + params: { + node_id: "model.jaffle_shop.stg_employees", + column: "employee_id", + change_analysis: true, + }, + }, + { + label: "stg_employees.store_id", + fixture: "cll-col-model_jaffle_shop_stg_employees-store_id", + params: { + node_id: "model.jaffle_shop.stg_employees", + column: "store_id", + change_analysis: true, + }, + }, + { + label: "revenue_summary.order_date", + fixture: "cll-col-model_jaffle_shop_revenue_summary-order_date", + params: { + node_id: "model.jaffle_shop.revenue_summary", + column: "order_date", + change_analysis: true, + }, + }, + { + label: "revenue_summary.order_week", + fixture: "cll-col-model_jaffle_shop_revenue_summary-order_week", + params: { + node_id: "model.jaffle_shop.revenue_summary", + column: "order_week", + change_analysis: true, + }, + }, + { + label: "raw_stores.id", + fixture: "cll-col-seed_jaffle_shop_raw_stores-id", + params: { + node_id: "seed.jaffle_shop.raw_stores", + column: "id", + change_analysis: true, + }, + }, + { + label: "raw_stores.name", + fixture: "cll-col-seed_jaffle_shop_raw_stores-name", + params: { + node_id: "seed.jaffle_shop.raw_stores", + column: "name", + change_analysis: true, + }, + }, + { + label: "int_store_revenue.store_id", + fixture: "cll-col-model_jaffle_shop_int_store_revenue-store_id", + params: { + node_id: "model.jaffle_shop.int_store_revenue", + column: "store_id", + change_analysis: true, + }, + }, + { + label: "int_store_revenue.order_count", + fixture: "cll-col-model_jaffle_shop_int_store_revenue-order_count", + params: { + node_id: "model.jaffle_shop.int_store_revenue", + column: "order_count", + change_analysis: true, + }, + }, +]; + +describe("sliceCllMap equivalence with backend fixtures", () => { + describe("node-level (no changes)", () => { + for (const tc of NODE_TESTS) { + it(tc.label, () => { + const serverResult = loadFixture(tc.fixture); + const clientResult = sliceCllMap(fullMap, tc.params); + assertEquivalent(tc.label, clientResult, serverResult); + }); + } + }); + + describe("column-level (no changes)", () => { + for (const tc of COLUMN_TESTS) { + it(tc.label, () => { + const serverResult = loadFixture(tc.fixture); + const clientResult = sliceCllMap(fullMap, tc.params); + assertEquivalent(tc.label, clientResult, serverResult); + }); + } + }); +}); + +// ============================================================================ +// Diff fixtures: server with actual dbt changes (stg_customers: added column, +// stg_orders: modified column def, int_store_revenue: WHERE clause added). +// Full map captured with full_map=true (all 99 nodes). Each node/column +// fixture captured via classic API call for comparison. +// ============================================================================ + +const diffFullMap = loadFixture("diff/cll-diff-full-map"); + +// Helper to build a column test case +function col(nodeId: string, column: string): TestCase { + const safeCol = `${nodeId}_${column}`.replaceAll(".", "_"); + return { + label: `${nodeId.split(".").pop()}.${column}`, + fixture: `diff/cll-diff-col-${safeCol}`, + params: { node_id: nodeId, column, change_analysis: true }, + }; +} + +// Helper to build a node test case +function node(nodeId: string, label?: string): TestCase { + const safe = nodeId.replaceAll(".", "_"); + return { + label: label ?? nodeId.split(".").pop()!, + fixture: `diff/cll-diff-node-${safe}`, + params: { node_id: nodeId, change_analysis: true }, + }; +} + +// --- Changed nodes --- +const INT_STORE_REV = "model.jaffle_shop.int_store_revenue"; +const STG_ORDERS = "model.jaffle_shop.stg_orders"; +const STG_CUSTOMERS = "model.jaffle_shop.stg_customers"; +// --- Downstream / impacted nodes --- +const ORDERS = "model.jaffle_shop.orders"; +const INT_ORDER_ENRICHED = "model.jaffle_shop.int_order_enriched"; +const STORE_RANKINGS = "model.jaffle_shop.store_rankings"; +const ORDER_RETURNS = "model.jaffle_shop.order_returns"; + +const DIFF_NODE_TESTS: TestCase[] = [ + node(STG_CUSTOMERS, "stg_customers (non_breaking)"), + node(STG_ORDERS, "stg_orders (partial_breaking)"), + node(INT_STORE_REV, "int_store_revenue (breaking)"), + node(ORDERS, "orders (downstream)"), + node(INT_ORDER_ENRICHED, "int_order_enriched (downstream)"), + node(STORE_RANKINGS, "store_rankings (far downstream)"), + node(ORDER_RETURNS, "order_returns (downstream)"), +]; + +const DIFF_COLUMN_TESTS: TestCase[] = [ + // int_store_revenue: breaking, 5 columns + col(INT_STORE_REV, "store_id"), + col(INT_STORE_REV, "order_count"), + col(INT_STORE_REV, "unique_customers"), + col(INT_STORE_REV, "total_revenue"), + col(INT_STORE_REV, "total_cost"), + // stg_orders: partial_breaking, 4 columns + col(STG_ORDERS, "status"), + col(STG_ORDERS, "order_id"), + col(STG_ORDERS, "customer_id"), + col(STG_ORDERS, "order_date"), + // stg_customers: non_breaking, 4 columns + col(STG_CUSTOMERS, "full_name"), + col(STG_CUSTOMERS, "customer_id"), + col(STG_CUSTOMERS, "first_name"), + col(STG_CUSTOMERS, "last_name"), + // orders: downstream, 5 columns (reaches outside impact scope) + col(ORDERS, "order_id"), + col(ORDERS, "customer_id"), + col(ORDERS, "order_date"), + col(ORDERS, "status"), + col(ORDERS, "credit_card_amount"), + // int_order_enriched: downstream, 5 columns + col(INT_ORDER_ENRICHED, "order_id"), + col(INT_ORDER_ENRICHED, "customer_id"), + col(INT_ORDER_ENRICHED, "order_date"), + col(INT_ORDER_ENRICHED, "status"), + col(INT_ORDER_ENRICHED, "item_count"), + // store_rankings: far downstream, 5 columns + col(STORE_RANKINGS, "store_id"), + col(STORE_RANKINGS, "store_name"), + col(STORE_RANKINGS, "city"), + col(STORE_RANKINGS, "state"), + col(STORE_RANKINGS, "total_revenue"), + // order_returns: downstream, 5 columns + col(ORDER_RETURNS, "order_id"), + col(ORDER_RETURNS, "customer_id"), + col(ORDER_RETURNS, "order_date"), + col(ORDER_RETURNS, "status"), + col(ORDER_RETURNS, "credit_card_amount"), +]; + +describe("sliceCllMap equivalence with diff fixtures", () => { + describe("impact overview", () => { + it("matches server impact overview", () => { + const serverResult = loadFixture("diff/cll-diff-impact-overview"); + const clientResult = sliceCllMap(diffFullMap, { + change_analysis: true, + }); + assertEquivalent("impact-overview", clientResult, serverResult); + }); + }); + + describe("node-level (with changes)", () => { + for (const tc of DIFF_NODE_TESTS) { + it(tc.label, () => { + const serverResult = loadFixture(tc.fixture); + const clientResult = sliceCllMap(diffFullMap, tc.params); + assertEquivalent(tc.label, clientResult, serverResult); + }); + } + }); + + describe("column-level (with changes)", () => { + for (const tc of DIFF_COLUMN_TESTS) { + it(tc.label, () => { + const serverResult = loadFixture(tc.fixture); + const clientResult = sliceCllMap(diffFullMap, tc.params); + assertEquivalent(tc.label, clientResult, serverResult); + }); + } + }); +}); diff --git a/js/packages/ui/src/components/lineage/__tests__/sliceCllMap.test.ts b/js/packages/ui/src/components/lineage/__tests__/sliceCllMap.test.ts new file mode 100644 index 000000000..649de72f8 --- /dev/null +++ b/js/packages/ui/src/components/lineage/__tests__/sliceCllMap.test.ts @@ -0,0 +1,301 @@ +import type { CllInput, ColumnLineageData } from "../../../api/cll"; +import { sliceCllMap } from "../sliceCllMap"; + +/** + * Test graph topology: + * + * source_a ──► staging ──► mart + * + * source_a columns: id, name + * staging columns: id, name, amount + * mart columns: id, total + * + * Column lineage: + * source_a.id → staging.id → mart.id + * source_a.name → staging.name + * staging.amount → mart.total + */ + +const SOURCE = "model.test.source_a"; +const STAGING = "model.test.staging"; +const MART = "model.test.mart"; + +function makeFullMap(): ColumnLineageData { + return { + current: { + nodes: { + [SOURCE]: { + id: SOURCE, + name: "source_a", + source_name: "", + resource_type: "source", + change_status: "modified", + change_category: "breaking", + impacted: false, + }, + [STAGING]: { + id: STAGING, + name: "staging", + source_name: "", + resource_type: "model", + impacted: true, + }, + [MART]: { + id: MART, + name: "mart", + source_name: "", + resource_type: "model", + impacted: true, + }, + }, + columns: { + [`${SOURCE}_id`]: { name: "id", type: "INTEGER" }, + [`${SOURCE}_name`]: { name: "name", type: "VARCHAR" }, + [`${STAGING}_id`]: { name: "id", type: "INTEGER" }, + [`${STAGING}_name`]: { name: "name", type: "VARCHAR" }, + [`${STAGING}_amount`]: { name: "amount", type: "FLOAT" }, + [`${MART}_id`]: { name: "id", type: "INTEGER" }, + [`${MART}_total`]: { name: "total", type: "FLOAT" }, + }, + parent_map: { + // Node-level parents (who feeds into this node) + [SOURCE]: [], + [STAGING]: [SOURCE], + [MART]: [STAGING], + // Column-level parents (who feeds into this column) + [`${SOURCE}_id`]: [], + [`${SOURCE}_name`]: [], + [`${STAGING}_id`]: [`${SOURCE}_id`], + [`${STAGING}_name`]: [`${SOURCE}_name`], + [`${STAGING}_amount`]: [], + [`${MART}_id`]: [`${STAGING}_id`], + [`${MART}_total`]: [`${STAGING}_amount`], + }, + child_map: { + // Node-level children + [SOURCE]: [STAGING], + [STAGING]: [MART], + [MART]: [], + // Column-level children + [`${SOURCE}_id`]: [`${STAGING}_id`], + [`${SOURCE}_name`]: [`${STAGING}_name`], + [`${STAGING}_id`]: [`${MART}_id`], + [`${STAGING}_name`]: [], + [`${STAGING}_amount`]: [`${MART}_total`], + [`${MART}_id`]: [], + [`${MART}_total`]: [], + }, + }, + }; +} + +describe("sliceCllMap", () => { + describe("impact overview (no node_id)", () => { + it("filters to changed nodes and their reachable lineage", () => { + const fullMap = makeFullMap(); + // source_a has change_status="modified", change_category="breaking" + // With change_analysis, it becomes an anchor. BFS reaches all 3 nodes. + const result = sliceCllMap(fullMap, { change_analysis: true }); + + // All nodes reachable from the changed source_a + expect(Object.keys(result.current.nodes).sort()).toEqual( + [SOURCE, STAGING, MART].sort(), + ); + }); + + it("without change_analysis, anchors on changed node IDs only", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, {}); + + // source_a is changed → anchor, BFS reaches staging and mart + expect(Object.keys(result.current.nodes).sort()).toEqual( + [SOURCE, STAGING, MART].sort(), + ); + }); + }); + + describe("node-level (node_id only)", () => { + it("includes the anchor node and its upstream/downstream", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { node_id: STAGING }); + + expect(Object.keys(result.current.nodes).sort()).toEqual( + [SOURCE, STAGING, MART].sort(), + ); + }); + + it("includes columns for all reachable nodes", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { node_id: STAGING }); + + // All columns from source, staging, and mart should be present + expect(Object.keys(result.current.columns).sort()).toEqual( + [ + `${SOURCE}_id`, + `${SOURCE}_name`, + `${STAGING}_id`, + `${STAGING}_name`, + `${STAGING}_amount`, + `${MART}_id`, + `${MART}_total`, + ].sort(), + ); + }); + + it("respects no_upstream — excludes upstream nodes", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + no_upstream: true, + }); + + expect(Object.keys(result.current.nodes).sort()).toEqual( + [STAGING, MART].sort(), + ); + // source_a columns should not appear + expect(result.current.columns[`${SOURCE}_id`]).toBeUndefined(); + expect(result.current.columns[`${SOURCE}_name`]).toBeUndefined(); + }); + + it("respects no_downstream — excludes downstream nodes", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + no_downstream: true, + }); + + expect(Object.keys(result.current.nodes).sort()).toEqual( + [SOURCE, STAGING].sort(), + ); + // mart columns should not appear + expect(result.current.columns[`${MART}_id`]).toBeUndefined(); + expect(result.current.columns[`${MART}_total`]).toBeUndefined(); + }); + + it("respects both no_upstream and no_downstream — anchor only", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + no_upstream: true, + no_downstream: true, + }); + + expect(Object.keys(result.current.nodes)).toEqual([STAGING]); + expect(Object.keys(result.current.columns).sort()).toEqual( + [`${STAGING}_id`, `${STAGING}_name`, `${STAGING}_amount`].sort(), + ); + }); + + it("filters parent_map and child_map to only include reachable entries", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + no_upstream: true, + }); + + // parent_map should not reference source columns + expect(result.current.parent_map[`${STAGING}_id`] ?? []).toEqual([]); + expect(result.current.parent_map[`${STAGING}_name`] ?? []).toEqual([]); + // child_map for staging columns should still point to mart + expect(result.current.child_map[`${STAGING}_id`]).toEqual([`${MART}_id`]); + }); + + it("handles anchor at the edge (leaf node)", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { node_id: MART }); + + expect(Object.keys(result.current.nodes).sort()).toEqual( + [SOURCE, STAGING, MART].sort(), + ); + }); + }); + + describe("column-level (node_id + column)", () => { + it("traces upstream and downstream from the anchor column", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + column: "id", + }); + + // Should trace: source_a.id → staging.id → mart.id + const columnKeys = Object.keys(result.current.columns).sort(); + expect(columnKeys).toEqual( + [`${SOURCE}_id`, `${STAGING}_id`, `${MART}_id`].sort(), + ); + }); + + it("does not include nodes in column-level results (matches backend)", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + column: "id", + }); + + // Backend returns only columns for column-level queries, not nodes + expect(Object.keys(result.current.nodes)).toEqual([]); + }); + + it("does not include unrelated columns", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + column: "id", + }); + + // staging.name and staging.amount are not in the id lineage + expect(result.current.columns[`${STAGING}_name`]).toBeUndefined(); + expect(result.current.columns[`${STAGING}_amount`]).toBeUndefined(); + expect(result.current.columns[`${SOURCE}_name`]).toBeUndefined(); + }); + + it("respects no_upstream with column anchor", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + column: "id", + no_upstream: true, + }); + + const columnKeys = Object.keys(result.current.columns).sort(); + expect(columnKeys).toEqual([`${STAGING}_id`, `${MART}_id`].sort()); + expect(result.current.nodes[SOURCE]).toBeUndefined(); + }); + + it("respects no_downstream with column anchor", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + column: "id", + no_downstream: true, + }); + + const columnKeys = Object.keys(result.current.columns).sort(); + expect(columnKeys).toEqual([`${SOURCE}_id`, `${STAGING}_id`].sort()); + expect(result.current.nodes[MART]).toBeUndefined(); + }); + + it("traces column with no upstream parents (origin column)", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + column: "amount", + }); + + // amount has no upstream, but flows to mart.total + const columnKeys = Object.keys(result.current.columns).sort(); + expect(columnKeys).toEqual([`${STAGING}_amount`, `${MART}_total`].sort()); + }); + + it("preserves change metadata on nodes in node-level results", () => { + const fullMap = makeFullMap(); + const result = sliceCllMap(fullMap, { + node_id: STAGING, + }); + + expect(result.current.nodes[SOURCE].change_status).toBe("modified"); + expect(result.current.nodes[SOURCE].change_category).toBe("breaking"); + expect(result.current.nodes[STAGING].impacted).toBe(true); + }); + }); +}); diff --git a/js/packages/ui/src/components/lineage/sliceCllMap.ts b/js/packages/ui/src/components/lineage/sliceCllMap.ts new file mode 100644 index 000000000..aca84b7f3 --- /dev/null +++ b/js/packages/ui/src/components/lineage/sliceCllMap.ts @@ -0,0 +1,346 @@ +import type { CllInput, ColumnLineageData } from "../../api/cll"; + +/** + * Client-side filtering of a full CLL map. + * + * Replicates the backend's anchor + reachability filtering: + * - No params → return full map (impact overview) + * - node_id → anchor node + reachable upstream/downstream + * - node_id + column → BFS from anchor column through parent/child maps + */ +export function sliceCllMap( + fullMap: ColumnLineageData, + params: CllInput, +): ColumnLineageData { + const { node_id, column, no_upstream, no_downstream } = params; + + // Impact overview — filter to changed nodes + reachable lineage + if (!node_id) { + return sliceImpactOverview(fullMap, params); + } + + const { nodes, columns, parent_map, child_map } = fullMap.current; + + if (column) { + // Column-level: BFS from anchor column through column maps only + const anchorKey = `${node_id}_${column}`; + const reachable = new Set([anchorKey]); + + if (!no_upstream) { + bfs(anchorKey, parent_map, reachable); + } + if (!no_downstream) { + bfs(anchorKey, child_map, reachable); + } + + // Split into nodes and columns (BFS may reach node keys too) + const reachableNodes = new Set(); + const reachableColumns = new Set(); + for (const key of reachable) { + if (nodes[key]) { + reachableNodes.add(key); + } else if (columns[key]) { + reachableColumns.add(key); + } + } + + return buildSlice(fullMap, reachableNodes, reachableColumns); + } + + // Node-level: build anchors based on change_analysis, then BFS + const anchors = new Set([node_id]); + const extraNodes = new Set(); + + if (params.change_analysis) { + const node = nodes[node_id]; + if (node?.change_status && node.change_status !== "removed") { + // Node has changes — anchor on changed columns, not the node itself + // (unless category is breaking/unknown) + anchors.delete(node_id); + extraNodes.add(node_id); + + if ( + node.change_category === "breaking" || + node.change_category === "unknown" + ) { + anchors.add(node_id); + } + + // Add changed columns as anchors + for (const colKey of Object.keys(columns)) { + if ( + colKey.startsWith(`${node_id}_`) && + columns[colKey]?.change_status + ) { + anchors.add(colKey); + } + } + } + // else: no changes — anchor stays as just node_id (no column anchors) + } else { + // No change_analysis — anchor on node + all its columns + for (const colKey of Object.keys(columns)) { + if (colKey.startsWith(`${node_id}_`)) { + anchors.add(colKey); + } + } + } + + // BFS upstream and downstream separately, then union (matches backend) + const reachable = bfsFromAnchors( + anchors, + parent_map, + child_map, + no_upstream, + no_downstream, + ); + + // Split into nodes and columns + const reachableNodes = new Set(); + const reachableColumns = new Set(); + for (const key of reachable) { + if (nodes[key]) { + reachableNodes.add(key); + } else if (columns[key]) { + reachableColumns.add(key); + } + } + + // Extra nodes: visible in nodes dict but NOT in maps (matches backend). + // Only truly "extra" if not already reached by BFS. + const onlyExtra = new Set(); + for (const nid of extraNodes) { + if (!reachable.has(nid)) { + onlyExtra.add(nid); + } + reachableNodes.add(nid); + } + + return buildSlice(fullMap, reachableNodes, reachableColumns, onlyExtra); +} + +/** + * Impact overview: find changed nodes, build anchors, BFS to reachable set. + * Matches the backend's anchor logic for node_id=None + change_analysis. + */ +function sliceImpactOverview( + fullMap: ColumnLineageData, + params: CllInput, +): ColumnLineageData { + const { nodes, columns, parent_map, child_map } = fullMap.current; + const { no_upstream, no_downstream } = params; + + if (!params.change_analysis) { + // Without change_analysis, all changed nodes are anchors + const anchors = new Set(); + for (const [nid, node] of Object.entries(nodes)) { + if (node.change_status) { + anchors.add(nid); + } + } + const reachable = bfsFromAnchors( + anchors, + parent_map, + child_map, + no_upstream, + no_downstream, + ); + const reachableNodes = new Set(); + const reachableColumns = new Set(); + for (const key of reachable) { + if (nodes[key]) reachableNodes.add(key); + else if (columns[key]) reachableColumns.add(key); + } + return buildSlice(fullMap, reachableNodes, reachableColumns); + } + + // change_analysis: replicate backend's per-status anchor logic + const anchors = new Set(); + const extraNodes = new Set(); + + for (const [nid, node] of Object.entries(nodes)) { + if (!node.change_status) continue; + + if (node.change_status === "added") { + // Added node + all its columns → anchors + anchors.add(nid); + for (const colKey of Object.keys(columns)) { + if (colKey.startsWith(`${nid}_`)) { + anchors.add(colKey); + } + } + continue; + } + + if (node.change_status === "removed") { + extraNodes.add(nid); + continue; + } + + // Modified: node → extra; breaking/unknown → also anchor; changed cols → anchors + extraNodes.add(nid); + if ( + node.change_category === "breaking" || + node.change_category === "unknown" + ) { + anchors.add(nid); + } + for (const colKey of Object.keys(columns)) { + if (colKey.startsWith(`${nid}_`) && columns[colKey]?.change_status) { + anchors.add(colKey); + } + } + } + + // BFS upstream and downstream separately, then union (matches backend) + const reachable = bfsFromAnchors( + anchors, + parent_map, + child_map, + no_upstream, + no_downstream, + ); + + // Split into nodes and columns + const reachableNodes = new Set(); + const reachableColumns = new Set(); + for (const key of reachable) { + if (nodes[key]) reachableNodes.add(key); + else if (columns[key]) reachableColumns.add(key); + } + + // Extra nodes: visible but not in maps + const onlyExtra = new Set(); + for (const nid of extraNodes) { + if (!reachable.has(nid)) onlyExtra.add(nid); + reachableNodes.add(nid); + } + + return buildSlice(fullMap, reachableNodes, reachableColumns, onlyExtra); +} + +/** + * BFS upstream and downstream separately from anchors, then union results. + * Matches the backend's find_upstream/find_downstream pattern — separate + * traversals prevent upstream BFS from "poisoning" downstream visited set. + */ +function bfsFromAnchors( + anchors: Set, + parentMap: Record, + childMap: Record, + noUpstream?: boolean, + noDownstream?: boolean, +): Set { + const result = new Set(anchors); + + if (!noUpstream) { + const upstream = new Set(anchors); + for (const anchor of anchors) { + bfs(anchor, parentMap, upstream); + } + for (const key of upstream) result.add(key); + } + + if (!noDownstream) { + const downstream = new Set(anchors); + for (const anchor of anchors) { + bfs(anchor, childMap, downstream); + } + for (const key of downstream) result.add(key); + } + + return result; +} + +function bfs( + start: string, + adjacency: Record, + visited: Set, +): void { + const queue = [start]; + let item: string | undefined; + while ((item = queue.pop()) !== undefined) { + for (const neighbor of adjacency[item] ?? []) { + if (!visited.has(neighbor)) { + visited.add(neighbor); + queue.push(neighbor); + } + } + } +} + +function buildSlice( + fullMap: ColumnLineageData, + reachableNodes: Set, + reachableColumns: Set, + extraNodes?: Set, +): ColumnLineageData { + const { nodes, columns, parent_map } = fullMap.current; + + // Shallow-clone nodes: set impacted flag + filter node.columns + const slicedNodes: typeof nodes = {}; + for (const nid of reachableNodes) { + if (nodes[nid]) { + const orig = nodes[nid]; + const isExtra = extraNodes?.has(nid) ?? false; + // Filter node.columns to only include columns in the reachable set + const filteredColumns: NonNullable = {}; + if (orig.columns) { + for (const [colName, colData] of Object.entries(orig.columns)) { + const colKey = `${nid}_${colName}`; + if (reachableColumns.has(colKey)) { + filteredColumns[colName] = colData; + } + } + } + slicedNodes[nid] = { + ...orig, + impacted: isExtra ? false : true, + columns: filteredColumns, + }; + } + } + + const slicedColumns: typeof columns = {}; + for (const colKey of reachableColumns) { + if (columns[colKey]) { + slicedColumns[colKey] = columns[colKey]; + } + } + + // Maps use BFS-reachable keys only (extra nodes appear in nodes but not maps) + const mapKeys = new Set([...reachableNodes, ...reachableColumns]); + if (extraNodes) { + for (const nid of extraNodes) { + mapKeys.delete(nid); + } + } + const allReachable = mapKeys; + + const slicedParentMap: Record = {}; + for (const key of allReachable) { + if (parent_map[key]) { + slicedParentMap[key] = parent_map[key].filter((v) => allReachable.has(v)); + } + } + + // Build child_map by inverting parent_map (same as backend) + const slicedChildMap: Record = {}; + for (const [childKey, parents] of Object.entries(slicedParentMap)) { + for (const parentKey of parents) { + if (!slicedChildMap[parentKey]) { + slicedChildMap[parentKey] = []; + } + slicedChildMap[parentKey].push(childKey); + } + } + + return { + current: { + nodes: slicedNodes, + columns: slicedColumns, + parent_map: slicedParentMap, + child_map: slicedChildMap, + }, + }; +} diff --git a/recce/adapter/dbt_adapter/__init__.py b/recce/adapter/dbt_adapter/__init__.py index 890556150..68210f160 100644 --- a/recce/adapter/dbt_adapter/__init__.py +++ b/recce/adapter/dbt_adapter/__init__.py @@ -4,7 +4,7 @@ import time import uuid from contextlib import contextmanager -from copy import deepcopy +from copy import copy from dataclasses import dataclass, fields from errno import ENOENT from functools import lru_cache @@ -1010,7 +1010,15 @@ def get_cll( manifest_dict = manifest.to_dict() # Find related model nodes - if node_id is not None: + if no_filter and node_id is None: + # Full map mode: start from ALL nodes so the frontend can + # slice any node/column without further API calls. + cll_node_ids = set() + for key in ["sources", "nodes", "exposures", "metrics"]: + cll_node_ids.update(getattr(manifest, key).keys()) + if hasattr(manifest, "semantic_models"): + cll_node_ids.update(manifest.semantic_models.keys()) + elif node_id is not None: cll_node_ids = {node_id} else: lineage_diff = self.get_lineage_diff() @@ -1039,23 +1047,29 @@ def get_cll( for cll_node_id in cll_node_ids: if cll_node_id not in allowed_related_nodes: continue - cll_data_one = deepcopy(self.get_cll_cached(cll_node_id, base=False)) + cll_data_one = self.get_cll_cached(cll_node_id, base=False) cll_tracker.increment_cll_nodes() if cll_data_one is None: continue - nodes[cll_node_id] = cll_data_one.nodes.get(cll_node_id) - node_diff = None - if change_analysis: - node_diff = self.get_change_analysis_cached(cll_node_id) - cll_tracker.increment_change_analysis_nodes() - if node_diff is not None: - nodes[cll_node_id].change_status = node_diff.change_status - if node_diff.change is not None: - nodes[cll_node_id].change_category = node_diff.change.category + # Shallow-copy node to avoid mutating the cache + node = cll_data_one.nodes.get(cll_node_id) + if node is not None: + node_diff = None + if change_analysis: + node_diff = self.get_change_analysis_cached(cll_node_id) + cll_tracker.increment_change_analysis_nodes() + if node_diff is not None: + node = copy(node) + node.change_status = node_diff.change_status + if node_diff.change is not None: + node.change_category = node_diff.change.category + nodes[cll_node_id] = node + for c_id, c in cll_data_one.columns.items(): - columns[c_id] = c if node_diff is not None: + # Shallow-copy column to avoid mutating the cache + c = copy(c) if node_diff.change_status == "added": c.change_status = "added" elif node_diff.change_status == "removed": @@ -1064,6 +1078,7 @@ def get_cll( column_diff = node_diff.change.columns.get(c.name) if column_diff: c.change_status = column_diff + columns[c_id] = c for p_id, parents in cll_data_one.parent_map.items(): parent_map[p_id] = parents @@ -1256,7 +1271,7 @@ def _build_schema_from_aliases(self, manifest, catalog, parent_list) -> dict: schema[table_name] = columns return schema - @lru_cache(maxsize=128) + @lru_cache(maxsize=4096) def get_cll_cached(self, node_id: str, base: Optional[bool] = False) -> Optional[CllData]: cll_tracker = CLLPerformanceTracking() @@ -1278,7 +1293,7 @@ def _apply_all_columns(node: CllNode, transformation_type): cll_data.parent_map[column_id] = set() return cll_data - manifest = as_manifest(self.get_manifest(base)) + manifest = self.previous_state.manifest if base else self.manifest catalog = self.curr_catalog if base is False else self.base_catalog resource_type = node.resource_type if resource_type not in {"model", "seed", "source", "snapshot"}: diff --git a/recce/server.py b/recce/server.py index 206f00280..e5c1b2c65 100644 --- a/recce/server.py +++ b/recce/server.py @@ -630,6 +630,7 @@ class CllIn(BaseModel): no_cll: Optional[bool] = False no_upstream: Optional[bool] = False no_downstream: Optional[bool] = False + full_map: Optional[bool] = False class CllOutput(BaseModel): @@ -648,6 +649,7 @@ async def column_level_lineage_by_node(cll_input: CllIn): no_upstream=cll_input.no_upstream, no_downstream=cll_input.no_downstream, no_cll=cll_input.no_cll, + no_filter=cll_input.full_map, ) return CllOutput(current=cll) diff --git a/tests/adapter/dbt_adapter/test_dbt_cll.py b/tests/adapter/dbt_adapter/test_dbt_cll.py index 105901d84..197738347 100644 --- a/tests/adapter/dbt_adapter/test_dbt_cll.py +++ b/tests/adapter/dbt_adapter/test_dbt_cll.py @@ -200,14 +200,21 @@ def _set_compiled_code(adapter, node_id, compiled_code, base=False): """Set compiled_code on a manifest node after set_artifacts has been called. The test helper's set_artifacts round-trips through writable_manifest() which - strips compiled_code. This helper patches it back directly on both the - WritableManifest and the Manifest used by the adapter. + strips compiled_code. This helper patches it back on both the WritableManifest + and the Manifest, and clears the lru_cache so get_cll_cached picks up the change. """ writable = adapter.curr_manifest if not base else adapter.base_manifest if node_id in writable.nodes: writable.nodes[node_id].compiled_code = compiled_code writable.nodes[node_id].compiled = True + manifest = adapter.previous_state.manifest if base else adapter.manifest + if node_id in manifest.nodes: + manifest.nodes[node_id].compiled_code = compiled_code + manifest.nodes[node_id].compiled = True + + adapter.get_cll_cached.cache_clear() + def test_cll_with_compiled_code(dbt_test_helper): """When compiled_code is set on the manifest node, skip Jinja rendering and use it directly."""