change "tests:" to "data_tests:"

This commit is contained in:
Pablo Martin 2025-01-13 16:00:35 +01:00
parent db1edf7a1c
commit c3c628aec4
29 changed files with 1565 additions and 1565 deletions

View file

@ -14,7 +14,7 @@ models:
- name: id_verification
data_type: text
description: "unique Superhog generated id for this verification"
tests:
data_tests:
- unique
- not_null
@ -27,7 +27,7 @@ models:
- name: id_user_partner
data_type: text
description: "unique Superhog generated id for partner"
tests:
data_tests:
- not_null
- name: id_accommodation
@ -37,7 +37,7 @@ models:
- name: version
data_type: text
description: "value to identify if it is Guesty (V1) or E-deposit (V2)"
tests:
data_tests:
- accepted_values:
values:
- V1
@ -45,7 +45,7 @@ models:
- name: verification_source
data_type: text
description: "source of the verification for the booking"
tests:
data_tests:
- accepted_values:
values:
- Guesty
@ -213,7 +213,7 @@ models:
- name: id_verification
data_type: text
description: "unique Superhog generated id for this verification"
tests:
data_tests:
- unique
- not_null
@ -222,7 +222,7 @@ models:
description: "unique Superhog generated id for a booking.
note that there might be duplicate bookings on the original data
but we remove them keeping only the verification with the most recent update."
tests:
data_tests:
- not_null
- unique
@ -233,13 +233,13 @@ models:
- name: is_cancelled
data_type: boolean
description: "indicates if the booking has been cancelled or not."
tests:
data_tests:
- not_null
- name: ok_status_fee_in_gbp
data_type: integer
description: "total fee charged on checkout, this is only charged for approved verifications"
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -249,11 +249,11 @@ models:
- name: created_date_utc
data_type: date
description: "Date of creation of the verification in the system"
tests:
data_tests:
- not_null
- name: checkout_date_utc
data_type: date
description: "Date of checkout for the booking"
tests:
data_tests:
- not_null

View file

@ -9,33 +9,33 @@ models:
- name: id_record
data_type: text
description: Unique identifier for the record.
tests:
data_tests:
- unique
- not_null
- name: id_user_partner
data_type: text
description: Identifier for the partner user associated with the check-in.
tests:
data_tests:
- not_null
- name: id_reservation
data_type: text
description: Unique identifier for the reservation associated with the check-in.
tests:
data_tests:
- not_null
- name: id_accommodation
data_type: text
description: Unique identifier for the accommodation associated with the reservation.
tests:
data_tests:
- not_null
- name: id_currency
data_type: bigint
description: "Id of the currency, works as a foreign key to the
currency table"
tests:
data_tests:
- not_null
- relationships:
to: ref('stg_core__currency')
@ -64,7 +64,7 @@ models:
- name: reservation_total_amount_in_local_currency
data_type: numeric
description: Total cost amount in guest currency for the reservation.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
@ -73,19 +73,19 @@ models:
data_type: text
description: |
Currency ISO code used by guest for the reservation.
tests:
data_tests:
- not_null
- name: channel
data_type: text
description: Booking channel or source.
tests:
data_tests:
- not_null
- name: checkin_date_utc
data_type: date
description: Check-in date for the booking.
tests:
data_tests:
- not_null
- name: checkin_time_utc
@ -95,13 +95,13 @@ models:
- name: checkout_date_utc
data_type: date
description: Check-out date for the booking.
tests:
data_tests:
- not_null
- name: number_of_nights
data_type: integer
description: Number of nights for the reservation.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 1
@ -140,29 +140,29 @@ models:
- name: updated_at_utc
data_type: timestamp without time zone
description: Timestamp of the last update to the record.
tests:
data_tests:
- not_null
- name: updated_date_utc
data_type: date
description: Date of the last update to the record.
tests:
data_tests:
- not_null
- name: cosmos_creation_at_utc
data_type: timestamp without time zone
description: Timestamp when the record was created in Cosmos DB.
tests:
data_tests:
- not_null
- name: cosmos_creation_date_utc
data_type: date
description: Date when the record was created in Cosmos DB.
tests:
data_tests:
- not_null
- name: created_date_utc
data_type: date
description: Date when the record was created.
tests:
data_tests:
- not_null

File diff suppressed because it is too large Load diff

View file

@ -26,18 +26,18 @@ models:
description: A unique ID for the record, derived from concatenating the
currencies, date, source and version. Currency order is relevant
(EURUSD != USDEUR).
tests:
data_tests:
- not_null
- unique
- name: from_currency
data_type: character
description: The source currency, represented as an ISO 4217 code.
tests:
data_tests:
- not_null
- name: to_currency
data_type: character
description: The target currency, represented as an ISO 4217 code.
tests:
data_tests:
- not_null
- name: rate
data_type: numeric
@ -51,13 +51,13 @@ models:
always be one.
The rate can be smaller than one, but can't be negative.
tests:
data_tests:
- not_negative_or_zero
- not_null
- name: rate_date_utc
data_type: date
description: The date in which the rate record is relevant.
tests:
data_tests:
- not_null
- name: source
data_type: text
@ -72,7 +72,7 @@ models:
in nature) or `guess` (the rate sits in the past and is a guess in
nature). Note that one currency pair can have multiple rate versions
on the same date.
tests:
data_tests:
- accepted_values:
values:
- guess
@ -85,7 +85,7 @@ models:
For external sources, this will be the point in time when the
information was obtained from them. For stuff we make up here in the
DWH, this will be the point in time when we made the assumption.
tests:
data_tests:
- not_null
- name: int_simple_exchange_rates
description: >-
@ -96,7 +96,7 @@ models:
The time granularity is daily. Each record holds a currency pair for a
specific day. You will only find one conversion rate per currency pair and
date.
tests:
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- from_currency
@ -106,22 +106,22 @@ models:
- name: from_currency
data_type: character
description: The source currency, represented as an ISO 4217 code.
tests:
data_tests:
- not_null
- name: to_currency
data_type: character
description: The source currency, represented as an ISO 4217 code.
tests:
data_tests:
- not_null
- name: rate
data_type: numeric
description: The target currency, represented as an ISO 4217 code.
tests:
data_tests:
- not_null
- name: rate_date_utc
data_type: date
description: The date in which the rate record is relevant.
tests:
data_tests:
- not_null
- name: updated_at_utc
data_type: timestamp with time zone
@ -129,7 +129,7 @@ models:
For external sources, this will be the point in time when the
information was obtained from them. For stuff we make up here in the
DWH, this will be the point in time when we made the assumption.
tests:
data_tests:
- not_null
- name: int_mtd_vs_previous_year_metrics
@ -145,7 +145,7 @@ models:
date and it computes the relative increment by using the macro:
- calculate_safe_relative_increment
tests:
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
@ -156,13 +156,13 @@ models:
- name: date
data_type: date
description: The date for the month-to-date metrics.
tests:
data_tests:
- not_null
- name: dimension
data_type: string
description: The dimension or granularity of the metrics.
tests:
data_tests:
- accepted_values:
values:
- global
@ -172,7 +172,7 @@ models:
- name: dimension_value
data_type: string
description: The value or segment available for the selected dimension.
tests:
data_tests:
- not_null
- name: int_mtd_aggregated_metrics
@ -183,7 +183,7 @@ models:
a set of metric, value, previous_year_value and relative_increment at a given date. It uses Jinja
code to avoid code replication.
tests:
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
@ -195,31 +195,31 @@ models:
- name: year
data_type: int
description: year number of the given date.
tests:
data_tests:
- not_null
- name: month
data_type: int
description: month number of the given date.
tests:
data_tests:
- not_null
- name: day
data_type: int
description: day monthly number of the given date.
tests:
data_tests:
- not_null
- name: is_end_of_month
data_type: boolean
description: True if it's end of month.
tests:
data_tests:
- not_null
- name: is_end_of_month_or_yesterday
data_type: boolean
description: True if it's end of month or yesterday.
tests:
data_tests:
- not_null
- name: is_current_month
@ -227,27 +227,27 @@ models:
description: |
checks if the date is within the current executed month,
1 for yes, 0 for no.
tests:
data_tests:
- not_null
- name: first_day_month
data_type: date
description: |
first day of the month corresponding to the date field.
tests:
data_tests:
- not_null
- name: date
data_type: date
description: |
main date for the computation, that is used for filters.
tests:
data_tests:
- not_null
- name: dimension
data_type: string
description: The dimension or granularity of the metrics.
tests:
data_tests:
- accepted_values:
values:
- global
@ -257,7 +257,7 @@ models:
- name: dimension_value
data_type: string
description: The value or segment available for the selected dimension.
tests:
data_tests:
- not_null
- name: previous_year_date
@ -270,7 +270,7 @@ models:
- name: metric
data_type: text
description: name of the business metric.
tests:
data_tests:
- not_null
- name: order_by
@ -282,7 +282,7 @@ models:
- name: number_format
data_type: text
description: allows for grouping and formatting for displaying purposes.
tests:
data_tests:
- accepted_values:
values:
[
@ -333,7 +333,7 @@ models:
enforces that a booking/guest journey/listing/etc has a host with a deal assigned, which is
not necessarily the case.
tests:
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
@ -343,27 +343,27 @@ models:
- name: date
data_type: date
description: The last day of the month or yesterday for historic metrics.
tests:
data_tests:
- not_null
- name: id_deal
data_type: character varying
description: Id of the deal associated to the host.
tests:
data_tests:
- not_null
- name: main_deal_name
data_type: string
description: |
Main name for this ID deal.
tests:
data_tests:
- not_null
- name: has_active_pms
data_type: boolean
description: |
Does the deal have an active associated PMS.
tests:
data_tests:
- not_null
- name: active_pms_list
@ -415,7 +415,7 @@ models:
Lastly, this model provides informative date fields, deal attributes, absolute
metric values and MoM & YoY relative incrementals to enrich reporting.
tests:
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
@ -428,7 +428,7 @@ models:
Date corresponding to the last day of the month. Given month
metrics are inclusive to this date. Together with id_deal, it
acts as the primary key of this model.
tests:
data_tests:
- not_null
- name: id_deal
@ -436,21 +436,21 @@ models:
description: |
Unique identifier of a Deal. Together with date, it acts as
the primary key of this model.
tests:
data_tests:
- not_null
- name: main_deal_name
data_type: string
description: |
Main name for a Deal, representing the client.
tests:
data_tests:
- not_null
- name: has_active_pms
data_type: boolean
description: |
Does the deal have an active associated PMS.
tests:
data_tests:
- not_null
- name: active_pms_list
@ -499,7 +499,7 @@ models:
Informative field. It indicates the first day of the
month corresponding to date.
If date = 2024-09-30, this field will be 2024-09-01.
tests:
data_tests:
- not_null
- name: previous_1_month_first_day_month
@ -569,7 +569,7 @@ models:
for a specific deal. This value corresponds to
the given month. This value can be negative,
but not null.
tests:
data_tests:
- not_null
- name: previous_1_month_revenue_in_gbp
@ -620,7 +620,7 @@ models:
the previous month.
It can be null if any revenue used in the computation
is null or it's negative.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
strictly: false
@ -634,7 +634,7 @@ models:
It can be null if any revenue used in the computation
is null or it's negative.
This field is used for the growth score computation.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
strictly: false
@ -647,7 +647,7 @@ models:
months ago.
It can be null if any revenue used in the computation
is null or it's negative.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
strictly: false
@ -661,7 +661,7 @@ models:
It can be null if any revenue used in the computation
is null or it's negative.
This field is used for the growth score computation.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
strictly: false
@ -672,7 +672,7 @@ models:
Monthly value representing created bookings
for a specific deal. This value corresponds to
the given month. This value cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -686,7 +686,7 @@ models:
the previous month.
This value can be null, thus indicating that no
history is available.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -699,7 +699,7 @@ models:
monthly amount generated 12 months ago.
This value can be null, thus indicating that no
history is available.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -713,7 +713,7 @@ models:
It can be null if the bookings created in the
previous month are null.
This field is used for the growth score computation.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
strictly: false
@ -727,7 +727,7 @@ models:
It can be null if the bookings created 12 months
ago are null.
This field is used for the growth score computation.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
strictly: false
@ -738,7 +738,7 @@ models:
Monthly value representing the listings booked in month
for a specific deal. This value corresponds to
the given month. This value cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -752,7 +752,7 @@ models:
the previous month.
This value can be null, thus indicating that no
history is available.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -765,7 +765,7 @@ models:
monthly amount generated 12 months ago.
This value can be null, thus indicating that no
history is available.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -779,7 +779,7 @@ models:
It can be null if the listings booked in month in the
previous month are null.
This field is used for the growth score computation.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
strictly: false
@ -793,7 +793,7 @@ models:
It can be null if the listings booked in month of 12
months ago are null.
This field is used for the growth score computation.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
strictly: false
@ -807,7 +807,7 @@ models:
aggregated_revenue_to_first_day_month.
It can be negative if the sum is negative.
It cannot be null.
tests:
data_tests:
- not_null
- name: effective_deal_revenue_12_months_window
@ -821,7 +821,7 @@ models:
thus this value should not be reported.
It is used for the deal contribution share with respect
to the global revenue. It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -838,7 +838,7 @@ models:
thus this value should not be reported.
It is used for the deal contribution share with respect
to the global revenue. It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -850,7 +850,7 @@ models:
Represents the size of the deal in terms of revenue. In
other words, what's the percentage of the global revenue
that can be attributed to this deal. It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -864,7 +864,7 @@ models:
If more than one deal have the same share, the order is
not under control.
It cannot be null.
tests:
data_tests:
- not_null
- name: deal_created_bookings_12_months_window
@ -875,7 +875,7 @@ models:
aggregated_revenue_from_first_day_month to
aggregated_revenue_to_first_day_month.
It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -890,7 +890,7 @@ models:
aggregated_revenue_to_first_day_month.
It is used for the deal contribution share with respect
to the global created bookings. It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -903,7 +903,7 @@ models:
In other words, what's the percentage of the global created
bookings that can be attributed to this deal.
It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -917,7 +917,7 @@ models:
If more than one deal have the same share, the order is
not under control.
It cannot be null.
tests:
data_tests:
- not_null
- name: deal_avg_listings_booked_in_month_12_months_window
@ -928,7 +928,7 @@ models:
aggregated_revenue_from_first_day_month to
aggregated_revenue_to_first_day_month.
It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -944,7 +944,7 @@ models:
It is used for the deal contribution share with respect
to the global average listings booked in month.
It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -958,7 +958,7 @@ models:
In other words, what's the percentage of the global average listings
booked in month that can be attributed to this deal.
It cannot be null.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -972,7 +972,7 @@ models:
If more than one deal have the same share, the order is
not under control.
It cannot be null.
tests:
data_tests:
- not_null
- name: avg_mom_growth_score
@ -983,7 +983,7 @@ models:
MoM shifted by one month of revenue.
It indicates the tendency of growth of the deal without
taking into account its revenue size. It cannot be null.
tests:
data_tests:
- not_null
- name: avg_yoy_growth_score
@ -994,7 +994,7 @@ models:
YoY shifted by one month of revenue.
It indicates the tendency of growth of the deal without
taking into account its revenue size. It cannot be null.
tests:
data_tests:
- not_null
- name: avg_growth_score
@ -1005,7 +1005,7 @@ models:
YoY and MoM shifted by one month of revenue.
It indicates the tendency of growth of the deal without
taking into account its revenue size. It cannot be null.
tests:
data_tests:
- not_null
- name: weighted_avg_growth_score
@ -1017,7 +1017,7 @@ models:
It's the main indicator towards measuring both growth
(if positive) or decay (if negative) while weighting
the financial impact this deal tendency can have.
tests:
data_tests:
- not_null
- name: categorisation_weighted_avg_growth_score
@ -1028,7 +1028,7 @@ models:
losers, flat, winners and top winners.
Currently the categorisation is based on the score itself
rather than selecting a top up/down.
tests:
data_tests:
- not_null
- accepted_values:
values:
@ -1058,7 +1058,7 @@ models:
The average approach "boosts" the contribution of those accounts
that have been active for less than 12 months.
tests:
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
@ -1071,7 +1071,7 @@ models:
Date corresponding to the last day of the month.
Metrics are inclusive to this date. Together with id_deal, it
acts as the primary key of this model.
tests:
data_tests:
- not_null
- name: id_deal
@ -1079,7 +1079,7 @@ models:
description: |
Unique identifier of a Deal. Together with date, it acts as
the primary key of this model.
tests:
data_tests:
- not_null
- name: deal_lifecycle_state
@ -1096,7 +1096,7 @@ models:
a given deal. In essence it states the amount of
months a given deal has been active before a the month
given by date, capped at 12 months.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 12
@ -1117,7 +1117,7 @@ models:
vs. the global amount, on the preceding 12 months
with respect to date. It uses the average approach.
It can be negative.
tests:
data_tests:
- not_null
- name: created_bookings_12m_average_contribution
@ -1126,7 +1126,7 @@ models:
Share of the deal contribution on created bookings
vs. the global amount, on the preceding 12 months
with respect to date. It uses the average approach.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -1139,7 +1139,7 @@ models:
Share of the deal contribution on listings booked in month
vs. the global amount, on the preceding 12 months
with respect to date. It uses the average approach.
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -1172,7 +1172,7 @@ models:
to the global amount. This means that, for instance, if we have 10% of churn
in a month, it can be divided by 9% USA and 1% GBR since 9%+1% = 10%.
tests:
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
@ -1183,13 +1183,13 @@ models:
- name: date
data_type: date
description: The date for the month-to-date metrics.
tests:
data_tests:
- not_null
- name: dimension
data_type: string
description: The dimension or granularity of the metrics.
tests:
data_tests:
- accepted_values:
values:
- global
@ -1199,7 +1199,7 @@ models:
- name: dimension_value
data_type: string
description: The value or segment available for the selected dimension.
tests:
data_tests:
- not_null
- name: total_revenue_churn_average_contribution
@ -1228,7 +1228,7 @@ models:
- name: id_verification
data_type: text
description: "unique Superhog generated id for this verification"
tests:
data_tests:
- unique
- not_null
@ -1241,7 +1241,7 @@ models:
- name: id_user_partner
data_type: text
description: "unique Superhog generated id for partner"
tests:
data_tests:
- not_null
- name: id_accommodation
@ -1251,7 +1251,7 @@ models:
- name: version
data_type: text
description: "value to identify if it is Guesty (V1) or E-deposit (V2)"
tests:
data_tests:
- accepted_values:
values:
- V1
@ -1260,7 +1260,7 @@ models:
- name: verification_source
data_type: text
description: "source of the verification for the booking"
tests:
data_tests:
- accepted_values:
values:
- Guesty
@ -1434,7 +1434,7 @@ models:
additional metrics.
The data is segmented by deal and time window for detailed analysis.
tests:
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
@ -1447,20 +1447,20 @@ models:
description: |
The last day of the month or yesterday for historic metrics.
It's the same date as for KPIs related models.
tests:
data_tests:
- not_null
- name: id_deal
data_type: character varying
description: Id of the deal associated to the host.
tests:
data_tests:
- not_null
- name: time_window
data_type: character varying
description: |
Identifier of the time window used for the aggregation of the metrics.
tests:
data_tests:
- not_null
- accepted_values:
values:
@ -1490,14 +1490,14 @@ models:
data_type: string
description: |
Main name for this ID deal.
tests:
data_tests:
- not_null
- name: has_active_pms
data_type: boolean
description: |
Does the deal have an active associated PMS.
tests:
data_tests:
- not_null
- name: active_pms_list
@ -1548,7 +1548,7 @@ models:
Total amount of bookings created by the deal
in the time window. It can be null if no bookings
were created.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -1559,7 +1559,7 @@ models:
Average amount of listings booked in month by the deal
in the time window. It can be null if no listings
were booked.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -1600,7 +1600,7 @@ models:
Total amount of payments in GBP made by the guest
in the time window. It can be null if no payments
were made by the guest. It can be negative.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -1619,7 +1619,7 @@ models:
Total amount of resolution payments made to the host
in the time window. It can be null if no resolution
payments were made by the host.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -1649,7 +1649,7 @@ models:
- name: id_deal
data_type: character varying
description: "Unique ID for this deal."
tests:
data_tests:
- unique
- not_null
@ -1662,7 +1662,7 @@ models:
description: "Count of distinct names the deal has in Core.
It might be the case that a deal has ony NULL value for a name,
so the count will be 0"
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -1676,7 +1676,7 @@ models:
description: "Count of distinct names the deal has in Hubspot.
It might be the case that a deal has ony NULL value for a name,
so the count will be 0"
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
@ -1690,7 +1690,7 @@ models:
description: "Count of distinct names the deal has in Xero.
It might be the case that a deal has ony NULL value for a name,
so the count will be 0"
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false

View file

@ -15,7 +15,7 @@ models:
- name: id_verification
data_type: text
description: "unique Superhog generated id for this verification"
tests:
data_tests:
- unique
- not_null
@ -28,7 +28,7 @@ models:
- name: id_user_partner
data_type: text
description: "unique Superhog generated id for partner"
tests:
data_tests:
- not_null
- name: id_accommodation
@ -38,7 +38,7 @@ models:
- name: version
data_type: text
description: "value to identify if it is Guesty (V1) or E-deposit (V2)"
tests:
data_tests:
- accepted_values:
values:
- V2
@ -46,7 +46,7 @@ models:
- name: verification_source
data_type: text
description: "source of the verification for the booking"
tests:
data_tests:
- accepted_values:
values:
- Guesty
@ -206,7 +206,7 @@ models:
description: "Unique Superhog generated id for this verification.
Note that there are some users that have a different id in Cosmos.
For those users we created a mapping to relate this ids."
tests:
data_tests:
- unique
- not_null
@ -215,19 +215,19 @@ models:
description: "unique Superhog generated id for a booking.
note that this could be duplicated and both will be charged,
it's up to the user to no generate duplicate verifications"
tests:
data_tests:
- not_null
- name: id_user_partner
data_type: text
description: "unique Superhog generated id for partner"
tests:
data_tests:
- not_null
- name: id_accommodation
data_type: text
description: "unique Superhog generated id for a listing"
tests:
data_tests:
- not_null
- name: listing_town
@ -257,7 +257,7 @@ models:
- name: currency
data_type: text
description: "currency in which the transaction actually happened"
tests:
data_tests:
- not_null
- name: nightly_fee_local
@ -271,7 +271,7 @@ models:
- name: ok_status_fee_in_txn_currency
data_type: numeric
description: "fee charged in used currency for approved or flagged verifications and not cancelled"
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -280,7 +280,7 @@ models:
- name: ok_status_fee_in_gbp
data_type: numeric
description: "fee charged in gbp for approved or flagged verifications and not cancelled"
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -289,7 +289,7 @@ models:
- name: rejected_fee_in_txn_currency
data_type: numeric
description: "fee charged in used currency for rejected verifications"
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -298,7 +298,7 @@ models:
- name: rejected_fee_in_gbp
data_type: numeric
description: "fee charged in gbp for rejected verifications"
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -307,7 +307,7 @@ models:
- name: cancelled_fee_in_txn_currency
data_type: numeric
description: "fee charged in used currency for cancelled verifications"
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -316,7 +316,7 @@ models:
- name: cancelled_fee_in_gbp
data_type: numeric
description: "fee charged in gbp for cancelled verifications"
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
@ -325,7 +325,7 @@ models:
- name: created_date_utc
data_type: date
description: "Date of creation of the verification in the system"
tests:
data_tests:
- not_null
- name: cancelled_date_utc
@ -335,11 +335,11 @@ models:
- name: checkin_date_utc
data_type: date
description: "Date of checkin for the booking"
tests:
data_tests:
- not_null
- name: checkout_date_utc
data_type: date
description: "Date of checkout for the booking"
tests:
data_tests:
- not_null

View file

@ -17,7 +17,7 @@ models:
- name: id_deal
data_type: character varying
description: Unique ID for this deal.
tests:
data_tests:
- unique
- not_null

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@ models:
Records of verification requests from the Screen and Protect API. The
table tracks verification requests, their outcomes, and related metadata
about guests, listings, and partners.
tests:
data_tests:
- at_least_one_null:
columns:
- monthly_volume_discount
@ -15,20 +15,20 @@ models:
- name: id_verification
data_type: text
description: Unique identifier for the verification request.
tests:
data_tests:
- unique
- not_null
- name: id_booking
data_type: text
description: Unique identifier for the booking associated with the verification.
tests:
data_tests:
- not_null
- name: id_user_partner
data_type: text
description: Identifier for the partner user initiating the verification.
tests:
data_tests:
- not_null
- name: id_accommodation
@ -39,7 +39,7 @@ models:
data_type: bigint
description: "Id of the currency, works as a foreign key to the
currency table"
tests:
data_tests:
- not_null
- relationships:
to: ref('stg_core__currency')
@ -49,13 +49,13 @@ models:
data_type: boolean
description: |
Indicates if the booking is protected or not.
tests:
data_tests:
- not_null
- name: protection_type
data_type: text
description: Specific protection type for the request.
tests:
data_tests:
- not_null
- accepted_values:
values:
@ -70,7 +70,7 @@ models:
description: Field used for protection type "STANDALONE PROTECTION" to
indicate the starting level of protection.
In local currency.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100000
@ -81,7 +81,7 @@ models:
description: Field used for protection type "SCREEN & PROTECT",
"BASIC PROTECTION" or "DAMAGE WAIVER" to show the basic amount of protection.
In local currency.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100000
@ -92,7 +92,7 @@ models:
description: Field used for protection type "SCREEN & PROTECT",
or "STANDALONE PROTECTION" to show the basic amount of protection.
In local currency.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 50000000
@ -105,7 +105,7 @@ models:
- name: verification_status
data_type: text
description: Outcome of the verification process.
tests:
data_tests:
- not_null
- accepted_values:
values:
@ -117,7 +117,7 @@ models:
data_type: numeric
description: The percentage or value of the price increase
applied to the user's account.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
@ -126,7 +126,7 @@ models:
data_type: date
description: The date when the price increase becomes effective.
This is the first day of the month.
tests:
data_tests:
- is_first_day_of_month
- name: monthly_volume_discount
@ -134,7 +134,7 @@ models:
description: The discount percentage or value offered based on the
volume of bookings achieved within a month.
No user can have more than one discount per month.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100
@ -144,7 +144,7 @@ models:
data_type: numeric
description: The minimum number of bookings required to qualify for
the monthly volume discount.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: true
@ -153,14 +153,14 @@ models:
data_type: date
description: The date when the monthly volume discount period begins.
This is the first day of the month.
tests:
data_tests:
- is_first_day_of_month
- name: monthly_volume_discount_end_date_utc
data_type: date
description: The date when the monthly volume discount period ends.
This is the last day of the month.
tests:
data_tests:
- is_last_day_of_month
- name: monthly_general_discount
@ -168,7 +168,7 @@ models:
description: The general discount percentage or value applied to all
bookings within the applicable period.
No user can have more than one discount per month.
tests:
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100
@ -178,14 +178,14 @@ models:
data_type: date
description: The date when the general discount period begins.
This is the first day of the month.
tests:
data_tests:
- is_first_day_of_month
- name: monthly_general_discount_end_date_utc
data_type: date
description: The date when the general discount period ends.
This is the last day of the month.
tests:
data_tests:
- is_last_day_of_month
- name: verification_status_reason
@ -203,7 +203,7 @@ models:
- name: watch_list
data_type: text
description: Indicates if the guest was flagged on a watchlist.
tests:
data_tests:
- accepted_values:
values:
- "MATCH"
@ -228,13 +228,13 @@ models:
- name: is_cancelled
data_type: boolean
description: Indicates if the booking was canceled.
tests:
data_tests:
- not_null
- name: cancelled_at_utc
data_type: timestamp without time zone
description: Timestamp when the booking was canceled.
tests:
data_tests:
- not_null:
where: is_cancelled = true
@ -297,44 +297,44 @@ models:
- name: status_updated_at_utc
data_type: timestamp without time zone
description: Timestamp of the last status update for the verification.
tests:
data_tests:
- not_null
- name: status_updated_date_utc
data_type: date
description: Date of the last status update for the verification.
tests:
data_tests:
- not_null
- name: updated_at_utc
data_type: timestamp without time zone
description: Timestamp of the last update to the record.
tests:
data_tests:
- not_null
- name: updated_date_utc
data_type: date
description: Date of the last update to the record.
tests:
data_tests:
- not_null
- name: creation_at_utc
data_type: timestamp without time zone
description: |
Timestamp of when the reservation was created.
tests:
data_tests:
- not_null
- name: creation_date_utc
data_type: date
description: |
Date of when the reservation was created.
tests:
data_tests:
- not_null
- name: cosmos_created_date_utc
data_type: date
description: |
Date of when the verification request was created in Cosmos DB.
tests:
data_tests:
- not_null

View file

@ -4,31 +4,31 @@ models:
- name: int_xero__invoices
columns:
- name: id_invoice
tests:
data_tests:
- not_null
- unique
- name: int_xero__credit_notes
columns:
- name: id_credit_note
tests:
data_tests:
- not_null
- unique
- name: int_xero__invoice_line_items
columns:
- name: id_line_item
tests:
data_tests:
- not_null
- unique
- name: int_xero__credit_note_line_items
columns:
- name: id_line_item
tests:
data_tests:
- not_null
- unique
- name: int_xero__bank_transactions
columns:
- name: id_bank_transaction
tests:
data_tests:
- not_null
- unique
@ -63,7 +63,7 @@ models:
- name: id_line_item
data_type: text
description: ""
tests:
data_tests:
- not_null
- unique
@ -75,7 +75,7 @@ models:
data_type: text
description: |
Indicates whether the record belongs in an invoice or a credit note.
tests:
data_tests:
- not_null
- accepted_values:
values:
@ -137,7 +137,7 @@ models:
- name: document_currency_iso_4217
data_type: character varying
description: ""
tests:
data_tests:
- not_null
- length_between:
min_length: 3
@ -150,7 +150,7 @@ models:
- name: id_document
data_type: character varying
description: ""
tests:
data_tests:
- not_null
- name: reference
@ -172,7 +172,7 @@ models:
- name: document_type
data_type: character varying
description: ""
tests:
data_tests:
- not_null
- accepted_values:
values:
@ -188,14 +188,14 @@ models:
- name: exchange_rate_to_gbp
data_type: numeric
description: ""
tests:
data_tests:
- not_null
- not_negative
- name: document_status
data_type: character varying
description: ""
tests:
data_tests:
- not_null
- accepted_values:
values:
@ -209,7 +209,7 @@ models:
- name: line_amount_tax_inclusiveness
data_type: character varying
description: ""
tests:
data_tests:
- accepted_values:
values:
- Inclusive