Commit graph

385 commits

Author SHA1 Message Date
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
Oriol Roqué Paniagua
cf1d6e28cc Merged PR 2849: Fix: KYG lite migration with proper date migration handling
# Description

This PR fixes the New Dash migration issue that happened on September 10th 2024. In this migration, users were directly assigned the claim of KygMvp that does not contain a date value. We were using a default hardcode of the first MVP migration, thus in DWH all users have been considered to be migrated late July instead of splitting the first 22 in late July and the ~200 others in September.

The issue lies in the fact that users have configured a ProductBundle and can have Bookings with ProductBundle BEFORE the migration date, which greatly breaks the logic of a migration monitoring.

Changes:
* New migration phase added based on the claim MvpMigratedUser, that Ben created on Friday 13th
* Adaptation of the code in int_core__user_migration to detect if the claim_value (a text field) has a date or not. If so, use that date as long as it's equal or greater than the deployment date, if not use the deployment date. If the claim does not contain a date, use the deployment date (this is the case for the first true 22 migrated users)

I checked that volumes now look correct with this fix.

# 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 07:57:41 +00:00
Joaquin Ossa
80a6b225b3 Merged PR 2846: removing duplicates from guesty and removing tests for edeposit_users
# Description

removing duplicates from guesty and removing tests for edeposit_users and edeposit_verification_fees until further notice

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

removing duplicates from guesty and removing tests for edeposit_users

Related work items: #20125
2024-09-13 15:16:08 +00:00
Joaquin Ossa
d8501e2df7 kept first updated record instead of last 2024-09-13 17:14:34 +02:00
Joaquin Ossa
32c8ffb655 removef all tests for edeposit_verification_fees 2024-09-13 16:31:47 +02:00
Joaquin Ossa
5551c97db0 removing duplicates from guesty and removing tests for edeposit_users 2024-09-13 16:14:03 +02:00
Pablo Martin
6434c5c88d replace custom generic test with standard range between one 2024-09-13 15:21:22 +02:00
Pablo Martin
4cf74db49a replace hardcode with variable 2024-09-13 15:21:22 +02:00
Pablo Martin
092b8bd725 clarify refund is not in GBP 2024-09-13 15:21:22 +02:00
Pablo Martin
ec8490527d reorder case for readability 2024-09-13 15:20:39 +02:00
Pablo Martin
0312a1ccd8 remove explicit version reference, rely on latest 2024-09-13 15:20:39 +02:00
Pablo Martin
da3070949a finish columns and schema 2024-09-13 15:20:39 +02:00
Pablo Martin
63599d7a9b add columns 2024-09-13 15:20:39 +02:00
Pablo Martin
8c96b96ee5 small comment 2024-09-13 15:20:39 +02:00
Pablo Martin
6136db8403 cte for pre-defining if vat is applicable or not 2024-09-13 15:20:39 +02:00
Pablo Martin
f58e97a3f2 set references for v1 2024-09-13 15:20:39 +02:00
Pablo Martin
2cd115eede remove unnecessary alias, remove unrelated errors in yaml 2024-09-13 15:20:39 +02:00
Pablo Martin
1974da99f7 fix typos 2024-09-13 15:20:39 +02:00
Pablo Martin
d4b797c741 add alias 2024-09-13 15:20:39 +02:00
Pablo Martin
4efc1ba50f v1 goes back to original state 2024-09-13 15:20:39 +02:00
Pablo Martin
bbb9558f62 yaml for new version, plus deprecation 2024-09-13 15:20:39 +02:00
Pablo Martin
4ba6c80d6f v2 model 2024-09-13 15:20:15 +02:00
Pablo Martin
bde6f12404 add new columns 2024-09-13 15:20:15 +02:00
Pablo Martin
0aaec6a619 fuck around with Uri 2024-09-13 15:20:15 +02:00
Pablo Martin
05d5cc6d10 fix schemas in intermediate 2024-09-12 15:38:50 +02:00
Oriol Roqué Paniagua
c336081d3d Merged PR 2825: Propagates deal Name and Billing Country in int_monthly_aggregated_metrics_history_by_deal
# Description

Changes (only in intermediate):
* Applies sqlfmt in KPIs source models (for some of them it was already applied). Specifically, the 3 Core models ONLY contains formatting changes
![image.png](https://guardhog.visualstudio.com/4148d95f-4b6d-4205-bcff-e9c8e0d2ca65/_apis/git/repositories/54ac356f-aad7-46d2-b62c-e8c5b3bb8ebf/pullRequests/2825/attachments/image.png)

* Adds `main_deal_name` and `main_billing_country_iso_3_per_deal` in `int_monthly_aggregated_metrics_history_by_deal`

* Adds the 2 new fields in the schema entry of `int_monthly_aggregated_metrics_history_by_deal`, including the dbt test not null in the deal 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.
- [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: #18911, #19083
2024-09-12 12:04:04 +00:00
Oriol Roqué Paniagua
72c966631e Merged PR 2824: Propagates Billing Country and Deal Name into int_dates_by_deal
# Description

Changes:
* Adding `main_deal_name` and `main_billing_country_iso_3_per_deal` in `int_dates_by_deal` model.
* Documents the 2 new fields. Also, ensures `main_deal_name` is not null
* Removes `id_deal not null` condition since it's enforced on the inner join with `int_core__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.
- [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: #18911, #19083
2024-09-12 10:27:56 +00:00
Joaquin Ossa
91296fa91c Fixed model that wasn't mapping correctly 2024-09-10 12:09:16 +02:00
Joaquin Ossa
d5151e2e90 Merged PR 2788: Update edeposit users table
# Description

Created a mapping for some users that have a different id in Cosmos so we can join them using data that Ray shared with me, with this we can get all currency information for each user

# 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: #20125
2024-09-10 08:35:37 +00:00
Joaquin Ossa
6ed48a39fc Included explanation in schema 2024-09-09 18:36:13 +02:00
Joaquin Ossa
a54bc78c53 Fixed mapping 2024-09-09 18:32:25 +02:00
Pablo Martín
2733adfd31 Merged PR 2774: Inline CTEs on int_core__mtd_booking_metrics
# Description

This PR is a pure refactor (as in, doesn't change the output of the model at all).

The only purpose of the changes in this PR is to improve the performance on the model. The strategy to achieve this has been to inline the basic CTEs of the model (inline=replace references to the CTE with direct `ref` inside the model).

This works because it breaks an optimization fence.

# 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: #20835
2024-09-09 12:55:24 +00:00
Pablo Martin
afaceefe88 comment a bit more 2024-09-09 12:31:34 +02:00
Pablo Martin
c22a840084 inline the CTEs of the model 2024-09-09 12:05:44 +02:00
uri
f18a2eb520 First version of name unification for a deal 2024-09-06 17:08:50 +02:00
Joaquin Ossa
1e89966153 Merged PR 2756: guesty_verifications model
# Description

I added verification status to be able to show the amount of bookings that have been approved vs not approved (rejected, flagged, or missing info)

# 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: #20125
2024-09-05 15:32:43 +00:00
Joaquin Ossa
7036b24847 guesty_verifications model 2024-09-05 17:21:48 +02:00
Pablo Martin
01c9c0d8ad remove distincts from booking counts 2024-09-05 15:17:45 +02:00
Joaquin Ossa
920f6f7e51 Changed model for bookings with 0 nights 2024-09-05 13:56:07 +02:00