Final clarifications
This commit is contained in:
parent
0b6612f25b
commit
1f683ec651
6 changed files with 132 additions and 26 deletions
|
|
@ -10,6 +10,7 @@ select
|
||||||
id_user_partner,
|
id_user_partner,
|
||||||
id_accommodation,
|
id_accommodation,
|
||||||
protection_type,
|
protection_type,
|
||||||
|
protection_starting_level,
|
||||||
protection_basic_amount,
|
protection_basic_amount,
|
||||||
protection_extended_amount,
|
protection_extended_amount,
|
||||||
pet_protection,
|
pet_protection,
|
||||||
|
|
@ -43,6 +44,7 @@ select
|
||||||
status_updated_date_utc,
|
status_updated_date_utc,
|
||||||
updated_at_utc,
|
updated_at_utc,
|
||||||
updated_date_utc,
|
updated_date_utc,
|
||||||
created_at_utc,
|
cosmos_creation_at_utc,
|
||||||
|
cosmos_creation_date_utc,
|
||||||
created_date_utc
|
created_date_utc
|
||||||
from stg_screen_and_protect__verification_requests
|
from stg_screen_and_protect__verification_requests
|
||||||
|
|
|
||||||
|
|
@ -43,17 +43,35 @@ models:
|
||||||
- "DAMAGE WAIVER"
|
- "DAMAGE WAIVER"
|
||||||
- "PET PROTECTION"
|
- "PET PROTECTION"
|
||||||
|
|
||||||
- name: protection_basic_amount
|
- name: protection_starting_level
|
||||||
data_type: numeric
|
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:
|
tests:
|
||||||
- dbt_expectations.expect_column_values_to_be_between:
|
- dbt_expectations.expect_column_values_to_be_between:
|
||||||
min_value: 0
|
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
|
strictly: true
|
||||||
|
|
||||||
- name: protection_extended_amount
|
- name: protection_extended_amount
|
||||||
data_type: numeric
|
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
|
- name: pet_protection
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
|
|
@ -200,14 +218,23 @@ models:
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
- name: created_at_utc
|
- name: cosmos_creation_at_utc
|
||||||
data_type: timestamp without time zone
|
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:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
- name: created_date_utc
|
- name: created_date_utc
|
||||||
data_type: date
|
data_type: date
|
||||||
description: Internal date when the record was created.
|
description: |
|
||||||
|
Date when the reservation was created.
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
|
||||||
|
|
@ -43,17 +43,35 @@ models:
|
||||||
- "DAMAGE WAIVER"
|
- "DAMAGE WAIVER"
|
||||||
- "PET PROTECTION"
|
- "PET PROTECTION"
|
||||||
|
|
||||||
- name: protection_basic_amount
|
- name: protection_starting_level
|
||||||
data_type: numeric
|
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:
|
tests:
|
||||||
- dbt_expectations.expect_column_values_to_be_between:
|
- dbt_expectations.expect_column_values_to_be_between:
|
||||||
min_value: 0
|
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
|
strictly: true
|
||||||
|
|
||||||
- name: protection_extended_amount
|
- name: protection_extended_amount
|
||||||
data_type: numeric
|
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
|
- name: pet_protection
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
|
|
@ -200,14 +218,23 @@ models:
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
- name: created_at_utc
|
- name: cosmos_creation_at_utc
|
||||||
data_type: timestamp without time zone
|
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:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
- name: created_date_utc
|
- name: created_date_utc
|
||||||
data_type: date
|
data_type: date
|
||||||
description: Internal date when the record was created.
|
description: |
|
||||||
|
Date when the reservation was created.
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ select
|
||||||
id_user_partner as id_user_partner,
|
id_user_partner as id_user_partner,
|
||||||
id_accommodation as id_accommodation,
|
id_accommodation as id_accommodation,
|
||||||
protection_type as protection_type,
|
protection_type as protection_type,
|
||||||
|
protection_starting_level as protection_starting_level,
|
||||||
protection_basic_amount as protection_basic_amount,
|
protection_basic_amount as protection_basic_amount,
|
||||||
protection_extended_amount as protection_extended_amount,
|
protection_extended_amount as protection_extended_amount,
|
||||||
pet_protection as pet_protection,
|
pet_protection as pet_protection,
|
||||||
|
|
@ -43,6 +44,7 @@ select
|
||||||
status_updated_date_utc as status_updated_date_utc,
|
status_updated_date_utc as status_updated_date_utc,
|
||||||
updated_at_utc as updated_at_utc,
|
updated_at_utc as updated_at_utc,
|
||||||
updated_date_utc as updated_date_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
|
created_date_utc as created_date_utc
|
||||||
from int_screen_and_protect__verification_requests
|
from int_screen_and_protect__verification_requests
|
||||||
|
|
|
||||||
|
|
@ -43,17 +43,35 @@ models:
|
||||||
- "DAMAGE WAIVER"
|
- "DAMAGE WAIVER"
|
||||||
- "PET PROTECTION"
|
- "PET PROTECTION"
|
||||||
|
|
||||||
- name: protection_basic_amount
|
- name: protection_starting_level
|
||||||
data_type: numeric
|
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:
|
tests:
|
||||||
- dbt_expectations.expect_column_values_to_be_between:
|
- dbt_expectations.expect_column_values_to_be_between:
|
||||||
min_value: 0
|
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
|
strictly: true
|
||||||
|
|
||||||
- name: protection_extended_amount
|
- name: protection_extended_amount
|
||||||
data_type: numeric
|
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
|
- name: pet_protection
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
|
|
@ -196,15 +214,24 @@ models:
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
- name: created_at_utc
|
- name: cosmos_creation_at_utc
|
||||||
data_type: timestamp without time zone
|
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:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
- name: created_date_utc
|
- name: created_date_utc
|
||||||
data_type: date
|
data_type: date
|
||||||
description: Internal date when the record was created.
|
description: |
|
||||||
|
Date when the reservation was created.
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,31 @@ with
|
||||||
{{ adapter.quote("documents") }} ->> 'ProtectionType'
|
{{ adapter.quote("documents") }} ->> 'ProtectionType'
|
||||||
) as protection_type,
|
) as protection_type,
|
||||||
cast(
|
cast(
|
||||||
{{ adapter.quote("documents") }}
|
case
|
||||||
->> 'ProtectionBasicAmount' as decimal(19, 4)
|
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,
|
) as protection_basic_amount,
|
||||||
cast(
|
cast(
|
||||||
{{ adapter.quote("documents") }}
|
case
|
||||||
->> 'ProtectionExtendedAmount' as decimal(19, 4)
|
when
|
||||||
|
{{ adapter.quote("documents") }} ->> 'ProtectionExtendedAmount'
|
||||||
|
= ''
|
||||||
|
then null
|
||||||
|
else {{ adapter.quote("documents") }} ->> 'ProtectionExtendedAmount'
|
||||||
|
end as decimal(19, 4)
|
||||||
) as protection_extended_amount,
|
) as protection_extended_amount,
|
||||||
({{ adapter.quote("documents") }} ->> 'PetProtection')::boolean
|
({{ adapter.quote("documents") }} ->> 'PetProtection')::boolean
|
||||||
as pet_protection,
|
as pet_protection,
|
||||||
|
|
@ -66,9 +85,11 @@ with
|
||||||
as updated_at_utc,
|
as updated_at_utc,
|
||||||
({{ adapter.quote("documents") }} ->> 'UpdatedDate')::date
|
({{ adapter.quote("documents") }} ->> 'UpdatedDate')::date
|
||||||
as updated_date_utc,
|
as updated_date_utc,
|
||||||
({{ adapter.quote("documents") }} ->> 'CreatedDate')::timestamp
|
({{ adapter.quote("documents") }} ->> 'CreationDate')::timestamp
|
||||||
as created_at_utc,
|
as cosmos_creation_at_utc,
|
||||||
({{ adapter.quote("documents") }} ->> 'CreationDate')::date
|
({{ adapter.quote("documents") }} ->> 'CreationDate')::date
|
||||||
|
as cosmos_creation_date_utc,
|
||||||
|
({{ adapter.quote("documents") }} ->> 'CreatedDate')::date
|
||||||
as created_date_utc,
|
as created_date_utc,
|
||||||
to_timestamp(
|
to_timestamp(
|
||||||
(({{ adapter.quote("documents") }} ->> '_ts'))::integer
|
(({{ adapter.quote("documents") }} ->> '_ts'))::integer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue