Stage 3.4

This commit is contained in:
2026-04-20 16:40:44 +03:00
parent 42a047a938
commit b24cbc97f3
25 changed files with 2520 additions and 123 deletions

View File

@@ -1,18 +1,17 @@
-module(logic_calendar).
-include("records.hrl").
-export([create_calendar/3, get_calendar/2, list_calendars/1,
-export([create_calendar/4, get_calendar/2, list_calendars/1,
update_calendar/3, delete_calendar/2]).
-export([can_access/2, can_edit/2]).
%% Создание календаря
create_calendar(UserId, Title, Description) ->
% Проверка, что пользователь может создавать календари
create_calendar(UserId, Title, Description, Confirmation) ->
case core_user:get_by_id(UserId) of
{ok, User} ->
case User#user.status of
active ->
core_calendar:create(UserId, Title, Description);
core_calendar:create(UserId, Title, Description, Confirmation);
_ ->
{error, user_inactive}
end;