Commit graph

140 commits

Author SHA1 Message Date
Joaquin
a543fa1d83 changed names 2025-06-10 14:20:28 +02:00
Joaquin
e85de15d22 data alert fix 2025-06-10 13:58:50 +02:00
Oriol Roqué Paniagua
dc0abe6098 Merged PR 5403: Removes test accounts
# Description

This PR directly removes test accounts, and not just flag them, from:
* `int_core__unified_user`, which means is also propagated to `int_core__user_host`.

It does so by creating a new, extremely simple model named: `int_core__user_test_account`

Then, `int_core__user_host` is inner joined with a small explanation comment on:
* `int_core__accommodation`
* `int_core__unique_accommodation_to_user`
* `int_core__bookings`
* `int_core__verification_requests`
* `int_core__payments`

Effectively removing test accounts.

Lastly, any existence and usage of the column `is_test_account` has been removed -> mostly on New Dash-related models.

# Checklist

**As discussed in the daily, I'll be playing around in prod with this PR**

- [ ] 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: #27319
2025-06-06 12:17:49 +00:00
Pablo Martin
8b8b8441d3 Merged PR 5365: New version of CIH users through activity
# Description

This PR adds a new version to `int_core__check_in_cover_users`. The new version respectes the public interface of V1, but changes the strategy to determine which users get included in the list. Instead of relying on their account configuration (v1), v2 simply looks at whether they had any VR created offering CIH in the past 30 days.

This approach changes the semantic of the model, but we deem the new one reasonable.

The motivation behind this change is to ensure this models (1) keeps working after the activation of the Guest Products FF and (2) stays simple. Trying to follow a strategy where we look at both old and new configs was deemed very complex and didn't add much value.

# 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: #30165
2025-06-04 08:55:55 +00:00
Pablo Martin
a401153472 be more precise 2025-06-04 10:54:27 +02:00
Pablo Martin
92b144d78e Merged PR 5357: Adapt vr_check_in_cover model for Guest Products
# Description

This PR prepares the existing `int_core__vr_check_in_cover` model for the activation of the Guest Products feature flag.

It creates a second logic path which identifies VRs that have CIH in them ~~through product bundles~~ through looking at `stg_core__verification_request_to_guest_product `, and unions it with the old stuff.

The new CTE only gets called after the FF gets activated. This is defined in a var that we will need to adjust depending on when do we really activate the FF.

Note that these items are still pending:
- update the var to the right value once Lawrence pulls the trigger.
- clarify what the hell happens with CIH being "pushed" or not to ALL old dash hosts. This PR currently assumes this will NOT happen. If it will happen, we will need to change things.

# 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: #30165
2025-06-02 14:22:58 +00:00
Pablo Martin
1a35839deb new version and docs 2025-06-02 16:02:33 +02:00
Pablo Martin
c6a06b49e9 mention double logic in docs 2025-05-30 15:50:30 +02:00
Oriol Roqué Paniagua
d33e5ff2b2 Merged PR 5353: Switch int_core__booking_summary to int_booking_summary
# Description

This PR does the following:
* Moves `core/int_core__booking_summary` to `cross/int_core__booking_summary`
* Renames the model `cross/int_core__booking_summary` to `cross/int_booking_summary`
* Same for schema entry. In the new schema, I just added in the description how to retrieve exclusively New Dash Bookings for usability purposes.

Then, it adapts any dependency on `int_core__booking_summary` to `int_booking_summary`

No additional changes - inclusion of Resolution Incidents data will come later in a different PR.

# 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: #30676
2025-05-30 12:51:10 +00:00
Pablo Martin
f20d7a49ab deprecate old version 2025-05-20 17:46:02 +02:00
Pablo Martin
cf2d7251db add version metadata in schema file 2025-05-19 15:51:59 +02:00
Oriol Roqué Paniagua
5455bd2c01 Merged PR 5242: Adds new model in intermediate for new dash deal onboarding
# Description

Adds new model in intermediate for new dash deal onboarding.
Adds additional fields in new dash tables for services completion at program level.

# 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: #30249
2025-05-16 17:09:30 +00:00
Oriol Roqué Paniagua
ca3fc4add9 Merged PR 5234: Remove 2 fields that no longer exist
# Description

Removes 2 fields that no longer exist in the backend. Needed to do since I need to bring another table to sync_core.

No PBI dependencies found.

Fields are:
* flag_as_problem in SH User
* autonavigate in VerificationSet

# Checklist

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

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

Related work items: #30229
2025-05-16 10:06:08 +00:00
Oriol Roqué Paniagua
ae9bb524b7 Merged PR 5214: Integrates Guest Product new flow Payments
# Description

Integrates Guest Product Payments coming from the new flow of Guest Products.

This also removes few fields that will not be used or that do not make sense for GP specifically.

# 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: #30110
2025-05-15 07:00:11 +00:00
Oriol Roqué Paniagua
d5dd6df1c1 Merged PR 5201: Eliminates Verification Payments v2 + updates exposures
# Description

Eliminates Verification Payments v2 + updates exposures

# Checklist

- [X] Project compiles

Related work items: #30024
2025-05-13 14:48:34 +00:00
Oriol Roqué Paniagua
4cac5aefa5 Merged PR 5191: Guest Journey Payments to reporting
# Description

Guest Journey Payments to reporting. This aims to substitute core__verification_payments_v2, which is in use in the report of Guest Payments within Business Overview.

In order to avoid re-doing PBI work, I already set  id_guest_product_payment as text for future usage. Similarly, superhog fees are called truvi fees.

# 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: #30024
2025-05-13 07:40:53 +00:00
Oriol Roqué Paniagua
3badc02c9f Merged PR 5187: Switch models that use int_core__verification_payments
# Description

Switches all models that still use int_core__verification_payments, except for the equivalent in reporting that needs a parallel GJ Payments to do a proper refactor.

# 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: #30024
2025-05-12 15:58:53 +00:00
Oriol Roqué Paniagua
b1faa83156 Merged PR 5182: First version of Guest Journey Payments
# Description

Creates a first version of Guest Journey Payments. This model intends to replace int_core__verification_payments, and equivalent audit succeeds.

Additional changes:
* Removed decimal conversion in source models. In the GJ Payment model I avoid doing any currency conversion (thus one less join); however we need to have all decimals to exactly replicate the same computation. Peanuts, but still.
* Tagged as deprecated: int_core__verification_payments
* Added additional fields for reference in terms of IDs and specifically a handy is_status_paid for future joins.
* Added more robust test coverage and enhanced descriptions of fields.

# 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: #30024
2025-05-12 09:25:54 +00:00
Oriol Roqué Paniagua
77c3a02466 Merged PR 5173: First version of Verification Product Payments
# Description

New model for Verification Product Payments (Waiver, Deposit, Fee + not assigned set as Unknown).
This includes:
* Similar upper case and coalesce for payment status and verification product name
* Rename of paway_minimum_commission_local_curr as it was not clear (this needs to be handled separately)
* Waiver payaway stuff
* No tax handling

Audit passed with following considerations:

```
-- THIS GOES INTO AN AUDIT FILE
{% set old_query %}
  select
    *
  from dwh_hybrid.intermediate.int_core__verification_product_payments
{% endset %}

{% set new_query %}
  select
    id_verification_to_payment,
    id_payment,
    is_refundable,
    created_at_utc,
    updated_at_utc,
    payment_due_at_utc,
    payment_due_date_utc,
    payment_paid_at_utc,
    payment_paid_date_utc,
    payment_reference,
    refund_due_at_utc,
    refund_due_date_utc,
    payment_refunded_at_utc,
    payment_refunded_date_utc,
    refund_payment_reference,
    id_user_host,
    id_guest_user as id_user_guest,
    id_verification,
    id_verification_request,
    coalesce(
        upper(verification_payment_type), 'UNKNOWN'
    ) as verification_product_name,
    currency,
    total_amount_in_txn_currency,
    total_amount_in_gbp,
    is_host_taking_waiver_risk,
    payaway_percentage,
    payaway_minimum_commission_local_curr as payaway_minimum_commission_in_txn_currency,
    amount_due_to_host_in_txn_currency,
    amount_due_to_host_in_gbp,
    superhog_fee_in_txn_currency,
    superhog_fee_in_gbp,
    coalesce(upper(payment_status),'UNKNOWN') as payment_status,
    notes
  from dwh_hybrid.intermediate.int_core__verification_payments_v2
  where (verification_payment_type != 'CheckInCover' or verification_payment_type is null)
{% endset %}

{{
    audit_helper.compare_and_classify_query_results(
        old_query,
        new_query,
        primary_key_columns=["id_verification_to_payment"],
        columns=[
            "id_verification_to_payment",
            "id_payment",
            "is_refundable",
            "created_at_utc",
            "updated_at_utc",
            "payment_due_at_utc",
            "payment_due_date_utc",
            "payment_paid_at_utc",
            "payment_paid_date_utc",
            "payment_reference",
            "refund_due_at_utc",
            "refund_due_date_utc",
            "payment_refunded_at_utc",
            "payment_refunded_date_utc",
            "refund_payment_reference",
            "id_user_host",
            "id_user_guest",
            "id_verification",
            "id_verification_request",
            "verification_product_name",
            "currency",
            "total_amount_in_txn_currency",
            "total_amount_in_gbp",
            "is_host_taking_waiver_risk",
            "payaway_percentage",
            "payaway_minimum_commission_in_txn_currency",
            "amount_due_to_host_in_txn_currency",
            "amount_due_to_host_in_gbp",
            "superhog_fee_in_txn_currency",
        ...
2025-05-09 11:27:00 +00:00
Oriol Roqué Paniagua
ac73138cf1 Merged PR 5171: First version of Guest Product Payments
# Description

First model for Guest Product Payments. It only contains CIH from Verification Payments (so, the "old" CIH).

Some notes:
* It does not handle taxes computation.
* It converts guest product name to upper case, as the guest product tables are in upper case. I also apply it for payment status, as well as an UNKNOWN status for whenever it's null - we'd need to consider this for the rest of the refactor.
* Computation is placed within a CTE. This is intended since at some point this will include also Guest Product Payments that come from Guest Product related tables.
* Enhanced documentation with respect to Verification Payments V2.

Audit performed:

```
-- THIS GOES INTO AN AUDIT FILE
{% set old_query %}
  select
    *
  from dwh_hybrid.intermediate.int_core__guest_product_payments
{% endset %}

{% set new_query %}
  select
    id_verification_to_payment,
    id_payment,
    is_refundable,
    created_at_utc,
    updated_at_utc,
    payment_due_at_utc,
    payment_due_date_utc,
    payment_paid_at_utc,
    payment_paid_date_utc,
    payment_reference,
    refund_due_at_utc,
    refund_due_date_utc,
    payment_refunded_at_utc,
    payment_refunded_date_utc,
    refund_payment_reference,
    id_user_host,
    id_guest_user as id_user_guest,
    id_verification,
    id_verification_request,
    upper(verification_payment_type) as guest_product_name,
    currency,
    total_amount_in_txn_currency,
    total_amount_in_gbp,
    coalesce(upper(payment_status),'UNKNOWN') as payment_status,
    notes
  from dwh_hybrid.intermediate.int_core__verification_payments_v2
  where verification_payment_type = 'CheckInCover'
{% endset %}

{{
    audit_helper.compare_and_classify_query_results(
        old_query,
        new_query,
        primary_key_columns=["id_verification_to_payment"],
        columns=[
            "id_verification_to_payment",
            "id_payment",
            "is_refundable",
            "created_at_utc",
            "updated_at_utc",
            "payment_due_at_utc",
            "payment_due_date_utc",
            "payment_paid_at_utc",
            "payment_paid_date_utc",
            "payment_reference",
            "refund_due_at_utc",
            "refund_due_date_utc",
            "payment_refunded_at_utc",
            "payment_refunded_date_utc",
            "refund_payment_reference",
            "id_user_host",
            "id_user_guest",
            "id_verification",
            "id_verification_request",
            "guest_product_name",
            "currency",
            "total_amount_in_txn_currency",
            "total_amount_in_gbp",
            "payment_status",
            "notes",
        ],
        sample_limit=10000000,
    )
}}
```

# 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 ...
2025-05-09 10:13:58 +00:00
Joaquin
ce4e81749b upgraded screening 2025-04-08 12:09:08 +02:00
Joaquin
2637d68398 Addressed comments 2025-04-03 16:23:58 +02:00
Joaquin
82829db3d2 Update to listing count in new dash overview 2025-04-03 16:00:43 +02:00
Joaquin
b4a4925bc1 removed test of not_null 2025-03-31 12:10:26 +02:00
Joaquin
3833f3e92d Added current deal lifecycle to new dash overview 2025-03-27 17:56:36 +01:00
Joaquin
90581ea142 Addressed comments 2025-03-25 17:29:55 +01:00
Joaquin
20a8958679 Commit wip 2025-03-25 17:11:02 +01:00
Joaquin
2c5301c158 commit wip 2025-03-25 12:26:11 +01:00
Joaquin
721f3e4e9e Addressed comments 2025-03-25 12:26:11 +01:00
Joaquin
1ebd1c5ccb Created new kpi daily model for new dash users 2025-03-25 12:26:11 +01:00
Joaquin
c0a1e90fae Improved New Dash Services usage 2025-03-25 12:26:11 +01:00
uri
74a76fe8fc Removes configuration status and adds config id for further joins 2025-03-18 09:20:31 +01:00
uri
91e7fe09b1 Adds end date 2025-03-18 09:09:59 +01:00
uri
cba4b97082 Adds a master table for guest products price plans 2025-03-17 16:35:50 +01:00
Oriol Roqué Paniagua
918ed969d8 Merged PR 4699: Creates a master table for guest products
# Description

Creates a master table for guest products in intermediate. It just gathers information on the name and the latest display name, as well as a couple of additional time fields.

I opted for "latest" rather than "current" because technically Guest Products can be enabled and disabled, and I believe current name would be weird if the product is disabled. Anyway. Next step will be actually creating a master table on guest product configuration, that will handle this disable logic and so on.

# 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: #28513
2025-03-14 13:04:46 +00:00
Oriol Roqué Paniagua
bf1e125856 Merged PR 4687: Bugfix - Removal of SH fields that no longer exist
# Description

After the sync this morning in Core in Airbyte, we have some issues in SH User. This attempts to remove no longer existing fields, namely:
- id_airbnb
- airbnb_url
- platform_comms_recipient

# 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: #28502
2025-03-13 12:25:13 +00:00
Joaquin Ossa
2bc8e6c0c3 Updated test 2025-02-28 09:49:31 +01:00
Joaquin Ossa
1697bef090 timestamps 2025-02-25 15:14:54 +01:00
Joaquin Ossa
4a6158df28 Added timestamp to a/b test model 2025-02-25 14:48:37 +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
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
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
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