Created model in reporting as well with schema

This commit is contained in:
Joaquin Ossa 2024-07-03 16:34:33 +02:00
parent fb61c69714
commit 3b22832d8b
3 changed files with 110 additions and 5 deletions

View file

@ -46,11 +46,15 @@ select
u.date_of_birth,
extract(year from age(u.date_of_birth)) as age_of_guest,
case
when pt.checkincover is true then true else false
when pt.has_check_in_cover_payment is true then true else false
end as has_check_in_cover_payment,
case when pt.waiver is true then true else false end as has_waiver_payment,
case when pt.deposit is true then true else false end as has_deposit_payment,
case when pt.fee is true then true else false end as has_fee_payment
case
when pt.has_waiver_payment is true then true else false
end as has_waiver_payment,
case
when pt.has_deposit_payment is true then true else false
end as has_deposit_payment,
case when pt.has_fee_payment is true then true else false end as has_fee_payment
from staging.stg_core__guest_satisfaction_responses gss
left join
staging.stg_core__verification_request vr

View file

@ -0,0 +1,22 @@
with
int_core__guest_satisfaction_responses as (
select * from {{ ref("int_core__guest_satisfaction_responses") }}
)
select
id_verification_request as id_verification_request,
id_user_guest as id_user_guest,
guest_email as guest_email,
experience_rating as experience_rating,
guest_comments as guest_comments,
is_contactable as is_contactable,
created_at_utc as created_at_utc,
updated_at_utc as updated_at_utc,
selected_payment_option as selected_payment_option,
date_of_birth as date_of_birth,
age_of_guest as age_of_guest,
has_check_in_cover_payment as has_check_in_cover_payment,
has_waiver_payment as has_waiver_payment,
has_deposit_payment as has_deposit_payment,
has_fee_payment as has_fee_payment
from int_core__guest_satisfaction_responses

View file

@ -865,4 +865,83 @@ models:
- name: company_name
data_type: character varying
description: ""
description: ""
- name: core__guest_satisfaction_responses
description:
This model contains information on guests satisfaction survey responses,
it contains some basic information on the guests, a rating of their experience
and some comments on it.
It also includes information on the services provided by Superhog that they payed for.
columns:
- name: id_verification_request
data_type: bigint
description: Unique id value for the verification request
tests:
- not_null
- unique
- name: id_user_guest
data_type: character varying
description: Unique id value for the guest
- name: guest_email
data_type: character varying
description: Guest email
- name: experience_rating
data_type: bigint
description:
Guest rating of their experience with Superhog from 1 to 5
- name: guest_comments
data_type: character varying
description:
Guest comments on their experience with Superhog
- name: is_contactable
data_type: boolean
description: |
True if the guest allows to be contacted for more feedback
- name: created_at_utc
data_type: timestamp without time zone
description:
Date and time of response creation
- name: updated_at_utc
data_type: timestamp without time zone
description:
Date and time of last update of response
- name: selected_payment_option
data_type: character varying
description: ""
- name: date_of_birth
data_type: numeric
description: ""
- name: age_of_guest
data_type: numeric
description: ""
- name: has_check_in_cover_payment
data_type: boolean
description: |
True if guest payed for check-in cover
- name: has_waiver_payment
data_type: boolean
description: |
True if guest payed the waiver
- name: has_deposit_payment
data_type: boolean
description: |
True if guest payed the deposit
- name: has_fee_payment
data_type: boolean
description: |
True if guest payed the fee