data-dwh-dbt-project/models/intermediate/edeposit/schema.yml

358 lines
11 KiB
YAML
Raw Normal View History

2024-08-29 11:09:09 +02:00
version: 2
2024-08-29 11:09:09 +02:00
models:
- name: int_edeposit__verifications
2024-09-12 15:38:50 +02:00
description:
2024-08-29 11:09:09 +02:00
"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.
2024-09-02 11:16:51 +02:00
The id values found here are completely unrelated to the ones found in Core DWH.
2024-09-12 15:38:50 +02:00
2024-09-02 11:16:51 +02:00
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."
2024-08-29 11:09:09 +02:00
columns:
- name: id_verification
data_type: text
2024-09-12 15:38:50 +02:00
description: "unique Superhog generated id for this verification"
2025-01-13 16:00:35 +01:00
data_tests:
2024-08-29 11:09:09 +02:00
- unique
- not_null
- name: id_booking
data_type: text
2024-09-12 15:38:50 +02:00
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"
2024-08-29 11:09:09 +02:00
- name: id_user_partner
2024-08-29 11:09:09 +02:00
data_type: text
description: "unique Superhog generated id for partner"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
2024-08-29 11:09:09 +02:00
2025-03-18 12:06:25 +01:00
- name: id_deal
data_type: text
description: "unique Superhog generated id for a deal"
data_tests:
- not_null
2024-08-29 11:09:09 +02:00
- name: id_accommodation
data_type: text
description: "unique Superhog generated id for a listing"
- name: version
data_type: text
2024-09-12 15:38:50 +02:00
description: "value to identify if it is Guesty (V1) or E-deposit (V2)"
2025-01-13 16:00:35 +01:00
data_tests:
2024-08-29 11:09:09 +02:00
- accepted_values:
2024-09-12 15:38:50 +02:00
values:
2024-08-29 11:09:09 +02:00
- V2
- name: verification_source
data_type: text
2024-09-12 15:38:50 +02:00
description: "source of the verification for the booking"
2025-01-13 16:00:35 +01:00
data_tests:
2024-08-29 11:09:09 +02:00
- accepted_values:
2024-09-12 15:38:50 +02:00
values:
2024-08-29 11:09:09 +02:00
- Guesty
- Edeposit
- name: verification_status
data_type: text
description: "status of the verification"
- name: nightly_fee_local
data_type: double precision
2024-12-03 10:46:01 +01:00
description: "fee in local currency charged per night"
2024-08-29 11:09:09 +02:00
- name: number_nights
data_type: integer
description: "number of nights for the booking"
- name: email_flag
data_type: text
2024-09-02 11:16:51 +02:00
description: "screening result for email"
2024-08-29 11:09:09 +02:00
- name: phone_flag
data_type: text
2024-09-02 11:16:51 +02:00
description: "screening result for phone"
2024-08-29 11:09:09 +02:00
- name: watch_list
data_type: text
2024-09-02 11:16:51 +02:00
description: "screening result of the guest"
2024-08-29 11:09:09 +02:00
- name: channel
data_type: text
description: ""
- name: checkin_at_utc
data_type: timestamp without time zone
description: "Timestamp of checkin for the booking"
- name: checkin_date_utc
data_type: date
2024-09-02 11:16:51 +02:00
description: "Date of checkin for the booking"
2024-08-29 11:09:09 +02:00
- name: checkout_at_utc
data_type: timestamp without time zone
description: "Timestamp of checkout for the booking"
- name: checkout_date_utc
data_type: date
2024-09-02 11:16:51 +02:00
description: "Date of checkout for the booking"
2024-08-29 11:09:09 +02:00
- name: is_cancelled
data_type: boolean
description: ""
- name: cancelled_at_utc
data_type: timestamp without time zone
description: "Timestamp of cancellation of the booking"
2024-09-02 11:16:51 +02:00
- name: cancelled_date_utc
data_type: date
description: "Date of cancellation for the booking"
2024-08-29 11:09:09 +02:00
- name: user_email
data_type: text
description: ""
- name: guest_email
data_type: text
description: ""
- name: guest_last_name
data_type: text
description: ""
- name: guest_first_name
data_type: text
description: ""
- name: guest_telephone
data_type: text
description: ""
- name: company_name
data_type: text
description: ""
- name: listing_name
data_type: text
description: ""
2024-12-03 10:42:03 +01:00
- name: listing_address
data_type: text
description: ""
2024-08-29 11:09:09 +02:00
- name: listing_town
data_type: text
description: ""
- name: listing_country
data_type: text
description: ""
- name: listing_postcode
data_type: text
description: ""
- name: pets_allowed
data_type: boolean
description: ""
- name: status_updated_at_utc
data_type: timestamp without time zone
description: "Timestamp when status was last updated"
2024-09-02 11:16:51 +02:00
- name: status_updated_date_utc
data_type: date
description: "Date of last status update of the verification"
2024-08-29 11:09:09 +02:00
- name: updated_at_utc
data_type: timestamp without time zone
2024-09-02 11:16:51 +02:00
description: "Timestamp of last updated of the verification"
- name: updated_date_utc
data_type: date
description: "Date of last update of the verification"
2024-08-29 11:09:09 +02:00
2024-09-02 17:01:18 +02:00
- name: athena_creation_at_utc
2024-08-29 11:09:09 +02:00
data_type: timestamp without time zone
2024-09-12 15:38:50 +02:00
description:
"Athena timestamp referring to when the booking was created.
It's provided by Guesty, but is not mandatory.
2024-09-02 17:01:18 +02:00
In case of doubt use created_at_utc or created_date_utc fields"
2024-09-02 11:16:51 +02:00
2024-09-02 17:01:18 +02:00
- name: athena_creation_date_utc
2024-09-02 11:16:51 +02:00
data_type: date
2024-09-12 15:38:50 +02:00
description: "Athena date referring to when the booking was created.
It's provided by Guesty, but is not mandatory.
2024-09-02 17:01:18 +02:00
In case of doubt use created_at_utc or created_date_utc fields"
2024-08-29 11:09:09 +02:00
- name: created_at_utc
data_type: timestamp without time zone
2024-09-02 11:16:51 +02:00
description: "Timestamp of creation of the verification in the system"
- name: created_date_utc
data_type: date
description: "Date of creation of the verification in the system"
2024-09-02 11:16:51 +02:00
2024-08-30 11:33:55 +02:00
- name: int_edeposit__verification_fees
2024-09-12 15:38:50 +02:00
description:
2024-08-30 11:33:55 +02:00
"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).
2024-09-03 12:15:14 +02:00
Both cancellation and rejection fees are set to 0.25 though it might change.
Fees are both in the currency used by the user and in GBP"
2024-08-30 11:33:55 +02:00
columns:
- name: id_verification
data_type: text
2024-09-12 15:38:50 +02:00
description: "Unique Superhog generated id for this verification.
2024-09-09 18:36:13 +02:00
Note that there are some users that have a different id in Cosmos.
For those users we created a mapping to relate this ids."
2025-01-13 16:00:35 +01:00
data_tests:
- unique
- not_null
2024-08-30 11:33:55 +02:00
- name: id_booking
data_type: text
2024-09-12 15:38:50 +02:00
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"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
2024-10-02 10:57:30 +02:00
- name: id_user_partner
data_type: text
description: "unique Superhog generated id for partner"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
2024-10-02 10:57:30 +02:00
2025-03-18 12:06:25 +01:00
- name: id_deal
data_type: text
description: "unique Superhog generated id for a deal"
data_tests:
- not_null
2024-10-02 10:57:30 +02:00
- name: id_accommodation
data_type: text
description: "unique Superhog generated id for a listing"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
2024-10-02 10:57:30 +02:00
- name: listing_town
data_type: text
description: "town name where the listing is located"
- name: listing_country
data_type: text
description: "country name where the listing is located"
- name: verification_status
data_type: text
description: "status of the verification"
- name: channel
data_type: text
description: ""
- name: company_name
data_type: text
description: ""
- name: is_cancelled
data_type: boolean
description: "true if the booking was cancelled"
2024-09-03 12:15:14 +02:00
- name: currency
data_type: text
description: "currency in which the transaction actually happened"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
2024-09-03 12:15:14 +02:00
2024-10-02 10:57:30 +02:00
- name: nightly_fee_local
data_type: double precision
description: "fee charged per night"
- name: number_nights
data_type: integer
description: "number of nights for the booking"
2024-09-03 12:15:14 +02:00
- name: ok_status_fee_in_txn_currency
data_type: numeric
2024-09-05 12:45:09 +02:00
description: "fee charged in used currency for approved or flagged verifications and not cancelled"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
2024-09-03 12:15:14 +02:00
- name: ok_status_fee_in_gbp
data_type: numeric
2024-09-05 12:45:09 +02:00
description: "fee charged in gbp for approved or flagged verifications and not cancelled"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
2024-09-03 12:15:14 +02:00
- name: rejected_fee_in_txn_currency
data_type: numeric
description: "fee charged in used currency for rejected verifications"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
2024-09-03 12:15:14 +02:00
- name: rejected_fee_in_gbp
2024-08-30 11:33:55 +02:00
data_type: numeric
2024-09-03 12:15:14 +02:00
description: "fee charged in gbp for rejected verifications"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
2024-08-30 11:33:55 +02:00
2024-09-03 12:15:14 +02:00
- name: cancelled_fee_in_txn_currency
2024-08-30 11:33:55 +02:00
data_type: numeric
2024-09-12 15:38:50 +02:00
description: "fee charged in used currency for cancelled verifications"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
2024-08-30 11:33:55 +02:00
2024-09-03 12:15:14 +02:00
- name: cancelled_fee_in_gbp
2024-08-30 11:33:55 +02:00
data_type: numeric
2024-09-12 15:38:50 +02:00
description: "fee charged in gbp for cancelled verifications"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
2024-10-02 10:57:30 +02:00
- name: created_date_utc
data_type: date
2024-10-02 10:57:30 +02:00
description: "Date of creation of the verification in the system"
2025-01-13 16:00:35 +01:00
data_tests:
- not_null
2024-10-02 10:57:30 +02:00
- name: cancelled_date_utc
data_type: date
2024-10-02 10:57:30 +02:00
description: "Date of cancellation for the booking"
- name: checkin_date_utc
data_type: date
description: "Date of checkin for the booking"
2025-01-13 16:00:35 +01:00
data_tests:
2024-09-04 17:24:55 +02:00
- not_null
- name: checkout_date_utc
data_type: date
2024-09-12 15:38:50 +02:00
description: "Date of checkout for the booking"
2025-01-13 16:00:35 +01:00
data_tests:
2024-09-12 15:38:50 +02:00
- not_null