20 |
20 |
{'type': 'boolean'},
|
21 |
21 |
{
|
22 |
22 |
'type': 'string',
|
23 |
23 |
'pattern': '^([Oo][Uu][Ii]|[Nn][Oo][Nn]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee]|1|0)$',
|
24 |
24 |
'pattern_description': 'Les valeurs "0", "1", "true", "false", "oui" ou "non" sont autorisées (insensibles à la casse).',
|
25 |
25 |
},
|
26 |
26 |
]
|
27 |
27 |
|
|
28 |
|
|
29 |
ID_PROPERTIES = {
|
|
30 |
'firstname': {
|
|
31 |
'description': 'Prénom',
|
|
32 |
'type': 'string',
|
|
33 |
},
|
|
34 |
'lastname': {
|
|
35 |
'description': 'Nom',
|
|
36 |
'type': 'string',
|
|
37 |
},
|
|
38 |
'dateBirth': {
|
|
39 |
'description': 'Date de naissance',
|
|
40 |
'type': 'string',
|
|
41 |
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
42 |
},
|
|
43 |
}
|
|
44 |
|
|
45 |
|
28 |
46 |
LINK_SCHEMA = {
|
29 |
47 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
30 |
48 |
'title': 'Link',
|
31 |
49 |
'description': "Appairage d'un usager Publik à une famille dans Maelis",
|
32 |
50 |
'type': 'object',
|
33 |
51 |
'required': ['family_id', 'firstname', 'lastname', 'dateBirth'],
|
34 |
52 |
'properties': {
|
35 |
53 |
'family_id': {
|
36 |
54 |
'description': 'Numéro DUI',
|
37 |
55 |
'type': 'string',
|
38 |
56 |
},
|
39 |
|
'firstname': {
|
40 |
|
'description': 'Prénom du RL1',
|
41 |
|
'type': 'string',
|
42 |
|
},
|
43 |
|
'lastname': {
|
44 |
|
'description': 'Nom du RL1',
|
45 |
|
'type': 'string',
|
46 |
|
},
|
47 |
|
'dateBirth': {
|
48 |
|
'description': 'Date de naissance du RL1',
|
49 |
|
'type': 'string',
|
50 |
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
51 |
|
},
|
52 |
57 |
},
|
53 |
58 |
}
|
|
59 |
LINK_SCHEMA['properties'].update(ID_PROPERTIES)
|
|
60 |
|
54 |
61 |
|
55 |
62 |
ISEXISTS_SCHEMA = {
|
56 |
63 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
57 |
64 |
'title': 'Link',
|
58 |
65 |
'description': "Appairage d'un usager Publik à une famille dans Maelis",
|
59 |
66 |
'type': 'object',
|
60 |
|
'required': ['firstname', 'lastname', 'datebirth'],
|
61 |
|
'properties': {
|
62 |
|
'firstname': {
|
63 |
|
'description': 'Prénom',
|
64 |
|
'type': 'string',
|
65 |
|
},
|
66 |
|
'lastname': {
|
67 |
|
'description': 'Nom',
|
68 |
|
'type': 'string',
|
69 |
|
},
|
70 |
|
'datebirth': {
|
71 |
|
'description': 'Date de naissance',
|
72 |
|
'type': 'string',
|
73 |
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
74 |
|
},
|
75 |
|
},
|
|
67 |
'required': ['firstname', 'lastname', 'dateBirth'],
|
|
68 |
'properties': ID_PROPERTIES,
|
76 |
69 |
}
|
77 |
70 |
|
78 |
71 |
ADDRESS_SCHEMA = {
|
79 |
72 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
80 |
73 |
'title': 'Address',
|
81 |
74 |
'description': 'Informations sur une adresse',
|
82 |
75 |
'type': 'object',
|
83 |
76 |
'required': ['street1', 'town', 'zipcode'],
|
... | ... | |
236 |
229 |
'description': "Informations sur le responsable légal",
|
237 |
230 |
'type': 'object',
|
238 |
231 |
'required': ['firstname', 'lastname', 'quality', 'dateBirth', 'adresse'],
|
239 |
232 |
'properties': {
|
240 |
233 |
'civility': {
|
241 |
234 |
'description': 'civilité (depuis référenciel)',
|
242 |
235 |
'oneOf': [{'type': 'null'}, {'type': 'string'}],
|
243 |
236 |
},
|
244 |
|
'firstname': {
|
245 |
|
'description': 'Prénom',
|
246 |
|
'type': 'string',
|
247 |
|
},
|
248 |
|
'lastname': {
|
249 |
|
'description': 'Nom',
|
250 |
|
'type': 'string',
|
251 |
|
},
|
252 |
237 |
'quality': {
|
253 |
238 |
'description': 'Qualité',
|
254 |
239 |
'type': 'string',
|
255 |
240 |
},
|
256 |
|
'dateBirth': {
|
257 |
|
'description': 'Date de naissance',
|
258 |
|
'type': 'string',
|
259 |
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
260 |
|
},
|
261 |
241 |
'adresse': ADDRESS_SCHEMA,
|
262 |
242 |
'contact': CONTACT_SCHEMA,
|
263 |
243 |
'profession': PROFESSION_SCHEMA,
|
264 |
244 |
'CAFInfo': CAFINFO_SCHEMA,
|
265 |
245 |
},
|
266 |
246 |
}
|
|
247 |
RLINFO_SCHEMA['properties'].update(ID_PROPERTIES)
|
267 |
248 |
|
268 |
249 |
CHILDBIRTH_SCHEMA = {
|
269 |
250 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
270 |
251 |
'title': 'Child birth',
|
271 |
252 |
'description': "Informations sur la naissance d'un enfant",
|
272 |
253 |
'type': 'object',
|
273 |
254 |
'required': ['dateBirth'],
|
274 |
255 |
'properties': {
|
... | ... | |
517 |
498 |
'description': "Informations sur la création d'un enfant",
|
518 |
499 |
'type': 'object',
|
519 |
500 |
'required': ['sexe', 'firstname', 'lastname'],
|
520 |
501 |
'oneOf': [
|
521 |
502 |
{'required': ['dateBirth']}, # createFamily
|
522 |
503 |
{'required': ['birth']}, # updateFamily
|
523 |
504 |
],
|
524 |
505 |
'properties': {
|
525 |
|
'firstname': {
|
526 |
|
'description': 'Prénom',
|
527 |
|
'type': 'string',
|
528 |
|
},
|
529 |
|
'lastname': {
|
530 |
|
'description': 'Nom',
|
531 |
|
'type': 'string',
|
532 |
|
},
|
533 |
506 |
'sexe': {
|
534 |
507 |
'description': 'Sexe',
|
535 |
508 |
'type': 'string',
|
536 |
509 |
},
|
537 |
|
'dateBirth': {
|
538 |
|
'description': 'Date de naissance',
|
539 |
|
'type': 'string',
|
540 |
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
541 |
|
},
|
542 |
510 |
'birth': CHILDBIRTH_SCHEMA,
|
543 |
511 |
'dietcode': {
|
544 |
512 |
'description': 'Code de régime alimentaire',
|
545 |
513 |
'oneOf': [{'type': 'null'}, {'type': 'string'}],
|
546 |
514 |
},
|
547 |
515 |
'bPhoto': {
|
548 |
516 |
'description': 'Autorisation photo',
|
549 |
517 |
'oneOf': BOOLEAN_TYPES,
|
... | ... | |
552 |
520 |
'description': 'Autorisation à partir seul',
|
553 |
521 |
'oneOf': BOOLEAN_TYPES,
|
554 |
522 |
},
|
555 |
523 |
'fsl': FSL_SCHEMA,
|
556 |
524 |
'medicalRecord': MEDICALRECORD_SCHEMA,
|
557 |
525 |
'paiInfoBean': PAIINFO_SCHEMA,
|
558 |
526 |
},
|
559 |
527 |
}
|
|
528 |
CHILD_SCHEMA['properties'].update(ID_PROPERTIES)
|
560 |
529 |
|
561 |
530 |
CONTACTLIGHT_SCHEMA = {
|
562 |
531 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
563 |
532 |
'title': 'Contact',
|
564 |
533 |
'description': "Informations de contact pour les personnes autorisées à récupérer les enfants ou à prévenir en cas d'urgence",
|
565 |
534 |
'oneOf': [
|
566 |
535 |
{'type': 'null'},
|
567 |
536 |
{
|
... | ... | |
590 |
559 |
'description': "Informations sur les personnes autorisées à venir chercher les enfants ou à prévenir en cas d'urgence",
|
591 |
560 |
'type': 'object',
|
592 |
561 |
'required': ['firstname', 'lastname', 'dateBirth'],
|
593 |
562 |
'properties': {
|
594 |
563 |
'civility': {
|
595 |
564 |
'description': 'civilité (depuis référenciel)',
|
596 |
565 |
'oneOf': [{'type': 'null'}, {'type': 'string'}],
|
597 |
566 |
},
|
598 |
|
'firstname': {
|
599 |
|
'description': 'Prénom',
|
600 |
|
'type': 'string',
|
601 |
|
},
|
602 |
|
'lastname': {
|
603 |
|
'description': 'Nom',
|
604 |
|
'type': 'string',
|
605 |
|
},
|
606 |
567 |
'quality': {
|
607 |
568 |
'description': 'Qualité',
|
608 |
569 |
'oneOf': [{'type': 'null'}, {'type': 'string'}],
|
609 |
570 |
},
|
610 |
|
'dateBirth': {
|
611 |
|
'description': 'Date de naissance',
|
612 |
|
'type': 'string',
|
613 |
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
614 |
|
},
|
615 |
571 |
'contact': CONTACTLIGHT_SCHEMA,
|
616 |
572 |
},
|
617 |
573 |
'unflatten': True,
|
618 |
574 |
}
|
|
575 |
FAMILYPERSON_SCHEMA['properties'].update(ID_PROPERTIES)
|
619 |
576 |
|
620 |
577 |
AUTHORIZEDPERSON_SCHEMA = {
|
621 |
578 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
622 |
579 |
'title': 'Family',
|
623 |
580 |
'description': "Informations sur les personnes autorisées à venir chercher les enfants ou à prévenir en cas d'urgence",
|
624 |
581 |
'type': 'object',
|
625 |
582 |
'properties': {
|
626 |
583 |
'personList': {
|