Merged PR 2852: Fix: ensure priority selection on user migration

# Description

Fixing logic to ensure priority selection of claims when user satisfies multiple claim conditions.
It adds a new parameter that forcefully prioritises the selection of the date value for a certain claim over the others. If the value is repeated among claims, it will select the earliest date.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] 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.
- [X] 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: #20773
This commit is contained in:
Oriol Roqué Paniagua 2024-09-16 09:34:44 +00:00
parent cf1d6e28cc
commit c1b97e17e6
2 changed files with 28 additions and 5 deletions

View file

@ -18,6 +18,11 @@ Important note: if a user migrates once a phase has started, we
It is likely that User B won't have Bookings from new dash
until it's migrated. So this migration date should be considered
as a hard, lower-limit of dates.
If a user satisfies more than one valid claims, in order to ensure
that the good date is considered we use the claim_enforcement_priority
value to force that a certain claim type will have precedence over
another. The lower the value, the more priority.
*/
{% macro get_new_dash_migration_phases_config() %}
{% set migration_phases = [
@ -25,11 +30,13 @@ Important note: if a user migrates once a phase has started, we
"phase_name": "MVP",
"claim_type": "KYGMVP",
"default_deployment_date": "2024-07-30",
"claim_enforcement_priority": 1,
},
{
"phase_name": "MVP",
"claim_type": "MVPMIGRATEDUSER",
"default_deployment_date": "2024-09-10",
"claim_enforcement_priority": 0,
},
] %}
{{ return(migration_phases) }}