sh-notion/notion_data_team_no_files/Data quality assessment Guest Journeys with Paymen 5a34141e4f2f4267a9ce290101179610.md
Pablo Martin a256b48b01 pages
2025-07-11 16:15:17 +02:00

1.8 KiB
Raw Blame History

Data quality assessment: Guest Journeys with Payments but that are not completed (or not even started)

This is a brief explanation of some edge cases that could incur into data quality problems - or potentially, be linked to a bug.

Problem

During the initiative of creating business KPIs, we are in need of computing a rate between Guest Journeys with Payment and Guest Journeys Completed. The assumption we had was that these were sequential steps in the guest journey, namely:

  1. Guest Journey gets created
  2. Guest Journey starts
  3. Guest Journey is completed
  4. Guest Journey has payment

We know its possible some guests do not start the guest journey, or start it but not complete it; but our assumption is that in these cases, these guests should not be able to complete following steps.

What we observe is that we can have guests journeys with a payment but that:

  1. have not been completed

  2. have not been even started

Initially this was spotted into the DWH logic. However, we have the same problem on the source by executing the function GetVerificationProgress()

Backend Snippet

For further investigation on backend side

SELECT
	vr.Id,
	b.BookingId,
	p.PaymentId,
	ps.Name,
	dbo.GetVerificationProgress(
	b.BookingId,
	vr.VerificationSetId
) as VrProgress
FROM
	dbo.VerificationToPayment vtp
LEFT JOIN dbo.Verification v
	ON
	v.Id = vtp.VerificationId
LEFT JOIN dbo.VerificationRequest vr
	ON
	v.VerificationRequestId = vr.Id
LEFT JOIN dbo.Payment p
	ON
	vtp.PaymentId = p.PaymentId
LEFT JOIN dbo.PaymentStatus ps
	ON
	p.PaymentStatusId = ps.Id
LEFT JOIN dbo.Booking b
	ON
	b.VerificationRequestId = vr.Id
WHERE dbo.GetVerificationProgress(
	b.BookingId,
	vr.VerificationSetId
) != 'Complete' AND ps.Name = 'Paid'

Untitled