Merged PR 4271: Adapts test account logic + New Dash exclusion

# Description

Changes:
* Adapts the consideration for a test account in unified_user. Now, if a user domain is superhog.com, truvi.com or guardhog.com these accounts will also be considered as test accounts.
* Excludes test accounts for New Dash reporting in the 3 source models.

KPIs exclusions will be done in a separated PR.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [ ] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [X] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #27319
This commit is contained in:
Oriol Roqué Paniagua 2025-02-05 09:51:30 +00:00
parent f76e49a75c
commit 233d2f7590
4 changed files with 18 additions and 3 deletions

View file

@ -58,7 +58,10 @@ from stg_core__booking_view_to_service bvts
inner join stg_core__booking_view bv on bvts.id_booking_view = bv.id_booking_view
left join stg_core__booking b on bv.id_booking = b.id_booking
left join stg_core__booking_state bs on b.id_booking_state = bs.id_booking_state
left join int_core__user_host uh on b.id_user_host = uh.id_user_host
left join
int_core__user_host uh
on b.id_user_host = uh.id_user_host
and uh.is_test_account = false
left join
stg_core__booking_to_product_bundle btpb
on b.id_booking = btpb.id_booking

View file

@ -109,7 +109,10 @@ with
left join accommodation_aggregation a on upb.id_user_host = a.id_user_host
left join atpb_aggregation atpb on upb.id_user_host = atpb.id_user_host
left join btpb_aggregation btpb on upb.id_user_host = btpb.id_user_host
left join int_core__user_host uh on upb.id_user_host = uh.id_user_host
left join
int_core__user_host uh
on upb.id_user_host = uh.id_user_host
and uh.is_test_account = false
)
select
id_user_host,

View file

@ -50,7 +50,15 @@ select
su.platform_comms_recipient,
su.id_user_verification_status,
case
when act.account_type_name in {{ test_account_type_name }} then true else false
when act.account_type_name in {{ test_account_type_name }}
then true
when u.email like '%@guardhog.com'
then true
when u.email like '%@superhog.com'
then true
when u.email like '%@truvi.com'
then true
else false
end as is_test_account
from stg_core__user as u
inner join stg_core__superhog_user as su on u.id_user = su.id_superhoguser

View file

@ -53,4 +53,5 @@ inner join
on upb.id_user = uh.id_user_host
and uh.is_user_in_new_dash = true
and uh.is_missing_id_deal = false
and uh.is_test_account = false
left join stg_core__protection_plan pp on upb.id_protection_plan = pp.id_protection_plan