Ролевая модель и аудит Часть 1.

This commit is contained in:
2026-04-28 19:12:02 +03:00
parent 7ea4efd7d9
commit b2cea7896d
32 changed files with 369 additions and 320 deletions

View File

@@ -7,7 +7,7 @@
id :: binary(),
email :: binary(),
password_hash :: binary(),
role :: user | admin,
role :: user | bot,
status :: active | frozen | deleted,
created_at :: calendar:datetime(),
updated_at :: calendar:datetime()
@@ -20,6 +20,25 @@
type :: access | refresh
}).
%% ------------------- АДМИНИСТРАТОРЫ ------------------------------------
-record(admin, {
id :: binary(),
email :: binary(),
password_hash :: binary(),
role :: superadmin | moderator | support,
status :: active | blocked,
created_at :: calendar:datetime(),
updated_at :: calendar:datetime()
}).
%% ------------------- СЕССИИ АДМИНИСТРАТОРОВ ---------------------------
-record(admin_session, {
token :: binary(),
admin_id :: binary(),
expires_at :: calendar:datetime(),
type :: refresh
}).
%% ------------------- Календари ---------------------------------------
-record(calendar, {
id :: binary(),