feat: GET /v1/user/booking-requests + search image_url. Fixes EventHub/EventHubBack#59
CI / test (push) Successful in 7m1s
CI / deploy-ift (push) Successful in 5m59s
CI / e2e-ift (push) Successful in 1m34s
CI / deploy-stage (push) Successful in 2m47s
CI / e2e-stage (push) Successful in 1m18s

This commit is contained in:
2026-07-27 14:53:25 +03:00
parent b25c0447cd
commit 1d9752bb69
8 changed files with 263 additions and 8 deletions
+9
View File
@@ -25,6 +25,7 @@ logic_search_test_() ->
{"Search events by location", fun test_search_events_by_location/0},
{"Combined search", fun test_combined_search/0},
{"Search calendars", fun test_search_calendars/0},
{"Search calendars include image_url", fun test_search_calendars_image_url/0},
{"Search all", fun test_search_all/0},
{"Pagination", fun test_pagination/0},
{"Sorting", fun test_sorting/0},
@@ -175,6 +176,14 @@ test_search_calendars() ->
{Total2, _} = calendars_from(logic_search:search(<<"calendar">>, <<"Calendar">>, OwnerId, #{})),
?assertEqual(2, Total2).
test_search_calendars_image_url() ->
OwnerId = create_test_user(user),
CalendarId = create_test_calendar(OwnerId, commercial, [<<"cover">>]),
{ok, _} = core_calendar:update(CalendarId, [{image_url, <<"https://cdn.example/cal.jpg">>}]),
{_, Cals} = calendars_from(logic_search:search(<<"calendar">>, <<"Calendar">>, OwnerId, #{})),
[Hit | _] = [C || C <- Cals, maps:get(id, C) =:= CalendarId],
?assertEqual(<<"https://cdn.example/cal.jpg">>, maps:get(image_url, Hit)).
test_search_all() ->
OwnerId = create_test_user(user),
CalendarId = create_test_calendar(OwnerId, personal, []),