This commit is contained in:
2026-04-21 16:35:05 +03:00
parent a4a7daa5e0
commit 3b73439b49
11 changed files with 981 additions and 2 deletions
+14 -1
View File
@@ -11,11 +11,24 @@ create_calendar(UserId, Title, Description) ->
%% Создание календаря с указанной политикой подтверждения
create_calendar(UserId, Title, Description, Confirmation) ->
Type = personal, % По умолчанию
create_calendar(UserId, Title, Description, Confirmation, Type).
create_calendar(UserId, Title, Description, Confirmation, Type) ->
case core_user:get_by_id(UserId) of
{ok, User} ->
case User#user.status of
active ->
core_calendar:create(UserId, Title, Description, Confirmation);
% Проверяем подписку для commercial календарей
case Type of
commercial ->
case logic_subscription:can_create_commercial_calendar(UserId) of
true -> ok;
false -> {error, subscription_required}
end;
personal -> ok
end,
core_calendar:create(UserId, Title, Description, Confirmation, Type);
_ ->
{error, user_inactive}
end;