Commit 9bf68ce3 authored by Israel Weeks's avatar Israel Weeks 💬

build refunds modeling 3

parent 5acbcfd5
......@@ -19,12 +19,12 @@ WITH source AS (
createdbyid AS created_by_id,
createddate AS created_date,
defaultpaymentmethodid AS default_payment_method_id,
deleted,
deleted AS is_deleted,
gateway,
gatewayresponse AS gateway_response,
gatewayresponsecode AS gateway_response_code,
gatewaystate AS gateway_state,
id,
id AS refund_id,
methodtype AS method_type,
parentaccountid AS parent_account_id,
paymentmethodid AS payment_method_id,
......@@ -39,10 +39,10 @@ WITH source AS (
softdescriptorphone AS soft_descriptor_phone,
soldtocontactid AS sold_to_contact_id,
sourcetype AS source_type,
status,
status AS refund_status,
submittedon AS submitted_on,
transferredtoaccounting AS transferred_to_accounting,
type,
type AS refund_type,
updatedbyid AS updated_by_id,
updateddate AS updated_date
FROM source
......
WITH zuora_refund_base AS (
SELECT *
FROM {{ref('zuora_refund')}}
FROM {{ref('zuora_refund')}}
), zuora_account AS (
......@@ -9,7 +9,7 @@ WITH zuora_refund_base AS (
)
SELECT zuora_account.sfdc_entity AS entity,
SELECT zuora_account.sfdc_entity,
zuora_account.account_name,
zuora_account.account_number,
zuora_account.currency,
......@@ -17,7 +17,7 @@ SELECT zuora_account.sfdc_entity AS entity,
amount AS refund_amount,
comment,
reason_code,
zuora_refund_base.status
zuora_refund_base.refund_status
FROM zuora_refund_base
LEFT JOIN zuora_account
ON zuora_refund_base.account_id = zuora_account.account_id
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment