Adding int_core__accommodation
Includes both:
- Main information of the accommodation, mostly coming from stg_core__accommodation and int_core__country.
- Listing lifecycle computation, based on the created bookings from stg_core__bookings. It's just the current state, no history.
Some considerations:
- I opted to use stg_core__bookings and not int_core__bookings. Main reason is in case at some point we want to add listing-based information to the booking table, it would avoid cyclic references.
- I opted to keep all the logic of 1) accommodation info and 2) lifecycle in the same model. This could be easily split into: lifecycle first that reads uniquely from staging and then the int_core__accommodation that could read from the staging version to retrieve accommodation attributes + the lifecycle one. Up to you
I'd suggest to review first the documentation in schema since it explains the logic applied.
Notion page linked to this task: https://www.notion.so/knowyourguest-superhog/Listing-lifecycle-4dc0311b21ca44f8859969e419872ebd
Related work items: #17312
Adding Country to intermediate, both model + documentation.
At this stage, the model is set as a view but we can discuss what is the best approach
Related work items: #17312
Adding cancelled bookings metric based on the feedback of the tech team. Mainly, the date of a cancelled booking can be considered as the `updated_date_utc` for those bookings with status cancelled, as it's a terminal state and no additional steps should follow.
I also took the opportunity to update:
- The order on the `int_core__mtd_aggregated_metrics`, so it matches the one in the Notion page for the 1st batch, freeing already the space for the order_by numbers for missing metrics
- Make acronyms of alias in the `main_kpi` subquery in `int_core__mtd_booking_metrics` slightly more clear
- Remove empty line at the end of the file in `int_core__mtd_booking_metrics`
Keep in mind that the cancelled bookings metric will be directly available in the dashboard once this PR is approved and DWH re-runs.
Related work items: #17310
The CTEs that project currency rates backwards have a few mistakes that introduce additional dates in the period where we do have actual, factual rates. This PR fixes the errors that cause this.
Added verification estimated started at/date utc.
Ensured continuity for existing reports
I also noticed I missed one propagation of the end date, it's fixed here.
Note: changed the naming from 'start' to 'started' since we already had 'completed' and 'used_link'
Related work items: #17268
This PR includes the logic to handle the completed date of guest journey
Check the schema file to understand the logic implemented. It's an estimation, and in some cases, weird stuff happens on end dates before link usage dates, which effectively breaks the computation. I added a boolean for this
Related work items: #17268
This PR aims to provide a first draft for business KPIs, at this stage **quite minimal**.
It mostly contains a MTD and Monthly display approach. No dimensions are created.
The models created are:
- **int_dates_mtd**: mainly it reads from int_dates to retrieve those days needed for a MTD/monthly display
- **int_core__mtd_booking_metrics**: it contains the booking metrics, ending in a format of date|value|value last year|increment
--> here we could add, in the future, additional metrics from other sources (ex: guest journey, etc)
- **int_core__mtd_aggregated_metrics**: it transforms the data coming from the different mtd intermediate sources to be easily displayed in the dashboard. This is a good candidate for macros :)
- **core__mtd_aggregated_metrics**: copy-paste of the its int_core version, including a bit of model documentation
The dashboard is functional but in another PR. I can show you how it looks like at the moment you are going to check the PR
Related work items: #17214
- Ingest the currency table from the backend into DWH.
- Add the newly created `AccountCurrencyId` into the `User` table.
- Push the data to the intermediate user model while replacing the internal superhog currency ID by the ISO4217 code so it's easily joinable with other stuff.
Now, every money amount related to some user in the SQL server backend can be currency-informed instead of currency-less.