diff --git a/jaffle_shop/models/final/_exposures.yml b/jaffle_shop/models/final/_exposures.yml new file mode 100644 index 000000000..661c85d09 --- /dev/null +++ b/jaffle_shop/models/final/_exposures.yml @@ -0,0 +1,21 @@ +version: 2 + +exposures: + - name: fnl_finance_returns_by_customer + label: fnl_finance_returns_by_customer + description: Inksacio data app with dashboard for dbt certification + type: dashboard + url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/ + owner: + email: example.email@octoenergy.com + depends_on: + - ref('fnl_finance_returns_by_customer') + - name: fnl_sales_newcustomers + label: fnl_sales_newcustomers + description: Inksacio data app with dashboard for dbt certification + type: dashboard + url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/ + owner: + email: example.email@octoenergy.com + depends_on: + - ref('fnl_sales_newcustomers') \ No newline at end of file diff --git a/jaffle_shop/models/final/finance/_models.yml b/jaffle_shop/models/final/finance/_models.yml new file mode 100644 index 000000000..919c5e00e --- /dev/null +++ b/jaffle_shop/models/final/finance/_models.yml @@ -0,0 +1,15 @@ +version: 2 + +models: + - name: fnl_finance_returns_by_customer + meta: + owner: 'example.email@octoenergy.com' + description: + Table with value of completed returns by customer + columns: + - name: customer_id + tests: + - unique + - not_null + - name: total_returned + description: Total value of completed returns made by customer, excluding pending returns diff --git a/jaffle_shop/models/final/finance/fnl_finance_returns_by_customer.sql b/jaffle_shop/models/final/finance/fnl_finance_returns_by_customer.sql new file mode 100644 index 000000000..befd3cfe7 --- /dev/null +++ b/jaffle_shop/models/final/finance/fnl_finance_returns_by_customer.sql @@ -0,0 +1,6 @@ +SELECT + customer_id, + SUM(amount) AS total_returned +FROM {{ ref('wh_orders') }} +WHERE `status` = 'returned' +GROUP BY customer_id diff --git a/jaffle_shop/models/final/sales/_models.yml b/jaffle_shop/models/final/sales/_models.yml new file mode 100644 index 000000000..83f144a76 --- /dev/null +++ b/jaffle_shop/models/final/sales/_models.yml @@ -0,0 +1,13 @@ +version: 2 + +models: + - name: fnl_sales_newcustomers + meta: + owner: 'example.email@octoenergy.com' + description: + The customer count by month for customers making their first order + columns: + - name: first_order_month + tests: + - unique + - not_null diff --git a/jaffle_shop/models/final/sales/fnl_sales_newcustomers.sql b/jaffle_shop/models/final/sales/fnl_sales_newcustomers.sql new file mode 100644 index 000000000..8d55e4817 --- /dev/null +++ b/jaffle_shop/models/final/sales/fnl_sales_newcustomers.sql @@ -0,0 +1,5 @@ +SELECT + DATE_TRUNC('month', first_order) AS first_order_month, + COUNT(DISTINCT customer_id) AS number_first_orders +FROM {{ ref('wh_customers') }} +GROUP BY first_order_month diff --git a/jaffle_shop/seeds/dbt_project_evaluator_exceptions.csv b/jaffle_shop/seeds/dbt_project_evaluator_exceptions.csv new file mode 100644 index 000000000..b9f94e579 --- /dev/null +++ b/jaffle_shop/seeds/dbt_project_evaluator_exceptions.csv @@ -0,0 +1,2 @@ +fct_name,column_name,id_to_exclude,comment +fct_staging_dependent_on_staging,parent,stg_customers_pii,Scrubbing pii permitted in staging layer. \ No newline at end of file