edeposit_verifications_fees to reporting, this would be the model to use in the business overview report
This commit is contained in:
parent
470e5c7990
commit
f8131d9111
2 changed files with 117 additions and 0 deletions
18
models/reporting/edeposit/edeposit__verification_fees.sql
Normal file
18
models/reporting/edeposit/edeposit__verification_fees.sql
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
with
|
||||
int_edeposit__verification_fees as (
|
||||
select * from {{ ref("int_edeposit__verification_fees") }}
|
||||
)
|
||||
|
||||
select
|
||||
vf.id_verification as id_verification,
|
||||
vf.id_booking as id_booking,
|
||||
vf.currency as currency,
|
||||
vf.ok_status_fee_in_txn_currency as ok_status_fee_in_txn_currency,
|
||||
vf.ok_status_fee_in_gbp as ok_status_fee_in_gbp,
|
||||
vf.rejected_fee_in_txn_currency as rejected_fee_in_txn_currency,
|
||||
vf.rejected_fee_in_gbp as rejected_fee_in_gbp,
|
||||
vf.cancelled_fee_in_gbp as cancelled_fee_in_gbp,
|
||||
vf.cancelled_fee_in_txn_currency as cancelled_fee_in_txn_currency,
|
||||
vf.created_date_utc as created_date_utc,
|
||||
vf.checkout_date_utc as checkout_date_utc
|
||||
from int_edeposit__verification_fees vf
|
||||
99
models/reporting/edeposit/schema.yaml
Normal file
99
models/reporting/edeposit/schema.yaml
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
version: 2
|
||||
|
||||
models:
|
||||
|
||||
- name: edeposit__verification_fees
|
||||
description:
|
||||
"This table shows all fee charges per verification for E-deposit.
|
||||
Cancellation fee is charged when the monthly rate of cancelled bookings over
|
||||
total booking of the partner surpasses the threshold (currently set at 0.05).
|
||||
Both cancellation and rejection fees are set to 0.25 though it might change.
|
||||
Fees are both in the currency used by the user and in GBP"
|
||||
columns:
|
||||
- name: id_verification
|
||||
data_type: text
|
||||
description: "unique Superhog generated id for this verification"
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
|
||||
- name: id_booking
|
||||
data_type: text
|
||||
description:
|
||||
"unique Superhog generated id for a booking.
|
||||
note that this could be duplicated and both will be charged,
|
||||
it's up to the user to no generate duplicate verifications"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: currency
|
||||
data_type: text
|
||||
description: "currency in which the transaction actually happened"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: ok_status_fee_in_txn_currency
|
||||
data_type: numeric
|
||||
description: "fee charged in used currency for approved or flagged verifications"
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: ok_status_fee_in_gbp
|
||||
data_type: numeric
|
||||
description: "fee charged in gbp for approved or flagged verifications"
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: rejected_fee_in_txn_currency
|
||||
data_type: numeric
|
||||
description: "fee charged in used currency for rejected verifications"
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: rejected_fee_in_gbp
|
||||
data_type: numeric
|
||||
description: "fee charged in gbp for rejected verifications"
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: cancelled_fee_in_txn_currency
|
||||
data_type: numeric
|
||||
description: "fee charged in used currency for cancelled verifications"
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: cancelled_fee_in_gbp
|
||||
data_type: numeric
|
||||
description: "fee charged in gbp for cancelled verifications"
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: checkout_date_utc
|
||||
data_type: date
|
||||
description: "Date of checkout for the booking"
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: created_date_utc
|
||||
data_type: date
|
||||
description: "Date of creation of the verification in the system"
|
||||
tests:
|
||||
- not_null
|
||||
Loading…
Add table
Add a link
Reference in a new issue