From 6fce8c0ec68f38123123e82bff6b22baaa487897 Mon Sep 17 00:00:00 2001 From: Joaquin Ossa Date: Wed, 19 Feb 2025 14:57:44 +0100 Subject: [PATCH] Added listings data --- .../intermediate/core/int_core__payments.sql | 8 ++++-- models/intermediate/core/schema.yml | 25 +++++++++++++++++-- models/reporting/core/core__payments.sql | 8 ++++-- models/reporting/core/schema.yml | 25 +++++++++++++++++-- 4 files changed, 58 insertions(+), 8 deletions(-) diff --git a/models/intermediate/core/int_core__payments.sql b/models/intermediate/core/int_core__payments.sql index 5831a2c..6cb353a 100644 --- a/models/intermediate/core/int_core__payments.sql +++ b/models/intermediate/core/int_core__payments.sql @@ -51,8 +51,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 diff --git a/models/intermediate/core/schema.yml b/models/intermediate/core/schema.yml index 86b7d8c..328ec6c 100644 --- a/models/intermediate/core/schema.yml +++ b/models/intermediate/core/schema.yml @@ -5640,17 +5640,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..8334f78 100644 --- a/models/reporting/core/core__payments.sql +++ b/models/reporting/core/core__payments.sql @@ -43,8 +43,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..ba90065 100644 --- a/models/reporting/core/schema.yml +++ b/models/reporting/core/schema.yml @@ -1901,17 +1901,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.