feat(events): add booking_occupancy on event JSON for studio grid
Expose free|pending|confirmed so commercial calendar can aggregate slots by occupancy without N GET /bookings calls.
This commit is contained in:
@@ -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)
|
||||
}.
|
||||
|
||||
Reference in New Issue
Block a user