# Description First step towards reporting New Dash is to be able within DWH to know which hosts have been migrated. In order to do so, and anticipating that there's going to be new phases in the future, I've created a `int_core__user_migration` model that reads from a configuration macro `get_new_dash_migration_phases_config` that will allow semi-automatic user retrieval in the future. This avoids nasty hardcoding within the model itself. The information of whether a user is migrated, in which phase and when the phase was deployed is available at user level in the `int_core__user_host` table. # 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. **-> I selected a view for this model since I don't believe we should materialse this data other than the user host table** # Other - [ ] Check if a full-refresh is required after this PR is merged. Related work items: #19570
2270 lines
No EOL
76 KiB
YAML
2270 lines
No EOL
76 KiB
YAML
version: 2
|
|
|
|
models:
|
|
- name: int_core__duplicate_bookings
|
|
description: |
|
|
A list of bookings which are considered duplicates of other bookings.
|
|
|
|
We currently consider two bookings to be duplicate if they have the same:
|
|
- Guest user id
|
|
- Accomodation id
|
|
- Check-in date
|
|
|
|
Bear in mind these bookings do have different booking ids.
|
|
|
|
Out of a duplicated tuple of 2 or more bookings:
|
|
- Our logic will consider the oldest one to be the "original", not duplicate one.
|
|
- This table will contain only the duplicates, and not the original.
|
|
columns:
|
|
- name: id_booking
|
|
data_type: bigint
|
|
description: The unique, Superhog generated id for this booking.
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
|
|
- name: is_duplicate_booking
|
|
data_type: boolean
|
|
description: |
|
|
True if the booking is duplicate.
|
|
|
|
If you are thinking that this is redundant, you are right. All
|
|
records in this table will be true. But we keep this field to
|
|
make your life easier when joining with other tables.
|
|
|
|
- name: is_duplicating_booking_with_id
|
|
data_type: bigint
|
|
description: |
|
|
|
|
Indicates what's the original booking being duplicated.
|
|
|
|
If there is a tuple of duplicate bookings {A, B, C}, where A is the
|
|
original and the others are the duplicates:
|
|
- B and C will appear in this table, A will not.
|
|
- The value of this field for both B and C will be A's id.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__booking_charge_events
|
|
description: |
|
|
|
|
Booking charge events is a fancy word for saying: a booking happened,
|
|
the related host had a booking fee set up at the right time, hence we
|
|
need to charge him.
|
|
|
|
The table contains one record per booking and shows the associated
|
|
booking fee, as well as the point in time in which the charge event was
|
|
considered.
|
|
|
|
Be wary of the booking fees: they don't have an associated currency.
|
|
Crazy, I know, but we currently don't store that information in the
|
|
backend.
|
|
|
|
As for the charge dates: the exact point in time at which we consider
|
|
that we should be charging a fee depends on billing details of the host
|
|
customer. For some bookings, this will be the check-in. For others, its
|
|
when the guest begins the verification process.
|
|
|
|
Not all bookings appear here since we don't charge a fee for all
|
|
bookings.
|
|
|
|
columns:
|
|
- name: id_booking
|
|
data_type: bigint
|
|
description: The unique, Superhog generated id for this booking.
|
|
|
|
- name: id_price_plan
|
|
data_type: bigint
|
|
description: The id of the price plan that relates to this booking.
|
|
|
|
- name: booking_fee_local
|
|
data_type: numeric
|
|
description: The fee to apply to the booking, in host currency.
|
|
|
|
- name: booking_fee_charge_at_utc
|
|
data_type: timestamp without time zone
|
|
description: |
|
|
The point in time in which the booking should be invoiced.
|
|
|
|
This could be the check-in date of the booking or the date in which the guest verification
|
|
started, depending on the billing settings of the host.
|
|
|
|
- name: booking_fee_charge_date_utc
|
|
data_type: date
|
|
description: |
|
|
The date in which the booking should be invoiced.
|
|
|
|
This could be the check-in date of the booking or the date in which the guest verification
|
|
started, depending on the billing settings of the host.
|
|
|
|
- name: int_core__check_in_cover_prices
|
|
description: |
|
|
|
|
This table shows the active price and cover for the Check-In Hero
|
|
product.
|
|
|
|
The prices are obtained through a gross `GROUP BY` thrown at the payment
|
|
validation sets table. It works this way because the price settings of
|
|
this product were done with a terrible backend data model design.
|
|
|
|
How could the prices be changed remains a mystery, and the current design
|
|
does not support any kind of history tracking. When the time comes to
|
|
adjust prices, we will have a lot of careful work to do to make sure that
|
|
we keep history and that no downstream dependencies of this model blow
|
|
up.
|
|
|
|
columns:
|
|
- name: local_currency_iso_4217
|
|
data_type: character varying
|
|
description: A currency code.
|
|
|
|
- name: checkin_cover_guest_fee_local_curr
|
|
data_type: numeric
|
|
description: |
|
|
The fee that the guest user must pay if he wants to purchase the
|
|
cover.
|
|
|
|
- name: checkin_cover_cover_amount_local_curr
|
|
data_type: numeric
|
|
description: |
|
|
The amount for which the guest user is covered if he faces problems
|
|
during check-in.
|
|
|
|
- name: int_core__unified_user
|
|
columns:
|
|
- name: id_user
|
|
data_type: character varying
|
|
description: The unique ID for the user.
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: int_core__vr_check_in_cover
|
|
description:
|
|
"This tables holds information on verification requests
|
|
with Ckeck-in Hero available for the guests."
|
|
columns:
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
description:
|
|
"Unique, incremental, internal ID for the related verification
|
|
request."
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
|
|
- name: uuid_verification_request
|
|
data_type: text
|
|
description: "uuid for the related verification request"
|
|
|
|
- name: id_verification_set
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: id_superhog_verified_set
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: id_payment_validation_set
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: id_user_guest
|
|
data_type: character varying
|
|
description: Unique, incremental, internal ID for the guest user.
|
|
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: Unique, incremental, internal ID for the host user.
|
|
|
|
- name: id_booking
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: id_accommodation
|
|
data_type: bigint
|
|
description: "Id of the accommodation or listing."
|
|
|
|
- name: is_verification_request_complete
|
|
data_type: boolean
|
|
description:
|
|
"True if the verification request is considered
|
|
complete, AKA the guest has finished the full guest journey."
|
|
|
|
- name: is_past_check_in
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: is_awaiting_check_in
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: cover_was_purchased
|
|
data_type: boolean
|
|
description:
|
|
"Boolean to indicate if the cover was purchased by the guest or not."
|
|
|
|
- name: address_validation_passed
|
|
data_type: boolean
|
|
description:
|
|
"Boolean to indicate if the validation was approved or not.
|
|
In case there was a problem with the validation it will be Null"
|
|
|
|
- name: address_validation_notes
|
|
data_type: character varying
|
|
description: "Notes in case there was some problem with the validation."
|
|
|
|
- name: cover_was_rejected
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: verification_url
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: callback_url
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: redirect_url
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: logo
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: guest_email
|
|
data_type: character varying
|
|
description: "The email of the guest"
|
|
|
|
- name: last_name
|
|
data_type: character varying
|
|
description: The last name of the guest.
|
|
|
|
- name: first_name
|
|
data_type: character varying
|
|
description: The first name of the guest.
|
|
|
|
- name: guest_phone_number
|
|
data_type: character varying
|
|
description: The phone number of the guest.
|
|
|
|
- name: telephone_code
|
|
data_type: character varying
|
|
description: The telephone code of the guest.
|
|
|
|
- name: guest_phone_number_2
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: check_in_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: check_in_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: check_out_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: check_out_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: verification_start_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: verification_start_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: verification_end_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: verification_end_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: link_used_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: link_used_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: expire_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: expire_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: is_deleted
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: redirect_name
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: id_one_step_link
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: success_message
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: summary
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: rejection_reason
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: has_switched_to_mobile
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: is_verifier_rejected
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: config
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: metadata
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: created_at_utc
|
|
data_type: timestamp without time zone
|
|
description: "Date and time at which the validation was created."
|
|
|
|
- name: created_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: updated_at_utc
|
|
data_type: timestamp without time zone
|
|
description: "Date and time at which the validation was last updated."
|
|
|
|
- name: updated_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: dwh_extracted_at_utc
|
|
data_type: timestamp with time zone
|
|
description: "Date and time at which the record was extracted from the backend into the DWH."
|
|
|
|
- name: amount_in_txn_currency
|
|
data_type: numeric
|
|
description:
|
|
"The payment amount in the currency in which the transaction actually happened.
|
|
If the guest paid in Australian Dollars, this is measured in AUD."
|
|
|
|
- name: currency
|
|
data_type: text
|
|
description:
|
|
"The currency in which the transaction actually happened."
|
|
|
|
- name: amount_in_gbp
|
|
data_type: numeric
|
|
description:
|
|
"The payment amount value, converted to GBP, using the exchange rate for
|
|
the day on which the payment happened."
|
|
|
|
- name: payment_status
|
|
data_type: character varying
|
|
description:
|
|
"The status of the payment. It can be one of: Paid, Refunded, Refund Failed."
|
|
|
|
- name: payment_paid_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: checkin_cover_limit_amount_local_curr
|
|
data_type: numeric
|
|
description:
|
|
"The amount for which the guest user is covered if he faces problems
|
|
during check-in in their local currency."
|
|
|
|
- name: checkin_cover_limit_amount_in_gbp
|
|
data_type: numeric
|
|
description:
|
|
"The amount for which the guest user is covered if he faces problems
|
|
during check-in in GBP."
|
|
|
|
- name: int_core__monthly_accommodation_history_by_deal
|
|
description: |
|
|
This model contains the historic information regarding the accommodations, also known
|
|
as listings, for each deal id. It's used for the business KPIs in the view by deal id.
|
|
Data is aggregated at the last day of the month, or up to yesterday if it's the
|
|
current month.
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- id_deal
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The last day of the month or yesterday for historic listing metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_deal
|
|
data_type: character varying
|
|
description: Id of the deal associated to the host.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__monthly_booking_history_by_deal
|
|
description: |
|
|
This model contains the historic information regarding the bookings for each deal id.
|
|
It's used for the business KPIs in the view by deal id. Data is aggregated at the last
|
|
day of the month, or up to yesterday if it's the current month.
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- id_deal
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The last day of the month or yesterday for historic booking metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_deal
|
|
data_type: character varying
|
|
description: Id of the deal associated to the host.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__monthly_guest_journey_history_by_deal
|
|
description: |
|
|
This model contains the historic information regarding the guest journey for each deal id.
|
|
It's used for the business KPIs in the view by deal id. Data is aggregated at the last
|
|
day of the month, or up to yesterday if it's the current month.
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- id_deal
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The last day of the month or yesterday for historic guest journey metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_deal
|
|
data_type: character varying
|
|
description: Id of the deal associated to the host.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__mtd_booking_metrics
|
|
description: |
|
|
This model contains the historic information regarding the bookings in an aggregated manner.
|
|
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
|
|
days necessary for the Month-to-Date computation of the current month.
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- dimension
|
|
- dimension_value
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The date for the month-to-date booking-related metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: dimension
|
|
data_type: string
|
|
description: The dimension or granularity of the metrics.
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- global
|
|
- by_number_of_listings
|
|
|
|
- name: dimension_value
|
|
data_type: string
|
|
description: The value or segment available for the selected dimension.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__mtd_guest_journey_metrics
|
|
description: |
|
|
This model contains the historic information regarding the guest journeys in an aggregated manner.
|
|
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
|
|
days necessary for the Month-to-Date computation of the current month.
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- dimension
|
|
- dimension_value
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The date for the month-to-date guest journey-related metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: dimension
|
|
data_type: string
|
|
description: The dimension or granularity of the metrics.
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- global
|
|
- by_number_of_listings
|
|
|
|
- name: dimension_value
|
|
data_type: string
|
|
description: The value or segment available for the selected dimension.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__mtd_accommodation_metrics
|
|
description: |
|
|
This model contains the historic information regarding the accommodations in an aggregated manner.
|
|
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
|
|
days necessary for the Month-to-Date computation of the current month.
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- dimension
|
|
- dimension_value
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The date for the month-to-date accommodation-related metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: dimension
|
|
data_type: string
|
|
description: The dimension or granularity of the metrics.
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- global
|
|
- by_number_of_listings
|
|
|
|
- name: dimension_value
|
|
data_type: string
|
|
description: The value or segment available for the selected dimension.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__mtd_deal_metrics
|
|
description: |
|
|
This model contains the historic information regarding the deals in an aggregated manner.
|
|
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
|
|
days necessary for the Month-to-Date computation of the current month.
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- dimension
|
|
- dimension_value
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The date for the month-to-date deal-related metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: dimension
|
|
data_type: string
|
|
description: The dimension or granularity of the metrics.
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- global
|
|
- by_number_of_listings
|
|
|
|
- name: dimension_value
|
|
data_type: string
|
|
description: The value or segment available for the selected dimension.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__mtd_guest_payments_metrics
|
|
description: |
|
|
This model contains the historic information regarding the guest payments in an aggregated manner.
|
|
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
|
|
days necessary for the Month-to-Date computation of the current month.
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- dimension
|
|
- dimension_value
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The date for the month-to-date guest payments-related metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: dimension
|
|
data_type: string
|
|
description: The dimension or granularity of the metrics.
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- global
|
|
- by_number_of_listings
|
|
|
|
- name: dimension_value
|
|
data_type: string
|
|
description: The value or segment available for the selected dimension.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__monthly_guest_payments_history_by_deal
|
|
description: |
|
|
This model contains the historic information regarding the guest revenue for each deal id.
|
|
It's used for the business KPIs in the view by deal id. Data is aggregated at the last
|
|
day of the month, or up to yesterday if it's the current month.
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- id_deal
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The last day of the month or yesterday for historic guest revenue metrics.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_deal
|
|
data_type: character varying
|
|
description: Id of the deal associated to the host.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__verification_request_completeness
|
|
description: |
|
|
The `int_core__verification_request_completeness` model allows to determine if a verification request is
|
|
completed or not. To achieve it, it encapsulates the logic to determine the different possibilites. Its main
|
|
output is the column is_verification_request_complete, but it also provides outputs of the intermediate logic
|
|
steps to be used for further modeling, such as determining the completion date.
|
|
|
|
columns:
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
description: id of the verification request. It's the unique key for this model.
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: expected_verification_count
|
|
data_type: int
|
|
description: count of verifications that are expected to be passed in order to complete the request.
|
|
|
|
- name: confirmed_from_same_verification_request_count
|
|
data_type: int
|
|
description: count of confirmed verifications that its logic is computed from the same verification request.
|
|
|
|
- name: confirmed_from_previous_verification_requests_count
|
|
data_type: int
|
|
description: count of confirmed verifications that its logic is computed from previous verification requests.
|
|
|
|
- name: confirmed_verification_count
|
|
data_type: int
|
|
description: |
|
|
total count of confirmed verifications. Mainly, it's the sum of the confirmed verifications
|
|
that come from the same verification request plus the ones that come from previous verifications requests.
|
|
|
|
- name: is_verification_request_complete
|
|
data_type: boolean
|
|
description: if the verification request can be considered as completed or not.
|
|
|
|
- name: used_verification_from_same_verification_request
|
|
data_type: boolean
|
|
description: |
|
|
if the verification request can be considered as completed and has at least one confirmed verification
|
|
from the same verification request.
|
|
|
|
- name: used_verification_from_previous_verification_requests
|
|
data_type: boolean
|
|
description: |
|
|
if the verification request can be considered as completed and has at least one confirmed verification
|
|
from a previous verification request.
|
|
|
|
- name: is_complete_only_from_previous_verification_requests
|
|
data_type: boolean
|
|
description: |
|
|
if the verification request can be considered as completed and all confirmed verifications are from
|
|
previous verification requests.
|
|
|
|
- name: int_core__verification_request_completed_date
|
|
description: |
|
|
The `int_core__verification_request_completed_date` model allows to retrieve the time in which the guest
|
|
journey, or verification request, was completed. It only considers that a guest journey is completed based
|
|
on the positive outcome of the is_verification_complete boolean coming from verification_request_completeness
|
|
model.
|
|
|
|
The completion time is computed as follows:
|
|
- Only considering verification requests that have been tagged as completed. From here, we have:
|
|
- If the verification request has, at least, one verification linked; the date will be the creation date
|
|
of the last verification created linked to that verification request.
|
|
To keep in mind: for some cases, the last verification can have updates after the creation, but these
|
|
generally happen with very low time differences with respect to the creation date. However, there are
|
|
some outliers - mostly linked to admin override - that we're not considering here, since these might
|
|
not necessarily be linked to the Guest completing the Guest Journey.
|
|
- If the verification request does not have any verification linked; we assume an automatic completion.
|
|
In this case, we use the time from which the verification request was created.
|
|
|
|
For some cases, it is possible that this logic still generates some completed times that are actually
|
|
before a user usage of the link. For these cases, we do an override and we apply the used_link_at_utc
|
|
as the completed time. To account for this cases, check the boolean column
|
|
is_completed_at_overriden_with_used_link_at.
|
|
|
|
In summary, the guest journey completion time provided here is an estimation.
|
|
|
|
Finally, this model only contains those request that have been completed, so keep it in mind when joining this
|
|
table.
|
|
|
|
columns:
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
description: id of the completed verification request. It's the unique key for this model.
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: estimated_completed_at_utc
|
|
data_type: timestamp
|
|
description: estimated timestamp of when the verification request was completed.
|
|
|
|
- name: estimated_completed_date_utc
|
|
data_type: date
|
|
description: estimated date from the timestamp of when the verification request was completed.
|
|
|
|
- name: is_completed_at_overriden_with_used_link_at
|
|
data_type: boolean
|
|
description: >
|
|
boolean indicating if the estimated dates have been overriden with the
|
|
used link since the initial computation was still considering an end
|
|
date before a starting date.
|
|
|
|
- name: int_core__verification_payments
|
|
description: >-
|
|
A simplified table that holds guest journey payments with details around
|
|
when they happen, what service was being paid, what was the related
|
|
verification request, etc.
|
|
|
|
Currency rates are converted to GBP with our simple exchange rates view.
|
|
columns:
|
|
- name: id_verification_to_payment
|
|
data_type: bigint
|
|
description: Unique ID for the relation between the payment verification
|
|
and the payment at hand.
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
- name: id_payment
|
|
data_type: bigint
|
|
description: Unique ID for the payment itself.
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
- name: is_refundable
|
|
data_type: boolean
|
|
- name: created_at_utc
|
|
data_type: timestamp without time zone
|
|
- name: updated_at_utc
|
|
data_type: timestamp without time zone
|
|
- name: payment_due_at_utc
|
|
data_type: timestamp without time zone
|
|
tests:
|
|
- not_null
|
|
- name: payment_due_date_utc
|
|
data_type: date
|
|
tests:
|
|
- not_null
|
|
- name: payment_paid_at_utc
|
|
data_type: timestamp without time zone
|
|
- name: payment_paid_date_utc
|
|
data_type: date
|
|
- name: payment_reference
|
|
data_type: character varying
|
|
- name: refund_due_at_utc
|
|
data_type: timestamp without time zone
|
|
- name: refund_due_date_utc
|
|
data_type: date
|
|
- name: payment_refunded_at_utc
|
|
data_type: timestamp without time zone
|
|
- name: payment_refunded_date_utc
|
|
data_type: date
|
|
- name: refund_payment_reference
|
|
data_type: character varying
|
|
- name: id_guest_user
|
|
data_type: character varying
|
|
- name: id_verification
|
|
data_type: bigint
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
- name: verification_payment_type
|
|
data_type: character varying
|
|
- name: amount_in_txn_currency
|
|
data_type: numeric
|
|
tests:
|
|
- not_null
|
|
- name: currency
|
|
data_type: character varying
|
|
tests:
|
|
- not_null
|
|
- name: amount_in_gbp
|
|
data_type: numeric
|
|
tests:
|
|
- not_null
|
|
- name: payment_status
|
|
data_type: character varying
|
|
- name: notes
|
|
data_type: character varying
|
|
|
|
- name: int_core__country
|
|
description: |
|
|
This model contains information regarding countries, such as codes,
|
|
names and preferred currencies
|
|
|
|
columns:
|
|
- name: id_country
|
|
data_type: bigint
|
|
description: id of the country. It's the unique key for this model.
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: iso_2
|
|
data_type: char(2)
|
|
description: ISO 3166-1 alpha-2 country code. Cannot be null.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: iso_3
|
|
data_type: char(3)
|
|
description: |
|
|
ISO 3166-1 alpha-3 country code. Some countries can have this value as not set,
|
|
therefore it's nullable.
|
|
|
|
- name: country_name
|
|
data_type: character varying
|
|
description: name of the country. Cannot be null.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: iso_num_code
|
|
data_type: int
|
|
description: |
|
|
ISO 3166-1 numeric code. Usually it's 3 digits, but since it's categorised as
|
|
an integer, the preceding zeros are removed. Nullable.
|
|
|
|
- name: phone_code
|
|
data_type: int
|
|
description: |
|
|
Phone code prefix for a given country. Can contain default / duplicated values.
|
|
|
|
- name: id_preferred_currency
|
|
data_type: int
|
|
description: |
|
|
Id of the preferred currency for a given country. Might not be the only currency
|
|
used in the country, it's just the preferred one.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: preferred_currency_name
|
|
data_type: character varying
|
|
description: |
|
|
Currency name of the preferred currency for a given country.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: preferred_iso4217_code
|
|
data_type: char(3)
|
|
description: |
|
|
Three-letter code assigned to the preferred currency for a given country by the ISO.
|
|
These codes are part of the ISO 4217 standard.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__accommodation
|
|
description: |
|
|
This model contains information regarding accommodations, also known as listings.
|
|
It contains information regarding the host this accommodation is linked to,
|
|
the geographic details, the preferred currency according to the country, details about
|
|
the listing itself (floors, bedrooms, etc) and time-related information of when the
|
|
listing was created.
|
|
|
|
columns:
|
|
- name: id_accommodation
|
|
data_type: bigint
|
|
description: Id of the accommodation or listing. It's the unique key for this model.
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: The unique ID for the host. Can be null.
|
|
|
|
- name: id_payment_validation_set
|
|
data_type: bigint
|
|
description: Id of the payment validation set linked to a listing. Can be null.
|
|
|
|
- name: friendly_name
|
|
data_type: character varying
|
|
|
|
- name: country_iso_2
|
|
data_type: char(2)
|
|
description: ISO 3166-1 alpha-2 country code where the listing is located.
|
|
|
|
- name: country_name
|
|
data_type: character varying
|
|
description: Name of the country where the listing is located.
|
|
|
|
- name: country_preferred_currency_code
|
|
data_type: char(3)
|
|
description: |
|
|
Three-letter code assigned to the preferred currency for a given country by the ISO.
|
|
These codes are part of the ISO 4217 standard. Keep in mind this are preferred, not
|
|
necessarily the actual currency.
|
|
|
|
- name: is_active
|
|
data_type: boolean
|
|
description: |
|
|
Boolean to indicate if the listing is active or not. If false, this is considered as a
|
|
hard deactivation - meaning no more bookings can be assigned to this listing. However,
|
|
even if a listing is active, that does not necessarily mean that it's receiving bookings.
|
|
Do not confuse this column with the lifecycle activity of a listing that is computed in
|
|
int_core__mtd_accommodation_lifecycle.
|
|
|
|
- name: town
|
|
data_type: character varying
|
|
|
|
- name: postcode
|
|
data_type: character varying
|
|
|
|
- name: address_line_1
|
|
data_type: character varying
|
|
|
|
- name: address_line_2
|
|
data_type: character varying
|
|
|
|
- name: verification_level
|
|
data_type: integer
|
|
|
|
- name: floor_area
|
|
data_type: integer
|
|
|
|
- name: number_of_floors
|
|
data_type: integer
|
|
|
|
- name: number_of_bedrooms
|
|
data_type: integer
|
|
|
|
- name: number_of_bathrooms
|
|
data_type: integer
|
|
|
|
- name: number_of_other_rooms
|
|
data_type: integer
|
|
|
|
- name: construction_details
|
|
data_type: character varying
|
|
|
|
- name: created_at_utc
|
|
data_type: timestamp
|
|
description: Timestamp of when the listing was created. Cannot be null.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: created_date_utc
|
|
data_type: date
|
|
description: Date of when the listing was created
|
|
|
|
- name: updated_at_utc
|
|
data_type: timestamp
|
|
description: Timestamp of when the listing was last updated according to the backend.
|
|
|
|
- name: updated_date_utc
|
|
data_type: date
|
|
description: Date of when the listing was last updated according to the backend.
|
|
|
|
- name: dwh_extracted_at_utc
|
|
data_type: timestamp
|
|
description: Timestamp of when the accommodation record was extracted from the backend into the DWH.
|
|
|
|
- name: int_core__mtd_accommodation_lifecycle
|
|
description: |
|
|
This model contains the historic information regarding the lifecycle of accommodations, also known as
|
|
listings. The information regarding the booking-related time allows for the current status of any listing
|
|
regarding its activity. This information is encapsulated in the following columns:
|
|
|
|
accommodation_lifecycle_state: contains one of the following states
|
|
- 01-New: Listings that have been created in the current month, without bookings
|
|
- 02-Never Booked: Listings that have been created before the current month, without bookings.
|
|
- 03-First Time Booked: Listings that have been booked for the first time in the current month.
|
|
- 04-Active: Listings that have booking activity in the past 12 months (that are not FTB nor reactivated)
|
|
- 05-Churning: Listings that are becoming inactive because of lack of bookings in the past 12 months
|
|
- 06-Inactive: Listings that have not had a booking for more than 12 months.
|
|
- 07-Reactivated: Listings that have had a booking in the current month that were inactive or churning before.
|
|
- Finally, if none of the logic applies, which should not happen, null will be set and a dbt alert will raise.
|
|
|
|
Since the states of Active, First Time Booked and Reactivated indicate certain booking activity and are
|
|
mutually exclusive, the model also provides information of the recency of the bookings by the following
|
|
booleans:
|
|
- has_been_booked_within_current_month: If a listing has had a booking created in the current month
|
|
- has_been_booked_within_last_6_months: If a listing has had a booking created in the past 6 months
|
|
- has_been_booked_within_last_12_months: If a listing has had a booking created in the past 12 months
|
|
Note that if a listing has had a booking created in a given month, all 3 columns will be true. Similarly,
|
|
if the last booking created to a listing was 5 months ago, only the column has_been_booked_in_1_month
|
|
will be false; while the other 2 will be true.
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- id_accommodation
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The date for the month-to-date. Information is inclusive to the date displayed.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_accommodation
|
|
data_type: bigint
|
|
description: Id of the accommodation or listing.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: creation_date_utc
|
|
data_type: date
|
|
description: Date of when the listing was created.
|
|
|
|
- name: first_time_booked_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of the first booking created for a given listing. Can be null if the listing
|
|
has never had a booking associated with it.
|
|
|
|
- name: last_time_booked_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of the last booking created for a given listing. Can be null if the listing
|
|
has never had a booking associated with it. Can be the same as first_time_booked_date_utc
|
|
if the listing only had 1 booking in its history.
|
|
|
|
- name: second_to_last_time_booked_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of the second-to-last booking created for a given listing, meaning the creation
|
|
date of the booking that precedes the last one. It's relevant for the reactivation computation
|
|
on the lifecycle. Can be null if the listing has never had a booking associated with it or if
|
|
the listing only had 1 booking in its history.
|
|
|
|
- name: accommodation_lifecycle_state
|
|
data_type: character varying
|
|
description: |
|
|
Contains the lifecycle state of a Listing. The accepted values are:
|
|
01-New, 02-Never Booked, 03-First Time Booked, 04-Active, 05-Churning, 06-Inactive,
|
|
07-Reactivated. Failing to implement the logic will result in alert.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: has_been_booked_within_current_month
|
|
data_type: boolean
|
|
description: If the listing has had a booking created in the current month.
|
|
|
|
- name: has_been_booked_within_last_6_months
|
|
data_type: boolean
|
|
description: If the listing has had a booking created in the past 6 months.
|
|
|
|
- name: has_been_booked_within_last_12_months
|
|
data_type: boolean
|
|
description: If the listing has had a booking created in the past 12 months.
|
|
|
|
- name: int_core__mtd_accommodation_segmentation
|
|
description: |
|
|
This model contains the historic information regarding the customer segmentation based on active accommodations,
|
|
also known as listings. This model depends on the int_core__mtd_accommodation_lifecycle, thus the time granularity
|
|
is the same as for any mtd model.
|
|
|
|
The segmentation is applied at deal level, not at user host level. This has the drawback that hosts without a
|
|
deal assigned won't be considered in this segmentation. However, it correctly categorises customers based on the
|
|
number of listings across the different user hosts each deal can have.
|
|
|
|
The segmentation is available in the field active_accommodations_per_deal_segmentation. It considers listings that
|
|
have been booked within the last 12 months. Thus, it means it only considers the lifecycle states of
|
|
03-First Time Booked, 04-Active and 07-Reactivated. The segments are the following:
|
|
- '0'
|
|
- '01-05'
|
|
- '06-20'
|
|
- '21-60'
|
|
- '61+'
|
|
These segments are inspired from the ones RevOps team uses, but the associated deals and listings volume will differ
|
|
since the listing activity logic considered is different.
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- id_deal
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The date for the month-to-date. Information is inclusive to the date displayed.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_deal
|
|
data_type: character varying
|
|
description: Id of the deal associated to the host.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: active_accommodations_per_deal_segmentation
|
|
data_type: character varying
|
|
description: The segmentation based on the number of listings booked in the last 12 months.
|
|
tests:
|
|
- not_null
|
|
- accepted_values:
|
|
values:
|
|
- '0'
|
|
- '01-05'
|
|
- '06-20'
|
|
- '21-60'
|
|
- '61+'
|
|
|
|
- name: accommodations_booked_in_12_months
|
|
data_type: integer
|
|
description: Informative field of the actual number of listings booked in the last 12 months
|
|
|
|
- name: int_core__mtd_deal_lifecycle
|
|
description: |
|
|
This model contains the historic information regarding the lifecycle of hosts, at deal level.
|
|
The information regarding the booking-related time allows for the current status of any
|
|
deal regarding its activity. This information is encapsulated in the following columns:
|
|
|
|
deal_lifecycle_state: contains one of the following states
|
|
- 01-New: Deals that have been created in the current month, without bookings
|
|
- 02-Never Booked: Deals that have been created before the current month, without bookings.
|
|
- 03-First Time Booked: Deals that have been booked for the first time in the current month.
|
|
- 04-Active: Deals that have booking activity in the past 12 months (that are not FTB nor reactivated)
|
|
- 05-Churning: Deals that are becoming inactive because of lack of bookings in the past 12 months
|
|
- 06-Inactive: Deals that have not had a booking for more than 12 months.
|
|
- 07-Reactivated: Deals that have had a booking in the current month that were inactive or churning before.
|
|
- Finally, if none of the logic applies, which should not happen, null will be set and a dbt alert will raise.
|
|
|
|
Since the states of Active, First Time Booked and Reactivated indicate certain booking activity and are
|
|
mutually exclusive, the model also provides information of the recency of the bookings by the following
|
|
booleans:
|
|
- has_been_booked_within_current_month: If a deal has had a booking created in the current month
|
|
- has_been_booked_within_last_6_months: If a deal has had a booking created in the past 6 months
|
|
- has_been_booked_within_last_12_months: If a deal has had a booking created in the past 12 months
|
|
Note that if a deal has had a booking created in a given month, all 3 columns will be true. Similarly,
|
|
if the last booking created to a deal was 5 months ago, only the column has_been_booked_in_1_month
|
|
will be false; while the other 2 will be true.
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- id_deal
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: The date for the month-to-date. Information is inclusive to the date displayed.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_deal
|
|
data_type: character varying
|
|
description: Id of the deal associated to the host.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: creation_date_utc
|
|
data_type: date
|
|
description: Date of when the first host associated to that deal was created.
|
|
|
|
- name: first_time_booked_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of the first booking created for a given deal. Can be null if the deal
|
|
has never had a booking associated with it.
|
|
|
|
- name: last_time_booked_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of the last booking created for a given deal. Can be null if the deal
|
|
has never had a booking associated with it. Can be the same as first_time_booked_date_utc
|
|
if the deal only had 1 booking in its history.
|
|
|
|
- name: second_to_last_time_booked_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of the second-to-last booking created for a given deal, meaning the creation
|
|
date of the booking that precedes the last one. It's relevant for the reactivation computation
|
|
on the lifecycle. Can be null if the deal has never had a booking associated with it or if
|
|
the deal only had 1 booking in its history.
|
|
|
|
- name: deal_lifecycle_state
|
|
data_type: character varying
|
|
description: |
|
|
Contains the lifecycle state of a deal. The accepted values are:
|
|
01-New, 02-Never Booked, 03-First Time Booked, 04-Active, 05-Churning, 06-Inactive,
|
|
07-Reactivated. Failing to implement the logic will result in alert.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: has_been_booked_within_current_month
|
|
data_type: boolean
|
|
description: If the deal has had a booking created in the current month.
|
|
|
|
- name: has_been_booked_within_last_6_months
|
|
data_type: boolean
|
|
description: If the deal has had a booking created in the past 6 months.
|
|
|
|
- name: has_been_booked_within_last_12_months
|
|
data_type: boolean
|
|
description: If the deal has had a booking created in the past 12 months.
|
|
|
|
- name: int_core__check_in_cover_users
|
|
description:
|
|
This model contains information about hosts that offer check in cover.
|
|
It has basic information on the users like name, phone, email or joined date.
|
|
|
|
This model is restricted to active user so it doesn't include historical data
|
|
like users that had check-in cover but are currently inactive.
|
|
columns:
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: Unique id value for the user
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: id_deal
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: last_name
|
|
data_type: character varying
|
|
description: Last name of the user
|
|
|
|
- name: user_name
|
|
data_type: character varying
|
|
description: User name of the user
|
|
|
|
- name: first_name
|
|
data_type: character varying
|
|
description: First name of the user
|
|
|
|
- name: host_email
|
|
data_type: character varying
|
|
description: Email of the user
|
|
|
|
- name: phone_number
|
|
data_type: character varying
|
|
description: Phone number of the user
|
|
|
|
- name: joined_at_utc
|
|
data_type: timestamp without time zone
|
|
description: Date and time the user joined
|
|
|
|
- name: joined_date_utc
|
|
data_type: date
|
|
description: Date the user joined
|
|
|
|
- name: check_in_cover_added_date_utc
|
|
data_type: date
|
|
description:
|
|
Date the user first included check-in cover
|
|
|
|
- name: billing_town
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: company_name
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: int_core__guest_satisfaction_responses
|
|
description:
|
|
This model contains information on guests satisfaction survey responses,
|
|
it contains some basic information on the guests, a rating of their experience
|
|
and some comments on it.
|
|
It also includes information on the services provided by Superhog that they payed for.
|
|
columns:
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
description: Unique id value for the verification request
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: id_user_guest
|
|
data_type: character varying
|
|
description: Unique id value for the guest
|
|
|
|
- name: guest_email
|
|
data_type: character varying
|
|
description: Guest email
|
|
|
|
- name: verification_request_booking_source
|
|
data_type: text
|
|
description:
|
|
Source type of host of the booking, this could be either;
|
|
- PMS
|
|
- OSL
|
|
- API/MANUAL
|
|
tests:
|
|
- not_null
|
|
- accepted_values:
|
|
values:
|
|
- 'PMS'
|
|
- 'OSL'
|
|
- 'API/MANUAL'
|
|
|
|
- name: experience_rating
|
|
data_type: bigint
|
|
description:
|
|
Guest rating of their experience with Superhog from 1 to 5
|
|
|
|
- name: guest_comments
|
|
data_type: character varying
|
|
description:
|
|
Guest comments on their experience with Superhog
|
|
|
|
- name: is_contactable
|
|
data_type: boolean
|
|
description: |
|
|
True if the guest allows to be contacted for more feedback
|
|
|
|
- name: created_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
Date and time of response creation
|
|
|
|
- name: updated_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
Date and time of last update of response
|
|
|
|
- name: selected_payment_option
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: date_of_birth
|
|
data_type: numeric
|
|
description: ""
|
|
|
|
- name: age_of_guest
|
|
data_type: numeric
|
|
description: ""
|
|
|
|
- name: has_check_in_cover_payment
|
|
data_type: boolean
|
|
description: |
|
|
True if guest payed for check-in cover
|
|
|
|
- name: has_waiver_payment
|
|
data_type: boolean
|
|
description: |
|
|
True if guest payed the waiver
|
|
|
|
- name: has_deposit_payment
|
|
data_type: boolean
|
|
description: |
|
|
True if guest payed the deposit
|
|
|
|
- name: has_fee_payment
|
|
data_type: boolean
|
|
description: |
|
|
True if guest payed the fee
|
|
|
|
|
|
- name: int_core__verification_request_booking_source
|
|
description:
|
|
This model contains information on verification requests
|
|
and the category type of host that manages the associated
|
|
booking.
|
|
For PMS (Property Manager System) we use the id_integration
|
|
from stg_core__booking, if it isn't Null then the host is PMS type.
|
|
For OSL (One Step Link) we use the id_one_step_link from
|
|
stg_core__verification_request, similarly if it isn't Null then
|
|
the host is OSL type.
|
|
Finally if both id_integration and id_one_step_link are Null,
|
|
then we classify them as API/MANUAL. (At this point we can't
|
|
differentiate between these 2 categories so for now we keep
|
|
them together)
|
|
|
|
columns:
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
description:
|
|
Id value for the verification request, there can be more
|
|
than 1 record for each verification request since they can
|
|
be associated to more than 1 booking
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: created_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
Date and time of creation of the verification request
|
|
|
|
- name: created_date_utc
|
|
data_type: date
|
|
description:
|
|
Date of creation of the verification request
|
|
|
|
- name: verification_request_booking_source
|
|
data_type: text
|
|
description:
|
|
Source type of host of the booking, this could be either;
|
|
- PMS
|
|
- OSL
|
|
- API/MANUAL
|
|
tests:
|
|
- not_null
|
|
- accepted_values:
|
|
values:
|
|
- 'PMS'
|
|
- 'OSL'
|
|
- 'API/MANUAL'
|
|
|
|
- name: int_core__verification_requests
|
|
description:
|
|
This is a table that shows all guest journey from our guests users with
|
|
each record matching each guest journey.
|
|
|
|
It holds information about the guests like name, email, phone, etc.., as
|
|
well as dates regarding the process of the guest journey like when it
|
|
was started or finished.
|
|
columns:
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
description:
|
|
Unique, incremental, internal ID for the related verification
|
|
request.
|
|
|
|
- name: uuid_verification_request
|
|
data_type: text
|
|
description: uuid for the related verification request.
|
|
|
|
- name: id_verification_set
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: id_superhog_verified_set
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: id_payment_validation_set
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: id_user_guest
|
|
data_type: character varying
|
|
description: Unique, incremental, internal ID for the guest user.
|
|
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: Unique, incremental, internal ID for the host user.
|
|
|
|
- name: is_verification_request_complete
|
|
data_type: boolean
|
|
description: True if the verification request is considered
|
|
complete, AKA the guest has finished the full guest journey.
|
|
|
|
- name: verification_url
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: callback_url
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: redirect_url
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: logo
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: guest_email
|
|
data_type: character varying
|
|
description: The email of the guest.
|
|
|
|
- name: last_name
|
|
data_type: character varying
|
|
description: The last name of the guest.
|
|
|
|
- name: first_name
|
|
data_type: character varying
|
|
description: The first name of the guest.
|
|
|
|
- name: guest_phone_number
|
|
data_type: character varying
|
|
description: The phone number of the guest.
|
|
|
|
- name: telephone_code
|
|
data_type: character varying
|
|
description: The telephone code of the guest.
|
|
|
|
- name: guest_phone_number_2
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: verification_estimated_started_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
The estimated date and time at which the guest started the guest journey.
|
|
|
|
- name: verification_estimated_started_date_utc
|
|
data_type: date
|
|
description:
|
|
The estimated date on which the guest started the guest journey.
|
|
|
|
- name: verification_estimated_completed_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
The estimated date and time at which the guest finished the guest journey.
|
|
|
|
- name: verification_estimated_completed_date_utc
|
|
data_type: date
|
|
description:
|
|
The estimated date on which the guest finished the guest journey.
|
|
|
|
- name: link_used_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
The date and time at which the guest used the link for the verification.
|
|
|
|
- name: link_used_date_utc
|
|
data_type: date
|
|
description:
|
|
The date on which the guest used the link for the verification.
|
|
|
|
- name: expire_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
The date and time at which the link for the verification expires.
|
|
|
|
- name: expire_date_utc
|
|
data_type: date
|
|
description:
|
|
The date on which the link for the verification expires.
|
|
|
|
- name: is_deleted
|
|
data_type: boolean
|
|
description: |
|
|
True if the link for verification expired before finishing the
|
|
verification.
|
|
|
|
- name: redirect_name
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: id_one_step_link
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: verification_request_booking_source
|
|
data_type: text
|
|
description:
|
|
Source type of host of the booking, this could be either;
|
|
- PMS
|
|
- OSL
|
|
- API/MANUAL
|
|
tests:
|
|
- not_null
|
|
- accepted_values:
|
|
values:
|
|
- 'PMS'
|
|
- 'OSL'
|
|
- 'API/MANUAL'
|
|
|
|
- name: success_message
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: summary
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: rejection_reason
|
|
data_type: character varying
|
|
description:
|
|
Reason as to why the guest was rejected.
|
|
|
|
- name: has_switched_to_mobile
|
|
data_type: boolean
|
|
description: |
|
|
True if the guest changed has switched to mobile
|
|
during the verification process.
|
|
|
|
- name: is_verifier_rejected
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: config
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: metadata
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: created_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
The date and time at which the verification process was created.
|
|
|
|
- name: created_date_utc
|
|
data_type: date
|
|
description:
|
|
The date on which the verification process was created.
|
|
|
|
- name: updated_at_utc
|
|
data_type: timestamp without time zone
|
|
description:
|
|
The date and time at which the last update on the entry happened.
|
|
|
|
- name: updated_date_utc
|
|
data_type: date
|
|
description:
|
|
The date on which the last update on the entry happened.
|
|
|
|
- name: dwh_extracted_at_utc
|
|
data_type: timestamp with time zone
|
|
description: ""
|
|
|
|
- name: int_core__bookings
|
|
description: ""
|
|
columns:
|
|
- name: id_booking
|
|
data_type: bigint
|
|
description: "The unique, Superhog generated id for this booking."
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
|
|
- name: id_user_guest
|
|
data_type: character varying
|
|
description: "The unique, Superhog generated id for the guest"
|
|
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: "The unique, Superhog generated id for the host"
|
|
|
|
- name: id_integration
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: id_accommodation
|
|
data_type: bigint
|
|
description: "The ID of the booked listing."
|
|
|
|
- name: id_booking_source
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
description: "Id value for the verification request, there can be more than 1 record for each verification request since they can be associated to more than 1 booking"
|
|
|
|
- name: verification_request_booking_source
|
|
data_type: text
|
|
description:
|
|
Source type of host of the booking, this could be either;
|
|
- PMS
|
|
- OSL
|
|
- API/MANUAL
|
|
tests:
|
|
- not_null
|
|
- accepted_values:
|
|
values:
|
|
- 'PMS'
|
|
- 'OSL'
|
|
- 'API/MANUAL'
|
|
|
|
- name: id_staging_host_booking
|
|
data_type: bigint
|
|
description: ""
|
|
|
|
- name: is_duplicate_booking
|
|
data_type: boolean
|
|
description:
|
|
A flag that identifies whether the booking is a duplicate.
|
|
|
|
A booking is considered a duplicate if there's an older booking with the same user,
|
|
accomodation and check-in date. If there are two or more bookings with the same user,
|
|
accomodation and check-in date, the oldest one will have False as a value in this field,
|
|
and the other ones will have True as a value in this Failed."
|
|
|
|
Put simply, if you don't want to receive duplicates, filter this field to False.
|
|
|
|
- name: is_duplicating_booking_with_id
|
|
data_type: bigint
|
|
description:
|
|
"If is_duplicate_booking is True then gives id_booking"
|
|
|
|
- name: booking_state
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: check_in_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: check_in_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: check_out_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: check_out_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: check_in_sits_in_future
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: check_out_sits_in_future
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: booking_fee_local
|
|
data_type: numeric
|
|
description: "The fee to apply to the booking, in host currency."
|
|
|
|
- name: booking_fee_charge_at_utc
|
|
data_type: timestamp without time zone
|
|
description: The point in time in which the booking should be invoiced.
|
|
This could be the check-in date of the booking or the date in which the guest verification
|
|
started, depending on the billing settings of the host.
|
|
|
|
- name: booking_fee_charge_date_utc
|
|
data_type: date
|
|
description: The date in which the booking should be invoiced.
|
|
This could be the check-in date of the booking or the date in which the guest verification
|
|
started, depending on the billing settings of the host.
|
|
|
|
- name: summary
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: guest_email
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: guest_last_name
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: guest_first_name
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: guest_telephone
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: additional_guests
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: unsubscribe_verification_reminder
|
|
data_type: boolean
|
|
description: ""
|
|
|
|
- name: created_at_utc
|
|
data_type: timestamp without time zone
|
|
description: "Date and time of creation of the verification request"
|
|
|
|
- name: created_date_utc
|
|
data_type: date
|
|
description: "Date of creation of the verification request"
|
|
|
|
- name: updated_at_utc
|
|
data_type: timestamp without time zone
|
|
description: ""
|
|
|
|
- name: updated_date_utc
|
|
data_type: date
|
|
description: ""
|
|
|
|
- name: dwh_extracted_at_utc
|
|
data_type: timestamp with time zone
|
|
description: ""
|
|
|
|
- name: int_core__check_in_cover_listings
|
|
description:
|
|
This model contains information about hosts and their listings
|
|
that offer check in cover.
|
|
It has basic information on the users and listings like country,
|
|
town, address and if they are active or not.
|
|
|
|
This model is restricted to active user so it doesn't include historical
|
|
data like users that had check-in cover but are currently inactive.
|
|
columns:
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: Unique id value for the user
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_deal
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: last_name
|
|
data_type: character varying
|
|
description: Last name of the user
|
|
|
|
- name: user_name
|
|
data_type: character varying
|
|
description: User name of the user
|
|
|
|
- name: first_name
|
|
data_type: character varying
|
|
description: First name of the user
|
|
|
|
- name: host_email
|
|
data_type: character varying
|
|
description: Email of the user
|
|
|
|
- name: phone_number
|
|
data_type: character varying
|
|
description: Phone number of the user
|
|
|
|
- name: joined_at_utc
|
|
data_type: timestamp without time zone
|
|
description: Date and time the user joined
|
|
|
|
- name: joined_date_utc
|
|
data_type: date
|
|
description: Date the user joined
|
|
|
|
- name: check_in_cover_added_date_utc
|
|
data_type: date
|
|
description:
|
|
Date the user first included check-in cover
|
|
|
|
- name: billing_town
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: company_name
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: id_accommodation
|
|
data_type: bigint
|
|
description: "Id of the accommodation or listing. It's the unique key for this model."
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
|
|
- name: is_active
|
|
data_type: boolean
|
|
description: "Boolean to indicate if the accommodation is active or not"
|
|
|
|
- name: friendly_name
|
|
data_type: character varying
|
|
description: "Name of the accommodation"
|
|
|
|
- name: country_name
|
|
data_type: character varying
|
|
description: "Name of the country where the accommodation is located."
|
|
|
|
- name: town
|
|
data_type: character varying
|
|
description: "Town in which the accommodation is located"
|
|
|
|
- name: postcode
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: address_line_1
|
|
data_type: character varying
|
|
description: ""
|
|
|
|
- name: check_in_cover_purchased
|
|
data_type: bigint
|
|
description:
|
|
"Count of how many Check-in covers have been
|
|
purchased for this accommodation"
|
|
|
|
- name: int_core__host_booking_fees
|
|
description:
|
|
Bookings that have been processed by the Superhog backend.
|
|
Each record matches one booking and has information on host
|
|
booking fees, when they were charged and the currency used by
|
|
the host.
|
|
|
|
columns:
|
|
- name: id_booking
|
|
data_type: bigint
|
|
description: "The unique, Superhog generated id for this booking."
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
|
|
- name: id_user_guest
|
|
data_type: character varying
|
|
description: The UUID of the Superhog user playing the guest role in the booking.
|
|
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: The UUID of the Superhog user playing the host role in the booking.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: id_accommodation
|
|
data_type: bigint
|
|
description: The ID of the booked listing.
|
|
|
|
- name: booking_state
|
|
data_type: character varying
|
|
description:
|
|
"State in which the booking is, could be either of the following:
|
|
- Approved
|
|
- NotApproved
|
|
- Cancelled
|
|
- Rejected
|
|
- NoFlags
|
|
- Flagged
|
|
- IncompleteInformation"
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- 'Approved'
|
|
- 'NotApproved'
|
|
- 'Cancelled'
|
|
- 'Rejected'
|
|
- 'NoFlags'
|
|
- 'Flagged'
|
|
- 'IncompleteInformation'
|
|
|
|
- name: is_duplicate_booking
|
|
data_type: boolean
|
|
description: |
|
|
A flag that identifies whether the booking is a duplicate.
|
|
A booking is considered a duplicate if there's an older booking with the same user,
|
|
accomodation and check-in date. If there are two or more bookings with the same user,
|
|
accomodation and check-in date, the oldest one will have False as a value in this field,
|
|
and the other ones will have True as a value in this Failed."
|
|
Put simply, if you don't want to receive duplicates, filter this field to False.
|
|
|
|
- name: booking_fee_local
|
|
data_type: numeric
|
|
description: "The fee to apply to the booking, in host currency."
|
|
|
|
- name: account_currency_iso4217
|
|
data_type: character varying
|
|
description: "Currency used by host/pm/platform users."
|
|
|
|
- name: booking_fee_in_gbp
|
|
data_type: numeric
|
|
description: "The fee to apply to the booking, in GBP"
|
|
|
|
- name: booking_fee_charge_at_utc
|
|
data_type: timestamp without time zone
|
|
description: |
|
|
The point in time in which the booking should be invoiced.
|
|
|
|
This could be the check-in date of the booking or the date in which the guest verification
|
|
started, depending on the billing settings of the host.
|
|
|
|
- name: booking_fee_charge_date_utc
|
|
data_type: date
|
|
description: |
|
|
The date in which the booking should be invoiced.
|
|
|
|
This could be the check-in date of the booking or the date in which the guest verification
|
|
started, depending on the billing settings of the host.
|
|
|
|
- name: int_core__user_role
|
|
description: |
|
|
This model contains the relationship of user has a role.
|
|
A User in this table can have 1 or more than 1 roles.
|
|
Not all Users in this table appear in the standard user table,
|
|
meaning that not all users have a role assigned.
|
|
|
|
The possible roles are:
|
|
- Host
|
|
- Platform
|
|
- EDeposit
|
|
- Guest
|
|
- Admin
|
|
- KnowYourGuest
|
|
- ScreeningAPI
|
|
- PropertyVerificationManager
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- id_user
|
|
- role_name
|
|
|
|
columns:
|
|
- name: id_user
|
|
data_type: string
|
|
description: |
|
|
The identifier of the user. Can be duplicated if it has multiple roles.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: role_name
|
|
data_type: string
|
|
description: The name of the role a user has.
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- Host
|
|
- Platform
|
|
- EDeposit
|
|
- Guest
|
|
- Admin
|
|
- KnowYourGuest
|
|
- ScreeningApi
|
|
- PropertyVerificationManager
|
|
|
|
- name: int_core__user_host
|
|
description: |
|
|
This table provides information of the users that act as Hosts.
|
|
A Host needs to be understood in the broad sense of the term. Here host means any
|
|
user that acts as a "B2B" client.
|
|
The categorisation as a Host is based on two possibilities: the role of the user or if
|
|
the user comes from Know Your Guest (KYG) within the claim table. Any user that has
|
|
any of the following roles will be considered as a Host in this table:
|
|
- Host
|
|
- Platform
|
|
- EDeposit
|
|
- KnowYourGuest
|
|
- ScreeningAPI
|
|
- PropertyVerificationManager
|
|
Additionally, any user that has any of these claim types will be considered as a Host:
|
|
- KygRegistrationSignUpType
|
|
- KygRegistrationIntegrationTypeName
|
|
- KygMvp
|
|
Lastly, in case a user satisfies multiple conditions, it will only appear once in this table.
|
|
|
|
columns:
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: The unique user ID for the Host.
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
- name: id_account_type
|
|
data_type: integer
|
|
description: |
|
|
Account type ID. Can be null and might be not up-to-date.
|
|
- name: id_billing_country
|
|
data_type: integer
|
|
description: |
|
|
ID of the country in which the Host is billed.
|
|
In some cases it's null.
|
|
- name: account_currency_iso4217
|
|
data_type: string
|
|
description: |
|
|
3 character currency code linked to the account.
|
|
In some cases it's null.
|
|
- name: user_code
|
|
data_type: integer
|
|
description: |
|
|
A code identifying users.
|
|
- name: first_name
|
|
data_type: string
|
|
description: |
|
|
First name of the Host.
|
|
- name: last_name
|
|
data_type: string
|
|
description: |
|
|
Last name of the Host.
|
|
- name: company_name
|
|
data_type: string
|
|
description: |
|
|
Name of the company. In some cases, it's the same
|
|
as the first_name, the last_name, a concatenation of
|
|
both, or something different. Can be null and empty.
|
|
- name: email
|
|
data_type: string
|
|
description: |
|
|
Electronic mail of the Host.
|
|
- name: id_deal
|
|
data_type: string
|
|
description: |
|
|
Main identifier of the B2B clients. A Deal can have multiple Hosts.
|
|
A Host can have only 1 Deal or no Deal at all. This field can be null.
|
|
- name: joined_at_utc
|
|
data_type: timestamp
|
|
description: |
|
|
Timestamp of when the Host user joined Superhog.
|
|
- name: joined_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of when the Host user joined Superhog.
|
|
- name: created_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of when the Host user was created in our systems.
|
|
- name: updated_date_utc
|
|
data_type: date
|
|
description: |
|
|
Date of the last time the information of the Host was updated
|
|
in our systems.
|
|
- name: is_user_migrated
|
|
data_type: boolean
|
|
description: |
|
|
Flag to determine if this user host has been migrated according
|
|
to the logic implemented in user_migration table.
|
|
- name: migration_phase
|
|
data_type: string
|
|
description: |
|
|
The name of the phase this user was first migrated.
|
|
- name: lower_limit_migration_date_utc
|
|
data_type: date
|
|
description: |
|
|
The date that the deployment of the migration happened.
|
|
It does not necessarily mean that this user was migrated in
|
|
this date. This user could have not been migrated before
|
|
this date.
|
|
|
|
- name: int_core__user_migration
|
|
description: |
|
|
This table provides information of the host users that have been migrated.
|
|
At this stage, the main objective is to account for the user migration within
|
|
the scope of New Dashboard migration.
|
|
It uses the migration configuration settled in the macro:
|
|
- user_migration_configuration -> get_new_dash_migration_phases_config
|
|
|
|
columns:
|
|
- name: id_user_host
|
|
data_type: character varying
|
|
description: The unique user ID for the Host.
|
|
tests:
|
|
- not_null
|
|
- unique
|
|
- name: migration_phase
|
|
data_type: string
|
|
description: |
|
|
The name of the phase this user was first migrated.
|
|
tests:
|
|
- not_null
|
|
- name: lower_limit_migration_date_utc
|
|
data_type: date
|
|
description: |
|
|
The date that the deployment of the migration happened.
|
|
It does not necessarily mean that this user was migrated in
|
|
this date. This user could have not been migrated before
|
|
this date.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: int_core__address_validations
|
|
description:
|
|
"This tables contains records on address validation for Check-in Hero
|
|
purchases by guests.
|
|
The cover validation can pass or be rejected"
|
|
columns:
|
|
- name: id_address_validation
|
|
data_type: bigint
|
|
description: "Id of the address validation."
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
|
|
- name: id_verification
|
|
data_type: bigint
|
|
description: "Id of the verification."
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
|
|
- name: id_verification_request
|
|
data_type: bigint
|
|
description: "Id of the verification request."
|
|
tests:
|
|
- unique
|
|
- not_null
|
|
|
|
- name: id_accommodation
|
|
data_type: bigint
|
|
description: "Id of the accommodation or listing."
|
|
tests:
|
|
- not_null
|
|
|
|
- name: validation_passed
|
|
data_type: boolean
|
|
description: "Boolean to indicate if the validation was approved or not."
|
|
|
|
- name: feature_size_meters
|
|
data_type: numeric
|
|
description: ""
|
|
|
|
- name: feature_size_meters_upper_limit
|
|
data_type: numeric
|
|
description: ""
|
|
|
|
- name: notes
|
|
data_type: character varying
|
|
description: "Notes in case there was some problem with the validation."
|
|
|
|
- name: created_at_utc
|
|
data_type: timestamp without time zone
|
|
description: "Date and time at which the validation was created."
|
|
|
|
- name: updated_at_utc
|
|
data_type: timestamp without time zone
|
|
description: "Date and time at which the validation was last updated."
|
|
|
|
- name: dwh_extracted_at_utc
|
|
data_type: timestamp with time zone
|
|
description: "Date and time at which the record was extracted from the backend into the DWH." |