with stg_edeposit__verifications as ( select * from {{ ref("stg_edeposit__verifications") }} ) select id as id_verification, id_booking, id_user as id_user_host, id_listing as id_accommodation, case when version = 'V1' then 'Guesty' when version = 'V2' then 'Edeposit' else null end as verification_source, verification_status, verification_status_reason, nightly_fee_local, cast(checkout_at_utc as date) - cast(checkin_at_utc as date) as number_nights, email_flag, phone_flag, watch_list, channel, checkin_at_utc, checkout_at_utc, is_cancelled, cancelled_at_utc, user_email, guest_email, guest_last_name, guest_first_name, guest_telephone, company_name, property_manager_name, property_manager_email, listing_name, listing_town, listing_country, listing_postcode, pets_allowed, level_of_protection_amount, level_of_protection_currency, status_updated_at_utc, updated_at_utc, creation_at_utc, created_at_utc from stg_edeposit__verifications