commit wip

This commit is contained in:
Joaquin 2025-03-25 12:25:47 +01:00
parent 721f3e4e9e
commit 2c5301c158
4 changed files with 46 additions and 60 deletions

View file

@ -1,3 +1,7 @@
-- Default Protection Plan Id to use when the Id is missing in the source data.
-- This value represents "Basic Screening" protection.
{% set default_id_protection = 1 %}
{{ config(materialized="table") }}
with
stg_core__user_product_bundle as (
@ -18,13 +22,12 @@ select
pb.id_user_product_bundle,
pb.id_user as id_user_host,
pb.id_product_bundle,
ps.id_product_service as id_product,
'SERVICE' as product_type,
ps.id_product_service as id_service,
'PRODUCT' as service_source,
pb.product_bundle_name,
ps.service_business_type,
ps.is_default_service,
ps.product_service_name as product_name,
ps.product_service_display_name as product_display_name
ps.product_service_display_name as service_name
from stg_core__user_product_bundle pb
inner join int_core__user_host uh on pb.id_user = uh.id_user_host
cross join stg_core__product_service ps
@ -36,15 +39,12 @@ select
pb.id_user_product_bundle,
pb.id_user as id_user_host,
pb.id_product_bundle,
coalesce(pb.id_protection_plan, 1) as id_product,
'PROTECTION' as product_type,
coalesce(pb.id_protection_plan, {{ default_id_protection }}) as id_service,
'PROTECTION' as service_source,
pb.product_bundle_name,
'PROTECTION' as service_business_type,
pp.is_default_service,
coalesce(pp.protection_name, {{ var("default_service") }}) as product_name,
coalesce(
pp.protection_display_name, {{ var("default_service") }}
) as product_display_name
coalesce(pp.protection_display_name, {{ var("default_service") }}) as service_name
from stg_core__user_product_bundle pb
inner join int_core__user_host uh on pb.id_user = uh.id_user_host
left join

View file

@ -3027,8 +3027,8 @@ models:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- id_user_product_bundle
- id_product
- product_type
- id_service
- service_source
columns:
- name: id_user_product_bundle
@ -3051,22 +3051,22 @@ models:
description: |
The identifier of the product bundle. Can be null if it's a custom bundle.
- name: id_product
- name: id_service
data_type: bigint
description: |
The identifier of the product.
The identifier of the service.
data_tests:
- not_null
- name: product_type
- name: service_source
data_type: string
description: |
The type of the product, which can be either "service" or "protection".
The type of the service, which can be either "product" or "protection".
data_tests:
- not_null
- accepted_values:
values:
- "SERVICE"
- "PRODUCT"
- "PROTECTION"
- name: product_bundle_name
@ -3097,17 +3097,10 @@ models:
Flag that determines if the service is a default one (True)
or an upgraded service (False).
- name: product_name
- name: service_name
data_type: string
description: |
The name of the product service or protection.
data_tests:
- not_null
- name: product_display_name
data_type: string
description: |
The display name of the product service or protection.
The display name of the service.
data_tests:
- not_null