Addressed comments

This commit is contained in:
Joaquin 2025-04-03 16:23:58 +02:00
parent 82829db3d2
commit 2637d68398
4 changed files with 94 additions and 0 deletions

View file

@ -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

View file

@ -2667,6 +2667,30 @@ models:
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
description: |

View file

@ -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,

View file

@ -1263,6 +1263,30 @@ models:
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
description: |