From bfe224577ce8c6f58acc185c45fad34109bba9d2 Mon Sep 17 00:00:00 2001 From: Joaquin Ossa Date: Thu, 25 Jul 2024 11:34:07 +0200 Subject: [PATCH] Creating model in reporting --- .../core/core__check_in_cover_listings.sql | 26 +++++ models/reporting/core/schema.yaml | 100 +++++++++++++++++- 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 models/reporting/core/core__check_in_cover_listings.sql diff --git a/models/reporting/core/core__check_in_cover_listings.sql b/models/reporting/core/core__check_in_cover_listings.sql new file mode 100644 index 0000000..31b5e81 --- /dev/null +++ b/models/reporting/core/core__check_in_cover_listings.sql @@ -0,0 +1,26 @@ +with + int_core__check_in_cover_listings as ( + select * from {{ ref("int_core__check_in_cover_listings") }} + ) +select + id_user_host as id_user_host, + id_deal as id_deal, + last_name as last_name, + user_name as user_name, + first_name as first_name, + host_email as host_email, + phone_number as phone_number, + joined_at_utc as joined_at_utc, + joined_date_utc as joined_date_utc, + check_in_cover_added_date_utc as check_in_cover_added_date_utc, + billing_town as billing_town, + company_name as company_name, + id_accommodation as id_accommodation, + is_active as is_active, + friendly_name as friendly_name, + country_name as country_name, + town as town, + postcode as postcode, + address_line_1 as address_line_1, + check_in_cover_purchased as check_in_cover_purchased +from int_core__check_in_cover_listings diff --git a/models/reporting/core/schema.yaml b/models/reporting/core/schema.yaml index e12a0a7..cd74ee1 100644 --- a/models/reporting/core/schema.yaml +++ b/models/reporting/core/schema.yaml @@ -876,4 +876,102 @@ models: - name: has_fee_payment data_type: boolean description: | - True if guest payed the fee \ No newline at end of file + True if guest payed the fee + + - name: core__check_in_cover_listings + description: + This model contains information about hosts and their listings + that offer check in cover. + It has basic information on the users and listings like country, + town, address and if they are active or not. + + This model is restricted to active user so it doesn't include historical + data like users that had check-in cover but are currently inactive. + columns: + - name: id_user_host + data_type: character varying + description: Unique id value for the user + tests: + - not_null + + - name: id_deal + data_type: character varying + description: "" + + - name: last_name + data_type: character varying + description: Last name of the user + + - name: user_name + data_type: character varying + description: User name of the user + + - name: first_name + data_type: character varying + description: First name of the user + + - name: host_email + data_type: character varying + description: Email of the user + + - name: phone_number + data_type: character varying + description: Phone number of the user + + - name: joined_at_utc + data_type: timestamp without time zone + description: Date and time the user joined + + - name: joined_date_utc + data_type: date + description: Date the user joined + + - name: check_in_cover_added_date_utc + data_type: date + description: + Date the user first included check-in cover + + - name: billing_town + data_type: character varying + description: "" + + - name: company_name + data_type: character varying + description: "" + + - name: id_accommodation + data_type: bigint + description: "Id of the accommodation or listing. It's the unique key for this model." + tests: + - not_null + - unique + + - name: is_active + data_type: boolean + description: "Boolean to indicate if the accommodation is active or not" + + - name: friendly_name + data_type: character varying + description: "Name of the accommodation" + + - name: country_name + data_type: character varying + description: "Name of the country where the accommodation is located." + + - name: town + data_type: character varying + description: "Town in which the accommodation is located" + + - name: postcode + data_type: character varying + description: "" + + - name: address_line_1 + data_type: character varying + description: "" + + - name: check_in_cover_purchased + data_type: bigint + description: + "Count of how many Check-in covers have been + purchased for this accommodation" \ No newline at end of file