From 71e2b86521324276e6fc51e52f76055fa64cfbaa Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 18 Mar 2024 14:56:07 +0100 Subject: [PATCH 1/3] staging price plan to user --- .../core/stg_core__price_plan_to_user.sql | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 models/staging/core/stg_core__price_plan_to_user.sql diff --git a/models/staging/core/stg_core__price_plan_to_user.sql b/models/staging/core/stg_core__price_plan_to_user.sql new file mode 100644 index 0000000..62d533f --- /dev/null +++ b/models/staging/core/stg_core__price_plan_to_user.sql @@ -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_guest_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 From b03633f650bb71207215c51926c87935420caae1 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 18 Mar 2024 15:00:45 +0100 Subject: [PATCH 2/3] staging for charge by type --- .../core/stg_core__price_plan_charged_by_type.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 models/staging/core/stg_core__price_plan_charged_by_type.sql diff --git a/models/staging/core/stg_core__price_plan_charged_by_type.sql b/models/staging/core/stg_core__price_plan_charged_by_type.sql new file mode 100644 index 0000000..1e94cf1 --- /dev/null +++ b/models/staging/core/stg_core__price_plan_charged_by_type.sql @@ -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 From 8cb7073184500edfcad25be483c9ce9048b61d41 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 18 Mar 2024 15:08:17 +0100 Subject: [PATCH 3/3] typo in name --- models/staging/core/stg_core__price_plan_to_user.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/staging/core/stg_core__price_plan_to_user.sql b/models/staging/core/stg_core__price_plan_to_user.sql index 62d533f..5ea2258 100644 --- a/models/staging/core/stg_core__price_plan_to_user.sql +++ b/models/staging/core/stg_core__price_plan_to_user.sql @@ -3,7 +3,7 @@ with stg_core__price_plan_to_user as ( select {{ adapter.quote("Id") }} as id_price_plan, - {{ adapter.quote("SuperhogUserId") }} as id_guest_host, + {{ adapter.quote("SuperhogUserId") }} as id_user_host, {{ adapter.quote("PricePlanChargedByTypeId") }} as id_price_plan_charged_by_type, {{ adapter.quote("StartDate") }} as start_at_utc,