-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mermaid-instructions
- Loading branch information
Showing
6 changed files
with
267 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
warehouse/models/staging/payments/elavon/int_elavon__adjustment_transactions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{{ config(materialized='table') }} | ||
|
||
WITH | ||
|
||
adjustment_transactions AS ( | ||
|
||
SELECT * FROM {{ ref('stg_elavon__transactions') }} | ||
WHERE batch_type = 'A' | ||
|
||
), | ||
|
||
int_elavon__adjustment_transactions AS ( | ||
|
||
SELECT | ||
payment_reference, | ||
payment_date, | ||
account_number, | ||
routing_number, | ||
fund_amt, | ||
batch_reference, | ||
batch_type, | ||
customer_batch_reference, | ||
customer_name, | ||
merchant_number, | ||
external_mid, | ||
store_number, | ||
chain, | ||
batch_amt, | ||
amount, | ||
surchg_amount, | ||
convnce_amt, | ||
card_type, | ||
charge_type, | ||
charge_type_description, | ||
card_plan, | ||
card_no, | ||
chk_num, | ||
transaction_date, | ||
settlement_date, | ||
authorization_code, | ||
chargeback_control_no, | ||
roc_text, | ||
trn_aci, | ||
card_scheme_ref, | ||
trn_ref_num, | ||
settlement_method, | ||
currency_code, | ||
cb_acq_ref_id, | ||
chgbk_rsn_code, | ||
chgbk_rsn_desc, | ||
mer_ref, | ||
purch_id, | ||
cust_cod, | ||
trn_arn, | ||
term_id, | ||
ent_num, | ||
dt, | ||
execution_ts | ||
|
||
FROM adjustment_transactions | ||
|
||
) | ||
|
||
SELECT * FROM int_elavon__adjustment_transactions |
90 changes: 90 additions & 0 deletions
90
warehouse/models/staging/payments/elavon/int_elavon__chargeback_transactions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{{ config(materialized='table') }} | ||
|
||
WITH | ||
|
||
chargeback_transactions AS ( | ||
|
||
SELECT * FROM {{ ref('stg_elavon__transactions') }} | ||
WHERE batch_type = 'C' | ||
|
||
), | ||
|
||
int_elavon__chargeback_transactions AS ( | ||
|
||
SELECT | ||
|
||
payment_reference, | ||
payment_date, | ||
account_number, | ||
routing_number, | ||
fund_amt, | ||
batch_reference, | ||
batch_type, | ||
customer_batch_reference, | ||
customer_name, | ||
merchant_number, | ||
external_mid, | ||
store_number, | ||
chain, | ||
batch_amt, | ||
amount, | ||
surchg_amount, | ||
convnce_amt, | ||
card_type, | ||
charge_type, | ||
charge_type_description, | ||
card_plan, | ||
card_no, | ||
chk_num, | ||
transaction_date, | ||
settlement_date, | ||
authorization_code, | ||
chargeback_control_no, | ||
roc_text, | ||
trn_aci, | ||
card_scheme_ref, | ||
trn_ref_num, | ||
settlement_method, | ||
currency_code, | ||
cb_acq_ref_id, | ||
chgbk_rsn_code, | ||
chgbk_rsn_desc, | ||
mer_ref, | ||
purch_id, | ||
cust_cod, | ||
trn_arn, | ||
term_id, | ||
ent_num, | ||
dt, | ||
execution_ts | ||
|
||
-- if we remove the need for a union between billing and deposit data downstream, these are the columns to keep | ||
-- (ie deposit-specific, always null columns are removed) | ||
-- payment_reference, | ||
-- payment_date, | ||
-- account_number, | ||
-- routing_number, | ||
-- fund_amt, | ||
-- batch_reference, | ||
-- batch_type, | ||
-- customer_name, | ||
-- merchant_number, | ||
-- external_mid, | ||
-- chain, | ||
-- batch_amt, | ||
-- amount, | ||
-- card_type, | ||
-- charge_type, | ||
-- charge_type_description, | ||
-- card_plan, | ||
-- settlement_method, | ||
-- currency_code, | ||
-- ent_num, | ||
-- dt, | ||
-- execution_ts | ||
|
||
FROM chargeback_transactions | ||
|
||
) | ||
|
||
SELECT * FROM int_elavon__chargeback_transactions |