diff --git a/models/staging/core/_core_sources.yml b/models/staging/core/_core_sources.yml index 8a527b7..1faac30 100644 --- a/models/staging/core/_core_sources.yml +++ b/models/staging/core/_core_sources.yml @@ -225,3 +225,5 @@ sources: identifier: UserProductBundle - name: BookingToProductBundle identifier: BookingToProductBundle + - name: AddressValidation + identifier: AddressValidation diff --git a/models/staging/core/schema.yml b/models/staging/core/schema.yml index 812126b..e042eac 100644 --- a/models/staging/core/schema.yml +++ b/models/staging/core/schema.yml @@ -169,6 +169,12 @@ models: - name: stg_core__booking_to_product_bundle columns: - name: id_booking_to_product_bundle + tests: + - unique + - not_null + - name: stg_core__address_validation + columns: + - name: id_address_validation tests: - unique - not_null \ No newline at end of file diff --git a/models/staging/core/stg_core__address_validation.sql b/models/staging/core/stg_core__address_validation.sql new file mode 100644 index 0000000..a5039e1 --- /dev/null +++ b/models/staging/core/stg_core__address_validation.sql @@ -0,0 +1,19 @@ +with + raw_address_validation as (select * from {{ source("core", "AddressValidation") }}), + stg_core__address_validation as ( + select + {{ adapter.quote("Id") }} as id_address_validation, + {{ adapter.quote("AccommodationId") }} as id_accommodation, + {{ adapter.quote("Passed") }} as validation_passed, + {{ adapter.quote("FeatureSizeMeters") }} as feature_size_meters, + {{ adapter.quote("FeatureSizeMetersUpperLimit") }} + as feature_size_meters_upper_limit, + {{ adapter.quote("Notes") }} as notes, + {{ 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_address_validation + ) +select * +from stg_core__address_validation