data-dwh-dbt-project/models
Oriol Roqué Paniagua 059c92b345 Merged PR 3638: Propagates billing info to booking service detail and booking summary
# Description

Changes:
* Handles conversion to GBP directly in the models `int_core__product_service_billing_item` and `int_core__protection_plan_billing_item` .
* Adds the newly created field of `is_missing_id_deal` in `int_core__booking_to_service`, to avoid manually computing downstream.
* Computes total price per service in `int_core__booking_service_detail`. Since, technically, the same service can have different billing lines, I also retrieve some min/max charge dates and some booleans to help the identification.
* Computes total price per booking in `int_core__booking_summary`. Since, technically, the same booking can have different services charged in different moments in time, I also retrieve some min/max charge dates. I also computed a very necessary `is_booking_charged` to understand if we're making money or not out of it.

This PR should provide the necessary fields to start computing Revenue for New Dash.
HOWEVER:
1) I still need to handle Guest Payments computation for Waiver/Deposit services. I'll do it in a separated PR.
2) while doing this exercise I noticed that the current data is not good / consistent with what I was expecting in terms of New Pricing documentation. I will check with Dash Squad so it's correctly filled, before reporting fake numbers...

# 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: #20809
2024-11-22 13:50:30 +00:00
..
intermediate Merged PR 3638: Propagates billing info to booking service detail and booking summary 2024-11-22 13:50:30 +00:00
reporting Merged PR 3625: Excludes new dash users without id deal 2024-11-21 16:30:47 +00:00
staging Merged PR 3632: Brings Billing tables into Staging 2024-11-22 08:34:58 +00:00
doc_blocks.md improve stg_stripe__charges 2024-02-23 16:45:19 +01:00