Merged PR 2400: Creating model in reporting
Creating model in reporting for check in hero Related work items: #18190
This commit is contained in:
commit
da56aa3bb8
2 changed files with 125 additions and 1 deletions
26
models/reporting/core/core__check_in_cover_listings.sql
Normal file
26
models/reporting/core/core__check_in_cover_listings.sql
Normal file
|
|
@ -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
|
||||||
|
|
@ -876,4 +876,102 @@ models:
|
||||||
- name: has_fee_payment
|
- name: has_fee_payment
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
description: |
|
description: |
|
||||||
True if guest payed the fee
|
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"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue