Final clarifications

This commit is contained in:
Joaquin Ossa 2024-12-04 16:33:50 +01:00
parent 0b6612f25b
commit 1f683ec651
6 changed files with 132 additions and 26 deletions

View file

@ -10,6 +10,7 @@ select
id_user_partner,
id_accommodation,
protection_type,
protection_starting_level,
protection_basic_amount,
protection_extended_amount,
pet_protection,
@ -43,6 +44,7 @@ select
status_updated_date_utc,
updated_at_utc,
updated_date_utc,
created_at_utc,
cosmos_creation_at_utc,
cosmos_creation_date_utc,
created_date_utc
from stg_screen_and_protect__verification_requests

View file

@ -43,17 +43,35 @@ models:
- "DAMAGE WAIVER"
- "PET PROTECTION"
- name: protection_basic_amount
- name: protection_starting_level
data_type: numeric
description: Basic protection amount for the booking.
description: Field used for protection type "STANDALONE PROTECTION" to
indicate the starting level of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100000
strictly: true
- name: protection_basic_amount
data_type: numeric
description: Field used for protection type "SCREEN & PROTECT",
"BASIC PROTECTION" or "DAMAGE WAIVER" to show the basic amount of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100000
strictly: true
- name: protection_extended_amount
data_type: numeric
description: Extended protection amount for the booking.
description: Field used for protection type "SCREEN & PROTECT",
or "STANDALONE PROTECTION" to show the basic amount of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 50000000
strictly: true
- name: pet_protection
data_type: boolean
@ -200,14 +218,23 @@ models:
tests:
- not_null
- name: created_at_utc
- name: cosmos_creation_at_utc
data_type: timestamp without time zone
description: Internal timestamp when the record was created.
description: |
Timestamp of when the verification request was created in Cosmos DB.
tests:
- not_null
- name: cosmos_creation_date_utc
data_type: date
description: |
Date of when the verification request was created in Cosmos DB.
tests:
- not_null
- name: created_date_utc
data_type: date
description: Internal date when the record was created.
description: |
Date when the reservation was created.
tests:
- not_null

View file

@ -43,17 +43,35 @@ models:
- "DAMAGE WAIVER"
- "PET PROTECTION"
- name: protection_basic_amount
- name: protection_starting_level
data_type: numeric
description: Basic protection amount for the booking.
description: Field used for protection type "STANDALONE PROTECTION" to
indicate the starting level of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100000
strictly: true
- name: protection_basic_amount
data_type: numeric
description: Field used for protection type "SCREEN & PROTECT",
"BASIC PROTECTION" or "DAMAGE WAIVER" to show the basic amount of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100000
strictly: true
- name: protection_extended_amount
data_type: numeric
description: Extended protection amount for the booking.
description: Field used for protection type "SCREEN & PROTECT",
or "STANDALONE PROTECTION" to show the basic amount of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 50000000
strictly: true
- name: pet_protection
data_type: boolean
@ -200,14 +218,23 @@ models:
tests:
- not_null
- name: created_at_utc
- name: cosmos_creation_at_utc
data_type: timestamp without time zone
description: Internal timestamp when the record was created.
description: |
Timestamp of when the verification request was created in Cosmos DB.
tests:
- not_null
- name: cosmos_creation_date_utc
data_type: date
description: |
Date of when the verification request was created in Cosmos DB.
tests:
- not_null
- name: created_date_utc
data_type: date
description: Internal date when the record was created.
description: |
Date when the reservation was created.
tests:
- not_null

View file

@ -10,6 +10,7 @@ select
id_user_partner as id_user_partner,
id_accommodation as id_accommodation,
protection_type as protection_type,
protection_starting_level as protection_starting_level,
protection_basic_amount as protection_basic_amount,
protection_extended_amount as protection_extended_amount,
pet_protection as pet_protection,
@ -43,6 +44,7 @@ select
status_updated_date_utc as status_updated_date_utc,
updated_at_utc as updated_at_utc,
updated_date_utc as updated_date_utc,
created_at_utc as created_at_utc,
cosmos_creation_at_utc as cosmos_creation_at_utc,
cosmos_creation_date_utc as cosmos_creation_date_utc,
created_date_utc as created_date_utc
from int_screen_and_protect__verification_requests

View file

@ -43,17 +43,35 @@ models:
- "DAMAGE WAIVER"
- "PET PROTECTION"
- name: protection_basic_amount
- name: protection_starting_level
data_type: numeric
description: Basic protection amount for the booking.
description: Field used for protection type "STANDALONE PROTECTION" to
indicate the starting level of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100000
strictly: true
- name: protection_basic_amount
data_type: numeric
description: Field used for protection type "SCREEN & PROTECT",
"BASIC PROTECTION" or "DAMAGE WAIVER" to show the basic amount of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100000
strictly: true
- name: protection_extended_amount
data_type: numeric
description: Extended protection amount for the booking.
description: Field used for protection type "SCREEN & PROTECT",
or "STANDALONE PROTECTION" to show the basic amount of protection.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 50000000
strictly: true
- name: pet_protection
data_type: boolean
@ -196,15 +214,24 @@ models:
tests:
- not_null
- name: created_at_utc
- name: cosmos_creation_at_utc
data_type: timestamp without time zone
description: Internal timestamp when the record was created.
description: |
Timestamp of when the verification request was created in Cosmos DB.
tests:
- not_null
- name: cosmos_creation_date_utc
data_type: date
description: |
Date of when the verification request was created in Cosmos DB.
tests:
- not_null
- name: created_date_utc
data_type: date
description: Internal date when the record was created.
description: |
Date when the reservation was created.
tests:
- not_null

View file

@ -15,12 +15,31 @@ with
{{ adapter.quote("documents") }} ->> 'ProtectionType'
) as protection_type,
cast(
{{ adapter.quote("documents") }}
->> 'ProtectionBasicAmount' as decimal(19, 4)
case
when
{{ adapter.quote("documents") }} ->> 'ProtectionStartingLevel'
= ''
then null
else {{ adapter.quote("documents") }} ->> 'ProtectionStartingLevel'
end as decimal(19, 4)
) as protection_starting_level,
cast(
case
when
{{ adapter.quote("documents") }} ->> 'ProtectionBasicAmount'
= ''
then null
else {{ adapter.quote("documents") }} ->> 'ProtectionBasicAmount'
end as decimal(19, 4)
) as protection_basic_amount,
cast(
{{ adapter.quote("documents") }}
->> 'ProtectionExtendedAmount' as decimal(19, 4)
case
when
{{ adapter.quote("documents") }} ->> 'ProtectionExtendedAmount'
= ''
then null
else {{ adapter.quote("documents") }} ->> 'ProtectionExtendedAmount'
end as decimal(19, 4)
) as protection_extended_amount,
({{ adapter.quote("documents") }} ->> 'PetProtection')::boolean
as pet_protection,
@ -66,9 +85,11 @@ with
as updated_at_utc,
({{ adapter.quote("documents") }} ->> 'UpdatedDate')::date
as updated_date_utc,
({{ adapter.quote("documents") }} ->> 'CreatedDate')::timestamp
as created_at_utc,
({{ adapter.quote("documents") }} ->> 'CreationDate')::timestamp
as cosmos_creation_at_utc,
({{ adapter.quote("documents") }} ->> 'CreationDate')::date
as cosmos_creation_date_utc,
({{ adapter.quote("documents") }} ->> 'CreatedDate')::date
as created_date_utc,
to_timestamp(
(({{ adapter.quote("documents") }} ->> '_ts'))::integer