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
This commit is contained in:
Oriol Roqué Paniagua 2025-05-16 17:09:30 +00:00
parent 43a20a3c22
commit 5455bd2c01
6 changed files with 606 additions and 3 deletions

View file

@ -3695,3 +3695,239 @@ models:
description: |
Flag indicating if the growth score is overridden to -1 due to
cancellation in the same month.
- name: int_new_dash_deal_onboarding
description: |
A dedicated model to track the onboarding stages of new accounts (deals)
in New Dash.
This excludes any deal that has been migrated from Old Dash, so it just
contains "new business".
columns:
- name: id_deal
data_type: text
description: |
Unique identifier of an account.
data_tests:
- not_null
- unique
- name: deal_name
data_type: text
description: |
Name of the deal according to HubSpot.
- name: onboarding_owner
data_type: text
description: |
Name of the person that is in charge of onboarding this account.
- name: account_manager
data_type: text
description: |
Account manager in charge of the account.
- name: platform_company_name
data_type: text
description: |
Name of the company in Truvi's backend.
- name: count_platform_accounts
data_type: integer
description: |
Amount of Backend accounts (users) linked to this Deal.
- name: count_programs_at_deal_level
data_type: integer
description: |
Total amount of programs that this account has. These might not
necessarily be applied to a Listing.
- name: count_listings
data_type: integer
description: |
Total count of Listings from this account.
- name: count_active_listings
data_type: integer
description: |
Count of Listings that are currently active, meaning, that have not
been deactivated.
- name: count_listings_with_upgraded_programs
data_type: integer
description: |
Count of Listings that have had a program applied that contains at least
one service different to Basic Screening.
- name: count_active_listings_with_active_upgraded_programs
data_type: integer
description: |
Count of Listings that are currently active and that currently have an
active upgraded program, meaning, that contains at least one service
different to Basic Screening.
- name: count_bookings
data_type: integer
description: |
Total count of Bookings generated from this account.
- name: count_bookings_with_paid_service
data_type: integer
description: |
Count of Bookings that have at least one paid service.
- name: count_upgraded_programs_at_deal_level
data_type: integer
description: |
Count of programs that this account has that contain, at least, one
service different to Basic Screening. These might not necessarily
be applied to a Listing.
- name: count_upgraded_programs_at_listing_level
data_type: integer
description: |
Count of programs that contain at least one service different to
Basic Screening that have been applied to a Listing.
- name: count_active_upgraded_programs_at_active_listing_level
data_type: integer
description: |
Count of programs that contain at least one service different to
Basic Screening that are currently active and applied to an
active Listing.
- name: contract_signed_date_utc
data_type: date
description: |
Date in which the contract was signed according to HubSpot.
- name: live_date_utc
data_type: date
description: |
Date in which the Deal went live according to HubSpot.
- name: cancellation_date_utc
data_type: date
description: |
Date in which the Deal was cancelled according to HubSpot.
- name: backend_account_creation_utc
data_type: timestamp without timezone
description: |
Timestamp in which the account was created in the backend.
- name: first_listing_created_at_utc
data_type: timestamp without timezone
description: |
Timestamp in which the first listing was created in the backend.
- name: first_booking_created_at_utc
data_type: timestamp without timezone
description: |
Timestamp in which the first booking was created in the backend.
- name: first_program_created_at_utc
data_type: timestamp without timezone
description: |
Timestamp in which the first program was created at account level
in the backend.
- name: first_upgraded_program_created_at_utc
data_type: timestamp without timezone
description: |
Timestamp in which the first program was applied to a listing
for this account, in the backend.
- name: first_upgraded_program_applied_to_listing_at_utc
data_type: timestamp without timezone
description: |
Timestamp in which the first upgraded program was applied to a listing
for this account, in the backend.
- name: first_booking_with_paid_services_created_at_utc
data_type: timestamp without timezone
description: |
Timestamp in which the first booking that contained paid services
was created for this account, in the backend.
- name: first_invoice_at_utc
data_type: timestamp without timezone
description: |
Timestamp in which the first invoice happened for this account in Xero.
- name: expressed_service_interest
data_type: text
description: |
List of services that during onboarding generated interest
to the client.
- name: services_in_programs_at_deal_level
data_type: text
description: |
List of all distinct services that appear in programs at
deal level, separated by "|" and ordered alphabetically.
- name: services_in_programs_applied_to_listings
data_type: text
description: |
List of all distinct services that are applied in all listings
for this account, separated by "|" and ordered alphabetically.
- name: has_churned
data_type: boolean
description: |
True if the account has a cancellation date in HubSpot,
False otherwise.
- name: has_listings
data_type: boolean
description: |
True if the account has at least one listing appearing in
the backend, False otherwise.
- name: has_active_listings
data_type: boolean
description: |
True if the account has at least one listing that is currently
active in the backend, False otherwise.
- name: has_bookings
data_type: boolean
description: |
True if the account has at least one booking appearing in
the backend, False otherwise.
- name: has_been_invoiced
data_type: boolean
description: |
True if the account has at least one invoice appearing in
Xero, False otherwise.
- name: are_all_bookings_free
data_type: boolean
description: |
True if the account has bookings but all of them are free,
meaning, there's not a single service being paid.
- name: is_account_no_longer_generating_paid_bookings
data_type: boolean
description: |
True if the account has had in the past paid bookings but
at the moment there's not a single listing that contains
an active upgraded program.
Encouraged to be used alongside a filter to determine if
the account has churned or not.
- name: has_account_changed_services_applied_in_listings
data_type: boolean
description: |
True if the active services in programs applied to listings
is different than the services that were historically applied.
By nature, this always means that at least one service was
being applied before that is no longer being applied. This can
indicate a real decrease in services applied that could be linked to
a potential revenue loss (decrease in booking fees),
although it's also possible that the account has changed from a
certain low-level tier to a higher-level one (ex: from Basic
Protection to Protection Pro).