Commit graph

373 commits

Author SHA1 Message Date
Oriol Roqué Paniagua
eb213acb9e Merged PR 3137: Growth score to reporting
# Description

Copies intermediate to reporting for growth score by deal. Schema is copy-paste from intermediate changing the model's name.

# 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.
- [NA] 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: #22635
2024-10-14 12:26:01 +00:00
Oriol Roqué Paniagua
7f9c038fc0 Merged PR 3120: Creation of growth score by deal model for top losers report (intermediate)
# Description

Creates a model to identify deal growth based on YoY performance of Created Bookings, YoY performance of Listings Booked in Month and one month shifted YoY performance of Revenue.
Also added weighted score to account for revenue size.

# 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. **Probably something can be done here, sorry I've not checked.**
- [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: #22635
2024-10-11 07:20:35 +00:00
Oriol Roqué Paniagua
52f01adc11 Merged PR 3127: (3/3) Revenue renaming - KPIs by deal
# Description

Main changes:
* Guest revenue is now guest payments. PBI uses Guest revenue, so alias is changed at reporting level, while it uses guest_payments_in_gbp field.
* Removal of Waiver Amount Paid back to Host to Guest revenue and Total revenue.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [NA] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [NA] I have checked for DRY opportunities with other models and docs.
- [NA] 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: #22688
2024-10-10 14:01:49 +00:00
Oriol Roqué Paniagua
745f00bad2 Merged PR 3124: 1/3 - Revenue renaming Main KPIs - MTD scope
# Description

Adapts revenue figures in Main KPIs - MTD scope or global view. This includes MTD, Monthly Overview, Global Evolution over Time, Detail by Category. In essence, everything that is not by deal.

The changes are mainly 2:
* Remove the line that deducts the `Waiver Amount Paid Back to Hosts` in all metrics except the `Waiver Net Fees`. This effectively means that the previous `Guest Revenue` = `Guest Payments`, thus I dropped all 3 `Guest Payments` metrics.
* Do a renaming at metric display level, but not in the code. This means that I remove the computation of `guest_revenue_in_gbp` for instance and keep `guest_payments_in_gbp`, and apply the renaming later on, since the modelisation already accounts for defining metric names differently from those of the fields. For the rest of metrics, I revised all metrics name and did changes based on the [whiteboard](https://whiteboard.office.com/me/whiteboards/p/c3BvOmh0dHBzOi8vZ3VhcmRob2ctbXkuc2hhcmVwb2ludC5jb20vcGVyc29uYWwvcGFibG9fbWFydGluX3N1cGVyaG9nX2NvbQ%3d%3d/b!T2D3opQuBECSDnhuFZrUacFu3TxvSvdIsnI4Dxsh2IuaB1AigbciRqkqte61I4wz/01H5SI4J4L7HTPJGUT7JGYKTOSQYYWACXU). I also changed the dedicated data tests in Main KPIs to ensure it's working. I also changed the exclusion logic in reporting based on the name of the metric to not display metrics that depend on the invoicing cycle unless it's 2 months ago or before.

To keep in mind:
* Merging this will automatically display the new figures/naming in production. Might be wise to communicate to stakeholders since some key metrics (namely, Guest Revenue / Total Revenue) will change the meaning.
* We also need to do these changes in the metrics by deal part of the computation. I'd do first the removal of these fields in the PBI report (and take the opportunity to change the Data Catalogue) and then do the PR in DWH to change the logic. Before that though let's check that the names included in this PR are the correct ones :)

# Checklist

- [X] The edited models and dependants run properly with production data.
- [NA] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [NA] I have checked for DRY opportunities with other models and docs.
- [NA] 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: #22688
2024-10-10 13:46:59 +00:00
uri
7302790d42 Add new API role CancellationApi in user_role accepted values 2024-10-09 10:17:34 +02:00
Pablo Martin
2d42d99543 docs for athena int 2024-10-08 14:54:11 +02:00
Pablo Martin
c81f6c955d move docs for int_edeposit__guesty_verifications 2024-10-08 14:45:50 +02:00
Pablo Martin
d21d9b6a01 todos 2024-10-08 14:37:00 +02:00
Pablo Martin
d16647ac72 push upstream the filter 2024-10-08 14:37:00 +02:00
Pablo Martin
67dcc8b237 split staging layer 2024-10-08 14:37:00 +02:00
Pablo Martin
761cf409c6 push filter down one model 2024-10-08 14:37:00 +02:00
Pablo Martin
30c73b1ab9 duplicate athena verifications 2024-10-08 14:37:00 +02:00
Pablo Martin
67b8e1263d move guesty to athena folder 2024-10-08 14:37:00 +02:00
Oriol Roqué Paniagua
ea8972a91b Merged PR 3090: Propagates Protection Plan to intermediate, for price and cover
# Description

Propagates Protection Plan to price and cover to intermediate. Ideally I wanted to have a single table that contained prices + covers, but it is not straight forward to assume:
*  if a modification of the amount covered by a protection plan will create a new protection plan id, or not
* if a modification of the price a protection costs will create a new protection plan id, or not
So I keep it split for the time being. Besides, use cases might be different, ex: I want to see all prices of services (product + protection plan, but no need for cover).

# 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: #20809
2024-10-08 11:44:52 +00:00
Oriol Roqué Paniagua
bad27ecbc3 Merged PR 3087: Adding int_core__product_service_to_price
# Description

Adds int_core__product_service_to_price.

This model is the equivalent of staging but just adding currency code, product service name and a few boolean fields to identify if the product service to price is currently active and if it's the default price or not.
Currently it's a view since it has 16 records, likely it can be transformed into a table in the future.

The idea will be to create a similar table for protection_plan.

# 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.
- [NA] I've picked the right materialization for the affected models. -> We will see in the future if needs to be adapted

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #20809
2024-10-08 11:39:34 +00:00
uri
911603f2e8 Documenting protection name fields in user_product_bundle 2024-10-07 17:21:52 +02:00
uri
9424a96707 Adding protection names 2024-10-07 17:18:41 +02:00
uri
4de5c08a26 Keep latest booking to product bundle state 2024-10-04 10:32:15 +02:00
Oriol Roqué Paniagua
3480d4d787 Merged PR 3047: Override migration date with join date if join date is after migration date
# Description

Quick fix to make lower_limit_migration_date_utc more robust for new dash reporting purposes. I noticed some cases in which users were actually created after the migration date. In these cases, I just keep joined date.

# 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: #22331
2024-10-04 07:16:52 +00:00
Oriol Roqué Paniagua
8e4e967c20 Merged PR 3028: Adding int_core__user_product_bundle_contains_services
# Description

This PR adds a new table named `user_product_bundle_contains_services` in intermediate core.

Mainly, this table serves as a bridge between `user_product_bundle` and `product_services`. A `product_bundle` within `user_product_bundle` can contain 1 or several services, and this was stated in the field `contains_product_services`. The value of this field corresponds to the sum of `product_service_binary_tier` from the services that apply within that bundle. Even though the information is quite concise using this format, it adds extra complexity for analytical purposes, so this new table just duplicates the `user_product_bundle` main attributes as many times as services are contained.

For example:
`id_user_product_bundle` = 383 contains one unique bundle named Basic Program. This bundle has the `chosen_product_services` = 257, which can only be decomposed in power of 2 as of the sum of 256 + 1. This bundle therefore contains 2 services, Basic Screening (`product_service_binary_tier` = 1) and Waiver Pro (`product_service_binary_tier` = 256). Thus, in the new table, we will have 2 records and remove all this logic to something more standard, as seen in this screenshot:

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

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [ ] The edited models contain PK tests, and I've ran and passed them. *N/A - there's no PK in this table, but the combination of columns that should be unique is tested*
- [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: #20809
2024-10-02 14:54:03 +00:00
Pablo Martín
7d9d9faf71 Merged PR 3024: Activate country test for taxes
# Description

Activates a commented out test for verification payments v2. The test was deactivated because of some master data issues in the backend, but they were fixed after  #22148.

# Checklist

- [NA] The edited models and dependants run properly with production data.
- [NA ] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [NA] I have checked for DRY opportunities with other models and docs.
- [NA] 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: #20043
2024-10-02 09:09:18 +00:00
Joaquin Ossa
aab6155b67 more features into reporting 2024-10-02 10:57:30 +02:00
Joaquin Ossa
f37d419a1a fixed cancellation fee charge 2024-10-02 09:30:33 +02:00
Pablo Martin
6124c19f98 activate one test, prepare another but keep it commented 2024-09-27 16:11:34 +02:00
Joaquin Ossa
37d9f5250a Added new role 2024-09-27 09:55:37 +02:00
Pablo Martin
0cd8f71889 remove variable that doesn't make sense anymore 2024-09-25 16:12:55 +02:00
Pablo Martin
bea2e0d926 fix broken case logic 2024-09-25 16:12:36 +02:00
Pablo Martín
260b46171c Merged PR 2888: No taxes for host takes risk waivers
# Description

This PR modifies the V2 of `int_core__verification_payments` to make sure that taxes are not computed for waivers where the host takes the risk (in line with our guest taxes guidelines: https://www.notion.so/knowyourguest-superhog/Guest-Services-Taxes-How-to-calculate-a5ab4c049d61427fafab669dbbffb3a2?pvs=4#323e230365ed496cad6a65b5659895ea).

The PR changes the intermediate column `is_service_subject_to_vat`, making it `false` in the cases where there was no active payaway plan during the month where the payment was generated. This cascades in the main body of the model, because if `is_service_subject_to_vat` is `false`, then the tax amounts get turned into zero.

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

add logic

Related work items: #20043
2024-09-25 10:34:46 +00:00
Joaquin Ossa
5ac1a65e90 Financial rate metrics 2024-09-20 14:53:43 +02:00
Joaquin Ossa
40bfa60016 core__verification_payments_v2 2024-09-18 12:41:00 +02:00
Joaquin Ossa
9e62786aa9 commit2 2024-09-18 11:26:23 +02:00
Pablo Martin
136c297683 add logic 2024-09-17 17:56:56 +02:00
Joaquin Ossa
2dd4f66189 update int_core__guest_satisfaction_responses to version 2 of verification_payments 2024-09-17 17:12:46 +02:00
Pablo Martin
a20d511b93 missing text 2024-09-17 16:12:38 +02:00
Pablo Martin
049c2d3e31 model and docs+tests 2024-09-17 15:47:45 +02:00
Pablo Martin
f3e9985d0f model and docs 2024-09-17 12:16:52 +02:00
Pablo Martin
ac87ab4cfd create file 2024-09-17 11:56:21 +02:00
Joaquin Ossa
ae1e45a937 Merged PR 2869: Update mtd_aggregated_metrics guest payments to be tax-exclusive
# Description

Update mtd_aggregated_metrics guest payments to be tax-exclusive

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

Update mtd_aggregated_metrics guest payments to be tax-exclusive

Related work items: #20045
2024-09-17 07:27:08 +00:00
Oriol Roqué Paniagua
7b9ba021c1 Merged PR 2865: Propagate tax exclusive check in hero payments
# Description

This PR propagates tax exclusive check in hero payments for the reporting of Check in Hero.
Additionally, it keeps propagating the amounts with tax inclusiveness in case, at some point, we need them. These are with the new naming convention.

In order not to break anything, the previous amounts are duplicated and aliased in reporting.

Lastly, I spent some time adding some clarifications and documenting payments set to currency and the dependant used for check in hero.

# 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: #20046
2024-09-17 07:25:09 +00:00
Joaquin Ossa
b21590ab1d Simplified it 2024-09-17 09:05:38 +02:00
Joaquin Ossa
c3e4a07050 Update mtd_aggregated_metrics 2024-09-17 09:05:38 +02:00
Pablo Martin
60ea19f5ef remove dangling comment 2024-09-17 09:05:38 +02:00
Pablo Martin
fcbaae1381 update schemas 2024-09-17 09:05:38 +02:00
Pablo Martin
fd3b67935b remove old booking metrics 2024-09-17 09:05:37 +02:00
Pablo Martin
bbbfaeabdf refactor booking metrics children to use new models 2024-09-17 09:05:37 +02:00
Pablo Martin
4b5c4d1967 create individual models for each booking metric 2024-09-17 09:04:44 +02:00
Joaquin Ossa
50a8a512fe Update mtd_aggregated_metrics guest payments to be tax-exclusive 2024-09-17 08:38:33 +02:00
Joaquin Ossa
3d8ede273e Simplified it 2024-09-16 16:20:36 +02:00
Joaquin Ossa
54af8af30e Update mtd_aggregated_metrics 2024-09-16 16:01:49 +02:00
Oriol Roqué Paniagua
c1b97e17e6 Merged PR 2852: Fix: ensure priority selection on user migration
# Description

Fixing logic to ensure priority selection of claims when user satisfies multiple claim conditions.
It adds a new parameter that forcefully prioritises the selection of the date value for a certain claim over the others. If the value is repeated among claims, it will select the earliest date.

# 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: #20773
2024-09-16 09:34:44 +00:00