Commit graph

1263 commits

Author SHA1 Message Date
Joaquin
a85033922c Filtered test accounts 2025-03-19 16:50:19 +01:00
Joaquin Ossa
cef363847a Merged PR 4736: adding id_deal to api models
# Description

Adding `id_deal` to API models in Check in Cover and Screen & Protect

# 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: #28239
2025-03-19 10:33:49 +00:00
Joaquin
5d3f2f6908 adding id_deal to api models 2025-03-19 09:23:23 +01:00
Oriol Roqué Paniagua
5928a198b6 Merged PR 4734: Bugfix - Ensures accounts cannot be duplicated in Xero sales monthly trends
# Description

This fixes the duplication error when the same deal has more than one contact. Impact was not massive, it just affected because of the Home to Host account and this has happened during the past week. There were other cases that contained duplicates but these were not invoiced so it didn't affect the total sum.

Changes:
* Contacts now has a boolean field indicating if a deal exists.
* Contacts now has a boolean field indicating if that contact has a deal informed and it's the last updated one. This is opinionated - it could have been done with creation, for instance.
* Sales monthly trends forces the last updated contact to be true.
* Improved robustness by adding tests.

Note that modifying the logic in intermediate on `int_xero__sales_monthly_trends` by changing `id_deal` per `id_contact` would not have worked - we need to do this compute by deal to ensure that any invoicing is reported MoM and YTD.

# 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: #28576
2025-03-19 08:19:20 +00:00
Oriol Roqué Paniagua
06694faa68 Merged PR 4732: Removes accepted values test for guest product display name
# Description

It's a bit overkill to add an accepted tests in the display name, knowing that it can change. Note that I didn't remove it for the internal name.

This fixes the dbt test 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.

Removes accepted values test for guest product display name

Related work items: #28513
2025-03-18 16:03:49 +00:00
uri
09976bef13 Removes accepted values test for guest product display name 2025-03-18 16:34:00 +01:00
Oriol Roqué Paniagua
f799a8d30f Merged PR 4727: Bookings fees are now Old Dashboard Booking Fees in Main KPIs
# Description

Booking fees is widely used with different meanings, for old dash, for new dash, for both, etc. This is painful. First step to align on a proper naming is ensure that what we report in Main KPIs is clearly stated, which in this case, Booking Fees are now called Old Dashboard Booking Fees.

Changes:
* Modify `stg_seed__accounting_aggregations` seed to rename Booking Fees to Old Dashboard Booking Fees. This is for us to clarify. This is only applied for KPIs compute. I also added an empty space that I mistakenly forgot in the past for `financial_l3_aggregation`.
* Modify KPIs source, i.e., `int_kpis__metric_daily_invoiced_revenue`. Here I forcefully modify the name of the field to `xero_old_dashboard_booking_net_fees_in_gbp`.
* Propagate changes of downstream usages of `xero_booking_net_fees_in_gbp` to `xero_old_dashboard_booking_net_fees_in_gbp`. This affects all models, including the reporting model. On this one we still have both names to avoid breaking it. I will need to modify the data glossary in PBI anyway so I'll do this change as well.
* Modify displayed metric name from Booking Fees Revenue to Old Dashboard Booking Fees Revenue.
* Modify schema so it reflects the proper names, descriptions, and tests.
* Ensure outlier and completion tests still work after this change.

I confirm the field `xero_booking_net_fees_in_gbp` does not exist anymore in the rest of DWH after these changes, except for the abovementioned comment on the reporting line.

# 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: #28560
2025-03-18 14:55:32 +00:00
uri
74a76fe8fc Removes configuration status and adds config id for further joins 2025-03-18 09:20:31 +01:00
uri
91e7fe09b1 Adds end date 2025-03-18 09:09:59 +01:00
uri
cba4b97082 Adds a master table for guest products price plans 2025-03-17 16:35:50 +01:00
Joaquin Ossa
b518c536f2 Merged PR 4698: Added business scope to models
# Description

Added business scope to models `monthly_aggregated_metrics_history_by_deal`

# 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.

Added business scope to models

Related work items: #28501
2025-03-14 13:33:10 +00:00
Joaquin
e9cfb6c2bd Addressed comments 2025-03-14 14:20:57 +01:00
Oriol Roqué Paniagua
918ed969d8 Merged PR 4699: Creates a master table for guest products
# Description

Creates a master table for guest products in intermediate. It just gathers information on the name and the latest display name, as well as a couple of additional time fields.

I opted for "latest" rather than "current" because technically Guest Products can be enabled and disabled, and I believe current name would be weird if the product is disabled. Anyway. Next step will be actually creating a master table on guest product configuration, that will handle this disable logic and so on.

# 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: #28513
2025-03-14 13:04:46 +00:00
Joaquin
89b3989d19 Added business scope to models 2025-03-14 11:48:22 +01:00
Joaquin Ossa
72118389d6 Merged PR 4693: Live Dates according to HubSpot
# Description

Made the change as discussed during the daily.
Here we can see an example of the impact with the change (left old lifecycle, right new one)
The biggest impact comes from the Never Booked deals, 110, and Active 34.
![image.png](https://guardhog.visualstudio.com/4148d95f-4b6d-4205-bcff-e9c8e0d2ca65/_apis/git/repositories/54ac356f-aad7-46d2-b62c-e8c5b3bb8ebf/pullRequests/4693/attachments/image.png)

# 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: #28475
2025-03-14 10:20:34 +00:00
Joaquin
c33253b10a addressed comments 2025-03-14 11:19:22 +01:00
Joaquin
525720ea0a Changes in deals lifecycle 2025-03-14 10:39:01 +01:00
Joaquin
e0d18acf8e Churn update 2025-03-14 10:12:54 +01:00
Joaquin
e827c0f9d5 Updated schema 2025-03-13 17:31:15 +01:00
Joaquin
a2b3b7fa6b Updated schema 2025-03-13 17:29:24 +01:00
Joaquin
d6426b0066 change in new deals 2025-03-13 17:19:34 +01:00
Joaquin
1ced79ca0a commit wip 2025-03-13 15:48:15 +01:00
Oriol Roqué Paniagua
bf1e125856 Merged PR 4687: Bugfix - Removal of SH fields that no longer exist
# Description

After the sync this morning in Core in Airbyte, we have some issues in SH User. This attempts to remove no longer existing fields, namely:
- id_airbnb
- airbnb_url
- platform_comms_recipient

# 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: #28502
2025-03-13 12:25:13 +00:00
Oriol Roqué Paniagua
eb26252784 Merged PR 4686: Guest Products - Sync Guest Products
# Description

Adds the remaining Guest Products tables to staging

# 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: #28490
2025-03-13 11:53:04 +00:00
Oriol Roqué Paniagua
7ef460a59e Merged PR 4685: Guest Products - sync core tables
# Description

Adds `VerificationRequestGuestProductToPayment` and `VerificationRequestToGuestProduct` to staging.

Note these tables are empty thus it's possible that some tests might need to be adapted in the future.

I also already added the configuration for sync_guest_product sources.

# 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.

Guest Products - sync core tables

Related work items: #28490
2025-03-13 09:27:02 +00:00
Oriol Roqué Paniagua
9ca9c827fe Merged PR 4665: Projected Bookings to the end of the current month
# Description

Computes projected Bookings to the end of the current month per dimension and dimension value

KPIs changes:
* Adds a int_kpis__agg_daily_created_bookings model. This is a standard KPIs model that computes created bookings at a daily level per dimension and dimension value.

Projected KPIs (NEW):
* Adds a new folder named projected within KPIs. This includes a simple Readme.
* Adds a default dimension dates model that ranges from the past 3 complete months to the end of the current month, that is in the future.
* Adds 2 projected models for created bookings: The daily one, that handles the logic of the projection (same month + last 7 days) and the monthly one, that retrieves the end of month projected value as well as some indicators of how good or bad this was for previous months.

How good is the projection at 11th of March (so 10 days in the month)?

`select * from intermediate.int_kpis_projected__agg_monthly_created_bookings order by actual_created_bookings desc`

![image.png](https://guardhog.visualstudio.com/4148d95f-4b6d-4205-bcff-e9c8e0d2ca65/_apis/git/repositories/54ac356f-aad7-46d2-b62c-e8c5b3bb8ebf/pullRequests/4665/attachments/image.png)

# 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: #28251
2025-03-11 14:34:30 +00:00
Joaquin Ossa
459b1b3833 Updated exposures 2025-03-10 10:57:21 +01:00
Joaquin Ossa
f8362c4a71 addressed comments 2025-03-07 11:32:09 +01:00
Joaquin Ossa
2d4cded48c Addressed comments and included changes in reporting 2025-03-07 11:13:03 +01:00
Joaquin Ossa
2461286c9c Updated model 2025-03-07 10:17:11 +01:00
Joaquin Ossa
0536cfb0e2 Fixing formatting 2025-03-06 17:19:15 +01:00
Joaquin Ossa
f8b551a75c Updated existing model with some new fields for churning report 2025-03-06 17:12:32 +01:00
Joaquin Ossa
24d13185eb Added year and month 2025-03-06 15:02:44 +01:00
Joaquin Ossa
1245a88867 New churned deals model 2025-03-06 14:57:23 +01:00
Joaquin Ossa
089a1c37bd commit wip 2025-03-06 11:02:46 +01:00
Joaquin Ossa
d065d4beb6 New Dash bug fix 2025-03-06 08:16:40 +01:00
Oriol Roqué Paniagua
39fc6a7d13 Merged PR 4618: Bugfix - Ensure the PMS is active
# Description

Very silly mistake - affects many reports!

@<Joaquin Ossa> let me know if there's other use cases. I believe that's all of the computations, but you have this more fresh than me.

# 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: #28196
2025-03-05 14:57:57 +00:00
Oriol Roqué Paniagua
5ddbe5d5af Merged PR 4616: Adds first day month for reporting purposes
# Description

Just adds the first day of the month for AM models. The problem is that the display of the graph and the value shown are misleading. This aims to fix it. I hate PBI.

# 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.

Adds first day month for reporting purposes

Related work items: #28181
2025-03-05 14:31:36 +00:00
Oriol Roqué Paniagua
5d6e860e2b Merged PR 4596: Propagates Client Type to KPIs by Deal and AM models
# Description

Propagates Client Type to KPIs by Deal and AM models. This is just a distinction between Platform and APIs.

# 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: #28181
2025-03-05 13:02:07 +00:00
Oriol Roqué Paniagua
1a4a9fac37 Merged PR 4578: Propagates the month attribution from invoicing data
# Description

Following the changes of the month attribution on invoicing data depending if the document is posted on Xero or in Hyperline, this PR ensures that the 2 affected areas capture this change.

This means:
* Xero - Sales Monthly Trends
* KPIs - Invoiced Revenue

# 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: #28158
2025-03-04 14:13:53 +00:00
Oriol Roqué Paniagua
3f1e2ea1d9 Merged PR 4572: Applies logic to modify the invoicing cycle date depending on the issuing source
# Description

Hyperline invoices/credit notes have an issuing date that corresponds to the moment in which these are actually created.

This is an issue since it means that an invoice or credit note posted today, 4th March 2025, that is supposed to be related to February 2025 invoicing cycle, will have:

* If the document is posted in Hyperline, an issuing date on the March 2025
* If the document is NOT posted in Hyperline, an issuing date on February 2025

This PR just creates a field that handles the logic effectively, to be used further in other reports/kpis 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.
- [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: #28158
2025-03-04 11:32:52 +00:00
Oriol Roqué Paniagua
dcf0f205a2 Merged PR 4568: Adds flag to identify invoices/credit notes that are posted in Hyperline
# Description

Adds flag to identify invoices/credit notes that are posted in Hyperline.
For Invoices, these need to be ACCREC and follow a convention of 20XX-Y
For Credit Notes, these need to be ACCRECCREDIT and follow a convention of CN-20XX-Y

# 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: #28146
2025-03-04 10:12:03 +00:00
Joaquin Ossa
dda393d693 Resolution exposure update 2025-03-03 15:32:47 +01:00
Oriol Roqué Paniagua
230f4c08de Merged PR 4560: Update exposures main kpis
# Description

Update exposures main kpis with the latest YTD/MTD/Target addition.

Code compiles correctly

# Checklist

- [ ] 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.

Related work items: #27609
2025-03-03 14:30:58 +00:00
Joaquin Ossa
b2e15bbbab Merged PR 4546: Calculator changes
# Description

After talking with the Ant he we realised that the `was_overriden` was not properly set up so I removed it.
Added all calculated and submitted values for both guests and hosts and left out values in USD since we are not going to use them on the report.

# 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.

Calculator changes

Related work items: #27812
2025-02-28 11:25:29 +00:00
Joaquin Ossa
b20cb44779 Calculator changes 2025-02-28 12:19:24 +01:00
Joaquin Ossa
da0b0dad67 Updated all service_business_type tests 2025-02-28 11:14:40 +01:00
Joaquin Ossa
2bc8e6c0c3 Updated test 2025-02-28 09:49:31 +01:00
Joaquin Ossa
c85ce8d0a7 new dash guest agreement fix 2025-02-28 09:13:29 +01:00
Oriol Roqué Paniagua
cfc17a5d3a Merged PR 4528: Adds number format
# Description

Adds number format for display 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.
- [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.

Adds number format

Related work items: #27609
2025-02-27 13:18:03 +00:00