staging model for booking
This commit is contained in:
parent
1a5db1a8c4
commit
71cae21cea
1 changed files with 35 additions and 0 deletions
35
models/staging/core/stg_core__booking.sql
Normal file
35
models/staging/core/stg_core__booking.sql
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
with
|
||||
raw_booking as (select * from {{ source("core", "Booking") }}),
|
||||
stg_core__booking as (
|
||||
select
|
||||
{{ adapter.quote("BookingId") }} as id_booking,
|
||||
{{ adapter.quote("GuestUserId") }} as id_user_guest,
|
||||
{{ adapter.quote("CreatedByUserId") }} as id_user_host,
|
||||
{{ adapter.quote("IntegrationId") }} as id_integration,
|
||||
{{ adapter.quote("AccommodationId") }} as id_accommodation,
|
||||
{{ adapter.quote("BookingSourceId") }} as id_booking_source,
|
||||
{{ adapter.quote("VerificationRequestId") }} as id_verification_request,
|
||||
{{ adapter.quote("BookingStateId") }} as id_booking_state,
|
||||
{{ adapter.quote("StagingHostBookingId") }} as id_staging_host_booking,
|
||||
{{ adapter.quote("CheckIn") }} as check_in_at_utc,
|
||||
cast({{ adapter.quote("CheckIn") }} as date) as check_in_date_utc,
|
||||
{{ adapter.quote("CheckOut") }} as check_out_at_utc,
|
||||
cast({{ adapter.quote("CheckOut") }} as date) as check_out_date_utc,
|
||||
{{ adapter.quote("Summary") }} as summary,
|
||||
{{ adapter.quote("GuestEmail") }} as guest_email,
|
||||
{{ adapter.quote("GuestLastName") }} as guest_last_name,
|
||||
{{ adapter.quote("GuestFirstName") }} as guest_first_name,
|
||||
{{ adapter.quote("GuestTelephone") }} as guest_telephone,
|
||||
{{ adapter.quote("AdditionalGuests") }} as additional_guests,
|
||||
{{ adapter.quote("UnsubscribeVerificationReminder") }}
|
||||
as unsubscribe_verification_reminder,
|
||||
{{ adapter.quote("CreatedDate") }} as created_at_utc,
|
||||
cast({{ adapter.quote("CreatedDate") }} as date) as created_date_utc,
|
||||
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
||||
cast({{ adapter.quote("UpdatedDate") }} as date) as updated_date_utc,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
|
||||
from raw_booking
|
||||
)
|
||||
select *
|
||||
from stg_core__booking
|
||||
Loading…
Add table
Add a link
Reference in a new issue