Merged PR 4515: resolutions incidents to reporting
# Description Resolutions incidents model to reporting # Checklist - [x] The edited models and dependants run properly with production data. - [x] The edited models are sufficiently documented. - [x] The edited models contain PK tests, and I've ran and passed them. - [x] I have checked for DRY opportunities with other models and docs. - [x] I've picked the right materialization for the affected models. # Other - [ ] Check if a full-refresh is required after this PR is merged. resolutions incidents to reporting Related work items: #27811
This commit is contained in:
parent
00d3922104
commit
ed707849e7
2 changed files with 503 additions and 0 deletions
81
models/reporting/resolutions/resolutions__incidents.sql
Normal file
81
models/reporting/resolutions/resolutions__incidents.sql
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
with
|
||||
int_resolutions__incidents as (
|
||||
select * from {{ ref("int_resolutions__incidents") }}
|
||||
)
|
||||
|
||||
select
|
||||
id_incident as id_incident,
|
||||
id_verification as id_verification,
|
||||
current_status_name as current_status_name,
|
||||
is_submission_complete as is_submission_complete,
|
||||
current_agent_name as current_agent_name,
|
||||
document_version as document_version,
|
||||
created_at_utc as created_at_utc,
|
||||
created_date_utc as created_date_utc,
|
||||
updated_at_utc as updated_at_utc,
|
||||
updated_date_utc as updated_date_utc,
|
||||
first_comment_at_utc as first_comment_at_utc,
|
||||
last_comment_at_utc as last_comment_at_utc,
|
||||
comment_count as comment_count,
|
||||
first_status_at_utc as first_status_at_utc,
|
||||
last_status_at_utc as last_status_at_utc,
|
||||
resolution_time_in_hours as resolution_time_in_hours,
|
||||
number_damaged_items as number_damaged_items,
|
||||
original_value_amount_in_host_currency as original_value_amount_in_host_currency,
|
||||
original_value_amount_in_gbp as original_value_amount_in_gbp,
|
||||
asked_repair_amount_in_host_currency as asked_repair_amount_in_host_currency,
|
||||
asked_repair_amount_in_gbp as asked_repair_amount_in_gbp,
|
||||
accepted_amount_in_host_currency as accepted_amount_in_host_currency,
|
||||
accepted_amount_in_gbp as accepted_amount_in_gbp,
|
||||
host_currency as host_currency,
|
||||
protection_name as protection_name,
|
||||
was_overriden as was_overriden,
|
||||
waiver_or_deposit_name as waiver_or_deposit_name,
|
||||
guest_verification_status as guest_verification_status,
|
||||
lower_protection_limit_usd as lower_protection_limit_usd,
|
||||
upper_protection_limit_usd as upper_protection_limit_usd,
|
||||
calculated_payout_amount_in_txn_currency
|
||||
as calculated_payout_amount_in_txn_currency,
|
||||
calculated_payout_currency as calculated_payout_currency,
|
||||
calculated_payout_amount_in_usd as calculated_payout_amount_in_usd,
|
||||
calculated_payout_amount_in_gbp as calculated_payout_amount_in_gbp,
|
||||
calculated_guest_charge_amount_in_txn_currency
|
||||
as calculated_guest_charge_amount_in_txn_currency,
|
||||
calculated_guest_charge_currency as calculated_guest_charge_currency,
|
||||
calculated_guest_charge_amount_in_usd as calculated_guest_charge_amount_in_usd,
|
||||
calculated_guest_charge_amount_in_gbp as calculated_guest_charge_amount_in_gbp,
|
||||
id_user_host as id_user_host,
|
||||
host_account_name as host_account_name,
|
||||
host_email as host_email,
|
||||
host_last_name as host_last_name,
|
||||
host_first_name as host_first_name,
|
||||
host_phone_code as host_phone_code,
|
||||
host_phone_number as host_phone_number,
|
||||
id_user_guest as id_user_guest,
|
||||
guest_email as guest_email,
|
||||
guest_last_name as guest_last_name,
|
||||
guest_first_name as guest_first_name,
|
||||
guest_phone_code as guest_phone_code,
|
||||
guest_phone_number as guest_phone_number,
|
||||
is_guest_deposit_retained as is_guest_deposit_retained,
|
||||
is_guest_deposit_collected as is_guest_deposit_collected,
|
||||
deposit_retained_amount_in_txn_currency as deposit_retained_amount_in_txn_currency,
|
||||
deposit_retained_currency as deposit_retained_currency,
|
||||
has_guest_contributed_to_cost as has_guest_contributed_to_cost,
|
||||
has_host_taken_preventative_steps as has_host_taken_preventative_steps,
|
||||
guest_contribution_amount_in_txn_currency
|
||||
as guest_contribution_amount_in_txn_currency,
|
||||
guest_contribution_currency as guest_contribution_currency,
|
||||
guest_contribution_amount_in_gbp as guest_contribution_amount_in_gbp,
|
||||
is_guest_contacted_about_damage as is_guest_contacted_about_damage,
|
||||
id_accommodation as id_accommodation,
|
||||
accommodation_name as accommodation_name,
|
||||
check_in_at_utc as check_in_at_utc,
|
||||
check_in_date_utc as check_in_date_utc,
|
||||
check_out_at_utc as check_out_at_utc,
|
||||
check_out_date_utc as check_out_date_utc,
|
||||
id_booking as id_booking,
|
||||
booking_status as booking_status,
|
||||
id_reservation as id_reservation
|
||||
|
||||
from int_resolutions__incidents i
|
||||
Loading…
Add table
Add a link
Reference in a new issue