Merged PR 1847: Checkin Hero Complentess Patch

There is a bug in the backend that breaks the completeness query for journeys with checkinhero where the user does not purchase the cover.

This PR deploys a temporary patch that fixes it. A hardcode might have to be removed once the engineering team deals with the situation in the backend.
This commit is contained in:
Pablo Martín 2024-05-15 12:26:23 +00:00
commit 58a675c849

View file

@ -62,6 +62,13 @@ with
left join
stg_core__verification_type vt
on vstvt.id_verification_type = vt.id_verification_type
-- This hardcode was implement on 2024-05-15 because there is a gap in
-- the backend. CheckInCover is included as a verification in the
-- verification request, but if the client doesn't purchase it, it
-- never gets marked as complete (id_verification_status = 1).
-- We are ignoring it for now until this bug is fixed. Once the bug
-- is fixed, this need to be removed.
where vt.verification_type not in ('CheckInCover')
),
same_vr_verification_state as (
select vr.id_verification_request, v.verification, v.id_verification_status
@ -87,7 +94,12 @@ with
evt.verification_type,
coalesce(
t1.id_verification_status, t2.id_verification_status
) as global_id_verification_status
) as global_id_verification_status,
case
when coalesce(t1.id_verification_status, t2.id_verification_status) = 1
then 1
else 0
end as verification_is_complete
from expected_verification_types evt
left join
same_vr_verification_state as t1
@ -103,7 +115,7 @@ select
count(1) as expected_verification_count,
sum(global_id_verification_status) as confirmed_verification_count,
coalesce(
count(1) = sum(global_id_verification_status), false
count(1) = sum(verification_is_complete), false
) as is_verification_request_complete
from completeness_summary
group by id_verification_request