Skip to content

Commit

Permalink
MM-60962: add cloud server URL to Cloud trial sync (#1626)
Browse files Browse the repository at this point in the history
* MM-60962: add cloud DNS to sync

* MM-60962: add cloud DNS to sync
  • Loading branch information
ifoukarakis authored Oct 8, 2024
1 parent af964c1 commit 9540a52
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ cloud_trial_requests as (
subscriptions.trial_start_at,
subscriptions.trial_end_at,
subscriptions.cws_installation,
subscriptions.cws_dns,
products.product_id,
products.name as product_name
from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,39 @@ models:
- not_null
- dbt_utils.not_empty_string
- unique
- name: trial_start_at
description: The starting date of the trial.
- name: trial_end_at
description: The ending date of the trial.
- name: cws_installation
description: The installation id of the Cloud server provisioned for the trial.
tests:
- not_null
- dbt_utils.not_empty_string
- name: cws_dns
description: The URL of the Cloud server provisioned for the trial.
tests:
- not_null
- dbt_utils.not_empty_string
- name: existing_lead_id
description: The id of the lead to update (if any exists), matched on email.
- name: existing_campaign_member_id
description: The id of the campaign member to update (if any exists), matched on email.
- name: campaign_id
description: The id of the campaign to attribute this lead to.
- name: is_existing_lead
description: Whether there's already a lead with the same email.
- name: is_existing_campaign_member
description: Whether there's already a campaign member for the same email and lead.
- name: campaign_member_status
description: The campaign member's status.
# Removing the test for now.
# tests:
# - accepted_values:
# values: ['Account created', 'Email verified', 'Workspace created', null]
- name: is_valid_email
description: Whether the email is valid. Used to skip invalid emails.
- name: is_blacklisted_email
description: Whether the email is blacklisted.
tests:
- dbt_utils.expression_is_true:
expression: "trial_start_at < trial_end_at"

- name: sync_lead_account_link
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
with cloud_trial_requests_pre as (
select
email,
cws_installation,
cws_installation,
cws_dns,
trial_start_at,
trial_end_at
from
Expand All @@ -17,6 +18,8 @@ cloud_trial_requests as (
ctr.email,
ctr.trial_start_at,
ctr.trial_end_at,
ctr.cws_installation,
ctr.cws_dns,
l.lead_id as existing_lead_id,
cm.campaign_member_id as existing_campaign_member_id,
'{{ var('cloud_enterprise_trial_campaign_id') }}' as campaign_id,
Expand Down

0 comments on commit 9540a52

Please sign in to comment.