Merged PR 1489: More core staging
Adding a few core models to staging
This commit is contained in:
commit
4e14702014
2 changed files with 42 additions and 0 deletions
14
models/staging/core/stg_core__price_plan_charged_by_type.sql
Normal file
14
models/staging/core/stg_core__price_plan_charged_by_type.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
with
|
||||
raw_price_plan_charged_by_type as (
|
||||
select * from {{ source("core", "PricePlanChargedByType") }}
|
||||
),
|
||||
stg_core__price_plan_charged_by_type as (
|
||||
select
|
||||
{{ adapter.quote("Id") }} as id_price_plan_charged_by_type,
|
||||
{{ adapter.quote("Name") }} as price_plan_charged_by_type,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
|
||||
from raw_price_plan_charged_by_type
|
||||
)
|
||||
select *
|
||||
from stg_core__price_plan_charged_by_type
|
||||
28
models/staging/core/stg_core__price_plan_to_user.sql
Normal file
28
models/staging/core/stg_core__price_plan_to_user.sql
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
with
|
||||
raw_price_plan_to_user as (select * from {{ source("core", "PricePlanToUser") }}),
|
||||
stg_core__price_plan_to_user as (
|
||||
select
|
||||
{{ adapter.quote("Id") }} as id_price_plan,
|
||||
{{ adapter.quote("SuperhogUserId") }} as id_user_host,
|
||||
{{ adapter.quote("PricePlanChargedByTypeId") }}
|
||||
as id_price_plan_charged_by_type,
|
||||
{{ adapter.quote("StartDate") }} as start_at_utc,
|
||||
cast({{ adapter.quote("StartDate") }} as date) as start_date_utc,
|
||||
{{ adapter.quote("EndDate") }} as end_at_utc,
|
||||
cast({{ adapter.quote("EndDate") }} as date) end_date_utc,
|
||||
{{ adapter.quote("BookingFeeNet") }} as booking_fee,
|
||||
{{ adapter.quote("ListingFeeNet") }} as listing_fee,
|
||||
{{ adapter.quote("SupportFeeNet") }} as support_fee,
|
||||
{{ adapter.quote("TaxPercentage") }} as tax_percentage,
|
||||
{{ adapter.quote("MinBillableListings") }} as minimum_billable_listings,
|
||||
{{ adapter.quote("MinMonthlyListingFee") }} as minimum_monthly_listing_fee,
|
||||
{{ adapter.quote("CreatedDate") }} as created_at_utc,
|
||||
cast({{ adapter.quote("CreatedDate") }} as date) as created_date_utc,
|
||||
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
||||
{{ adapter.quote("UpdatedDate") }} as updated_date_utc,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
|
||||
from raw_price_plan_to_user
|
||||
)
|
||||
select *
|
||||
from stg_core__price_plan_to_user
|
||||
Loading…
Add table
Add a link
Reference in a new issue