Merged PR 3578: First version of int_core__booking_service_detail
# Description Minor Changes: * Computation in staging of `is_default_service` column for Basic Screening. This includes `stg_core__product_service`, `stg_core__protection_plan` and the schema entry. * Propagation of `is_default_service` to intermediate. This includes `int_core__protection_plan_to_price`, `int_core__product_service_to_price` and the schema entry. * Adapting a small data test to include a new case in `stg_core__booking_view_to_service` schema entry. Main Changes: * New fields and re-order existing ones on `int_core__booking_to_service`. * Changed materialisation of `int_core__booking_to_service` to a view, since the new model `int_core__booking_service_detail` is materialised as table. New Model: * First version of `int_core__booking_service_detail`. This model includes the current state of a Service that is applied within a Booking. It includes many Booking attributes, Service attributes as well as some meta data fields regarding the business scope and type, according to the [New Pricing](https://www.notion.so/knowyourguest-superhog/All-Services-Definitions-333fba1fbed54715b6b1c3b5133f0d4f) documentation. * This is one of the 3 Booking models that I propose to create for New Pricing. You can read about the others [here](https://www.notion.so/knowyourguest-superhog/Services-and-Revenue-modelling-1420446ff9c980118e0cfffa7c41f369), although I'll probably won't do them until New Dash is finalised on tech side. * This current model should suffice to be able to understand which services are applied within a Booking. Notably you will see that this is not enough to compute revenue, as there's some placeholders in place. This is expected. # Checklist - [X] The edited models and dependants run properly with production data. - [X] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [X] I have checked for DRY opportunities with other models and docs. - [X] I've picked the right materialization for the affected models. # Other - [ ] Check if a full-refresh is required after this PR is merged. Related work items: #20809
This commit is contained in:
parent
30a12f6875
commit
f1359bf696
8 changed files with 551 additions and 29 deletions
|
|
@ -567,6 +567,15 @@ models:
|
|||
values:
|
||||
- "SCREENING"
|
||||
- "DEPOSIT_MANAGEMENT"
|
||||
|
||||
- name: is_default_service
|
||||
data_type: boolean
|
||||
description: |
|
||||
Flag that determines if the service is a default one (True)
|
||||
or an upgraded service (False).
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: dwh_extracted_at_utc
|
||||
data_type: timestamp
|
||||
description: |
|
||||
|
|
@ -759,6 +768,13 @@ models:
|
|||
data_type: date
|
||||
description: |
|
||||
Date of when this product protection plan was last updated.
|
||||
- name: is_default_service
|
||||
data_type: boolean
|
||||
description: |
|
||||
Flag that determines if the service is a default one (True)
|
||||
or an upgraded service (False).
|
||||
tests:
|
||||
- not_null
|
||||
- name: dwh_extracted_at_utc
|
||||
data_type: timestamp
|
||||
description: |
|
||||
|
|
@ -1050,6 +1066,7 @@ models:
|
|||
- "REJECTED"
|
||||
- "FLAGGED"
|
||||
- "NOCHECKS"
|
||||
- "NOT PAID"
|
||||
- "-"
|
||||
- name: created_at_utc
|
||||
data_type: timestamp
|
||||
|
|
|
|||
|
|
@ -41,5 +41,13 @@ select
|
|||
product_service_display_name,
|
||||
product_service_description,
|
||||
product_service_binary_tier,
|
||||
case
|
||||
when
|
||||
id_product_service in (
|
||||
1 -- 'BASIC SCREENING'
|
||||
)
|
||||
then true
|
||||
else false
|
||||
end as is_default_service,
|
||||
dwh_extracted_at_utc
|
||||
from stg_core__product_service
|
||||
|
|
|
|||
|
|
@ -43,6 +43,14 @@ select
|
|||
pp.created_date_utc,
|
||||
pp.updated_at_utc,
|
||||
pp.updated_date_utc,
|
||||
case
|
||||
when
|
||||
id_protection_plan in (
|
||||
1 -- 'BASIC SCREENING'
|
||||
)
|
||||
then true
|
||||
else false
|
||||
end as is_default_service,
|
||||
pp.dwh_extracted_at_utc
|
||||
from raw_protection_plan pp
|
||||
left join raw_protection p on pp.id_protection = p.id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue