Анализ и расширение структуры таблиц #12

This commit is contained in:
2026-05-02 19:26:37 +03:00
parent f36dd3bbc1
commit 6b64fc80ab

View File

@@ -10,13 +10,20 @@
role :: user | bot,
status :: active | frozen | deleted,
reason :: binary() | undefined,
nickname :: binary() | undefined,
avatar_url :: binary() | undefined,
timezone :: binary() | undefined,
language :: binary() | undefined,
social_links :: [binary()] | undefined,
phone :: binary() | undefined,
preferences :: map() | undefined,
created_at :: calendar:datetime(),
updated_at :: calendar:datetime()
}).
-record(session, {
token :: binary(), % JWT или refresh токен
user_id :: binary(),
token :: binary(), % JWT или refresh токен
expires_at :: calendar:datetime(),
type :: access | refresh
}).
@@ -28,14 +35,20 @@
password_hash :: binary(),
role :: superadmin | admin | moderator | support,
status :: active | blocked,
nickname :: binary() | undefined,
avatar_url :: binary() | undefined,
timezone :: binary() | undefined,
language :: binary() | undefined,
phone :: binary() | undefined,
preferences :: map() | undefined,
created_at :: calendar:datetime(),
updated_at :: calendar:datetime()
}).
%% ------------------- СЕССИИ АДМИНИСТРАТОРОВ ---------------------------
-record(admin_session, {
token :: binary(),
admin_id :: binary(),
token :: binary(),
expires_at :: calendar:datetime(),
type :: refresh
}).
@@ -46,6 +59,11 @@
owner_id :: binary(),
title :: binary(),
description :: binary(),
short_name :: binary() | undefined,
category :: binary() | undefined,
color :: binary() | undefined,
image_url :: binary() | undefined,
settings :: map() | undefined,
tags :: [binary()],
type :: personal | commercial,
confirmation :: auto | manual | {timeout, integer()}, % секунд
@@ -63,6 +81,17 @@
rights :: read | write | admin
}).
%% ------------------- Специалисты календаря ---------------------------
-record(calendar_specialist, {
calendar_id :: binary(),
user_id :: binary(), % id пользователя-специалиста
name :: binary(), % отображаемое имя в этом календаре
specialization :: [binary()] | undefined, % список специализаций (услуг)
status :: active | inactive,
added_at :: calendar:datetime(),
updated_at :: calendar:datetime()
}).
-record(location, {
address :: binary(),
lat :: float(),
@@ -90,6 +119,8 @@
reason :: binary() | undefined,
rating_avg :: float(),
rating_count :: non_neg_integer(),
attachments :: [binary()] | undefined,
edit_history :: [map()] | undefined,
created_at :: calendar:datetime(),
updated_at :: calendar:datetime()
}).
@@ -107,6 +138,8 @@
event_id :: binary(), % ссылка на конкретный экземпляр события
user_id :: binary(),
status :: pending | confirmed | cancelled,
notes :: binary() | undefined,
reminder_sent :: boolean(),
confirmed_at :: calendar:datetime() | undefined,
created_at :: calendar:datetime(),
updated_at :: calendar:datetime()
@@ -122,6 +155,8 @@
comment :: binary(),
status :: visible | hidden | deleted,
reason :: binary() | undefined,
likes :: non_neg_integer(),
dislikes :: non_neg_integer(),
created_at :: calendar:datetime(),
updated_at :: calendar:datetime()
}).
@@ -188,3 +223,14 @@
ip :: binary(),
reason :: binary() | undefined
}).
%% ------------------- Уведомления (задача #12) ------------------------
-record(notification, {
id :: binary(),
user_id :: binary(),
type :: booking_confirmed | event_reminder | event_cancelled | custom,
title :: binary(),
body :: binary(),
is_read :: boolean(),
created_at :: calendar:datetime()
}).