Updated model
This commit is contained in:
parent
68c21458c2
commit
a00a4b4e4b
6 changed files with 229 additions and 170 deletions
|
|
@ -1,28 +0,0 @@
|
|||
{% macro count_bookings_by_service_status() %}
|
||||
{% set service_status_map = {
|
||||
"PROTECTED": "number_protected_bookings",
|
||||
"REJECTED": "number_rejected_bookings",
|
||||
"NOCHECKS": "number_no_checks_bookings",
|
||||
"NOFLAGS": "number_no_flags_bookings",
|
||||
"PAID": "number_paid_bookings",
|
||||
"PENDING": "number_pending_bookings",
|
||||
"-": "number_unknown_status_bookings",
|
||||
"PARTIALLY PROTECTED": "number_partially_protected_bookings",
|
||||
"NOT PROTECTED": "number_not_protected_bookings",
|
||||
"NOT PAID": "number_not_paid_bookings",
|
||||
"CONFIRMED": "number_confirmed_bookings",
|
||||
"FORREVIEW": "number_for_review_bookings",
|
||||
"FLAGGED": "number_flagged_bookings",
|
||||
} %}
|
||||
|
||||
{% for status, alias in service_status_map.items() %}
|
||||
count(
|
||||
distinct case
|
||||
when upper(ub.service_status) = '{{ status }}'
|
||||
then (ub.id_booking)
|
||||
else null
|
||||
end
|
||||
) as {{ alias }}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue