Рефакторинг обработчиков. Часть 1 #21

This commit is contained in:
2026-05-10 22:14:38 +03:00
parent a35d6f7acc
commit 6403f061df
46 changed files with 3082 additions and 2091 deletions
+2 -7
View File
@@ -3,12 +3,11 @@
-export([create/2, get_by_id/1, get_by_event_and_user/2, list_by_event/1, list_by_user/1]).
-export([update_status/2, delete/1]).
-export([generate_id/0]).
-export([count_bookings/0]).
%% Создание бронирования
create(EventId, UserId) ->
Id = generate_id(),
Id = infra_utils:generate_id(16),
Booking = #booking{
id = Id,
event_id = EventId,
@@ -98,8 +97,4 @@ delete(Id) ->
{aborted, Reason} -> {error, Reason}
end.
count_bookings() -> mnesia:table_info(booking, size).
%% Внутренние функции
generate_id() ->
base64:encode(crypto:strong_rand_bytes(16), #{mode => urlsafe, padding => false}).
count_bookings() -> mnesia:table_info(booking, size).