Commit graph

325 commits

Author SHA1 Message Date
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
b20cb44779 Calculator changes 2025-02-28 12:19:24 +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
Joaquin Ossa
42701b4d2c Merged PR 4530: first comment time added
# Description

First comment time added

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

first comment time added

Related work items: #27812
2025-02-27 12:28:09 +00:00
Joaquin Ossa
6f28c4d9dc numeric 2025-02-26 16:51:56 +01:00
Joaquin Ossa
aaa0b1a5dd changed name 2025-02-26 16:45:01 +01:00
Joaquin Ossa
ed707849e7 Merged PR 4515: resolutions incidents to reporting
# Description

Resolutions incidents model to reporting

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

resolutions incidents to reporting

Related work items: #27811
2025-02-26 08:19:16 +00:00
Oriol Roqué Paniagua
84bdfe6083 Merged PR 4510: Fix sign
# Description

Fix sign...

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

Fix sign

Related work items: #27609
2025-02-25 15:24:05 +00:00
Oriol Roqué Paniagua
3c99c4f8bc Merged PR 4504: Onboarding MRR + Visualisation changes
# Description

Changes:
* Adds Onboarding MRR
* Refactors exclusion code for ongoing month / invoicing cycle
* Adds sign format on relative differences

# 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: #27609, #27805
2025-02-25 14:05:54 +00:00
Oriol Roqué Paniagua
7c4b0e752b Merged PR 4501: Revert "Refactor display exclusion for clarity purposes"
# Description

_Describe your motivation and changes here._

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

Revert "Refactor display exclusion for clarity purposes"

Reverted commit `fdec616f`.
2025-02-25 11:43:46 +00:00
Oriol Roqué Paniagua
5eebb4f560 Merged PR 4500: Revert "Relative increments with sign"
# Description

_Describe your motivation and changes here._

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

Revert "Relative increments with sign"

Reverted commit `f5718ded`.
2025-02-25 11:43:05 +00:00
uri
f5718ded4d Relative increments with sign 2025-02-25 12:30:23 +01:00
uri
fdec616fe6 Refactor display exclusion for clarity purposes 2025-02-25 11:45:14 +01:00
Oriol Roqué Paniagua
a6671ee4d0 Merged PR 4493: Adds Revenue Churn Rate in YTD/MTD Overview
# Description

Changes:
* Adds Revenue Churn Rate in YTD/MTD Overview. This has several implications, I finally understood how to properly compute a YTD.

The problem is that Revenue Churn Rate is a % of the Total "Churned" Revenue in a 12 m period vs. the Total Revenue in the same 12 m period. This is a bit tricky because it's not really additive, because of the Churn definition. Total Churned Revenue is the Revenue that the churned deals in a month generated on that past 12 months prior to churning.

So - in order to aggregate it properly, we need to do the sum of the Total Churned Revenue and retrieve the Total Revenue on these 12 months, and THEN compute the Churn rate.

This PR mainly retrieves the necessary input from the Churn models and then follows a similar computation as for the rest of YTD/MTD converted metrics.

I'll handle Onboarding MRR in a separated PR as this one is quite dense already.

# 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: #27609, #27805
2025-02-25 09:41:28 +00:00
Oriol Roqué Paniagua
85c2c73da7 Merged PR 4483: Adding targets (to be revised). Allows multi-year last-date computation
# Description

Changes:
* Adds template for targets -> These need to be revised
* Adds comparison of values vs. targets
* Allows for multi-year last date computation (allowing multiple years to be selected, not just the last one)

# 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: #27609, #27805
2025-02-24 10:39:45 +00:00
Joaquin Ossa
f29b67addd Updated tests on S&P fees 2025-02-23 16:14:42 +01:00
Oriol Roqué Paniagua
8cf7393173 Merged PR 4471: Visualisation changes
# Description

Adapts YTD/MTD for visualisation 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.

Visualisation changes

Related work items: #27609
2025-02-20 18:43:26 +00:00
Joaquin Ossa
aed9ce5575 Update exposures 2025-02-20 14:33:58 +01:00
Joaquin Ossa
b35d9b0a00 Addressed comments 2025-02-19 16:37:40 +01:00
Joaquin Ossa
c710de7117 Added has_verification_request 2025-02-19 16:00:33 +01:00
Joaquin Ossa
a94fb760e5 new booking fields 2025-02-19 15:29:05 +01:00
Joaquin Ossa
6fce8c0ec6 Added listings data 2025-02-19 14:57:44 +01:00
Joaquin Ossa
5585880b63 Merged PR 4448: Added booking id to payments model
# Description

Added booking id to payments model to upgrade payments 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.

Added booking id to payments model

Related work items: #27771
2025-02-19 10:59:13 +00:00
Joaquin Ossa
7b8af0f2ab Merged PR 4446: PMS model
# Description

New PMS model for PMS report in Legacy
This model shows the currently active PMS association for each host, with some basic host information, the amount of bookings done through this PMS and number of listings associated with the host.
**To be confirmed with someone more knowledgeable 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.
- [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: #27702
2025-02-19 10:58:58 +00:00
Joaquin Ossa
23393673b5 renamed field 2025-02-19 11:57:58 +01:00
Joaquin Ossa
533baa76c4 Added booking id to payments model 2025-02-19 11:53:19 +01:00
Joaquin Ossa
f994b5766e Renamed 2025-02-19 10:56:43 +01:00
Oriol Roqué Paniagua
78ae3e0119 Merged PR 4444: Exposes ytd_mtd_aggregated_main_metrics_overview
# Description

Exposes ytd_mtd_aggregated_main_metrics_overview in reporting.

I changed a bit the logic for exclusion, I believe this is a bit more clear than how it's currently done for the mtd/monthly metrics.

# 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: #27609
2025-02-19 09:26:05 +00:00
Joaquin Ossa
e9c0fa3ed0 Updated tests 2025-02-19 09:08:21 +01:00
Joaquin Ossa
74b045a930 New PMS model 2025-02-19 08:59:49 +01:00
Joaquin Ossa
b3739ec953 Added company_name 2025-02-18 14:31:57 +01:00
Joaquin Ossa
6dda0cdcc2 Adding fees in gbp 2025-02-18 10:52:38 +01:00
Oriol Roqué Paniagua
9540f18562 Merged PR 4425: Reworks Billable Bookings metrics
# Description

Changes:
* On Est. Billable Bookings, keeps previous logic for Old Dash while assuming the first billable service for New Dash
* Adds a Billable Check Out Bookings in Check Out bookings, as defined in the requirements.

# 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: #27619
2025-02-17 15:59:21 +00:00
Joaquin Ossa
aadd0c244b Fixed variable call and naming 2025-02-14 12:19:15 +01:00
Joaquin Ossa
4b94d5f70b Merged PR 3896: S&P invoice model
# 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

![image.png](https://guardhog.visualstudio.com/4148d95f-4b6d-4205-bcff-e9c8e0d2ca65/_apis/git/repositories/54ac356f-aad7-46d2-b62c-e8c5b3bb8ebf/pullRequests/3896/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: #25360
2025-02-14 08:18:42 +00:00
Joaquin Ossa
ca9188b1ab Addressed comments 2025-02-14 08:35:51 +01:00
Joaquin Ossa
a00a4b4e4b Updated model 2025-02-13 17:13:05 +01:00
Joaquin Ossa
67bf836621 commit wip 2025-02-13 15:31:22 +01:00
Joaquin Ossa
b4d19ddbb5 Merged PR 4371: fixed exposures
# 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
2025-02-12 14:49:46 +00:00
Joaquin Ossa
b8c953c7eb Merged PR 4370: new active_users data
# 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
2025-02-12 14:35:56 +00:00
Joaquin Ossa
c7a8420de3 fixed schema 2025-02-12 15:35:03 +01:00
Joaquin Ossa
375c8679cd changed naming 2025-02-12 15:16:41 +01:00
Joaquin Ossa
9e744f41b0 Format schema 2025-02-12 15:03:17 +01:00
Joaquin Ossa
9af7b27e04 new active_users data 2025-02-12 15:00:31 +01:00
Joaquin Ossa
06736de6a6 Updated exposures 2025-02-12 12:50:54 +01:00
Joaquin Ossa
aa840aedd0 fixed naming 2025-02-12 09:24:53 +01:00
Joaquin Ossa
0866b2bf9d added all booking states 2025-02-12 09:09:16 +01:00