add refunds model
This commit is contained in:
parent
7ed2c45a6a
commit
bb0cc1691d
1 changed files with 26 additions and 0 deletions
26
models/staging/stripe/stg_stripe__refunds.sql
Normal file
26
models/staging/stripe/stg_stripe__refunds.sql
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
with
|
||||
raw_refunds as (select * from {{ source("stripe_uk", "refunds") }}),
|
||||
stg_stripe__refunds as (
|
||||
select
|
||||
{{ adapter.quote("id") }},
|
||||
{{ adapter.quote("amount") }},
|
||||
{{ adapter.quote("charge") }},
|
||||
{{ adapter.quote("object") }},
|
||||
{{ adapter.quote("reason") }},
|
||||
{{ adapter.quote("status") }},
|
||||
to_timestamp({{ adapter.quote("created") }}) as created_at_utc,
|
||||
to_timestamp({{ adapter.quote("updated") }}) as updated_at_utc,
|
||||
{{ adapter.quote("currency") }},
|
||||
{{ adapter.quote("metadata") }},
|
||||
{{ adapter.quote("payment_intent") }},
|
||||
{{ adapter.quote("receipt_number") }},
|
||||
{{ adapter.quote("transfer_reversal") }},
|
||||
{{ adapter.quote("balance_transaction") }},
|
||||
{{ adapter.quote("destination_details") }},
|
||||
{{ adapter.quote("source_transfer_reversal") }},
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_date
|
||||
|
||||
from raw_refunds
|
||||
)
|
||||
select *
|
||||
from stg_stripe__refunds
|
||||
Loading…
Add table
Add a link
Reference in a new issue