Added host_booking_fees model to report
This commit is contained in:
parent
adefe2d3ce
commit
a75a4e9763
2 changed files with 102 additions and 1 deletions
16
models/reporting/core/core__host_booking_fees.sql
Normal file
16
models/reporting/core/core__host_booking_fees.sql
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
with
|
||||||
|
int_core__host_booking_fees as (
|
||||||
|
select * from {{ ref("int_core__host_booking_fees") }}
|
||||||
|
)
|
||||||
|
select
|
||||||
|
id_booking as id_booking,
|
||||||
|
id_user_guest as id_user_guest,
|
||||||
|
id_user_host as id_user_host,
|
||||||
|
id_accommodation as id_accommodation,
|
||||||
|
booking_state as booking_state,
|
||||||
|
is_duplicate_booking as is_duplicate_booking,
|
||||||
|
booking_fee_local as booking_fee_local,
|
||||||
|
account_currency_iso4217 as account_currency_iso4217,
|
||||||
|
booking_fee_charge_at_utc as booking_fee_charge_at_utc,
|
||||||
|
booking_fee_charge_date_utc as booking_fee_charge_date_utc
|
||||||
|
from int_core__host_booking_fees
|
||||||
|
|
@ -974,4 +974,89 @@ models:
|
||||||
data_type: bigint
|
data_type: bigint
|
||||||
description:
|
description:
|
||||||
"Count of how many Check-in covers have been
|
"Count of how many Check-in covers have been
|
||||||
purchased for this accommodation"
|
purchased for this accommodation"
|
||||||
|
|
||||||
|
- name: core__host_booking_fees
|
||||||
|
description:
|
||||||
|
Bookings that have been processed by the Superhog backend.
|
||||||
|
Each record matches one booking and has information on host
|
||||||
|
booking fees, when they were charged and the currency used by
|
||||||
|
the host.
|
||||||
|
|
||||||
|
columns:
|
||||||
|
- name: id_booking
|
||||||
|
data_type: bigint
|
||||||
|
description: "The unique, Superhog generated id for this booking."
|
||||||
|
tests:
|
||||||
|
- unique
|
||||||
|
- not_null
|
||||||
|
|
||||||
|
- name: id_user_guest
|
||||||
|
data_type: character varying
|
||||||
|
description: The UUID of the Superhog user playing the guest role in the booking.
|
||||||
|
|
||||||
|
- name: id_user_host
|
||||||
|
data_type: character varying
|
||||||
|
description: The UUID of the Superhog user playing the host role in the booking.
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
|
||||||
|
- name: id_accommodation
|
||||||
|
data_type: bigint
|
||||||
|
description: The ID of the booked listing.
|
||||||
|
|
||||||
|
- name: booking_state
|
||||||
|
data_type: character varying
|
||||||
|
description:
|
||||||
|
"State in which the booking is, could be either of the following:
|
||||||
|
- Approved
|
||||||
|
- NotApproved
|
||||||
|
- Cancelled
|
||||||
|
- Rejected
|
||||||
|
- NoFlags
|
||||||
|
- Flagged
|
||||||
|
- IncompleteInformation"
|
||||||
|
tests:
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- 'Approved'
|
||||||
|
- 'NotApproved'
|
||||||
|
- 'Cancelled'
|
||||||
|
- 'Rejected'
|
||||||
|
- 'NoFlags'
|
||||||
|
- 'Flagged'
|
||||||
|
- 'IncompleteInformation'
|
||||||
|
|
||||||
|
- name: is_duplicate_booking
|
||||||
|
data_type: boolean
|
||||||
|
description: |
|
||||||
|
A flag that identifies whether the booking is a duplicate.
|
||||||
|
A booking is considered a duplicate if there's an older booking with the same user,
|
||||||
|
accomodation and check-in date. If there are two or more bookings with the same user,
|
||||||
|
accomodation and check-in date, the oldest one will have False as a value in this field,
|
||||||
|
and the other ones will have True as a value in this Failed."
|
||||||
|
Put simply, if you don't want to receive duplicates, filter this field to False.
|
||||||
|
|
||||||
|
- name: booking_fee_local
|
||||||
|
data_type: numeric
|
||||||
|
description: "The fee to apply to the booking, in host currency."
|
||||||
|
|
||||||
|
- name: account_currency_iso4217
|
||||||
|
data_type: character varying
|
||||||
|
description: "Currency used by host/pm/platform users."
|
||||||
|
|
||||||
|
- name: booking_fee_charge_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
|
description: |
|
||||||
|
The point in time in which the booking should be invoiced.
|
||||||
|
|
||||||
|
This could be the check-in date of the booking or the date in which the guest verification
|
||||||
|
started, depending on the billing settings of the host.
|
||||||
|
|
||||||
|
- name: booking_fee_charge_date_utc
|
||||||
|
data_type: date
|
||||||
|
description: |
|
||||||
|
The date in which the booking should be invoiced.
|
||||||
|
|
||||||
|
This could be the check-in date of the booking or the date in which the guest verification
|
||||||
|
started, depending on the billing settings of the host.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue