fix schemas in intermediate

This commit is contained in:
Pablo Martin 2024-09-12 15:38:50 +02:00
parent aabb45dbd5
commit 05d5cc6d10
4 changed files with 327 additions and 387 deletions

View file

@ -2,28 +2,27 @@ version: 2
models:
- name: int_edeposit__verifications
description:
description:
"This table holds records on verifications for e-deposit bookings.
It contains details on validations checked on the guests, guest information
and some booking details like checkin-checkout date or the status of the verification.
The id values found here are completely unrelated to the ones found in Core DWH.
Note that id_verifications and booking_id should normally be 1 to 1.
Though there are exception, the API will accept a duplicate booking and the users
will be charged for it. A duplicate would return a unique id_verification."
columns:
- name: id_verification
data_type: text
description: "unique Superhog generated id for this verification"
description: "unique Superhog generated id for this verification"
tests:
- unique
- not_null
- name: id_booking
data_type: text
description:
"unique Superhog generated id for a booking.
note that this could be duplicated and both will be charged,
description: "unique Superhog generated id for a booking.
note that this could be duplicated and both will be charged,
it's up to the user to no generate duplicate verifications"
- name: id_user_partner
@ -38,21 +37,19 @@ models:
- name: version
data_type: text
description:
"value to identify if it is Guesty (V1) or E-deposit (V2)"
description: "value to identify if it is Guesty (V1) or E-deposit (V2)"
tests:
- accepted_values:
values:
values:
- V1
- V2
- name: verification_source
data_type: text
description:
"source of the verification for the booking"
description: "source of the verification for the booking"
tests:
- accepted_values:
values:
values:
- Guesty
- Edeposit
@ -190,16 +187,15 @@ models:
- name: athena_creation_at_utc
data_type: timestamp without time zone
description:
"Athena timestamp referring to when the booking was created.
It's provided by Guesty, but is not mandatory.
description:
"Athena timestamp referring to when the booking was created.
It's provided by Guesty, but is not mandatory.
In case of doubt use created_at_utc or created_date_utc fields"
- name: athena_creation_date_utc
data_type: date
description:
"Athena date referring to when the booking was created.
It's provided by Guesty, but is not mandatory.
description: "Athena date referring to when the booking was created.
It's provided by Guesty, but is not mandatory.
In case of doubt use created_at_utc or created_date_utc fields"
- name: created_at_utc
@ -211,7 +207,7 @@ models:
description: "Date of creation of the verification in the system"
- name: int_edeposit__verification_fees
description:
description:
"This table shows all fee charges per verification for E-deposit.
Cancellation fee is charged when the monthly rate of cancelled bookings over
total booking of the partner surpasses the threshold (currently set at 0.05).
@ -220,8 +216,7 @@ models:
columns:
- name: id_verification
data_type: text
description:
"Unique Superhog generated id for this verification.
description: "Unique Superhog generated id for this verification.
Note that there are some users that have a different id in Cosmos.
For those users we created a mapping to relate this ids."
tests:
@ -230,9 +225,8 @@ models:
- name: id_booking
data_type: text
description:
"unique Superhog generated id for a booking.
note that this could be duplicated and both will be charged,
description: "unique Superhog generated id for a booking.
note that this could be duplicated and both will be charged,
it's up to the user to no generate duplicate verifications"
tests:
- not_null
@ -281,7 +275,7 @@ models:
- name: cancelled_fee_in_txn_currency
data_type: numeric
description: "fee charged in used currency for cancelled verifications"
description: "fee charged in used currency for cancelled verifications"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
@ -290,7 +284,7 @@ models:
- name: cancelled_fee_in_gbp
data_type: numeric
description: "fee charged in gbp for cancelled verifications"
description: "fee charged in gbp for cancelled verifications"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
@ -299,21 +293,20 @@ models:
- name: checkout_date_utc
data_type: date
description: "Date of checkout for the booking"
description: "Date of checkout for the booking"
tests:
- not_null
- name: created_date_utc
data_type: date
description: "Date of creation of the verification in the system"
description: "Date of creation of the verification in the system"
tests:
- not_null
- name: int_edeposit__guesty_verifications
description:
"This table shows all verification for Guesty.
description: "This table shows all verification for Guesty.
The charged fee is 2GBP per booked night if booking is approved
(considered 1 night when the checkin and checkout are on the same day),
(considered 1 night when the checkin and checkout are on the same day),
to be charged on checkout."
columns:
- name: id_verification
@ -325,9 +318,8 @@ models:
- name: id_booking
data_type: text
description:
"unique Superhog generated id for a booking.
note that this could be duplicated and both will be charged,
description: "unique Superhog generated id for a booking.
note that this could be duplicated and both will be charged,
it's up to the user to not generate or cancel duplicate verifications"
tests:
- not_null
@ -344,8 +336,7 @@ models:
- name: ok_status_fee_in_gbp
data_type: integer
description:
"total fee charged on checkout, this is only charged for approved verifications"
description: "total fee charged on checkout, this is only charged for approved verifications"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
@ -355,14 +346,12 @@ models:
- name: created_date_utc
data_type: date
description:
"Date of creation of the verification in the system"
description: "Date of creation of the verification in the system"
tests:
- not_null
- name: checkout_date_utc
data_type: date
description:
"Date of checkout for the booking"
description: "Date of checkout for the booking"
tests:
- not_null
- not_null