DB validation WIP

This commit is contained in:
Profitroll 2022-12-11 01:30:56 +01:00
parent c0f6bd8b11
commit 12d6273c9a
6 changed files with 98 additions and 0 deletions

View File

@ -0,0 +1,6 @@
{
"$jsonSchema": {
"required": [],
"properties": {}
}
}

6
validation/context.json Normal file
View File

@ -0,0 +1,6 @@
{
"$jsonSchema": {
"required": [],
"properties": {}
}
}

36
validation/messages.json Normal file
View File

@ -0,0 +1,36 @@
{
"$jsonSchema": {
"required": [
"origin",
"origin.chat",
"origin.id",
"destination",
"destination.chat",
"destination.id"
],
"properties": {
"origin": {
"bsonType": "object"
},
"origin.chat": {
"bsonType": ["int", "long"],
"description": "Telegram ID of message's origin chat"
},
"origin.id": {
"bsonType": ["int", "long"],
"description": "ID of message in origin chat"
},
"destination": {
"bsonType": "object"
},
"destination.chat": {
"bsonType": ["int", "long"],
"description": "Telegram ID of message's destination chat"
},
"destination.id": {
"bsonType": ["int", "long"],
"description": "ID of message in destination chat"
}
}
}
}

View File

@ -0,0 +1,6 @@
{
"$jsonSchema": {
"required": [],
"properties": {}
}
}

38
validation/users.json Normal file
View File

@ -0,0 +1,38 @@
{
"$jsonSchema": {
"required": [
"user",
"link",
"tg_name",
"tg_phone",
"tg_locale",
"tg_username"
],
"properties": {
"user": {
"bsonType": ["int", "long"],
"description": "Telegram ID of user"
},
"link": {
"bsonType": "string",
"description": "Invite link to destination group"
},
"tg_name": {
"bsonType": "string",
"description": "Telegram first name"
},
"tg_phone": {
"bsonType": "string",
"description": "Telegram phone number"
},
"tg_locale": {
"bsonType": "string",
"description": "Telegram locale"
},
"tg_username": {
"bsonType": "string",
"description": "Telegram username"
}
}
}
}

6
validation/warnings.json Normal file
View File

@ -0,0 +1,6 @@
{
"$jsonSchema": {
"required": [],
"properties": {}
}
}