# Description
Fixed variable call and naming issue
# 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.
Fixed variable call and naming
Related work items: #25934
# Description
Changes:
* Adds Business Scope split on Billable Bookings + propagates towards Agg/Metric Monthly/MTD models
This is a temporary modification until the ticket on Billable Bookings for New Dash is handled.
# 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: #27356
# Description
New Invoice model for S&P
Quite a dense model, it needs to consider some different situations for the different Protection types, verification status and if the user has the `is_protected` flag active for it's bookings.
I leave the documentation for support to better clarify all the possible scenarios and a screenshot of how it is currently looking the model's result.
There are a couple of rename changes on other models, nothing big.
If there are any inquiries let me know.
https://www.notion.so/knowyourguest-superhog/Invoice-Screen-Protect-1610446ff9c980f88de6d6293b4fab03?pvs=4

# 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: #25360
# Description
Need opinion on this model, it's not so easy so if needed we can have a quick call
- Since the `int_core__booking_service_detail` has some services combined in one I tried to split them to count separately each service per booking and their statuses. There are also some cases where there are services combined but also separate for the same booking, in those cases I only take in count the status of the service with the most recent `service_detail_updated_at_utc `

So here it takes for the `BASIC DAMAGE DEPOSIT` the status Paid which is more recent but for `WAIVER PLUS` the status Not Paid.
- I created a macro to count all the distinct bookings with each `service_status` that also adds the column name. If there are new statuses being used we would have to add them to the macro as well as calling the new columns on the final select. Might not be the most optimal approach WDYT??
**The PR is not ready to be closed**
# Checklist
- [x] The edited models and dependants run properly with production data.
- [ ] The edited models are sufficiently documented.
- [ ] 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.
Adding booking services status
Related work items: #25934
# Description
Changes:
* Propagates business scope, based on deal, for Deal and Listing metrics. This already handles the daily metric and the daily aggregation.
* Modifies lifecycle_daily_deal to depend on dimension_deals and compute API segmentation.
* Creates new metric: Live Deals, that includes New, Active and Reactivated. This will be needed for YTD/MTD overview.
# 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: #27356
# Description
Changes:
* **Main change:** exclusion of KYG lite users of the segmentation of Business Scope. These are "freemium" users, kind of demo users, that shouldn't have any real impact in terms of revenue. These are in New Dash, but do not have a deal. The problem is that we don't want to consider them as New Dash, but the current condition was making them appear as Old Dash. This PR fixes this by handling the logic for backend related models. Note that Xero remains unaffected - this is based on Deal, and these users do not have Deal.
* Small data quality fix I noticed while debugging KYG lite cases. It's better to use the "is upgraded service" from the staging original tables rather than the one with the prices. If a user does not have a currency (which can be the case for KYG lite users), then the coalesce would tag any service as not upgraded, which is not true.
# 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: #27356
# Description
Fixed model error
# 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.
Fixed model error
# Description
Fixed model name
# Checklist
- [x] The edited models and dependants run properly with production data.
- [ ] The edited models are sufficiently documented.
- [ ] 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.
fixed exposures
# Description
Added active and inactive users:
- Active_users: those that are actually using the services in any accommodation of their bundles
- Inactive_users: basically the difference between users with the service and active_users
# 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.
new active_users data
Related work items: #25934
# Description
Included all booking states in the model.
At first I thought I would only show the most relevant but better to show all of them so the total adds up
# 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: #25934
# Description
Changes:
* Business scope is now propagated in Host Resolutions and Invoiced Revenue Monthly/MTD Metric and Aggregated models
# 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: #27356
# Description
Changes:
* Switches dash_source to business_scope in all kpis models, schema and macro configuration.
# 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: #27356
# Description
Changes:
* Creation of a deal-based model that contains when a "deal has appeared in new dash". This is tricky because a Deal can still have multiple users, thus it needs to be attributed to a date. I've chosen the first user appearance for the rest of the metrics.
* Adaptation of dimension deals in KPIs to include a client type, that indicates if the deal is from APIs or not (Platform, i.e., Dashboard).
* Xero metrics by Business Scope. This is the previous "dash source" that I need to change in the previously worked models. I decided to include APIs in the segmentation since in most cases we distinguish old dash from new dash by just "anything that is not in new dash". This is very wrong for invoicing metrics, in which we have APIs. So this actually properly computes a client segmentation by scope.
Note that I'll need to handle the monthly/mtd metrics/agg for these 2 metric models (Resolutions + Invoiced revenue) separately.
# 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: #27356
# Description
Payments model for legacy report
It includes payments with and without taxes for guest payment validations.
It also has the payaway amount depending on whether the host or superhog is taking the risk.
# 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.
In case you want to take a look at how is it looking

Payments model for legacy report
Related work items: #27178
# Description
Changes:
* Adds Dash Source in Monthly and MTD Metric models for Verification Request dependant KPIs
* Propagates to Aggregated Monthly and MTD models for VR dependant KPIs
* Eliminates unused Weekly Guest Payment models.
# 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: #27356
# Description
Changes:
* On Created and Check Out Bookings daily models, the determination of New Dash bookings now uses `int_core__booking_summary`. This does not change the output, but will be more consistent for other KPIs.
* Adds the categorisation of `dash_source` in all daily metric models that depend on Verification Requests (Guest Journeys). This affects GJ Created, GJ Started, GJ Completed, GJ w. Payment and Guest Payments. Note that the next aggregations (monthly, mtd, agg_monthly, agg_mtd) are not created yet. This will be done in a separated PR.
# 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: #27356