Commit graph

295 commits

Author SHA1 Message Date
Joaquin Ossa
05adc07674 commit wip 2025-02-21 17:44:00 +01:00
Joaquin Ossa
1b853a9503 commit wip (id_incident duplicates have to check) 2025-02-21 16:40:53 +01:00
Joaquin Ossa
725f2a54c3 Staging model for resolution incidents 2025-02-21 15:25:24 +01:00
Oriol Roqué Paniagua
a3793121af Merged PR 4423: Logic for Billable Bookings in New Dash Bookings
# Description

Changes:
* Tags services to be billed (invoiced to host) in the staging models of product_service and protection_plan
* Propagates into booking_service_detail master table. This also computes billable dates.
* Propagates into booking_summary master table. This has the final determination of a booking being billable or not, and when the first and last billing should occur.

# 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:01:44 +00:00
Pablo Martin
c3c628aec4 change "tests:" to "data_tests:" 2025-01-13 16:00:35 +01:00
Oriol Roqué Paniagua
33d4f18165 Merged PR 4034: BUGFIX: Ensure id_role are lower case
# Description

Ensures `id_role` are lower case. This should avoid issues downstream in dbt tests.

# 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: #26110
2025-01-13 11:27:29 +00:00
Oriol Roqué Paniagua
d26e08bffd Merged PR 3909: Fixes created_date_utc and updated_date_utc in SH User and its dependencies
# Description

The model `stg_core__superhog_user` contained the fields `created_date_utc` and `updated_date_utc`, which were actually timestamps, not dates. This created issues a while ago in KPIs that were fixed by forcing a date conversion at `int_kpis` level, but the source issue remained unfixed.

This PR just creates the proper fields in staging, meaning:
* `created_at_utc` and `created_date_utc`
* `updated_at_utc` and `updated_date_utc`

And propagates the changes through all dependencies. On KPIs, it also removes the hardcoded date conversion since it's no longer needed. It also adds the different schema entries on which these fields were already defined. Note I didn't update the staging entry since there's no entry for the rest of the fields.

I recommend checking this PR in the commits order.

What I've tested:
* Unified User and User Host have plenty of dependencies that I've checked one by one, at each dependency layer by using dbt docs.
* Run `core__unified_user` and the full execution of +`mtd_aggregated_metrics`

What clearly will fail:
* There's the famous `Users_dashboard` PBI report that shouldn't exist that has a dependency with `core__unified_user`. This report will fail. But it does not exist. I'd like to drop it once and forever

# Checklist

- [X] The edited models and dependants run properly with production data. **See above**
- [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

- [X] Check if a full-refresh is required after this PR is merged. **The staging model is incremental!**

Related work items: #23703
2024-12-31 08:04:03 +00:00
Joaquin Ossa
19d883ccd7 Simplify PR 2024-12-20 14:04:42 +01:00
Oriol Roqué Paniagua
7b28bbb925 Merged PR 3875: Propagates AccountType to staging
# Description

Propagates `AccountType` to staging by creating the first version of the model `stg_core__account_type`

# 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: #18944
2024-12-19 14:23:47 +00:00
Joaquin Ossa
6fd9c16e59 Merged PR 3872: Staging model for all screen & protect price tables
# Description

Staging model for all screen & protect price tables.
There are 4 types of protections for screen & protect and each of them have their own prices

# 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.
- [ ] I've picked the right materialization for the affected models.

# Other

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

Staging model for all screen & protect price tables

Related work items: #25360
2024-12-19 10:24:10 +00:00
Joaquin Ossa
2a87e4860c Added _in_local_currency to fees namings 2024-12-19 11:13:53 +01:00
Joaquin Ossa
5a92337b43 Clarification of long stay 2024-12-18 14:52:46 +01:00
Joaquin Ossa
463226a44b Staging model for all screen & protect price tables 2024-12-18 14:48:36 +01:00
Joaquin Ossa
c95f551acf s&p update models 2024-12-17 19:09:54 +01:00
Joaquin Ossa
34a5b0d86e Adding missing field in S&P models 2024-12-11 16:35:40 +01:00
Oriol Roqué Paniagua
c0e6ec2de8 Merged PR 3825: Removing Booking fields soon to be dropped
# Description

Following a communication from Gus, the following fields in Booking table are going to be removed:
* StagingHostBookingId
* AdditionalGuests

This PR aims to remove DWH dependencies.

# 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

- [X] Check if a full-refresh is required after this PR is merged. **Yes, Booking table in staging is incremental**

Related work items: #25405
2024-12-11 13:06:28 +00:00
Joaquin Ossa
ae80c6eb7f fixed id_apim_user description 2024-12-11 12:18:33 +01:00
Joaquin Ossa
0c9c284e3c Apim User staging models 2024-12-11 12:05:01 +01:00
Joaquin Ossa
baa437708f fixed name 2024-12-11 10:47:33 +01:00
Joaquin Ossa
b17e865162 local currency 2024-12-10 17:12:14 +01:00
Joaquin Ossa
92dd5b0960 Updated currency description 2024-12-10 15:53:22 +01:00
Joaquin Ossa
902e474148 staging model check in hero 2024-12-10 12:03:34 +01:00
uri
0c82a9592d Remove accepted values test from service status in stg_core__booking_view_to_service 2024-12-04 16:49:07 +01:00
Joaquin Ossa
1f683ec651 Final clarifications 2024-12-04 16:33:50 +01:00
Joaquin Ossa
2a19f1d19a Added ProtectionType 2024-12-04 14:36:49 +01:00
Joaquin Ossa
fba05c5dd3 Merged PR 3763: Staging model for S&P
# Description

Staging model for S&P
What do you think of the name of both the folder and model, I would prefer to leave it as `screen&protect` instead of `screen_and_protect` what do you think??

# 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.
- [ ] I've picked the right materialization for the affected models.

# Other

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

Staging model for S&P

Related work items: #25209
2024-12-04 09:59:51 +00:00
Joaquin Ossa
588e94ed7c Upper cased 2024-12-04 10:59:13 +01:00
Oriol Roqué Paniagua
896526fe15 Merged PR 3761: Remove no longer existing fields from Accommodation
# Description

This PR aims to properly fix the Accommodation removal of fields that have been dropped today.

# 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: #25199
2024-12-03 16:39:05 +00:00
Joaquin Ossa
d5f0db71fd Staging model for S&P 2024-12-03 17:29:37 +01:00
Oriol Roqué Paniagua
e8f7278032 Merged PR 3756: First version of verification request feature flag
# Description

Brings VerificationRequestFeatureFlag to staging. Needs further modelling to clean data for A/B test tracking purposes, but this will be done in intermediate.

# 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: #25145
2024-12-03 16:01:23 +00:00
Oriol Roqué Paniagua
62e1b6ea3b Merged PR 3752: Adds new PROTECTED accepted value for new pricing services
# Description

Adds Protected accepted value - linked to new services after New Dash v3 launch

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

Adds new PROTECTED accepted value for new pricing services
2024-12-03 13:36:24 +00:00
Oriol Roqué Paniagua
c5b7d919c5 Merged PR 3743: Hotfix for staging core accommodation
# Description

Fixes dbt execution after 2 fields in use were dropped in the backend.

# 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: #25196
2024-12-03 11:26:52 +00:00
Pablo Martin
f460a47833 remove fields from stg 2024-11-27 14:46:41 +01:00
Oriol Roqué Paniagua
aa3261cf9d Merged PR 3632: Brings Billing tables into Staging
# Description

Aims to bring the 2 new billing tables in the scope of New Pricing into DWH.
These correspond to a Product Service table and a Protection Plan table.

Further modelling is expected in intermediate. Main goal would be to enrich the tables of `int_core__booking_service_detail` and `int_core__booking_summary`

# 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-11-22 08:34:58 +00:00
Oriol Roqué Paniagua
f1359bf696 Merged PR 3578: First version of int_core__booking_service_detail
# Description

Minor Changes:
* Computation in staging of `is_default_service` column for Basic Screening. This includes `stg_core__product_service`, `stg_core__protection_plan` and the schema entry.
* Propagation of `is_default_service` to intermediate. This includes `int_core__protection_plan_to_price`, `int_core__product_service_to_price` and the schema entry.
* Adapting a small data test to include a new case in `stg_core__booking_view_to_service` schema entry.

Main Changes:
* New fields and re-order existing ones on `int_core__booking_to_service`.
* Changed materialisation of `int_core__booking_to_service` to a view, since the new model `int_core__booking_service_detail` is materialised as table.

New Model:
* First version of `int_core__booking_service_detail`. This model includes the current state of a Service that is applied within a Booking. It includes many Booking attributes, Service attributes as well as some meta data fields regarding the business scope and type, according to the [New Pricing](https://www.notion.so/knowyourguest-superhog/All-Services-Definitions-333fba1fbed54715b6b1c3b5133f0d4f) documentation.
* This is one of the 3 Booking models that I propose to create for New Pricing. You can read about the others [here](https://www.notion.so/knowyourguest-superhog/Services-and-Revenue-modelling-1420446ff9c980118e0cfffa7c41f369), although I'll probably won't do them until New Dash is finalised on tech side.
* This current model should suffice to be able to understand which services are applied within a Booking. Notably you will see that this is not enough to compute revenue, as there's some placeholders in place. This is expected.

# 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-11-19 08:24:32 +00:00
Oriol Roqué Paniagua
c209e670ca Merged PR 3539: Normalise service names and create booking to service table
# Description

Goal of the PR is start modelising the Services and Revenue for New Dash/New Pricing. Be aware that this is a first model and it's not by all means the definitive nor complete version.

Changes:
* Services name normalisation: It's a bit painful because we usually had two names: 'MyService' and 'My Service'. The initial setup I built was considering the first, but in some new integrated tables it only has the second. So I just standardised everything to be in upper case and with spaces such as 'MY SERVICE'. Might make more sense later on. This affects many existing models.
* Compute a new Service Business Type field in `stg_core__product_service`: Main reason is that effectively Platform scope in New Pricing have business differences in the services types but this does not exist in the backend. I do it at staging level with a dedicated accepted values test to ensure any new update is captured and notified. You can read more about the business logic in this [Notion page](https://www.notion.so/knowyourguest-superhog/All-Services-Definitions-333fba1fbed54715b6b1c3b5133f0d4f).
* Create a new model `int_core__booking_to_service`: this model joins the information of BookingViewToService with BookingView and Booking tables to retrieve a more consolidated version of what we will needed downstream for the future table of Booking Service Detail and the Aggregated version (not included in this PR). This table likely can be enriched in future PRs. At the moment it just contains the bare minimum fields needed for the lines/aggregated versions. (NB: Booking information is needed, for instance, for the services which unit price need to be applied for the number of nights of the booking)

# 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

- [X] Check if a full-refresh is required after this PR is merged. **stg_core__booking_view_to_service needs full refresh**

Related work items: #20809
2024-11-15 10:04:02 +00:00
Oriol Roqué Paniagua
321f48ca7d Merged PR 3506: Remove Address Validation
# Description

Removes Address Validation within DWH.
Note that I keep the 2 reporting fields, nullified. These should be removed after the removal of these fields in PBI.

# 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: #23976
2024-11-14 11:59:36 +00:00
Oriol Roqué Paniagua
cce5d2b9d6 Merged PR 3490: Removal of other_sharing_platform_url
# Description

Removes other_sharing_platform_url field that will disappear from the backend in the release going out next week.

Apparently there's a dependency with a PBI report that uses core__unified_user table, so I just nullified the reporting field. The report is called users_dashboard, which AFAIK is not published anywhere. I wonder if this is one of the it-should-not-exist report. Waiting for tomorrow confirmation with Pablo.

Important note: Since this removes fields from staging, which is incremental, we need to trigger a full-refresh for this table. Otherwise execution will fail.

# 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

- [X] Check if a full-refresh is required after this PR is merged. **Yes, please refer to my previous comment.**

Related work items: #23974
2024-11-13 09:23:42 +00:00
Oriol Roqué Paniagua
c21040fa30 Merged PR 3523: First version of BookingView and BookingViewToService integration
# Description

Modelises 2 new tables into staging:
* BookingView
* BookingViewToService

Ideally, we need the contents of BookingToService. This does not exist, so we will need to modelise it in intermediate. Current relationship is that 1) we know services applied to a booking view id (BookingViewToService ) 2) we know booking view id how it relates to booking (BookingView) 3) we can retrieve booking info as usual (Booking, etc)

# 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: #23996
2024-11-13 09:23:20 +00:00
Oriol Roqué Paniagua
3faf03c139 Merged PR 3207: Cast as dates and timestamps for hubspot deals in staging
# Description

Changes data type of dates and timestamps of relevant fields in stg_hubspot__deals

# 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.
- [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: #22689
2024-10-16 14:57:36 +00:00
Pablo Martin
bd7a54050f split edeposit source 2024-10-16 14:20:24 +02:00
Pablo Martin
c0e411ee12 remove duplicate deals entry 2024-10-15 18:03:31 +02:00
Pablo Martin
d9a90d7d24 partial schema. Not doing more because deals is a monster 2024-10-15 15:41:20 +02:00
Pablo Martin
e5b18f2ce7 rename col 2024-10-15 14:37:10 +02:00
Pablo Martin
7e9248aa6e added properties 2024-10-15 14:37:10 +02:00
Pablo Martin
ee0d60382d more schemas 2024-10-14 11:55:44 +02:00
Pablo Martin
5c64bf8b20 schema and final touches for deal pipeline 2024-10-14 11:47:44 +02:00
Pablo Martin
b9958129bc stages model 2024-10-14 11:37:42 +02:00
Pablo Martin
c0718daaa9 deal pipeline 2024-10-14 11:10:07 +02:00
Pablo Martin
ba29afa3bd docs for athena staging 2024-10-08 14:41:17 +02:00