From ce4e81749bd841ba7ec73283e7fb25b5b08460c3 Mon Sep 17 00:00:00 2001 From: Joaquin Date: Tue, 8 Apr 2025 12:09:08 +0200 Subject: [PATCH] upgraded screening --- .../core/int_core__booking_summary.sql | 15 +++++++++++++++ models/intermediate/core/schema.yml | 6 ++++++ .../general/new_dash_booking_summary.sql | 2 ++ models/reporting/general/schema.yml | 6 ++++++ 4 files changed, 29 insertions(+) diff --git a/models/intermediate/core/int_core__booking_summary.sql b/models/intermediate/core/int_core__booking_summary.sql index 2aa1dc3..6b2c8db 100644 --- a/models/intermediate/core/int_core__booking_summary.sql +++ b/models/intermediate/core/int_core__booking_summary.sql @@ -109,6 +109,21 @@ select then true else false end as has_screening_service_business_type, + case + when + sum( + case + when + bsd.service_business_type = 'SCREENING' + and bsd.service_name <> {{ var("default_service") }} + then 1 + else 0 + end + ) + > 0 + then true + else false + end as has_upgraded_screening_service_business_type, case when sum( diff --git a/models/intermediate/core/schema.yml b/models/intermediate/core/schema.yml index 5d40b9a..a4e7165 100644 --- a/models/intermediate/core/schema.yml +++ b/models/intermediate/core/schema.yml @@ -4398,6 +4398,12 @@ models: Flag to identify if the booking contains any Screening service or not. + - name: has_upgraded_screening_service_business_type + data_type: boolean + description: | + Flag to identify if the booking contains any Screening services + different from Basic Screening. + - name: has_deposit_management_service_business_type data_type: boolean description: | diff --git a/models/reporting/general/new_dash_booking_summary.sql b/models/reporting/general/new_dash_booking_summary.sql index 04e7b13..4f6683a 100644 --- a/models/reporting/general/new_dash_booking_summary.sql +++ b/models/reporting/general/new_dash_booking_summary.sql @@ -29,6 +29,8 @@ select b.is_booking_cancelled as is_booking_cancelled, b.has_upgraded_services as has_upgraded_services, b.has_screening_service_business_type as has_screening_service_business_type, + b.has_upgraded_screening_service_business_type + as has_upgraded_screening_service_business_type, b.has_deposit_management_service_business_type as has_deposit_management_service_business_type, b.has_protection_service_business_type as has_protection_service_business_type diff --git a/models/reporting/general/schema.yml b/models/reporting/general/schema.yml index 2057293..8c5edb7 100644 --- a/models/reporting/general/schema.yml +++ b/models/reporting/general/schema.yml @@ -1464,6 +1464,12 @@ models: Flag to identify if the booking contains any Screening service or not. + - name: has_upgraded_screening_service_business_type + data_type: boolean + description: | + Flag to identify if the booking contains any Screening services + different from Basic Screening. + - name: has_deposit_management_service_business_type data_type: boolean description: |