Merged PR 1468: More sources for core

This commit is contained in:
Pablo Martín 2024-03-18 12:03:23 +00:00
commit 19deb8f21e
3 changed files with 90 additions and 0 deletions

View file

@ -169,6 +169,8 @@ sources:
description: "{{ doc('_airbyte_meta_desc') }}"
- name: superhog_user
identifier: SuperhogUser
- name: VerificationRequest
identifier: VerificationRequest
- name: VerificationToPayment
identifier: VerificationToPayment
- name: VerificationPaymentType
@ -177,3 +179,10 @@ sources:
identifier: Payment
- name: PaymentStatus
identifier: PaymentStatus
- name: Booking
identifier: Booking
- name: PricePlanToUser
identifier: PricePlanToUser
- name: PricePlanChargedByType
identifier: PricePlanChargedByType

View 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

View file

@ -0,0 +1,46 @@
with
raw_verification_request as (
select * from {{ source("core", "VerificationRequest") }}
),
stg_core__verification_request as (
select
{{ adapter.quote("Id") }} as id_verification_request,
lower({{ adapter.quote("Identifier") }}) as uuid_verification_request,
{{ adapter.quote("VerificationSetId") }} as id_verification_set,
{{ adapter.quote("SuperhogVerifiedSetId") }} as id_superhog_verified_set,
{{ adapter.quote("PaymentValidationSetId") }} as id_payment_validation_set,
{{ adapter.quote("SuperhogUserId") }} as id_user_guest,
{{ adapter.quote("CreatedByUserId") }} as id_user_host,
{{ adapter.quote("Url") }} as verification_url,
{{ adapter.quote("CallbackUrl") }} as callback_url,
{{ adapter.quote("RedirectUrl") }} as redirect_url,
{{ adapter.quote("Logo") }} as logo,
{{ adapter.quote("Email") }} as guest_email,
{{ adapter.quote("LastName") }} as last_name,
{{ adapter.quote("FirstName") }} as first_name,
{{ adapter.quote("PhoneNumber") }} as guest_phone_number,
{{ adapter.quote("TelephoneCode") }} as telephone_code,
{{ adapter.quote("TelephoneNumber") }} as guest_phone_number_2,
{{ adapter.quote("LinkUsed") }} as link_used_at_utc,
cast({{ adapter.quote("LinkUsed") }} as date) as link_used_date_utc,
{{ adapter.quote("ExpiryDate") }} as expire_at_utc,
cast({{ adapter.quote("ExpiryDate") }} as date) as expire_date_utc,
{{ adapter.quote("Deleted") }} as is_deleted,
{{ adapter.quote("RedirectName") }} as redirect_name,
{{ adapter.quote("OneStepLinkId") }} as id_one_step_link,
{{ adapter.quote("SuccessMessage") }} as success_message,
{{ adapter.quote("Summary") }} as summary,
{{ adapter.quote("RejectionReason") }} as rejection_reason,
{{ adapter.quote("SwitchedToMobile") }} as has_switched_to_mobile,
{{ adapter.quote("VerifierRejected") }} as is_verifier_rejected,
{{ adapter.quote("Config") }} as config,
{{ adapter.quote("MetaData") }} as metadata,
{{ 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_verification_request
)
select *
from stg_core__verification_request