Merged PR 5342: Booking Summary - add months

# Description

Adds the month equivalent for creation, check in and check out dates for Booking Summary, for reporting purposes

# 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.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] 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: #30609
This commit is contained in:
Oriol Roqué Paniagua 2025-05-28 12:37:43 +00:00
parent 420d93d9bf
commit 5ddba42e12
2 changed files with 26 additions and 0 deletions

View file

@ -16,6 +16,9 @@ select
b.booking_created_date_utc as booking_created_date_utc,
b.booking_check_in_date_utc as booking_check_in_date_utc,
b.booking_check_out_date_utc as booking_check_out_date_utc,
date_trunc('month', b.booking_created_date_utc)::date as booking_created_month,
date_trunc('month', b.booking_check_in_date_utc)::date as booking_check_in_month,
date_trunc('month', b.booking_check_out_date_utc)::date as booking_check_out_month,
b.booking_number_of_nights as booking_number_of_nights,
b.host_currency_code as host_currency_code,
b.new_dash_version as new_dash_version,

View file

@ -560,6 +560,29 @@ models:
data_tests:
- not_null
- name: booking_created_month
data_type: date
description: |
First day of the month of when the Booking record was
created in the Backend. Cannot be null.
data_tests:
- not_null
- name: booking_check_in_month
data_type: timestamp
description: |
First day of the month of the Check-in of the Booking.
Cannot be null.
data_tests:
- not_null
- name: booking_check_out_month
data_type: date
description: |
First day of the month of the Check-out of the Booking.
data_tests:
- not_null
- name: booking_number_of_nights
data_type: integer
description: |