diff --git a/models/reporting/general/schema.yml b/models/reporting/general/schema.yml index 0b9eb65..1f88eba 100644 --- a/models/reporting/general/schema.yml +++ b/models/reporting/general/schema.yml @@ -2388,3 +2388,129 @@ models: during onboarding. data_tests: - not_null + + - name: stay_disrupt_conversion_funnel + description: | + This model tracks the conversion funnel of the Stay Disrupt product. + Data is aggregated in a monthly basis, up to yesterday. + There's 2 funnels tracked: + - At Account level + - At Guest Journey level + + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - month_start_date + - guest_product_name + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - month_start_date + - guest_product_latest_display_name + columns: + - name: month_start_date + data_type: date + description: | + Start date of the month for which the funnel is computed. + Corresponds to the first day of the month. + data_tests: + - not_null + + - name: guest_product_name + data_type: string + description: | + Internal name of the guest product, ex: STAYDISRUPT. Use this for filtering. + It cannot be null. + data_tests: + - not_null + + - name: guest_product_latest_display_name + data_type: string + description: | + Latest display name of the guest product. This is the name that + should be used for display purposes, ex: Confident Stay. + data_tests: + - not_null + + - name: count_active_accounts + data_type: integer + description: | + Count of accounts that have been active in the month. It doesn't + necessarily mean that these offer the guest product. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: true + + - name: count_active_accounts_with_guest_product_offered + data_type: integer + description: | + Count of accounts that have been active in the month and that offered + the guest product via Guest Journey that month. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: count_active_accounts + strictly: false + + - name: count_active_accounts_with_guest_product_payments + data_type: integer + description: | + Count of accounts that have been active in the month and that had at + least one payment for the guest product via Guest Journey that month. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: count_active_accounts + strictly: false + + - name: count_guest_journeys_started + data_type: integer + description: | + Count of Guest Journeys that have been started in the month. + It cannot be null. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: count_guest_journeys_started_with_guest_product_offered + data_type: integer + description: | + Count of Guest Journeys that have been started in the month and that + offered the guest product via Guest Journey that month. + It cannot be null. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: count_guest_journeys_started + strictly: false + + - name: count_guest_product_payments + data_type: integer + description: | + Count of Guest Journeys that have been started in the month and that + had at least one payment for the guest product via Guest Journey that month. + It cannot be null. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: count_guest_journeys_started + strictly: false + + - name: sum_amount_paid_without_taxes_in_gbp + data_type: decimal + description: | + Sum of the amount paid for the guest product via Guest Journey in GBP, + without taxes. + It cannot be null. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false diff --git a/models/reporting/general/stay_disrupt_conversion_funnel.sql b/models/reporting/general/stay_disrupt_conversion_funnel.sql new file mode 100644 index 0000000..216a4b2 --- /dev/null +++ b/models/reporting/general/stay_disrupt_conversion_funnel.sql @@ -0,0 +1,16 @@ +with + int_stay_disrupt_conversion_funnel as ( + select * from {{ ref("int_stay_disrupt_conversion_funnel") }} + ) +select + month_start_date, + guest_product_name, + guest_product_latest_display_name, + count_active_accounts, + count_active_accounts_with_guest_product_offered, + count_active_accounts_with_guest_product_payments, + count_guest_journeys_started, + count_guest_journeys_started_with_guest_product_offered, + count_guest_product_payments, + sum_amount_paid_without_taxes_in_gbp +from int_stay_disrupt_conversion_funnel