Skip to content

Commit

Permalink
fix billing info
Browse files Browse the repository at this point in the history
  • Loading branch information
btkcodedev committed Aug 13, 2024
1 parent 82c2e89 commit dde9bf1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 37 deletions.
8 changes: 1 addition & 7 deletions connectors/source_recurly/integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,13 @@ vars:
recurly_account_identifier: "accounts"
recurly_account_note_identifier: "account_notes"
recurly_account_coupon_redemption_identifier: "account_coupon_redemptions"
recurly_add_on_identifier: "add_ons"
recurly_billing_info_identifier: "billing_info"
recurly_billing_info_identifier: "billing_infos"
recurly_coupon_redemption_identifier: "account_coupon_redemptions"
recurly_coupon_identifier: "coupons"
recurly_credit_payment_identifier: "credit_payments"
recurly_export_date_identifier: "export_dates"
recurly_invoice_history_identifier: "invoices"
recurly_line_item_identifier: "line_items"
recurly_measured_unit_identifier: "measured_units"
recurly_plan_identifier: "plans"
recurly_shipping_address_identifier: "shipping_addresses"
recurly_shipping_method_identifier: "shipping_methods"
recurly_subscription_identifier: "subscriptions"
recurly_subscription_change_identifier: "subscriptions"
recurly_transaction_identifier: "transactions"
recurly_unique_coupon_identifier: "unique_coupons"
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
WITH tmp AS (
SELECT
id AS billing_id,
cast(updated_at AS {{ dbt.type_timestamp() }}) AS updated_at,
NULL AS updated_at,
account_id,
NULL AS billing_city,
NULL AS billing_country,
NULL AS billing_phone,
NULL AS billing_postal_code,
NULL AS billing_region,
NULL AS billing_street_1,
NULL AS billing_street_2,
city AS billing_city,
country AS billing_country,
phone AS billing_phone,
zip AS billing_postal_code,
state AS billing_region,
address1 AS billing_street_1,
address2 AS billing_street_2,
company,
cast(created_at AS {{ dbt.type_timestamp() }}) AS created_at,
NULL AS created_at,
first_name,
NULL AS is_valid,
last_name,
Expand All @@ -22,7 +22,8 @@
NULL AS updated_by_country,
NULL AS updated_by_ip,
vat_number,
ROW_NUMBER() OVER (PARTITION BY id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
ROW_NUMBER() OVER (PARTITION BY id DESC) = 1 AS is_most_recent_record,
NULL AS fraud_risk_rules_triggered
FROM
{{ source('source_recurly', 'billing_infos') }}
)
Expand All @@ -34,17 +35,17 @@
WITH tmp AS (
SELECT
id AS billing_id,
cast(updated_at AS {{ dbt.type_timestamp() }}) AS updated_at,
NULL AS updated_at,
account_id,
NULL AS billing_city,
NULL AS billing_country,
NULL AS billing_phone,
NULL AS billing_postal_code,
NULL AS billing_region,
NULL AS billing_street_1,
NULL AS billing_street_2,
city AS billing_city,
country AS billing_country,
phone AS billing_phone,
zip AS billing_postal_code,
state AS billing_region,
address1 AS billing_street_1,
address2 AS billing_street_2,
company,
cast(created_at AS {{ dbt.type_timestamp() }}) AS created_at,
NULL AS created_at,
first_name,
NULL AS is_valid,
last_name,
Expand All @@ -53,7 +54,8 @@
NULL AS updated_by_country,
NULL AS updated_by_ip,
vat_number,
ROW_NUMBER() OVER (PARTITION BY id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
ROW_NUMBER() OVER (PARTITION BY id DESC) = 1 AS is_most_recent_record,
NULL AS fraud_risk_rules_triggered
FROM
{{ source('source_recurly', 'billing_infos') }}
)
Expand All @@ -65,17 +67,17 @@
WITH tmp AS (
SELECT
id AS billing_id,
cast(updated_at AS {{ dbt.type_timestamp() }}) AS updated_at,
NULL AS updated_at,
account_id,
NULL AS billing_city,
NULL AS billing_country,
NULL AS billing_phone,
NULL AS billing_postal_code,
NULL AS billing_region,
NULL AS billing_street_1,
NULL AS billing_street_2,
city AS billing_city,
country AS billing_country,
phone AS billing_phone,
zip AS billing_postal_code,
state AS billing_region,
address1 AS billing_street_1,
address2 AS billing_street_2,
company,
cast(created_at AS {{ dbt.type_timestamp() }}) AS created_at,
NULL AS created_at,
first_name,
NULL AS is_valid,
last_name,
Expand All @@ -84,7 +86,8 @@
NULL AS updated_by_country,
NULL AS updated_by_ip,
vat_number,
ROW_NUMBER() OVER (PARTITION BY id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
ROW_NUMBER() OVER (PARTITION BY id DESC) = 1 AS is_most_recent_record,
NULL AS fraud_risk_rules_triggered
FROM
{{ source('source_recurly', 'billing_infos') }}
)
Expand Down

0 comments on commit dde9bf1

Please sign in to comment.