Commit graph

358 commits

Author SHA1 Message Date
Oriol Roqué Paniagua
fe93f594f5 Merged PR 2084: Adding int_core__accommodation
Adding int_core__accommodation

Includes both:
- Main information of the accommodation, mostly coming from stg_core__accommodation and int_core__country.
- Listing lifecycle computation, based on the created bookings from stg_core__bookings. It's just the current state, no history.

Some considerations:
- I opted to use stg_core__bookings and not int_core__bookings. Main reason is in case at some point we want to add listing-based information to the booking table, it would avoid cyclic references.
- I opted to keep all the logic of 1) accommodation info and 2) lifecycle in the same model. This could be easily split into: lifecycle first that reads uniquely from staging and then the int_core__accommodation that could read from the staging version to retrieve accommodation attributes + the lifecycle one. Up to you

I'd suggest to review first the documentation in schema since it explains the logic applied.

Notion page linked to this task: https://www.notion.so/knowyourguest-superhog/Listing-lifecycle-4dc0311b21ca44f8859969e419872ebd

Related work items: #17312
2024-06-20 16:02:16 +00:00
Pablo Martín
80120e68a2 Merged PR 2087: Add Xero Bank Transactions to staging
- Main purpose is to bring the Bank Transactions table from sync to stg.

- Along the way:
  - I created a couple of new generic tests.
  - I reviewed docs and tests for a couple of other Xero models that were not in the best shape.

Related work items: #17551
2024-06-20 14:42:03 +00:00
Pablo Martin
696490aecb docs for bank transactions table 2024-06-20 15:52:55 +02:00
Pablo Martin
26e7358648 credit notes docs 2024-06-20 15:26:33 +02:00
Pablo Martin
e1a4faf3b9 more contact tests 2024-06-20 15:15:19 +02:00
Pablo Martin
8f14f5d37d add length between test 2024-06-20 15:13:21 +02:00
Pablo Martin
7aa667f7cf boy scout: tests for invoices 2024-06-20 15:00:59 +02:00
Pablo Martin
34b678df26 new not_negative test 2024-06-20 14:43:51 +02:00
Pablo Martin
c671701071 boy scout: contact tests 2024-06-20 14:37:55 +02:00
Pablo Martin
79d69a9286 staging model 2024-06-20 14:31:12 +02:00
Pablo Martin
cd9c797f02 add source 2024-06-20 14:12:30 +02:00
Pablo Martin
05f35fcb69 add value to test 2024-06-19 18:25:49 +02:00
Pablo Martín
5bea450428 Merged PR 2083: Add values to Stripe tests
There's a couple of broken tests for Stripe data in production for some `accepted_values` one, but it's just because our test is too strict and doesn't really account for all values.

This PR fixes plus drops a small comment on the funky sources table which won't hurt for future modelers.
2024-06-19 16:23:49 +00:00
Pablo Martin
6ad203b92f add some comments 2024-06-19 18:18:38 +02:00
Oriol Roqué Paniagua
839e5fae1b Merged PR 2077: Adding Country to intermediate
Adding Country to intermediate, both model + documentation.

At this stage, the model is set as a view but we can discuss what is the best approach

Related work items: #17312
2024-06-19 15:34:15 +00:00
Joaquin Ossa
4a80625eeb Merged PR 2064: Created currency exchange tables
Created currency exchange tables in general for new dashboard

Related work items: #17323
2024-06-19 10:01:20 +00:00
Joaquin Ossa
31feff162a Fixed names of tables 2024-06-19 11:59:45 +02:00
Joaquin Ossa
f64b17a223 Created currency exchange tables 2024-06-19 11:52:28 +02:00
Oriol Roqué Paniagua
fb86850ffe Merged PR 2074: Adding country to staging
Adding country to staging

Related work items: #17312
2024-06-19 08:40:08 +00:00
Oriol Roqué Paniagua
771b226888 Merged PR 2068: Adding cancelled bookings metric
Adding cancelled bookings metric based on the feedback of the tech team. Mainly, the date of a cancelled booking can be considered as the `updated_date_utc` for those bookings with status cancelled, as it's a terminal state and no additional steps should follow.

I also took the opportunity to update:
- The order on the `int_core__mtd_aggregated_metrics`, so it matches the one in the Notion page for the 1st batch, freeing already the space for the order_by numbers for missing metrics
- Make acronyms of alias in the `main_kpi` subquery in `int_core__mtd_booking_metrics` slightly more clear
- Remove empty line at the end of the file in `int_core__mtd_booking_metrics`

Keep in mind that the cancelled bookings metric will be directly available in the dashboard once this PR is approved and DWH re-runs.

Related work items: #17310
2024-06-18 14:58:55 +00:00
Pablo Martín
06fc35e58d Merged PR 2063: Part 2 of the previous PR
Adds tests and also places an upper on a field in staging for funky reasons
2024-06-18 11:41:55 +00:00
Pablo Martin
344419e660 formatting 2024-06-18 13:41:32 +02:00
Pablo Martin
3d3f3fb9ab fix docs 2024-06-18 13:40:36 +02:00
Pablo Martin
27759374b8 add docs and tests 2024-06-18 13:10:47 +02:00
Pablo Martin
c051831d6d upper in payments 2024-06-18 13:09:45 +02:00
Pablo Martín
361b1b6a7f Merged PR 2061: Deprecate hardcoded rates
This PR replaces the old hardcoded rates with the new ones from xe.com in the only model that used them.

Related work items: #17493
2024-06-18 10:34:32 +00:00
Pablo Martin
662c7b8ba8 remove hardcoded rates and seed, remove docs 2024-06-18 11:35:07 +02:00
Pablo Martin
8b91babad6 remove old table from cte 2024-06-18 11:31:59 +02:00
Pablo Martin
1f9df9ea5c remove old table 2024-06-18 11:24:03 +02:00
Pablo Martin
d96c8b2abb change which field we join on: payment date is not always informed 2024-06-18 11:23:10 +02:00
Pablo Martin
6f625ec7db do both rates to compare and test 2024-06-18 11:13:51 +02:00
Pablo Martin
e3be2708ad add new rates to CTEs 2024-06-18 11:06:27 +02:00
Oriol Roqué Paniagua
4958976733 Merged PR 2053: Added number_format category in mtd_aggregated_metrics
Added number_format category in mtd_aggregated_metrics

Related work items: #17458
2024-06-17 14:59:01 +00:00
Pablo Martín
a686c16978 Merged PR 2041: Fix Backward Currency Projection Bug
The CTEs that project currency rates backwards have a few mistakes that introduce additional dates in the period where we do have actual, factual rates. This PR fixes the errors that cause this.
2024-06-17 13:42:52 +00:00
Oriol Roqué Paniagua
484060df47 Merged PR 2046: Guest Journey KPIs
Implements the following metrics:
- Guest Journey Created
- Guest Journey Started
- Guest Journey Completed
- Guest Journey Start Rate
- Guest Journey Completion Rate
- Guest Journey Incompletion Rate

A new model, namely int_core__mtd_guest_journey_metrics have been created, that mainly reads from int_core__verification_requests and the estimated start and complete dates logic.

Metrics are integrated into the already existing mtd_aggregated_metrics. Small changes here to allow multi-source via macro.

Finally, increased documentation regarding the aggregated model and added a exposure for the main_kpis dashboard.

I also took the opportunity to include the git ignore of the new package integrated in the previous PR.

To keep in mind: no change on the dashboard applies, the metrics should appear automatically at the moment this PR is merged & production is updated with the changes

Related work items: #17311
2024-06-17 13:13:03 +00:00
uri
c8807ddf60 Adding exposure of main kpis dashboard 2024-06-17 14:04:51 +02:00
Pablo Martin
0606f2c93d go back to var, made a mistake in the last commit 2024-06-17 11:32:20 +02:00
uri
cc930c5202 Extra documentation in the int_core__mtd_aggregated_metrics model 2024-06-17 11:32:13 +02:00
Pablo Martin
1203d0921b use proper table, proper col, and remove off by one error 2024-06-17 11:31:54 +02:00
Pablo Martin
a8892e7d5d this max should have been an int 2024-06-17 11:27:44 +02:00
uri
17f2e92ddc Adding guest journey KPIs. Updating gitignore 2024-06-17 11:10:13 +02:00
Pablo Martín
f900ca794f Merged PR 2039: Simple rates
- Creates a simplified rates model that hides some of the complexities of the full blown exchange rates model.

Related work items: #17212
2024-06-14 15:33:01 +00:00
Pablo Martin
4c68df570f tests 2024-06-14 16:46:28 +02:00
Pablo Martin
913c07dad6 docs 2024-06-14 16:44:48 +02:00
Pablo Martin
84cd5ed7d0 simple model 2024-06-14 16:44:40 +02:00
Pablo Martin
fe304442a1 add dbt utils to deps 2024-06-14 16:39:07 +02:00
Pablo Martín
670cf9f30f Merged PR 2036: Create int rates table
- Creates an intermediate rates table that both uses real rates from xe.com and also make some assumptions about future and past dates.
- Also took the chance to place all orphan int models into a `cross` folder.

Related work items: #17212
2024-06-14 14:30:15 +00:00
Pablo Martin
41a7f7a510 replace hardcode with global var 2024-06-14 16:28:25 +02:00
Pablo Martin
bceb81ea18 more detail in docs 2024-06-14 16:26:18 +02:00
Pablo Martin
d4decdcd8b remove years into the future hardcode 2024-06-14 16:26:18 +02:00