diff --git a/models/intermediate/core/int_core__new_dash_user_overview.sql b/models/intermediate/core/int_core__new_dash_user_overview.sql index db4ac3a..135da8d 100644 --- a/models/intermediate/core/int_core__new_dash_user_overview.sql +++ b/models/intermediate/core/int_core__new_dash_user_overview.sql @@ -44,6 +44,27 @@ with atpb_aggregation as ( select upb.id_user_host, + -- To be deleted from here + count( + distinct case + when + atpb.user_product_bundle_name + not in ({{ var("default_service") }}) + then atpb.id_accommodation + else null + end + ) as total_listings_with_product_bundle_with_paid_service, + count( + distinct case + when + atpb.user_product_bundle_name + not in ({{ var("default_service") }}) + and atpb.has_no_end_date = true + then atpb.id_accommodation + else null + end + ) as total_listings_with_active_product_bundle_with_paid_service, + -- To be deleted until here count( distinct case when @@ -118,6 +139,10 @@ with a.total_active_listings, atpb.total_active_listings_with_active_product_bundle, atpb.total_active_listings_with_active_product_bundle_with_paid_service, + -- To be deleted from here + atpb.total_listings_with_product_bundle_with_paid_service, + atpb.total_listings_with_active_product_bundle_with_paid_service, + -- To be deleted until here btpb.total_bookings_with_product_bundle, btpb.total_bookings_with_product_bundle_with_paid_service from upb_aggregation upb @@ -159,6 +184,18 @@ select then 1 else 0 end as has_active_listings_with_active_paid_service_applied, + -- To be deleted from here + total_listings_with_product_bundle_with_paid_service, + total_listings_with_active_product_bundle_with_paid_service, + case + when total_listings_with_product_bundle_with_paid_service > 0 then 1 else 0 + end as has_listings_with_paid_service_applied, + case + when total_listings_with_active_product_bundle_with_paid_service > 0 + then 1 + else 0 + end as has_listings_with_active_paid_service_applied, + -- To be deleted until here total_bookings_with_product_bundle, total_bookings_with_product_bundle_with_paid_service, case diff --git a/models/intermediate/core/schema.yml b/models/intermediate/core/schema.yml index 9965231..5d40b9a 100644 --- a/models/intermediate/core/schema.yml +++ b/models/intermediate/core/schema.yml @@ -2666,6 +2666,30 @@ models: description: | Integer-based flag version of total_active_listings_with_active_product_bundle_with_paid_service. + + # To be deleted from here + - name: total_listings_with_product_bundle_with_paid_service + data_type: integer + description: | + Count of listings that have, or have had, a paid service + product bundle activated. + + - name: total_listings_with_active_product_bundle_with_paid_service + data_type: integer + description: | + Count of listings that currently have an active paid service + product bundle. + + - name: has_listings_with_paid_service_applied + data_type: integer + description: | + Integer-based flag version of total_listings_with_product_bundle_with_paid_service. + + - name: has_listings_with_active_paid_service_applied + data_type: integer + description: | + Integer-based flag version of total_listings_with_active_product_bundle_with_paid_service. + # To be deleted until here - name: total_bookings_with_product_bundle data_type: integer diff --git a/models/reporting/core/core__new_dash_user_overview.sql b/models/reporting/core/core__new_dash_user_overview.sql index bf19fd1..242a782 100644 --- a/models/reporting/core/core__new_dash_user_overview.sql +++ b/models/reporting/core/core__new_dash_user_overview.sql @@ -29,6 +29,15 @@ select as has_active_listings_with_active_product_bundle_applied, has_active_listings_with_active_paid_service_applied as has_active_listings_with_active_paid_service_applied, + -- To be deleted from here + total_listings_with_product_bundle_with_paid_service + as total_listings_with_product_bundle_with_paid_service, + total_listings_with_active_product_bundle_with_paid_service + as total_listings_with_active_product_bundle_with_paid_service, + has_listings_with_paid_service_applied as has_listings_with_paid_service_applied, + has_listings_with_active_paid_service_applied + as has_listings_with_active_paid_service_applied, + -- To be deleted until here total_bookings_with_product_bundle as total_bookings_with_product_bundle, total_bookings_with_product_bundle_with_paid_service as total_bookings_with_product_bundle_with_paid_service, diff --git a/models/reporting/core/schema.yml b/models/reporting/core/schema.yml index 22adf6f..a994603 100644 --- a/models/reporting/core/schema.yml +++ b/models/reporting/core/schema.yml @@ -1262,6 +1262,30 @@ models: description: | Integer-based flag version of total_active_listings_with_active_product_bundle_with_paid_service. + + # To be deleted from here + - name: total_listings_with_product_bundle_with_paid_service + data_type: integer + description: | + Count of listings that have, or have had, a paid service + product bundle activated. + + - name: total_listings_with_active_product_bundle_with_paid_service + data_type: integer + description: | + Count of listings that currently have an active paid service + product bundle. + + - name: has_listings_with_paid_service_applied + data_type: integer + description: | + Integer-based flag version of total_listings_with_product_bundle_with_paid_service. + + - name: has_listings_with_active_paid_service_applied + data_type: integer + description: | + Integer-based flag version of total_listings_with_active_product_bundle_with_paid_service. + # To be deleted until here - name: total_bookings_with_product_bundle data_type: integer