From 4a6fdd5ac756427146cf731b9d7f0b74600aafc9 Mon Sep 17 00:00:00 2001 From: Joaquin Ossa Date: Fri, 16 Aug 2024 12:51:13 +0200 Subject: [PATCH] Created address_validation in staging --- .../core/int_core__address_validation.sql | 25 ++++++++ models/intermediate/core/schema.yaml | 64 ++++++++++++++++++- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 models/intermediate/core/int_core__address_validation.sql diff --git a/models/intermediate/core/int_core__address_validation.sql b/models/intermediate/core/int_core__address_validation.sql new file mode 100644 index 0000000..6bb3f66 --- /dev/null +++ b/models/intermediate/core/int_core__address_validation.sql @@ -0,0 +1,25 @@ +with + stg_core__address_validation as ( + select * from {{ ref("stg_core__address_validation") }} + ), + stg_core__verification_to_address_validation as ( + select * from {{ ref("stg_core__verification_to_address_validation") }} + ), + stg_core__verification as (select * from {{ ref("stg_core__verification") }}) +select + av.id_address_validation as id_address_validation, + vtav.id_verification as id_verification, + v.id_verification_request as id_verification_request, + av.id_accommodation as id_accommodation, + coalesce(av.validation_passed, false) as validation_passed, + av.feature_size_meters as feature_size_meters, + av.feature_size_meters_upper_limit as feature_size_meters_upper_limit, + av.notes as notes, + av.created_at_utc as created_at_utc, + av.updated_at_utc as updated_at_utc, + av.dwh_extracted_at_utc as dwh_extracted_at_utc +from stg_core__address_validation av +left join + stg_core__verification_to_address_validation vtav + on av.id_address_validation = vtav.id_address_validation +left join stg_core__verification v on v.id_verification = vtav.id_verification diff --git a/models/intermediate/core/schema.yaml b/models/intermediate/core/schema.yaml index 7a7efc9..b630764 100644 --- a/models/intermediate/core/schema.yaml +++ b/models/intermediate/core/schema.yaml @@ -1855,4 +1855,66 @@ models: data_type: date description: | Date of the last time the information of the Host was updated - in our systems. \ No newline at end of file + in our systems. + + - name: int_core__address_validation + description: + "This table shows whether a request for Check-in cover was approved or not. + For each verification there is a unique address_validation." + columns: + - name: id_address_validation + data_type: bigint + description: "Unique value for the address validation" + tests: + - unique + - not_null + + - name: id_verification + data_type: bigint + description: "Unique value for the verification" + tests: + - unique + - not_null + + - name: id_verification_request + data_type: bigint + description: "Id value for the verification request" + + - name: id_accommodation + data_type: bigint + description: "Id of the accommodation or listing" + + - name: validation_passed + data_type: boolean + description: "Boolean to identify if the validation passed or not" + tests: + - accepted_values: + values: + - True + - False + + - name: feature_size_meters + data_type: numeric + description: "" + + - name: feature_size_meters_upper_limit + data_type: numeric + description: "" + + - name: notes + data_type: character varying + description: "Notes in case the validation failed" + + - name: created_at_utc + data_type: timestamp without time zone + description: "Date and time of creation of the address validation" + tests: + - not_null + + - name: updated_at_utc + data_type: timestamp without time zone + description: "Date of creation of the address validation" + + - name: dwh_extracted_at_utc + data_type: timestamp with time zone + description: "Date and time at which data was extracted to dwh" \ No newline at end of file