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

289 lines
8.6 KiB
YAML
Raw Permalink Normal View History

2024-12-11 14:32:39 +01:00
version: 2
models:
- name: int_check_in_hero__checkins
description: |
Records of checkins using Checkin Hero API, capturing details about reservations,
guests, accommodations, and booking details.
columns:
- name: id_record
data_type: text
description: Unique identifier for the record.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- unique
- not_null
- name: id_user_partner
data_type: text
description: Identifier for the partner user associated with the check-in.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
2025-03-19 09:23:23 +01:00
- name: id_deal
data_type: text
description: Identifier for the deal associated with the booking.
data_tests:
- not_null
2024-12-11 14:32:39 +01:00
- name: id_reservation
data_type: text
description: Unique identifier for the reservation associated with the check-in.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: id_accommodation
data_type: text
description: Unique identifier for the accommodation associated with the reservation.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
2024-12-20 15:36:00 +01:00
- name: id_currency
data_type: bigint
description: "Id of the currency, works as a foreign key to the
currency table"
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-20 15:36:00 +01:00
- not_null
- relationships:
to: ref('stg_core__currency')
field: id_currency
- name: currency_code
data_type: character varying
description: Currency ISO 4217 code used by user.
data_tests:
- not_null
- name: booking_fee_in_local_currency
data_type: numeric
description: "Fee charged to the user for each booking in the local currency."
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
2025-01-20 15:14:57 +01:00
- name: exchange_rate_to_gbp
data_type: numeric
description: "Exchange rate used to convert the local currency to GBP."
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
- name: booking_fee_in_gbp
data_type: numeric
description: "Total fee charged to the user for the month in gbp."
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
2024-12-11 14:32:39 +01:00
- name: guest_last_name
data_type: text
description: Last name of the guest checking in.
- name: guest_first_name
data_type: text
description: First name of the guest checking in.
- name: guest_email
data_type: text
description: Email address of the guest checking in.
- name: guest_telephone
data_type: text
description: Telephone number of the guest checking in.
- name: number_of_guests
data_type: integer
description: Total number of guests included in the check-in.
- name: reservation_total_amount_in_local_currency
data_type: numeric
description: Total cost amount in guest currency for the reservation.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
- name: reservation_currency
data_type: text
description: |
Currency ISO code used by guest for the reservation.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: channel
data_type: text
description: Booking channel or source.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: checkin_date_utc
data_type: date
description: Check-in date for the booking.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: checkin_time_utc
data_type: time without time zone
description: Time of check-in for the booking.
- name: checkout_date_utc
data_type: date
description: Check-out date for the booking.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: number_of_nights
data_type: integer
2024-12-12 11:29:11 +01:00
description: Number of nights for the reservation.
2025-01-13 16:00:35 +01:00
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 1
2024-12-11 14:32:39 +01:00
- name: listing_name
data_type: text
description: Name of the listing associated with the check-in.
- name: listing_address
data_type: text
description: Address of the listing.
- name: listing_address_line_2
data_type: text
description: Additional address details for the listing.
- name: listing_town
data_type: text
description: Town or city where the listing is located.
- name: listing_country
data_type: text
description: Country code for the location of the listing.
- name: listing_postcode
data_type: text
description: Postal code for the listing.
- name: company_name
data_type: text
description: Company name of partner user.
- name: user_email
data_type: text
description: Email address of the user associated with the check-in.
- name: updated_at_utc
data_type: timestamp without time zone
description: Timestamp of the last update to the record.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: updated_date_utc
data_type: date
description: Date of the last update to the record.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: cosmos_creation_at_utc
data_type: timestamp without time zone
description: Timestamp when the record was created in Cosmos DB.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: cosmos_creation_date_utc
data_type: date
description: Date when the record was created in Cosmos DB.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
- name: created_date_utc
data_type: date
description: Date when the record was created.
2025-01-13 16:00:35 +01:00
data_tests:
2024-12-11 14:32:39 +01:00
- not_null
2025-01-16 10:27:48 +01:00
- name: int_check_in_hero__user_monthly_fee
description: |
Table that shows the total monthly fee for each user.
These charges are calculated based on the amount of request created
for each user partner that will be invoiced at the beginning of the
following month.
columns:
- name: id_user_partner
data_type: text
description: |
Identifier for the partner user associated with the check-in.
2025-03-19 09:23:23 +01:00
data_tests:
- not_null
- name: id_deal
data_type: text
description: Identifier for the deal associated with the booking.
2025-01-16 10:27:48 +01:00
data_tests:
- not_null
- name: year
data_type: integer
description: |
Year when the charges are created. This is obtained from the
creation date of each record.
data_tests:
- not_null
- name: month
data_type: integer
description: |
Month number when the charges are created. This is obtained from the
creation date of each record.
data_tests:
- not_null
- name: id_currency
data_type: bigint
description: "Id of the currency, works as a foreign key to the
currency table"
data_tests:
- not_null
- relationships:
to: ref('stg_core__currency')
field: id_currency
- name: currency_code
data_type: character varying
description: Currency ISO 4217 code used by user.
data_tests:
- not_null
- name: total_fee_in_local_currency
data_type: numeric
description: "Total fee charged to the user for the month in the local currency."
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
2025-01-20 15:14:57 +01:00
- name: total_fee_in_gbp
data_type: numeric
description: "Total fee charged to the user for the month in gbp."
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
2025-01-16 10:27:48 +01:00
- name: number_of_requests
data_type: numeric
description: "Count of requests created by the user partner for the month."
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
- name: company_name
data_type: text
description: Company name of partner user.
- name: user_email
data_type: text
description: Email address of the user associated with the check-in.