data-dwh-dbt-project/models/intermediate/core
Oriol Roqué Paniagua 1781031c9d Merged PR 2195: Computes GJ with Payment and GJ Payment Rate metrics
Adds the following metrics:
- Guest Journey with Payment
- Guest Journey Payment Rate

by both visions (global and by deal id)

**Important**: it does not expose these metrics to the dashboard, this will be done after we have feedback from Ben R. on the paid GJ without GJ completeness. Missing steps to make them appear is to adapt `int_core__mtd_aggregated_metrics` and `int_core__monthly_aggregated_metrics_history_by_deal` and the respective reporting counterparts.

It adapts:
- `int_core__mtd_guest_journey_metrics`
- `int_core__monthly_guest_journey_history_by_deal`

the approaches are similar in the sense that we join with `int_core__verification_payments` and filter by a PAID status, that has been defined in the `dbt_project.yml` in a similar manner as we did with cancelled bookings. It can happen that the same verification request has multiple payments (see screenshot), which in this case we keep the first date in which the paid payment happens. The volume is quite low anyway.

![image.png](https://guardhog.visualstudio.com/4148d95f-4b6d-4205-bcff-e9c8e0d2ca65/_apis/git/repositories/54ac356f-aad7-46d2-b62c-e8c5b3bb8ebf/pullRequests/2195/attachments/image.png)
code for the screenshot:

```
with pre as (
select
	id_verification_request,
	count(distinct icvp.id_payment) as total_paid_payments
from intermediate.int_core__verification_payments icvp
where icvp.payment_status = 'Paid'
group by 1
)
select
	case when total_paid_payments > 2 then 'more than 2'
	when total_paid_payments = 2 then '2'
	when total_paid_payments = 1 then '1'
	end as payment_volume_category,
	count(1) as vr_volume
from pre
group by 1
order by 2 desc
```

I also added a missing reference in `schema.yaml` int about `int_core__mtd_guest_journey_metrics`

Related work items: #18105
2024-07-04 09:54:41 +00:00
..
int_core__accommodation.sql Merged PR 2125: Fixing accommodation host 2024-06-26 14:47:15 +00:00
int_core__booking_charge_events.sql Merged PR 2029: Guest Journey - start date based on used link 2024-06-13 14:53:58 +00:00
int_core__bookings.sql a few quick and dirty improvements 2024-05-10 00:31:27 +02:00
int_core__check_in_cover_prices.sql propagating renames 2024-05-08 12:03:44 +02:00
int_core__check_in_cover_users.sql Added id_deal to both intermediate and report model 2024-07-01 10:48:00 +02:00
int_core__country.sql Merged PR 2077: Adding Country to intermediate 2024-06-19 15:34:15 +00:00
int_core__deal_id_master_list.sql docs and moving stuff 2024-04-08 09:44:32 +02:00
int_core__duplicate_bookings.sql a few quick and dirty improvements 2024-05-10 00:31:27 +02:00
int_core__monthly_accommodation_history_by_deal.sql Merged PR 2172: Adding accommodation metrics by deal id 2024-07-02 09:32:52 +00:00
int_core__monthly_aggregated_metrics_history_by_deal.sql Merged PR 2179: Computes aggregated metrics by deal id and exposes it to reporting 2024-07-03 07:06:34 +00:00
int_core__monthly_booking_history_by_deal.sql Merged PR 2164: Adding booking metrics by deal id for business kpis 2024-07-01 16:00:14 +00:00
int_core__monthly_guest_journey_history_by_deal.sql Merged PR 2195: Computes GJ with Payment and GJ Payment Rate metrics 2024-07-04 09:54:41 +00:00
int_core__mtd_accommodation_lifecycle.sql Merged PR 2125: Fixing accommodation host 2024-06-26 14:47:15 +00:00
int_core__mtd_accommodation_metrics.sql Merged PR 2107: Adds host lifecycle metrics into biz kpis 2024-06-25 12:20:59 +00:00
int_core__mtd_aggregated_metrics.sql Merged PR 2107: Adds host lifecycle metrics into biz kpis 2024-06-25 12:20:59 +00:00
int_core__mtd_booking_metrics.sql Merged PR 2164: Adding booking metrics by deal id for business kpis 2024-07-01 16:00:14 +00:00
int_core__mtd_deal_lifecycle.sql Merged PR 2107: Adds host lifecycle metrics into biz kpis 2024-06-25 12:20:59 +00:00
int_core__mtd_deal_metrics.sql Merged PR 2107: Adds host lifecycle metrics into biz kpis 2024-06-25 12:20:59 +00:00
int_core__mtd_guest_journey_metrics.sql Merged PR 2195: Computes GJ with Payment and GJ Payment Rate metrics 2024-07-04 09:54:41 +00:00
int_core__price_plans.sql docs and moving stuff 2024-04-08 09:44:32 +02:00
int_core__unified_user.sql add phone number 2024-06-10 16:14:07 +02:00
int_core__unique_accommodation_to_user.sql Merged PR 2125: Fixing accommodation host 2024-06-26 14:47:15 +00:00
int_core__verification_payments.sql remove old table from cte 2024-06-18 11:31:59 +02:00
int_core__verification_request_completed_date.sql Merged PR 2028: guest journey estimated completed date 2024-06-13 13:30:22 +00:00
int_core__verification_request_completeness.sql Merged PR 2020: Verification request completeness for intermediate steps + schema documentation 2024-06-13 08:14:11 +00:00
int_core__verification_requests.sql Merged PR 2029: Guest Journey - start date based on used link 2024-06-13 14:53:58 +00:00
int_core__vr_check_in_cover.sql Merged PR 2029: Guest Journey - start date based on used link 2024-06-13 14:53:58 +00:00
schema.yaml Merged PR 2195: Computes GJ with Payment and GJ Payment Rate metrics 2024-07-04 09:54:41 +00:00