Commit graph

1819 commits

Author SHA1 Message Date
Pablo Martin
7339cf4c87 change logic in new CTE to use new tables 2025-05-30 15:47:35 +02:00
Pablo Martin
58c1ae5b8f put var in proper format 2025-05-30 15:46:45 +02:00
Pablo Martin
f1883aaa7a second cte, then we union 2025-05-27 15:03:48 +02:00
Pablo Martin
34985f3de1 wrap final select in cte 2025-05-27 15:01:47 +02:00
Pablo Martin
420d93d9bf Merged PR 5329: Refactor model var to global var
# Description

Pulls up the date var in `int_core__guest_product_payments_v2` into the global project (will soon be used in other models).

The name was also changed to something more descriptive for the purpose it will follow in the global project.

# 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-05-27 12:55:47 +00:00
Pablo Martin
6a9787a85b change from model var to project var 2025-05-27 14:49:29 +02:00
Oriol Roqué Paniagua
06a4f679ea Merged PR 5322: First version of Stay Disrupt conversion funnel
# Description

First version of Stay Disrupt conversion funnel. It's a simple monthly compute of:
Active accounts -> Accounts that offered SD in GJ started in month -> Accounts that have had payments paid of SD in month
Total Guest Journeys Started -> GJ that offered SD in month-> Payments paid of SD in month

Some details:
* It also includes CIH, and data starts on 1st Jan 2025. This is to create report. This needs to be changed once the report is created.
* Note that Accounts that offered SD in GJ started in month and GJ that offered SD in month is equal to 0 as no data flows through the new flow. The rest has data.
* I consider all users, not only New Dash, knowing that I don't know if someone knows which users will have a certain Guest Product enabled.

Model is "agnostic" to the GP if we want, though the name still aims to be only for SD.

# 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. **View to start with**

# Other

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

Related work items: #30277
2025-05-27 09:41:49 +00:00
Oriol Roqué Paniagua
42af06c4dd Merged PR 5321: DRAFT: Switch calogica to metaplane
# Description

Draft to verify if prod compiles with just a switch in the package name.
2025-05-26 11:32:16 +00:00
uri
92fd8dba36 Switch calogica to metaplane 2025-05-26 11:48:02 +02:00
Oriol Roqué Paniagua
9f7f92912f Merged PR 5311: Adds Confident Stay Revenue as a Main KPIs and Account Performance metric
# Description

Creates a new metric: Confident Stay Revenue.

This includes:
* Setting the computation in `int_mtd_vs_previous_year_metrics`
* Configuring the metric behavior in `int_mtd_aggregated_metrics`. It follows the same as CIH.
* Adding the metric in the completion test. I didn't add it in the outlier test in purpose as any new value would trigger the outlier since there's no history to compare against.

Few notes:
* I confirm it displays no value, as the product has not been launched.
* Note that the inclusion of Confident Stay in Guest Revenue was already handled in the previous PR.

Next steps to complete the ticket:
* Add in the Data Glossary of Main KPIs the definition of Confident Stay Revenue
* Add in the Data Glossary of Account Performance the definition of Confident Stay Revenue

# 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.
- [N/A] I have checked for DRY opportunities with other models and docs.
- [N/A] 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: #30278
2025-05-26 09:22:15 +00:00
Oriol Roqué Paniagua
0e1741ad9d Merged PR 5285: Adds Stay Disrupt (Confident Stay) Fees in KPIs Guest Payments flow
# Description

Propagates Stay Disrupt Guest Product in KPIs flow, within Guest Payments. This is done by:
* Adding a new measure on `stay_disrupt_fees_in_gbp` in the daily model `int_kpis__metric_daily_guest_payments`
* Adding stay_disrupt_fees_in_gbp in the `total_guest_payments_in_gbp` measure in the daily model `int_kpis__metric_daily_guest_payments`

Afterwards this gets propagated downstream. No changes in the `total_guest_payments_in_gbp` measure in following models. However, a new measure for `stay_disrupt_fees_in_gbp` is created in the 4 Guest Payments related models of:
* `int_kpis__metric_monthly_guest_payments`
* `int_kpis__agg_monthly_guest_payments`
* `int_kpis__metric_mtd_guest_payments`
* `int_kpis__agg_mtd_guest_payments`

Note that this also affects the schema entry of KPIs for both description and completion tests, in the case of aggregation models.

Considering the almost non-existent usage of Guest KPIs report, I will not bother propagating Confident Stay in Product Guest KPIs, nor the report itself:

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

However, total Guest Revenue would include Confident Stay in Guest KPIs as well.

Next steps, in a separated PR:
* Propagation of new measure `stay_disrupt_fees_in_gbp` so it's available in Main KPIs.

# 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: #30278
2025-05-23 10:33:26 +00:00
Oriol Roqué Paniagua
14c099b6b2 Merged PR 5296: Drop Monthly Growth Score By Deal legacy models
# Description

Drop Monthly Growth Score By Deal legacy models in Intermediate and Reporting.
This includes schema entries.
These models were already identified as to be deprecated on the 23rd May 2025, so, today.

# Checklist

- [X] Project compiles, no additional warning is raised.

Related work items: #29826
2025-05-23 10:32:56 +00:00
Oriol Roqué Paniagua
e6819f05cc Merged PR 5281: First version of stg_core__user_product_bundle_to_guest_product
# Description

First version in staging of stg_core__user_product_bundle_to_guest_product.

This table informs which Guest Products are enabled for a given New Dash bundle (or program).

Be aware that for these to be effective, the bundle needs to be applied and active to an active listing that generates bookings.

# 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-05-22 08:15:26 +00:00
Pablo Martin
7e5d94e1b8 Merged PR 5271: Deprecate int_core__guest_product_payments old version
# Description

After validating that we are happy with the new version of `int_core__guest_product_payments` introduced by PR https://guardhog.visualstudio.com/Data/_git/data-dwh-dbt-project/pullrequest/5254, this PR remove the old version and repoints dependants to the new version.

Repointing gets done by changing the `latest_version` property in the `schema` file, since all `ref`s to the model are version-less.

# 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: #30275
2025-05-20 15:52:57 +00:00
Pablo Martin
f20d7a49ab deprecate old version 2025-05-20 17:46:02 +02:00
Oriol Roqué Paniagua
f199bbd105 Merged PR 5265: Updates exposures
# Description

Adds exposures for New Dash Onboarding report

# Checklist

- [X] dbt Compiles **Though I get the expected warnings due to the v1/v2 on Guest Product Payments and the deprecation of the old Account Growth report**

Related work items: #30249
2025-05-20 10:11:45 +00:00
uri
ee341e207f Hotfix - Fixes Hubspot Owner Seed 2025-05-20 08:25:17 +02:00
Oriol Roqué Paniagua
747fa1b731 Merged PR 5261: Adds contract signed month in onboarding reporting
# Description

Adds contract signed month + not null test

# 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-20 05:53:30 +00:00
Oriol Roqué Paniagua
56aeb701cd Merged PR 5256: Reporting version of New Dash Onboarding
# Description

Reporting version of New Dash Onboarding

It also adds a missing description of a field.
It also adapts the logic for Hubspot Onboarding Owner, after a discussion with Alex. It still does not cover 100% of the cases but he's investigating the rest.

# 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-19 15:41:48 +00:00
Pablo Martin
7b6f0d13f6 Merged PR 5254: Optimized Guest Product Payments model
# Description

This PR introduces a new version (`v2`) for `int_core__guest_product_payments`.

The new version is expected to be semantically identical to `v1`, but have much better performance.

Because testing the validity of the semantically identity is hard (`v1` takes 30min to run on DWH HW), I've decided to make this PR to simply have both models at the same time in the DWH and leverage that to validate. To avoid mistakes, this PR ensures that all downstream dependants of `int_core__guest_product_payments` still point to `v1`, so "nothing changes".

Once we validate that `v2` is good to go, I'll make another PR to deprecate `v1` and repoint all downstreams to `v2`.

# 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: #30275
2025-05-19 14:13:26 +00:00
Pablo Martin
cf2d7251db add version metadata in schema file 2025-05-19 15:51:59 +02:00
Pablo Martin
cf0c9fd3fa bring v1 back to starting code 2025-05-19 15:48:55 +02:00
Pablo Martin
128d12d372 put the new stuff into a v2 2025-05-19 15:48:13 +02:00
Pablo Martin
92c8331ae4 refactor 2025-05-19 15:44:06 +02:00
Oriol Roqué Paniagua
8c7c3e84cf Merged PR 5246: Ordered services in HS and added new boolean
# Description

Improvements on onboarding data:
* Hubspot services that clients expressed their interest in are now sorted alphabetically. This is needed for:
* A new boolean to compare current active services applied in listings vs. services that captured the interest of the client on onboarding. This can help identify clients that we might need to follow up to ensure all programs are created and applied.

# 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-19 08:40:14 +00:00
uri
fea129bcee Materialise guest product payments as table 2025-05-16 20:11:04 +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
43a20a3c22 Merged PR 5238: Brings additional sales info from hubspot
# Description

Brings additional info from Hubspot Deals regarding onboarding process

# 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 11:08:17 +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
53874ab08a Merged PR 5227: Fix Billable Services New Dash
# Description

Fixes Billable Services categorisation. We were not handling Guest Agreement exclusion. I just changed so instead of including services as billable by default, it's the other way around.

# 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.
2025-05-15 15:01:21 +00:00
Oriol Roqué Paniagua
baf9d2767c Merged PR 5215: Switch from 20th to 12th for invoicing cap
# Description

After a discussion with Nathan, the invoicing cycle has again been reduced by quite a few days.
We agreed to move the cap from 20th to 12th of the following month.

# 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: #30147
2025-05-15 14:10:27 +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
c6b61856f0 Merged PR 5183: Switch dependencies on verification payments for KPIs models
# Description

Switches the 3 KPIs models that used int_core__verification_payments_v2 to now use int_core__guest_journey_payments.

Audit successful.

# 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 10:56:02 +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
Oriol Roqué Paniagua
a3038089e8 Merged PR 5162: Fixes month shift on revenue share and rank
# Description

Fixes the Account Growth issue on the rank/share on revenue metrics.

Issue was that the share needs to be shifted one month for account computation; meaning that the impact score of April relies on the share from March (as there's no April revenue data).

The shift also affected the rank as it's based on the share.

Solution is:
* Re-bring actual revenue share and attribute it to the correct month
* Apply a coalesce giving priority to the revenue share/rank from the correct month. If no data is available (ongoing month), show share/rank of previous month. This is intended to help quantify account importance in the ongoing month - as it's actually the case in the report

Tested locally + run in prod to check the report performance. Small note, this makes revenue share not adding up anymore to 100% as accounts that go live in the same month are excluded. This is exactly the same as for Billable Items.

# 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: #30013
2025-05-08 06:15:44 +00:00
Pablo Martin
4475c8d56f slim down ci to simple steps that don't give headaches 2025-05-06 09:27:59 +02:00
Joaquin Ossa
fb3a8c7bfa Merged PR 5131: Remove old models
# Description

Remove old models:
- `monthly_aggregated_metrics_history_by_deal`
- `int_monthly_aggregated_metrics_history_by_deal`

# Checklist

- [ ] 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.

Remove old models

Related work items: #29672
2025-05-05 14:00:21 +00:00
Joaquin
a265b01672 Remove old models 2025-05-05 14:47:22 +02:00
Oriol Roqué Paniagua
09e599308c Merged PR 5129: Update exposures/deprecation dates on AM reporting
# Description

Updates deprecation dates to 23rd May.
Updates exposure with new Account Growth report

# Checklist

- [X] Project compiles

Related work items: #29374
2025-05-05 07:09:41 +00:00
Joaquin Ossa
6970901196 Merged PR 5103: Updated exposure
# Description

Updated exposures with new model for Host Resolutions Payments
Deleted previous models that are not longer being used

# Checklist

- [ ] 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.

Updated exposure

Related work items: #29373
2025-05-02 13:55:10 +00:00
Joaquin
8235bb5228 Restored schema 2025-04-30 16:54:06 +02:00
Joaquin
8372f4680f restored files 2025-04-30 16:51:25 +02:00
Joaquin
ce63d90a3f Updated exposure 2025-04-30 16:23:03 +02:00
Oriol Roqué Paniagua
b2e3355612 Merged PR 5085: Propagates the new account growth model to reporting
# Description

Propagates the new account growth model to reporting.

Rounds and a couple of additional fields are handled here for PBI purposes.

# 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: #29374
2025-04-29 12:46:50 +00:00
Joaquin Ossa
0bd26ab4c0 Merged PR 5083: Host Resolution model for report
# Description

New `xero__host_resolutions_payments` for Resolutions Host Payments Report.
I also updated a few descriptions from Superhog to Truvi

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

Host Resolution model for report

Related work items: #29373
2025-04-29 10:09:04 +00:00