feat(booking): studio journal and instance inbox. Refs EventHub/EventHubFront#60
CI / test (push) Successful in 7m31s
CI / deploy-ift (push) Successful in 2m38s
CI / e2e-ift (push) Successful in 1m26s
CI / deploy-stage (push) Successful in 2m3s
CI / e2e-stage (push) Successful in 1m21s

This commit is contained in:
2026-08-14 11:13:01 +03:00
parent 520af23cc6
commit 2567585333
7 changed files with 155 additions and 10 deletions
@@ -8,6 +8,7 @@
-export([init/2]).
-export([trails/0]).
-export([item_to_json/1]).
-include("records.hrl").
@@ -76,7 +77,7 @@ list_requests(Req) ->
{ok, UserId, Req1} ->
case logic_booking:list_user_booking_requests(UserId) of
{ok, Items} ->
Response = [request_to_json(I) || I <- Items],
Response = [item_to_json(I) || I <- Items],
handler_utils:send_json(Req1, 200, Response);
{error, _} ->
handler_utils:send_error(Req1, 500, <<"Internal server error">>)
@@ -85,8 +86,8 @@ list_requests(Req) ->
handler_utils:send_error(Req1, Code, Message)
end.
-spec request_to_json({#booking{}, #event{}, owner | specialist}) -> map().
request_to_json({Booking, Event, Role}) ->
-spec item_to_json({#booking{}, #event{}, owner | specialist}) -> map().
item_to_json({Booking, Event, Role}) ->
CalendarTitle = case core_calendar:get_by_id(Event#event.calendar_id) of
{ok, Cal} -> Cal#calendar.title;
_ -> null