clients
Key
_id  
objectId
NN
Key
masterId  
objectId
NN
Key
telegramUserId  
any
name  
string
NN
phone  
string
NN
createdAt  
date
NN
updatedAt  
date
NN
__v  
double
NN
deletedAt  
any
notes  
string
NN
Key
_id_
masters
Key
_id  
objectId
NN
Key
userId  
objectId
NN
businessName  
string
NN
category  
string
NN
description  
string
NN
address  
string
NN
slotDuration  
double
NN
planningHorizon  
double
NN
contacts{}  
object
NN
welcomeText  
string
NN
webhookSecret  
string
NN
timeZone  
string
NN
workingSchedule{}  
object
NN
knowledge[{}]  
object
NN
botLink  
string
NN
createdAt  
date
NN
updatedAt  
date
NN
__v  
double
NN
gptTokensUsed{}  
object
NN
masterName  
string
NN
fbUserAccessToken  
string
NN
fbUserAccessTokenExpiresAt  
date
NN
fbUserId  
string
NN
igUserId  
string
NN
pageAccessToken  
string
NN
pageId  
string
NN
pageTokenObtainedAt  
date
NN
calendarToken  
string
NN
tgBotToken  
string
NN
google{}  
object
NN
smartSlotsEnabled  
bool
NN
webhookSecretToken  
string
NN
Key
_id_
Key
webhookSecret_1
Key
calendarToken_1
users
Key
_id  
objectId
NN
tgId  
string
NN
username  
string
NN
firstName  
string
NN
lastName  
string
NN
langCode  
string
NN
isPremium  
bool
NN
status  
string
NN
avatar  
string
NN
createdAt  
date
NN
updatedAt  
date
NN
__v  
double
NN
name  
string
NN
phone  
string
NN
Key
_id_
Key
tgId_1
Key
igUserId_1
masterdayoverrides
Key
_id  
objectId
NN
date  
string
NN
Key
masterId  
objectId
NN
__v  
double
NN
blocks[{}]  
object
NN
createdAt  
date
NN
opens[{}]  
object
NN
source  
string
NN
updatedAt  
date
NN
Key
_id_
Key
masterId_1
Key
date_1
Key
masterId_1_date_1
Trial version
services
Key
_id  
objectId
NN
Key
master  
objectId
NN
name  
string
NN
description  
string
NN
price{}  
object
NN
duration{}  
object
NN
format  
string
NN
interactionType  
string
NN
maxParticipants  
double
NN
tags  
object
NN
images  
object
NN
isActive  
bool
NN
createdAt  
date
NN
updatedAt  
date
NN
__v  
double
NN
Key
_id_
gptusagelogs
Key
_id  
objectId
NN
Key
masterId  
objectId
NN
model  
string
NN
layer  
string
NN
inputTokens  
double
NN
outputTokens  
double
NN
totalCostUSD  
double
NN
isFunctionCall  
bool
NN
wasError  
bool
NN
createdAt  
date
NN
updatedAt  
date
NN
__v  
double
NN
Key
_id_
appointments
Key
_id  
objectId
NN
Key
masterId  
objectId
NN
Key
clientId  
objectId
NN
startTime  
date
NN
endTime  
date
NN
services[{}]  
object
NN
internalStatus  
string
NN
googleEventId  
string
NN
icsToken  
string
NN
createdAt  
date
NN
updatedAt  
date
NN
totalDuration{}  
object
NN
totalPrice{}  
object
NN
__v  
double
NN
notes  
string
NN
Key
_id_
Key
icsToken_1
messages
Key
_id  
objectId
NN
Key
user  
objectId
NN
Key
master  
objectId
NN
userTgId  
string
NN
role  
string
NN
content  
string
NN
function_call  
null
name  
null
tokensUsed{}  
object
NN
timestamp  
date
NN
__v  
double
NN
Key
_id_
Key
chatId_1
Key
timestamp_1
Key
chatId_1_timestamp_-1
contacts { } NN
phone  
string
NN
telegram  
string
NN
instagram  
string
NN
website  
string
NN
workingHours { } NN
from  
string
NN
to  
string
NN
Trial version
breaks [{ }] NN
from  
string
NN
to  
string
NN
workingHours { } NN
from  
string
NN
to  
string
NN
breaks [{ }] NN
from  
string
NN
to  
string
NN
workingHours { } NN
from  
string
NN
to  
string
NN
breaks [{ }] NN
from  
string
NN
to  
string
NN
workingHours { } NN
from  
string
NN
to  
string
NN
breaks [{ }] NN
from  
string
NN
to  
string
NN
workingHours { } NN
from  
string
NN
to  
string
NN
Trial version
breaks [{ }] NN
from  
string
NN
to  
string
NN
workingHours { } NN
from  
string
NN
to  
string
NN
breaks [{ }] NN
from  
string
NN
to  
string
NN
Trial version
knowledge [{ }] NN
type  
string
NN
content  
string
NN
gptTokensUsed { } NN
inputTokens  
double
NN
outputTokens  
double
NN
totalCostUSD  
double
NN
Trial version
google { } NN
isConnected  
bool
NN
calendarId  
string
NN
refreshToken  
string
NN
monday { } NN
isWorkingDay  
bool
NN
workingHours{}  
object
NN
breaks[{}]  
object
NN
tuesday { } NN
isWorkingDay  
bool
NN
workingHours{}  
object
NN
breaks[{}]  
object
NN
wednesday { } NN
isWorkingDay  
bool
NN
workingHours{}  
object
NN
breaks[{}]  
object
NN
thursday { } NN
isWorkingDay  
bool
NN
workingHours{}  
object
NN
breaks[{}]  
object
NN
Trial version
friday { } NN
isWorkingDay  
bool
NN
workingHours{}  
object
NN
breaks[{}]  
object
NN
saturday { } NN
isWorkingDay  
bool
NN
workingHours{}  
object
NN
breaks[{}]  
object
NN
workingSchedule { } NN
monday{}  
object
NN
tuesday{}  
object
NN
wednesday{}  
object
NN
thursday{}  
object
NN
friday{}  
object
NN
saturday{}  
object
NN
sunday{}  
object
NN
Trial version
blocks [{ }] NN
from  
string
NN
to  
string
NN
opens [{ }] NN
from  
string
NN
to  
string
NN
note  
string
NN
price { } NN
type  
string
NN
value  
double
NN
currency  
string
NN
duration { } NN
type  
string
NN
value  
double
NN
price { } NN
type  
string
NN
value  
double
NN
currency  
string
NN
duration { } NN
type  
string
NN
value  
double
NN
totalDuration { } NN
type  
string
NN
value  
double
NN
totalPrice { } NN
type  
string
NN
value  
double
NN
currency  
string
NN
services [{ }] NN
name  
string
NN
description  
string
NN
price{}  
object
NN
duration{}  
object
NN
format  
string
NN
interactionType  
string
NN
category  
null
preMeetingQuestions  
null
serviceId  
string
NN
tokensUsed { } NN
request  
double
NN
response  
double
NN
Key
_id  
objectId
NN
sunday { } NN
isWorkingDay  
bool
NN
workingHours{}  
object
NN
breaks[{}]  
object
NN
breaks [{ }] NN
from  
string
NN
to  
string
NN
workingHours { } NN
from  
string
NN
to  
string
NN

Documentation for project DEV
DEV
Project
Name
DEV
Diagram
Name
Main Diagram
Report
Generated
10/19/2025 | 9:47:33 PM
collections
Name
clients
Fields
Name
Data type
Array
Key
Required
_id
objectId
Yes
Yes
masterId
objectId
Yes
telegramUserId
any
Any type restrictions
"objectId","null"
name
string
Yes
phone
string
Yes
createdAt
date
Yes
updatedAt
date
Yes
__v
double
Yes
deletedAt
any
Any type restrictions
"date","null"
notes
string
Yes
Indexes
_id_
Create statement
db.clients.createIndex(
{
  "_id": 1
})

Name
masters
Fields
Name
Data type
Array
Key
Required
_id
objectId
Yes
Yes
userId
objectId
Yes
businessName
string
Yes
category
string
Yes
description
string
Yes
address
string
Yes
slotDuration
double
Yes
planningHorizon
double
Yes
contacts
Yes
welcomeText
string
Yes
webhookSecret
string
Yes
timeZone
string
Yes
workingSchedule
Yes
knowledge
Yes
Yes
botLink
string
Yes
createdAt
date
Yes
updatedAt
date
Yes
__v
double
Yes
gptTokensUsed
Yes
masterName
string
Yes
fbUserAccessToken
string
Yes
fbUserAccessTokenExpiresAt
date
Yes
fbUserId
string
Yes
igUserId
string
Yes
pageAccessToken
string
Yes
pageId
string
Yes
pageTokenObtainedAt
date
Yes
calendarToken
string
Yes
tgBotToken
string
Yes
google
Yes
smartSlotsEnabled
bool
Yes
webhookSecretToken
string
Yes
Indexes
_id_
Create statement
db.masters.createIndex(
{
  "_id": 1
})

webhookSecret_1
Create statement
db.masters.createIndex(
{
  "webhookSecret": 1
},
 {
  "background": true,
  "unique": true
}
)

calendarToken_1
Create statement
db.masters.createIndex(
{
  "calendarToken": 1
},
 {
  "background": true,
  "unique": true
}
)

Name
users
Fields
Name
Data type
Array
Key
Required
_id
objectId
Yes
Yes
tgId
string
Yes
username
string
Yes
firstName
string
Yes
lastName
string
Yes
langCode
string
Yes
isPremium
bool
Yes
status
string
Yes
avatar
string
Yes
createdAt
date
Yes
updatedAt
date
Yes
__v
double
Yes
name
string
Yes
phone
string
Yes
Indexes
_id_
Create statement
db.users.createIndex(
{
  "_id": 1
})

tgId_1
Create statement
db.users.createIndex(
{
  "tgId": 1
},
 {
  "background": true,
  "unique": true
}
)

igUserId_1
Create statement
db.users.createIndex(
{
  "igUserId": 1
},
 {
  "background": true
}
)

Name
masterdayoverrides
Fields
Name
Data type
Array
Key
Required
_id
objectId
Yes
Yes
date
string
Yes
masterId
objectId
Yes
__v
double
Yes
blocks
Yes
Yes
createdAt
date
Yes
opens
Yes
Yes
source
string
Yes
updatedAt
date
Yes
Indexes
_id_
Create statement
db.masterdayoverrides.createIndex(
{
  "_id": 1
})

masterId_1
Create statement
db.masterdayoverrides.createIndex(
{
  "masterId": 1
},
 {
  "background": true
}
)

date_1
Create statement
db.masterdayoverrides.createIndex(
{
  "date": 1
},
 {
  "background": true
}
)

masterId_1_date_1
Create statement
db.masterdayoverrides.createIndex(
{
  "masterId": 1,
  "date": 1
},
 {
  "background": true,
  "unique": true
}
)

Name
services
Fields
Name
Data type
Array
Key
Required
_id
objectId
Yes
Yes
master
objectId
Yes
name
string
Yes
description
string
Yes
price
Yes
duration
Yes
format
string
Yes
interactionType
string
Yes
maxParticipants
double
Yes
tags
object
Yes
images
object
Yes
isActive
bool
Yes
createdAt
date
Yes
updatedAt
date
Yes
__v
double
Yes
Indexes
_id_
Create statement
db.services.createIndex(
{
  "_id": 1
})

References
Name
gptusagelogs
Fields
Name
Data type
Array
Key
Required
_id
objectId
Yes
Yes
masterId
objectId
Yes
model
string
Yes
layer
string
Yes
inputTokens
double
Yes
outputTokens
double
Yes
totalCostUSD
double
Yes
isFunctionCall
bool
Yes
wasError
bool
Yes
createdAt
date
Yes
updatedAt
date
Yes
__v
double
Yes
Indexes
_id_
Create statement
db.gptusagelogs.createIndex(
{
  "_id": 1
})

Name
appointments
Fields
Name
Data type
Array
Key
Required
_id
objectId
Yes
Yes
masterId
objectId
Yes
clientId
objectId
Yes
startTime
date
Yes
endTime
date
Yes
services
Yes
Yes
internalStatus
string
Yes
googleEventId
string
Yes
icsToken
string
Yes
createdAt
date
Yes
updatedAt
date
Yes
totalDuration
Yes
totalPrice
Yes
__v
double
Yes
notes
string
Yes
Indexes
_id_
Create statement
db.appointments.createIndex(
{
  "_id": 1
})

icsToken_1
Create statement
db.appointments.createIndex(
{
  "icsToken": 1
},
 {
  "background": true,
  "unique": true
}
)

Name
messages
Fields
Name
Data type
Array
Key
Required
_id
objectId
Yes
Yes
user
objectId
Yes
master
objectId
Yes
userTgId
string
Yes
role
string
Yes
content
string
Yes
function_call
null
name
null
tokensUsed
Yes
timestamp
date
Yes
__v
double
Yes
Indexes
_id_
Create statement
db.messages.createIndex(
{
  "_id": 1
})

chatId_1
Create statement
db.messages.createIndex(
{
  "chatId": 1
},
 {
  "background": true
}
)

timestamp_1
Create statement
db.messages.createIndex(
{
  "timestamp": 1
},
 {
  "background": true
}
)

chatId_1_timestamp_-1
Create statement
db.messages.createIndex(
{
  "chatId": 1,
  "timestamp": -1
},
 {
  "background": true
}
)

Objects
Name
contacts
Fields
Name
Data type
Array
Key
Required
phone
string
Yes
telegram
string
Yes
instagram
string
Yes
website
string
Yes
Name
workingHours
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
breaks
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
workingHours
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
breaks
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
workingHours
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
breaks
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
workingHours
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
breaks
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
workingHours
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
breaks
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
workingHours
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
breaks
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
knowledge
Fields
Name
Data type
Array
Key
Required
type
string
Yes
content
string
Yes
Name
gptTokensUsed
Fields
Name
Data type
Array
Key
Required
inputTokens
double
Yes
outputTokens
double
Yes
totalCostUSD
double
Yes
Name
google
Fields
Name
Data type
Array
Key
Required
isConnected
bool
Yes
calendarId
string
Yes
refreshToken
string
Yes
Name
monday
Fields
Name
Data type
Array
Key
Required
isWorkingDay
bool
Yes
workingHours
Yes
breaks
Yes
Yes
Name
tuesday
Fields
Name
Data type
Array
Key
Required
isWorkingDay
bool
Yes
workingHours
Yes
breaks
Yes
Yes
Name
wednesday
Fields
Name
Data type
Array
Key
Required
isWorkingDay
bool
Yes
workingHours
Yes
breaks
Yes
Yes
Name
thursday
Fields
Name
Data type
Array
Key
Required
isWorkingDay
bool
Yes
workingHours
Yes
breaks
Yes
Yes
Name
friday
Fields
Name
Data type
Array
Key
Required
isWorkingDay
bool
Yes
workingHours
Yes
breaks
Yes
Yes
Name
saturday
Fields
Name
Data type
Array
Key
Required
isWorkingDay
bool
Yes
workingHours
Yes
breaks
Yes
Yes
Name
workingSchedule
Fields
Name
Data type
Array
Key
Required
monday
Yes
tuesday
Yes
wednesday
Yes
thursday
Yes
friday
Yes
saturday
Yes
sunday
Yes
Name
blocks
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
opens
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
note
string
Yes
Name
price
Fields
Name
Data type
Array
Key
Required
type
string
Yes
value
double
Yes
currency
string
Yes
Name
duration
Fields
Name
Data type
Array
Key
Required
type
string
Yes
value
double
Yes
Name
price
Fields
Name
Data type
Array
Key
Required
type
string
Yes
value
double
Yes
currency
string
Yes
Name
duration
Fields
Name
Data type
Array
Key
Required
type
string
Yes
value
double
Yes
Name
totalDuration
Fields
Name
Data type
Array
Key
Required
type
string
Yes
value
double
Yes
Name
totalPrice
Fields
Name
Data type
Array
Key
Required
type
string
Yes
value
double
Yes
currency
string
Yes
Name
services
Fields
Name
Data type
Array
Key
Required
name
string
Yes
description
string
Yes
price
Yes
duration
Yes
format
string
Yes
interactionType
string
Yes
category
null
preMeetingQuestions
null
serviceId
string
Yes
Name
tokensUsed
Fields
Name
Data type
Array
Key
Required
request
double
Yes
response
double
Yes
_id
objectId
Yes
Name
sunday
Fields
Name
Data type
Array
Key
Required
isWorkingDay
bool
Yes
workingHours
Yes
breaks
Yes
Yes
Name
breaks
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
Name
workingHours
Fields
Name
Data type
Array
Key
Required
from
string
Yes
to
string
Yes
references
Name
masters-clients.masterId
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
users-clients.telegramUserId
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
users-masters.userId
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
masters-masterdayoverrides.masterId
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
masters-services.master
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
masters-gptusagelogs.masterId
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
clients-appointments.clientId
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
masters-appointments.masterId
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
users-messages.user
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Name
masters-messages.master
Name
Source
Target
Cardinality type:
One to
many
Ordinality:
Optional
Optional
Lines