diff --git a/models/staging/core/_core_sources.yml b/models/staging/core/_core_sources.yml index 12ae258..eff5619 100644 --- a/models/staging/core/_core_sources.yml +++ b/models/staging/core/_core_sources.yml @@ -167,7 +167,7 @@ sources: - name: _airbyte_meta data_type: jsonb description: "{{ doc('_airbyte_meta_desc') }}" - - name: superhog_user + - name: SuperhogUser identifier: SuperhogUser - name: UserVerificationStatus identifier: UserVerificationStatus @@ -205,3 +205,7 @@ sources: identifier: Integration - name: IntegrationType identifier: IntegrationType + - name: Accommodation + identifier: Accommodation + - name: AccommodationToUser + identifier: AccommodationToUser diff --git a/models/staging/core/schema.yml b/models/staging/core/schema.yml index 5df73b6..604588d 100644 --- a/models/staging/core/schema.yml +++ b/models/staging/core/schema.yml @@ -106,3 +106,17 @@ models: tests: - unique - not_null + + - name: stg_core__accommodation + columns: + - name: id_accommodation + tests: + - unique + - not_null + + - name: stg_core__accommodation_to_user + columns: + - name: id_accommodation_to_user + tests: + - unique + - not_null diff --git a/models/staging/core/stg_core__accommodation.sql b/models/staging/core/stg_core__accommodation.sql new file mode 100644 index 0000000..b28eedb --- /dev/null +++ b/models/staging/core/stg_core__accommodation.sql @@ -0,0 +1,30 @@ +with + raw_accommodation as (select * from {{ source("core", "Accommodation") }}), + stg_core__accommodation as ( + select + {{ adapter.quote("AccommodationId") }} as id_accommodation, + {{ adapter.quote("CreatedByUserId") }} as id_creating_user, + {{ adapter.quote("PaymentValidationSetId") }} as id_payment_validation_set, + {{ adapter.quote("FriendlyName") }} as friendly_name, + {{ adapter.quote("CountryId") }} as id_country, + {{ adapter.quote("IsActive") }} as is_active, + {{ adapter.quote("Town") }} as town, + {{ adapter.quote("Postcode") }} as postcode, + {{ adapter.quote("AddressLine1") }} as address_line_1, + {{ adapter.quote("AddressLine2") }} as address_line_2, + {{ adapter.quote("VerificationLevel") }} as verification_level, + {{ adapter.quote("ManuallyValidated") }} as manually_validated, + {{ adapter.quote("FloorArea") }} as floor_area, + {{ adapter.quote("NumberOfFloors") }} as number_of_floors, + {{ adapter.quote("NumberOfBedrooms") }} as number_of_bedrooms, + {{ adapter.quote("NumberOfBathrooms") }} as number_of_bathrooms, + {{ adapter.quote("NumberOfOtherRooms") }} as number_of_other_rooms, + {{ adapter.quote("DetailsOfConstruction") }} as construction_details, + {{ adapter.quote("CreatedDate") }} as created_at_utc, + {{ adapter.quote("UpdatedDate") }} as updated_at_utc, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc + + from raw_accommodation + ) +select * +from stg_core__accommodation diff --git a/models/staging/core/stg_core__accommodation_to_user.sql b/models/staging/core/stg_core__accommodation_to_user.sql new file mode 100644 index 0000000..7841d02 --- /dev/null +++ b/models/staging/core/stg_core__accommodation_to_user.sql @@ -0,0 +1,18 @@ +with + raw_accommodation_to_user as ( + select * from {{ source("core", "AccommodationToUser") }} + ), + stg_core__accommodation_to_user as ( + select + {{ adapter.quote("SuperhogUserId") }} as id_user_owner, + {{ adapter.quote("AccommodationId") }} as id_accommodation, + {{ adapter.quote("AccommodationToUserId") }} as id_accommodation_to_user, + {{ adapter.quote("AccommodationUserType") }} as accommodation_user_type, + {{ adapter.quote("CreatedDate") }} as created_at_utc, + {{ adapter.quote("UpdatedDate") }} as updated_at_utc, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc + + from raw_accommodation_to_user + ) +select * +from stg_core__accommodation_to_user diff --git a/models/staging/core/stg_core__superhog_user.sql b/models/staging/core/stg_core__superhog_user.sql index 39e875c..5f3468b 100644 --- a/models/staging/core/stg_core__superhog_user.sql +++ b/models/staging/core/stg_core__superhog_user.sql @@ -7,7 +7,7 @@ }} with - raw_superhog_user as (select * from {{ source("core", "superhog_user") }}), + raw_superhog_user as (select * from {{ source("core", "SuperhogUser") }}), stg_core__superhog_user as ( select {{ adapter.quote("Avatar") }} as avatar,