data-dwh-dbt-project/models/staging
Oriol Roqué Paniagua 0021827368 Merged PR 5429: Rework Booking Source in int_core__bookings
# Description

This PR creates a proper Booking Source in `int_core__bookings` table. This mostly refers to ensure that whenever we do data requests tickets on this regards we have a proper logic in place (as last time we had issues because of this). Logic follows Gus recommendation on applying:

```
case
  when upper(coalesce(bsrc.booking_source, 'UNKNOWN')) = 'UNKNOWN'
  then b.raw_booking_source
  else bsrc.booking_source
end
```

where b. is Booking table and bsrc. is Booking Source table.

Things to note:
* A new `stg_core__booking_source` table is created, full-refreshed from the backend (less than 10 records)
* I added a unique test for `stg_core__booking` that was not in there. I don't document the rest of the model though.
* I remove the previous `id_booking_source` as it wasn't used and the logic in place should be far more accurate.
* I do NOT remove the existing `verification_request_booking_source`. I don't remember what's this but I see this is in use specially on Guest Insights (CSAT) and the legacy Truvi reporting (Bookings, PMS, etc.). Not the scope of this ticket to change it.
* I don't do further propagation, but potentially, this could be extended to New Dash Booking Summary as this source is being shown in the dashboard itself.

# 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: #30415
2025-06-10 14:38:35 +00:00
..
athena Update athena models to remove id_accommodation 2025-02-24 15:21:44 +01:00
check_in_hero change "tests:" to "data_tests:" 2025-01-13 16:00:35 +01:00
core Merged PR 5429: Rework Booking Source in int_core__bookings 2025-06-10 14:38:35 +00:00
edeposit change "tests:" to "data_tests:" 2025-01-13 16:00:35 +01:00
hubspot Merged PR 5246: Ordered services in HS and added new boolean 2025-05-19 08:40:14 +00:00
resolutions Calculator changes 2025-02-28 12:19:24 +01:00
screen_and_protect change "tests:" to "data_tests:" 2025-01-13 16:00:35 +01:00
screening change "tests:" to "data_tests:" 2025-01-13 16:00:35 +01:00
stripe change "tests:" to "data_tests:" 2025-01-13 16:00:35 +01:00
xedotcom change "tests:" to "data_tests:" 2025-01-13 16:00:35 +01:00
xero change "tests:" to "data_tests:" 2025-01-13 16:00:35 +01:00