refactoring
This commit is contained in:
parent
c4b9c42a3c
commit
e84294c4b7
7 changed files with 57 additions and 18 deletions
|
|
@ -173,3 +173,7 @@ sources:
|
|||
identifier: VerificationToPayment
|
||||
- name: VerificationPaymentType
|
||||
identifier: VerificationPaymentType
|
||||
- name: Payment
|
||||
identifier: Payment
|
||||
- name: PaymentStatus
|
||||
identifier: PaymentStatus
|
||||
|
|
|
|||
21
models/staging/core/stg_core__payment.sql
Normal file
21
models/staging/core/stg_core__payment.sql
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
with
|
||||
raw_payment as (select * from {{ source("core", "Payment") }}),
|
||||
sgt_core__payment as (
|
||||
select
|
||||
{{ adapter.quote("Notes") }} as notes,
|
||||
{{ adapter.quote("Amount") }} as amount,
|
||||
{{ adapter.quote("PaymentId") }} as id_payment,
|
||||
{{ adapter.quote("PaymentRef") }} as payment_reference,
|
||||
{{ adapter.quote("RefundDate") }} as refunded_at_utc,
|
||||
{{ adapter.quote("CreatedDate") }} as created_at_utc,
|
||||
{{ adapter.quote("CurrencyIso") }} as currency,
|
||||
{{ adapter.quote("PaymentDate") }} as paid_at_utc,
|
||||
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
||||
{{ adapter.quote("PaymentStatusId") }} as id_payment_status,
|
||||
{{ adapter.quote("RefundPaymentRef") }} as refund_payment_reference,
|
||||
{{ adapter.quote("PaymentProviderId") }} as id_payment_provider,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
from raw_payment
|
||||
)
|
||||
select *
|
||||
from sgt_core__payment
|
||||
12
models/staging/core/stg_core__payment_status.sql
Normal file
12
models/staging/core/stg_core__payment_status.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
with
|
||||
raw_payment_status as (select * from {{ source("core", "PaymentStatus") }}),
|
||||
stg_core__payment_status as (
|
||||
select
|
||||
{{ adapter.quote("Id") }} as id_payment_status,
|
||||
{{ adapter.quote("FullName") }} as payment_status,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }}dwh_extracted_at_utc
|
||||
|
||||
from raw_payment_status
|
||||
)
|
||||
select *
|
||||
from stg_core__payment_status
|
||||
|
|
@ -6,7 +6,7 @@ with
|
|||
select
|
||||
{{ adapter.quote("Id") }} as id_verification_payment_type,
|
||||
{{ adapter.quote("Name") }} as verification_payment_type,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_date_utc
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
|
||||
from raw_verificationpaymenttype
|
||||
)
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ with
|
|||
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
||||
{{ adapter.quote("RefundDueDate") }} as refund_due_at_utc,
|
||||
{{ adapter.quote("PaymentDueDate") }} as payment_due_at_utc,
|
||||
{{ adapter.quote("SuperhogUserId") }} as id_superhog_user,
|
||||
{{ adapter.quote("SuperhogUserId") }} as id_guest_user,
|
||||
{{ adapter.quote("VerificationId") }} as id_verification,
|
||||
{{ adapter.quote("VerificationPaymentTypeId") }}
|
||||
as id_verification_payment_type,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_date_utc
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
|
||||
from raw_verificationtopayment
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue