Updated validation rules

This commit is contained in:
Profitroll 2023-01-03 15:43:48 +01:00
parent b383ab6001
commit ccebccf086
3 changed files with 128 additions and 4 deletions

View File

@ -1,6 +1,87 @@
{ {
"$jsonSchema": { "$jsonSchema": {
"required": [], "required": [
"properties": {} "user",
"date",
"admin",
"application",
"application.1",
"application.2",
"application.3",
"application.3.name",
"application.3.adminName1",
"application.3.countryCode",
"application.3.countryName",
"application.3.location",
"application.4",
"application.5",
"application.6",
"application.7",
"application.8",
"application.9",
"application.10"
],
"properties": {
"user": {
"bsonType": ["int", "long"],
"description": "Telegram ID of user"
},
"date": {
"bsonType": "date",
"description": "Date when application was accepted"
},
"admin": {
"bsonType": ["int", "long"],
"description": "Telegram ID of admin that accepted the application"
},
"application": {
"bsonType": "object"
},
"application.1": {
"bsonType": "string"
},
"application.2": {
"bsonType": "date"
},
"application.3": {
"bsonType": "object"
},
"application.3.name": {
"bsonType": "string"
},
"application.3.adminName1": {
"bsonType": "string"
},
"application.3.countryCode": {
"bsonType": "string"
},
"application.3.countryName": {
"bsonType": "string"
},
"application.3.location": {
"bsonType": "array"
},
"application.4": {
"bsonType": "string"
},
"application.5": {
"bsonType": "string"
},
"application.6": {
"bsonType": "string"
},
"application.7": {
"bsonType": "string"
},
"application.8": {
"bsonType": "string"
},
"application.9": {
"bsonType": "string"
},
"application.10": {
"bsonType": "string"
}
}
} }
} }

View File

@ -1,6 +1,43 @@
{ {
"$jsonSchema": { "$jsonSchema": {
"required": [], "required": [
"properties": {} "user",
"date",
"admin",
"sponsorship",
"sponsorship.streamer",
"sponsorship.expires",
"sponsorship.proof",
"sponsorship.label"
],
"properties": {
"user": {
"bsonType": ["int", "long"],
"description": "Telegram ID of user"
},
"date": {
"bsonType": "date",
"description": "Date when sponsorship was accepted"
},
"admin": {
"bsonType": ["int", "long"],
"description": "Telegram ID of admin that accepted the sponsorship"
},
"sponsorship": {
"bsonType": "object"
},
"sponsorship.streamer": {
"bsonType": "string"
},
"sponsorship.expires": {
"bsonType": "date"
},
"sponsorship.proof": {
"bsonType": "binData"
},
"sponsorship.label": {
"bsonType": "string"
}
}
} }
} }

6
validation/tmp.json Normal file
View File

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