diff --git a/models/intermediate/core/int_core__payments.sql b/models/intermediate/core/int_core__payments.sql index 5831a2c..4275e3f 100644 --- a/models/intermediate/core/int_core__payments.sql +++ b/models/intermediate/core/int_core__payments.sql @@ -6,6 +6,9 @@ with int_core__unified_user as (select * from {{ ref("int_core__unified_user") }}), int_core__bookings as (select * from {{ ref("int_core__bookings") }}), int_core__accommodation as (select * from {{ ref("int_core__accommodation") }}), + int_core__verification_requests as ( + select * from {{ ref("int_core__verification_requests") }} + ), int_daily_currency_exchange_rates as ( select * from {{ ref("int_daily_currency_exchange_rates") }} ) @@ -39,6 +42,8 @@ select vp.currency, der.rate as exchange_rate_to_gbp, b.id_booking, + b.booking_state, + vr.is_verification_request_complete, uh.id_user_host, uh.id_deal, uh.first_name as host_first_name, @@ -51,8 +56,12 @@ select uu.email as guest_email, uu.billing_country_name as guest_billing_country, uu.billing_town as guest_billing_town, - a.friendly_name, - a.address_line_1, + a.id_accommodation, + a.friendly_name as accommodation_name, + a.country_name as accommodation_country, + a.town as accommodation_town, + a.address_line_1 as accommodation_address, + a.postcode as accommodation_postcode, b.check_in_date_utc, b.check_out_date_utc, uh.account_currency_iso4217 as host_currency @@ -61,6 +70,9 @@ left join int_core__user_host uh on vp.id_user_host = uh.id_user_host left join int_core__bookings b on vp.id_verification_request = b.id_verification_request left join int_core__unified_user uu on uu.id_user = b.id_user_guest left join int_core__accommodation a on b.id_accommodation = a.id_accommodation +left join + int_core__verification_requests vr + on vp.id_verification_request = vr.id_verification_request left join int_daily_currency_exchange_rates der on vp.payment_paid_date_utc = der.rate_date_utc diff --git a/models/intermediate/core/schema.yml b/models/intermediate/core/schema.yml index 86b7d8c..5f6380f 100644 --- a/models/intermediate/core/schema.yml +++ b/models/intermediate/core/schema.yml @@ -5585,6 +5585,15 @@ models: description: The unique, Superhog generated id for this booking. Can be null for verification request not related to a booking. + - name: booking_state + data_type: character varying + description: "State in which the booking is" + + - name: is_verification_request_complete + data_type: boolean + description: "True if the verification request is considered + complete, AKA the guest has finished the full guest journey." + - name: id_user_host data_type: character varying description: | @@ -5640,17 +5649,38 @@ models: description: | The town or city name of the guest's billing address. - - name: friendly_name + - name: id_accommodation + data_type: character varying + description: | + "Id of the accommodation or listing." + + - name: accommodation_name data_type: character varying description: | A user-friendly name for the booking or transaction, often used for display purposes. - - name: address_line_1 + - name: accommodation_country + data_type: text + description: | + The country name of the accommodation. + + - name: accommodation_town + data_type: text + description: | + The town or city name of the accommodation. + + - name: accommodation_address data_type: character varying description: | The first line of the property address associated with the payment. + - name: accommodation_postcode + data_type: character varying + description: | + The postal code of the property address associated with the payment + for the booking. + - name: check_in_date_utc data_type: date description: The scheduled check-in date of the guest, in UTC. diff --git a/models/reporting/core/core__payments.sql b/models/reporting/core/core__payments.sql index 3ab834f..5b76daa 100644 --- a/models/reporting/core/core__payments.sql +++ b/models/reporting/core/core__payments.sql @@ -31,6 +31,8 @@ select currency as currency, exchange_rate_to_gbp as exchange_rate_to_gbp, id_booking as id_booking, + booking_state as booking_state, + is_verification_request_complete as is_verification_request_complete, id_user_host as id_user_host, id_deal as id_deal, host_first_name as host_first_name, @@ -43,8 +45,12 @@ select guest_email as guest_email, guest_billing_country as guest_billing_country, guest_billing_town as guest_billing_town, - friendly_name as friendly_name, - address_line_1 as address_line_1, + id_accommodation as id_accommodation, + accommodation_name as accommodation_name, + accommodation_country as accommodation_country, + accommodation_town as accommodation_town, + accommodation_address as accommodation_address, + accommodation_postcode as accommodation_postcode, check_in_date_utc as check_in_date_utc, check_out_date_utc as check_out_date_utc, host_currency as host_currency diff --git a/models/reporting/core/schema.yml b/models/reporting/core/schema.yml index a0ada28..5936c75 100644 --- a/models/reporting/core/schema.yml +++ b/models/reporting/core/schema.yml @@ -1846,6 +1846,15 @@ models: description: The unique, Superhog generated id for this booking. Can be null for verification request not related to a booking. + - name: booking_state + data_type: character varying + description: "State in which the booking is" + + - name: is_verification_request_complete + data_type: boolean + description: "True if the verification request is considered + complete, AKA the guest has finished the full guest journey." + - name: id_user_host data_type: character varying description: | @@ -1901,17 +1910,38 @@ models: description: | The town or city name of the guest's billing address. - - name: friendly_name + - name: id_accommodation + data_type: character varying + description: | + "Id of the accommodation or listing." + + - name: accommodation_name data_type: character varying description: | A user-friendly name for the booking or transaction, often used for display purposes. - - name: address_line_1 + - name: accommodation_country + data_type: text + description: | + The country name of the accommodation. + + - name: accommodation_town + data_type: text + description: | + The town or city name of the accommodation. + + - name: accommodation_address data_type: character varying description: | The first line of the property address associated with the payment. + - name: accommodation_postcode + data_type: character varying + description: | + The postal code of the property address associated with the payment + for the booking. + - name: check_in_date_utc data_type: date description: The scheduled check-in date of the guest, in UTC.