Анализ и расширение структуры таблиц #12
This commit is contained in:
@@ -10,13 +10,20 @@
|
|||||||
role :: user | bot,
|
role :: user | bot,
|
||||||
status :: active | frozen | deleted,
|
status :: active | frozen | deleted,
|
||||||
reason :: binary() | undefined,
|
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(),
|
created_at :: calendar:datetime(),
|
||||||
updated_at :: calendar:datetime()
|
updated_at :: calendar:datetime()
|
||||||
}).
|
}).
|
||||||
|
|
||||||
-record(session, {
|
-record(session, {
|
||||||
token :: binary(), % JWT или refresh токен
|
|
||||||
user_id :: binary(),
|
user_id :: binary(),
|
||||||
|
token :: binary(), % JWT или refresh токен
|
||||||
expires_at :: calendar:datetime(),
|
expires_at :: calendar:datetime(),
|
||||||
type :: access | refresh
|
type :: access | refresh
|
||||||
}).
|
}).
|
||||||
@@ -28,14 +35,20 @@
|
|||||||
password_hash :: binary(),
|
password_hash :: binary(),
|
||||||
role :: superadmin | admin | moderator | support,
|
role :: superadmin | admin | moderator | support,
|
||||||
status :: active | blocked,
|
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(),
|
created_at :: calendar:datetime(),
|
||||||
updated_at :: calendar:datetime()
|
updated_at :: calendar:datetime()
|
||||||
}).
|
}).
|
||||||
|
|
||||||
%% ------------------- СЕССИИ АДМИНИСТРАТОРОВ ---------------------------
|
%% ------------------- СЕССИИ АДМИНИСТРАТОРОВ ---------------------------
|
||||||
-record(admin_session, {
|
-record(admin_session, {
|
||||||
token :: binary(),
|
|
||||||
admin_id :: binary(),
|
admin_id :: binary(),
|
||||||
|
token :: binary(),
|
||||||
expires_at :: calendar:datetime(),
|
expires_at :: calendar:datetime(),
|
||||||
type :: refresh
|
type :: refresh
|
||||||
}).
|
}).
|
||||||
@@ -46,9 +59,14 @@
|
|||||||
owner_id :: binary(),
|
owner_id :: binary(),
|
||||||
title :: binary(),
|
title :: binary(),
|
||||||
description :: binary(),
|
description :: binary(),
|
||||||
|
short_name :: binary() | undefined,
|
||||||
|
category :: binary() | undefined,
|
||||||
|
color :: binary() | undefined,
|
||||||
|
image_url :: binary() | undefined,
|
||||||
|
settings :: map() | undefined,
|
||||||
tags :: [binary()],
|
tags :: [binary()],
|
||||||
type :: personal | commercial,
|
type :: personal | commercial,
|
||||||
confirmation :: auto | manual | {timeout, integer()}, % секунд
|
confirmation :: auto | manual | {timeout, integer()}, % секунд
|
||||||
rating_avg :: float(),
|
rating_avg :: float(),
|
||||||
rating_count :: non_neg_integer(),
|
rating_count :: non_neg_integer(),
|
||||||
status :: active | frozen | deleted,
|
status :: active | frozen | deleted,
|
||||||
@@ -63,6 +81,17 @@
|
|||||||
rights :: read | write | admin
|
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, {
|
-record(location, {
|
||||||
address :: binary(),
|
address :: binary(),
|
||||||
lat :: float(),
|
lat :: float(),
|
||||||
@@ -77,7 +106,7 @@
|
|||||||
description :: binary(),
|
description :: binary(),
|
||||||
event_type :: single | recurring,
|
event_type :: single | recurring,
|
||||||
start_time :: calendar:datetime(),
|
start_time :: calendar:datetime(),
|
||||||
duration :: integer(), % минуты
|
duration :: integer(), % минуты
|
||||||
recurrence_rule :: binary() | undefined,
|
recurrence_rule :: binary() | undefined,
|
||||||
master_id :: binary() | undefined,
|
master_id :: binary() | undefined,
|
||||||
is_instance :: boolean(),
|
is_instance :: boolean(),
|
||||||
@@ -90,6 +119,8 @@
|
|||||||
reason :: binary() | undefined,
|
reason :: binary() | undefined,
|
||||||
rating_avg :: float(),
|
rating_avg :: float(),
|
||||||
rating_count :: non_neg_integer(),
|
rating_count :: non_neg_integer(),
|
||||||
|
attachments :: [binary()] | undefined,
|
||||||
|
edit_history :: [map()] | undefined,
|
||||||
created_at :: calendar:datetime(),
|
created_at :: calendar:datetime(),
|
||||||
updated_at :: calendar:datetime()
|
updated_at :: calendar:datetime()
|
||||||
}).
|
}).
|
||||||
@@ -104,9 +135,11 @@
|
|||||||
%% ------------------- Бронирования ------------------------------------
|
%% ------------------- Бронирования ------------------------------------
|
||||||
-record(booking, {
|
-record(booking, {
|
||||||
id :: binary(),
|
id :: binary(),
|
||||||
event_id :: binary(), % ссылка на конкретный экземпляр события
|
event_id :: binary(), % ссылка на конкретный экземпляр события
|
||||||
user_id :: binary(),
|
user_id :: binary(),
|
||||||
status :: pending | confirmed | cancelled,
|
status :: pending | confirmed | cancelled,
|
||||||
|
notes :: binary() | undefined,
|
||||||
|
reminder_sent :: boolean(),
|
||||||
confirmed_at :: calendar:datetime() | undefined,
|
confirmed_at :: calendar:datetime() | undefined,
|
||||||
created_at :: calendar:datetime(),
|
created_at :: calendar:datetime(),
|
||||||
updated_at :: calendar:datetime()
|
updated_at :: calendar:datetime()
|
||||||
@@ -122,6 +155,8 @@
|
|||||||
comment :: binary(),
|
comment :: binary(),
|
||||||
status :: visible | hidden | deleted,
|
status :: visible | hidden | deleted,
|
||||||
reason :: binary() | undefined,
|
reason :: binary() | undefined,
|
||||||
|
likes :: non_neg_integer(),
|
||||||
|
dislikes :: non_neg_integer(),
|
||||||
created_at :: calendar:datetime(),
|
created_at :: calendar:datetime(),
|
||||||
updated_at :: calendar:datetime()
|
updated_at :: calendar:datetime()
|
||||||
}).
|
}).
|
||||||
@@ -142,7 +177,7 @@
|
|||||||
-record(banned_word, {
|
-record(banned_word, {
|
||||||
id :: binary(),
|
id :: binary(),
|
||||||
word :: binary(),
|
word :: binary(),
|
||||||
added_by :: binary() | undefined, % id администратора, добавившего слово
|
added_by :: binary() | undefined, % id администратора, добавившего слово
|
||||||
added_at :: calendar:datetime() | undefined
|
added_at :: calendar:datetime() | undefined
|
||||||
}).
|
}).
|
||||||
|
|
||||||
@@ -153,7 +188,7 @@
|
|||||||
error_hash :: binary(),
|
error_hash :: binary(),
|
||||||
error_message :: binary(),
|
error_message :: binary(),
|
||||||
stacktrace :: binary(),
|
stacktrace :: binary(),
|
||||||
context :: binary(), % ← новое поле (term_to_binary)
|
context :: binary(), % ← новое поле (term_to_binary)
|
||||||
count :: non_neg_integer(),
|
count :: non_neg_integer(),
|
||||||
first_seen :: calendar:datetime(),
|
first_seen :: calendar:datetime(),
|
||||||
last_seen :: calendar:datetime(),
|
last_seen :: calendar:datetime(),
|
||||||
@@ -177,14 +212,25 @@
|
|||||||
|
|
||||||
%% ------------------- Аудит -------------------------------------------
|
%% ------------------- Аудит -------------------------------------------
|
||||||
-record(admin_audit, {
|
-record(admin_audit, {
|
||||||
id :: binary(),
|
id :: binary(),
|
||||||
admin_id :: binary(),
|
admin_id :: binary(),
|
||||||
email :: binary(),
|
email :: binary(),
|
||||||
role :: atom(),
|
role :: atom(),
|
||||||
action :: binary(),
|
action :: binary(),
|
||||||
entity_type :: binary(),
|
entity_type :: binary(),
|
||||||
entity_id :: binary(),
|
entity_id :: binary(),
|
||||||
timestamp :: calendar:datetime(),
|
timestamp :: calendar:datetime(),
|
||||||
ip :: binary(),
|
ip :: binary(),
|
||||||
reason :: binary() | undefined
|
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()
|
||||||
}).
|
}).
|
||||||
Reference in New Issue
Block a user