1 | const stringSchema = require('./string');
|
2 | const intervalSchema = require('./interval');
|
3 |
|
4 | const individualTest = /^[A-Z\d]+$/.source.toString();
|
5 | const snilsTest = /^\d{11}$/.source.toString();
|
6 |
|
7 | module.exports = {
|
8 | type: 'object',
|
9 | requied: ['name', 'location', 'positionName', 'individual', 'id', 'surname', 'patrName', 'firstName', 'speciality', 'fio', 'snils', 'room', 'position', 'interval'],
|
10 | properties: {
|
11 | name: stringSchema(),
|
12 | location: {
|
13 | type: 'integer'
|
14 | },
|
15 | positionName: stringSchema(),
|
16 | individual: stringSchema(individualTest),
|
17 | id: {
|
18 | type: 'integer'
|
19 | },
|
20 | surname: stringSchema(),
|
21 | patrName: stringSchema(),
|
22 | firstName: stringSchema(),
|
23 | firstName: stringSchema(),
|
24 | speciality: {
|
25 | type: 'integer'
|
26 | },
|
27 | fio: stringSchema(),
|
28 | snils: stringSchema(snilsTest),
|
29 | room: {
|
30 | type: 'string'
|
31 | },
|
32 | position: {
|
33 | type: 'integer'
|
34 | },
|
35 | birthDate: {
|
36 | type: 'string',
|
37 | format: 'date-time'
|
38 | },
|
39 | interval: {
|
40 | type: 'array',
|
41 | items: intervalSchema
|
42 | }
|
43 | }
|
44 | };
|