feat(events): add booking_occupancy on event JSON for studio grid
CI / test (push) Failing after 6m23s
CI / deploy-ift (push) Has been skipped
CI / e2e-ift (push) Has been skipped
CI / deploy-stage (push) Has been skipped
CI / e2e-stage (push) Has been skipped

Expose free|pending|confirmed so commercial calendar can aggregate
slots by occupancy without N GET /bookings calls.
This commit is contained in:
2026-07-30 15:33:49 +03:00
parent 1fce1aa12d
commit edd396dff8
2 changed files with 30 additions and 3 deletions
+6 -2
View File
@@ -339,10 +339,14 @@ parse_datetime_binary(Str) ->
Dt.
occurrence_to_json(Master, Occurrence) ->
%% Virtual row: occupancy by master event id (materialized instances use event_to_json).
#{
master_id => Master#event.id,
start_time => handler_utils:datetime_to_iso8601(Occurrence),
duration => Master#event.duration,
title => Master#event.title,
is_virtual => true
}.
is_virtual => true,
specialist_id => Master#event.specialist_id,
calendar_id => Master#event.calendar_id,
booking_occupancy => handler_utils:booking_occupancy(Master)
}.