Merged PR 3019: fixed cancellation fee charge

# Description

Fixed cancellation fee charge that was being applied to every verification when the threshold was passed, now it will be applied only to those that are actually cancelled

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

fixed cancellation fee charge
This commit is contained in:
Joaquin Ossa 2024-10-02 07:56:42 +00:00
commit e001691ed4

View file

@ -88,12 +88,12 @@ select
er.rejected_fee_in_txn_currency,
er.rejected_fee_in_gbp,
case
when ct.is_cancellation_threshold_surpassed is true
when ct.is_cancellation_threshold_surpassed is true and v.is_cancelled is true
then {{ cancellation_fee }}
else 0
end as cancelled_fee_in_txn_currency,
case
when ct.is_cancellation_threshold_surpassed is true
when ct.is_cancellation_threshold_surpassed is true and v.is_cancelled is true
then rate * {{ cancellation_fee }}
else 0
end as cancelled_fee_in_gbp,