Projet

Général

Profil

0001-toulouse_maelis-correct-comments-in-schema-69046.patch

Nicolas Roche, 13 septembre 2022 19:48

Télécharger (6,13 ko)

Voir les différences:

Subject: [PATCH 1/3] toulouse_maelis: correct comments in schema (#69046)

 passerelle/contrib/toulouse_maelis/schemas.py | 21 ++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)
passerelle/contrib/toulouse_maelis/schemas.py
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 28
ID_PROPERTIES = {
30 29
    'firstname': {
31 30
        'description': 'Prénom',
32 31
        'type': 'string',
33 32
    },
34 33
    'lastname': {
35 34
        'description': 'Nom',
36 35
        'type': 'string',
37 36
    },
38 37
    'dateBirth': {
39 38
        'description': 'Date de naissance',
40 39
        'type': 'string',
41 40
        'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
42 41
    },
43 42
}
44 43

  
45

  
46 44
LINK_SCHEMA = {
47 45
    '$schema': 'http://json-schema.org/draft-04/schema#',
48 46
    'title': 'Link',
49 47
    'description': "Appairage d'un usager Publik à une famille dans Maelis",
50 48
    'type': 'object',
51 49
    'required': ['family_id', 'firstname', 'lastname', 'dateBirth'],
52 50
    'properties': {
53 51
        'family_id': {
54 52
            'description': 'Numéro DUI',
55 53
            'type': 'string',
56 54
        },
57 55
    },
58 56
}
59 57
LINK_SCHEMA['properties'].update(ID_PROPERTIES)
60 58

  
61

  
62 59
ISEXISTS_SCHEMA = {
63 60
    '$schema': 'http://json-schema.org/draft-04/schema#',
64
    'title': 'Link',
65
    'description': "Appairage d'un usager Publik à une famille dans Maelis",
61
    'title': 'Exist',
62
    'description': "Recherche d'un responsable légal ou d'un enfant dans Maelis",
66 63
    'type': 'object',
67 64
    'required': ['firstname', 'lastname', 'dateBirth'],
68 65
    'properties': ID_PROPERTIES,
69 66
}
70 67

  
71 68
ADDRESS_SCHEMA = {
72 69
    '$schema': 'http://json-schema.org/draft-04/schema#',
73 70
    'title': 'Address',
......
137 134
                },
138 135
            },
139 136
        },
140 137
    ],
141 138
}
142 139

  
143 140
ADDRESSPROF_SCHEMA = {
144 141
    '$schema': 'http://json-schema.org/draft-04/schema#',
145
    'title': 'Contact',
142
    'title': 'Adresse pro',
146 143
    'description': "Informations sur l'adresse professionnelle",
147 144
    'oneOf': [
148 145
        {'type': 'null'},
149 146
        {
150 147
            'type': 'object',
151 148
            'properties': {
152 149
                'num': {
153 150
                    'description': "Numéro de l'adresse",
......
198 195
                'addressPro': ADDRESSPROF_SCHEMA,
199 196
            },
200 197
        },
201 198
    ],
202 199
}
203 200

  
204 201
CAFINFO_SCHEMA = {
205 202
    '$schema': 'http://json-schema.org/draft-04/schema#',
206
    'title': 'Contact',
203
    'title': 'CAF',
207 204
    'description': 'Informations sur la CAF',
208 205
    'oneOf': [
209 206
        {'type': 'null'},
210 207
        {
211 208
            'type': 'object',
212 209
            'properties': {
213 210
                'number': {
214 211
                    'description': "Numéro d'allocataire",
......
220 217
                },
221 218
            },
222 219
        },
223 220
    ],
224 221
}
225 222

  
226 223
RLINFO_SCHEMA = {
227 224
    '$schema': 'http://json-schema.org/draft-04/schema#',
228
    'title': 'RLInfo',
225
    'title': 'RL',
229 226
    'description': "Informations sur le responsable légal",
230 227
    'type': 'object',
231 228
    'required': ['firstname', 'lastname', 'civility', 'quality', 'dateBirth', 'adresse'],
232 229
    'properties': {
233 230
        'civility': {
234 231
            'description': 'civilité (depuis référenciel)',
235 232
            'oneOf': [{'type': 'null'}, {'type': 'string'}],
236 233
        },
......
448 445
                },
449 446
            },
450 447
        },
451 448
    ],
452 449
}
453 450

  
454 451
PAIINFO_SCHEMA = {
455 452
    '$schema': 'http://json-schema.org/draft-04/schema#',
456
    'title': 'PAI Info',
453
    'title': 'PAI',
457 454
    'description': "Informations médicales",
458 455
    'oneOf': [
459 456
        {'type': 'null'},
460 457
        {
461 458
            'type': 'object',
462 459
            'properties': {
463 460
                'code': {
464 461
                    'description': 'Code',
......
524 521
        'medicalRecord': MEDICALRECORD_SCHEMA,
525 522
        'paiInfoBean': PAIINFO_SCHEMA,
526 523
    },
527 524
}
528 525
CHILD_SCHEMA['properties'].update(ID_PROPERTIES)
529 526

  
530 527
CONTACTLIGHT_SCHEMA = {
531 528
    '$schema': 'http://json-schema.org/draft-04/schema#',
532
    'title': 'Contact',
529
    'title': 'Contact light',
533 530
    'description': "Informations de contact pour les personnes autorisées à récupérer les enfants ou à prévenir en cas d'urgence",
534 531
    'oneOf': [
535 532
        {'type': 'null'},
536 533
        {
537 534
            'type': 'object',
538 535
            'properties': {
539 536
                'phone': {
540 537
                    'description': 'Téléphone',
......
550 547
                },
551 548
            },
552 549
        },
553 550
    ],
554 551
}
555 552

  
556 553
FAMILYPERSON_SCHEMA = {
557 554
    '$schema': 'http://json-schema.org/draft-04/schema#',
558
    'title': 'Family',
555
    'title': 'Family person',
559 556
    'description': "Informations sur les personnes autorisées à venir chercher les enfants ou à prévenir en cas d'urgence",
560 557
    'type': 'object',
561 558
    'required': ['firstname', 'lastname', 'dateBirth'],
562 559
    'properties': {
563 560
        'civility': {
564 561
            'description': 'civilité (depuis référenciel)',
565 562
            'oneOf': [{'type': 'null'}, {'type': 'string'}],
566 563
        },
......
571 568
        'contact': CONTACTLIGHT_SCHEMA,
572 569
    },
573 570
    'unflatten': True,
574 571
}
575 572
FAMILYPERSON_SCHEMA['properties'].update(ID_PROPERTIES)
576 573

  
577 574
AUTHORIZEDPERSON_SCHEMA = {
578 575
    '$schema': 'http://json-schema.org/draft-04/schema#',
579
    'title': 'Family',
576
    'title': 'Family persons',
580 577
    'description': "Informations sur les personnes autorisées à venir chercher les enfants ou à prévenir en cas d'urgence",
581 578
    'type': 'object',
582 579
    'properties': {
583 580
        'personList': {
584 581
            'oneOf': [
585 582
                {'type': 'null'},
586 583
                {
587 584
                    'type': 'array',
588
-