From 12d6273c9a620df0a78b85f3005922f5f6ab305c Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Sun, 11 Dec 2022 01:30:56 +0100 Subject: [PATCH] DB validation WIP --- validation/applications.json | 6 ++++++ validation/context.json | 6 ++++++ validation/messages.json | 36 ++++++++++++++++++++++++++++++++++ validation/sponsorships.json | 6 ++++++ validation/users.json | 38 ++++++++++++++++++++++++++++++++++++ validation/warnings.json | 6 ++++++ 6 files changed, 98 insertions(+) create mode 100644 validation/applications.json create mode 100644 validation/context.json create mode 100644 validation/messages.json create mode 100644 validation/sponsorships.json create mode 100644 validation/users.json create mode 100644 validation/warnings.json diff --git a/validation/applications.json b/validation/applications.json new file mode 100644 index 0000000..026bd47 --- /dev/null +++ b/validation/applications.json @@ -0,0 +1,6 @@ +{ + "$jsonSchema": { + "required": [], + "properties": {} + } +} \ No newline at end of file diff --git a/validation/context.json b/validation/context.json new file mode 100644 index 0000000..026bd47 --- /dev/null +++ b/validation/context.json @@ -0,0 +1,6 @@ +{ + "$jsonSchema": { + "required": [], + "properties": {} + } +} \ No newline at end of file diff --git a/validation/messages.json b/validation/messages.json new file mode 100644 index 0000000..6148354 --- /dev/null +++ b/validation/messages.json @@ -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" + } + } + } +} \ No newline at end of file diff --git a/validation/sponsorships.json b/validation/sponsorships.json new file mode 100644 index 0000000..026bd47 --- /dev/null +++ b/validation/sponsorships.json @@ -0,0 +1,6 @@ +{ + "$jsonSchema": { + "required": [], + "properties": {} + } +} \ No newline at end of file diff --git a/validation/users.json b/validation/users.json new file mode 100644 index 0000000..9a7a19d --- /dev/null +++ b/validation/users.json @@ -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" + } + } + } +} \ No newline at end of file diff --git a/validation/warnings.json b/validation/warnings.json new file mode 100644 index 0000000..026bd47 --- /dev/null +++ b/validation/warnings.json @@ -0,0 +1,6 @@ +{ + "$jsonSchema": { + "required": [], + "properties": {} + } +} \ No newline at end of file