Projet

Général

Profil

0001-toulouse-maelis-add-functional-tests-71647.patch

Nicolas Roche, 24 novembre 2022 11:59

Télécharger (97,4 ko)

Voir les différences:

Subject: [PATCH] toulouse-maelis: add functional tests (#71647)

 functests/toulouse_maelis/.gitignore          |   1 +
 functests/toulouse_maelis/README              |  22 +
 functests/toulouse_maelis/__init__.py         |   0
 functests/toulouse_maelis/conftest.py         | 412 +++++++++++
 functests/toulouse_maelis/conftest.py~        |   9 +
 .../data/test_create_child.json               |  26 +
 .../data/test_create_family.json              | 226 ++++++
 .../toulouse_maelis/data/test_create_rl2.json |  38 +
 .../data/test_read_category_list.json         |  14 +
 .../data/test_read_civility_list.json         |  10 +
 .../data/test_read_csp_list.json              | 110 +++
 .../data/test_read_dietcode_list.json         |  34 +
 .../data/test_read_organ_list.json            | 370 ++++++++++
 .../data/test_read_pai_list.json              |  18 +
 .../data/test_read_quality_list.json          |  70 ++
 .../data/test_read_quotient_list.json         |  26 +
 .../data/test_read_situation_list.json        |  38 +
 .../data/test_read_vaccin_list.json           |  82 +++
 .../data/test_update_child.json               | 108 +++
 .../test_update_child_medical_record.json     |  23 +
 .../data/test_update_child_pai.json           |   7 +
 .../data/test_update_child_person.json        |  41 ++
 .../data/test_update_coordinate.json          |  54 ++
 .../data/test_update_family.json              | 318 ++++++++
 .../data/test_update_family_ras.json          | 260 +++++++
 .../data/test_update_person.json              |  31 +
 .../toulouse_maelis/data/test_update_rl1.json |  38 +
 .../toulouse_maelis/data/test_update_rl2.json |  54 ++
 functests/toulouse_maelis/read_family.py      |  35 +
 functests/toulouse_maelis/test_family.py      | 693 ++++++++++++++++++
 functests/toulouse_maelis/test_misc.py        |  59 ++
 31 files changed, 3227 insertions(+)
 create mode 100644 functests/toulouse_maelis/.gitignore
 create mode 100644 functests/toulouse_maelis/README
 create mode 100644 functests/toulouse_maelis/__init__.py
 create mode 100644 functests/toulouse_maelis/conftest.py
 create mode 100644 functests/toulouse_maelis/conftest.py~
 create mode 100644 functests/toulouse_maelis/data/test_create_child.json
 create mode 100644 functests/toulouse_maelis/data/test_create_family.json
 create mode 100644 functests/toulouse_maelis/data/test_create_rl2.json
 create mode 100644 functests/toulouse_maelis/data/test_read_category_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_civility_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_csp_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_dietcode_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_organ_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_pai_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_quality_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_quotient_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_situation_list.json
 create mode 100644 functests/toulouse_maelis/data/test_read_vaccin_list.json
 create mode 100644 functests/toulouse_maelis/data/test_update_child.json
 create mode 100644 functests/toulouse_maelis/data/test_update_child_medical_record.json
 create mode 100644 functests/toulouse_maelis/data/test_update_child_pai.json
 create mode 100644 functests/toulouse_maelis/data/test_update_child_person.json
 create mode 100644 functests/toulouse_maelis/data/test_update_coordinate.json
 create mode 100644 functests/toulouse_maelis/data/test_update_family.json
 create mode 100644 functests/toulouse_maelis/data/test_update_family_ras.json
 create mode 100644 functests/toulouse_maelis/data/test_update_person.json
 create mode 100644 functests/toulouse_maelis/data/test_update_rl1.json
 create mode 100644 functests/toulouse_maelis/data/test_update_rl2.json
 create mode 100755 functests/toulouse_maelis/read_family.py
 create mode 100644 functests/toulouse_maelis/test_family.py
 create mode 100644 functests/toulouse_maelis/test_misc.py
functests/toulouse_maelis/.gitignore
1
*.res
functests/toulouse_maelis/README
1
Functional tests for the Toulouse Maelis connector
2

  
3
Description
4
===========
5

  
6
This test suite will use the web API of a passerelle Toulouse Maelis
7
connector to link a Publik account and check that the connector is
8
behaving as expected.
9

  
10

  
11
Usage
12
=====
13

  
14
You will need a running passerelle instance, whith the Toulouse Maelis connector instance configured to connect to
15
a Maelis server.
16
Suppose that the Toulouse Mealis connector instance is listening here :
17

  
18
    http://127.0.0.1:8000/toulouse-maelis/test
19

  
20
Then you would start the test suite with the following command:
21

  
22
    $ py.test -sx --url=http://127.0.0.1:8000/toulouse-maelis/test test_toulouse_maelis.py
functests/toulouse_maelis/conftest.py
1
import copy
2
import datetime
3
import json
4
import os
5
import subprocess
6
import time
7
from uuid import uuid4
8

  
9
import pytest
10
import requests
11
from django.core.serializers.json import DjangoJSONEncoder
12
from zeep.helpers import serialize_object
13

  
14
FAMILY_PAYLOAD = {
15
    'category': 'BI',
16
    'situation': 'VM',
17
    'rl1': {
18
        'civility': 'MME',
19
        'firstname': 'Marge',
20
        'lastname': 'Simpson',
21
        'maidenName': 'Bouvier',
22
        'quality': 'MERE',
23
        'birth': {'dateBirth': '1950-10-01'},
24
        'adresse': {'street1': 'Evergreen Terrace', 'town': 'Springfield', 'zipcode': '62701'},
25
    },
26
    'rl2': {
27
        'civility': 'M.',
28
        'firstname': 'Homer',
29
        'lastname': 'Simpson',
30
        'quality': 'PERE',
31
        'birth': {'dateBirth': '1956-05-12'},
32
        'adresse': {
33
            'num': '742',
34
            'numComp': None,
35
            'street1': 'Evergreen Terrace',
36
            'street2': None,
37
            'town': 'Springfield',
38
            'zipcode': '90701',
39
        },
40
        'contact': {
41
            'isContactMail': True,
42
            'isContactSms': True,
43
            'isInvoicePdf': True,
44
            'mail': 'homer.simpson@example.org.com',
45
            'mobile': '0622222222',
46
            'phone': '0122222222',
47
        },
48
        'profession': {
49
            'addressPro': {
50
                'num': None,
51
                'street': None,
52
                'town': 'Springfield',
53
                'zipcode': '90701',
54
            },
55
            'codeCSP': '13',
56
            'employerName': 'Burns',
57
            'phone': '0133333333',
58
            'profession': 'Inspecteur de sécurité',
59
        },
60
        'CAFInfo': {
61
            'number': '123',
62
            'organ': 'A10007752822',
63
        },
64
    },
65
    'childList': [
66
        {
67
            'sexe': 'M',
68
            'firstname': 'Bart',
69
            'lastname': 'Simpson',
70
            'birth': {'dateBirth': '1978-04-01'},
71
            'bPhoto': True,
72
            'bLeaveAlone': True,
73
            'dietcode': 'STD',
74
            'paiInfoBean': {
75
                'code': 'PAIMED',
76
                'dateDeb': '2022-09-01',
77
                'dateFin': '2023-07-01',
78
                'description': 'mischievous, rebellious, misunderstood, disruptive',
79
            },
80
            'medicalRecord': {
81
                'familyDoctor': {
82
                    'name': 'MONROE',
83
                    'phone': '0612341234',
84
                    'address': {
85
                        'street1': 'Alameda',
86
                        'zipcode': '90701',
87
                        'town': 'Springfield',
88
                    },
89
                },
90
                'allergy1': 'butterscotch, imitation butterscotch, glow-in-the-dark monster make-up',
91
                'allergy2': 'shrimp and cauliflower',
92
                'comment1': "the shrimp allergy isn't fully identified",
93
                'comment2': None,
94
                'observ1': 'Ay Caramba!',
95
                'observ2': 'Eat my shorts!',
96
                'isAuthHospital': True,
97
                'hospital': 'Springfield General Hospital',
98
                'vaccinList': [
99
                    {
100
                        'code': 'DTC',
101
                        'vaccinationDate': '2011-01-11',
102
                    },
103
                    {
104
                        'code': 'ROR',
105
                        'vaccinationDate': '2022-02-22',
106
                    },
107
                ],
108
            },
109
            'authorizedPersonList': [
110
                {
111
                    'personInfo': {
112
                        'civility': 'M.',
113
                        'firstname': 'Abraham Jebediah',
114
                        'lastname': 'Simpson',
115
                        'dateBirth': '1927-05-24',
116
                        'sexe': 'M',
117
                        'contact': {
118
                            'phone': '0312345678',
119
                            'mobile': '',
120
                            'mail': 'abe.simpson@example.org',
121
                        },
122
                    },
123
                    'personQuality': {
124
                        'code': 'GPP',
125
                    },
126
                },
127
                {
128
                    'personInfo': {
129
                        'civility': 'MME',
130
                        'firstname': 'Mona Penelope',
131
                        'lastname': 'Simpson',
132
                        'dateBirth': '1929-03-15',
133
                        'sexe': 'F',
134
                        'contact': {
135
                            'phone': '0412345678',
136
                            'mobile': '0612345678',
137
                            'mail': 'mona.simpson@example.org',
138
                        },
139
                    },
140
                    'personQuality': {
141
                        'code': 'GMP',
142
                    },
143
                },
144
            ],
145
        },
146
        {
147
            'sexe': 'F',
148
            'firstname': 'Lisa',
149
            'lastname': 'Simpson',
150
            'birth': {'dateBirth': '1980-05-09'},
151
            'dietcode': 'RSV',
152
            'paiInfoBean': {
153
                'code': 'PAIALI',
154
            },
155
        },
156
        {
157
            'sexe': 'F',
158
            'firstname': 'Maggie',
159
            'lastname': 'Simpson',
160
            'birth': {'dateBirth': '1989-12-17'},
161
            'dietcode': 'BB',
162
        },
163
    ],
164
    'emergencyPersonList': [
165
        {
166
            'civility': 'MME',
167
            'firstname': 'Patty',
168
            'lastname': 'Bouvier',
169
            'dateBirth': '1948-08-30',
170
            'sexe': 'F',
171
            'quality': 'T',
172
            'contact': {
173
                'phone': '0112345678',
174
                'mobile': '0612345678',
175
                'mail': 'patty.bouvier@example.org',
176
            },
177
        },
178
        {
179
            'civility': 'MME',
180
            'firstname': 'Selma',
181
            'lastname': 'Bouvier',
182
            'dateBirth': '1946-04-29',
183
            'sexe': 'F',
184
            'quality': 'OS',
185
            'contact': {
186
                'phone': '0112345678',
187
                'mobile': '0612345678',
188
                'mail': 'selma.bouvier@example.org',
189
            },
190
        },
191
    ],
192
}
193

  
194

  
195
def pytest_addoption(parser):
196
    parser.addoption(
197
        '--url',
198
        help='Url of a passerelle Toulouse Maelis connector instance',
199
        default='https://parsifal-passerelle.dev.publik.love/toulouse-maelis/test',
200
    )
201
    parser.addoption('--nameid', help='Publik Name ID', default='functest')
202
    parser.addoption('--dui', help='DUI number', default='')
203

  
204

  
205
def unlink(conn, name_id):
206
    url = conn + '/unlink?NameID=%s' % name_id
207
    resp = requests.post(url)
208
    resp.raise_for_status()
209
    return resp
210

  
211

  
212
def link(conn, data):
213
    url = conn + '/link?NameID=%s' % data['name_id']
214
    payload = {
215
        'family_id': data['family_id'],
216
        'firstname': data['family_payload']['rl1']['firstname'],
217
        'lastname': data['family_payload']['rl1']['lastname'],
218
        'dateBirth': data['family_payload']['rl1']['birth']['dateBirth'],
219
    }
220
    resp = requests.post(url, json=payload)
221
    resp.raise_for_status()
222
    res = resp.json()
223
    assert res == {'data': 'ok', 'err': 0}
224

  
225

  
226
def read_family(conn, name_id):
227
    url = conn + '/read-family?NameID=%s' % name_id
228
    resp = requests.get(url)
229
    resp.raise_for_status()
230
    res = resp.json()
231
    assert res['err'] == 0
232
    return res['data']
233

  
234

  
235
def diff(result, expected_file):
236
    class JSONEncoder(DjangoJSONEncoder):
237
        def default(self, o):
238
            if isinstance(o, time.struct_time):
239
                o = datetime.datetime(*tuple(o)[:6])
240
            return super().default(o)
241

  
242
    expected_file_path = 'data/' + expected_file
243
    assert os.path.isfile(expected_file_path), 'please, touch %s' % expected_file_path
244

  
245
    result_file_path = '/tmp/%s.res' % expected_file
246
    with open(result_file_path, 'w') as json_file:
247
        json.dump(serialize_object(result), json_file, cls=DjangoJSONEncoder, indent=2)
248
        json_file.write('\n')
249
    cmd = 'diff %s %s' % (result_file_path, expected_file_path)
250
    output = subprocess.run(cmd, shell=True, check=False, stdout=None, stderr=None)
251
    assert output.returncode == 0, 'please, %s' % cmd
252
    return True
253

  
254

  
255
def remove_id_on_child(child):
256
    child['num'] = 'N/A'
257
    child['lastname'] = 'N/A'
258
    child['mother'] = 'N/A'  # dont care yet
259
    child['father'] = 'N/A'  # dont care yet
260
    for person in child['authorizedPersonList']:
261
        person['personInfo']['num'] = 'N/A'
262

  
263

  
264
def remove_id_on_rlg(rlg):
265
    if rlg:
266
        rlg['num'] = 'N/A'
267
        rlg['lastname'] = 'N/A'
268

  
269

  
270
def remove_id_on_family(family):
271
    family['number'] = 'N/A'
272
    remove_id_on_rlg(family['RL1'])
273
    remove_id_on_rlg(family['RL2'])
274
    for child in family['childList']:
275
        remove_id_on_child(child)
276
    for person in family['emergencyPersonList']:
277
        person['numPerson'] = 'N/A'
278

  
279

  
280
def diff_child(conn, name_id, index, expected_file, key=None):
281
    data = read_family(conn, name_id)
282
    child = copy.deepcopy(data['childList'][index])
283
    remove_id_on_child(child)
284
    if not key:
285
        assert diff(child, expected_file)
286
    else:
287
        assert diff(child[key], expected_file)
288
    return data
289

  
290

  
291
def diff_rlg(conn, name_id, index, expected_file):
292
    data = read_family(conn, name_id)
293
    rlg = copy.deepcopy(data['RL%s' % index])
294
    remove_id_on_rlg(rlg)
295
    assert diff(rlg, expected_file)
296
    return data
297

  
298

  
299
def diff_family(conn, name_id, expected_file, key=None):
300
    data = read_family(conn, name_id)
301
    family = copy.deepcopy(data)
302
    remove_id_on_family(family)
303
    if not key:
304
        assert diff(family, expected_file)
305
    else:
306
        assert diff(family[key], expected_file)
307
    return data
308

  
309

  
310
@pytest.fixture(scope='session')
311
def conn(request):
312
    return request.config.getoption('--url')
313

  
314

  
315
@pytest.fixture(scope='session')
316
def create_data(request, conn):
317
    name_id = request.config.getoption('--nameid')
318
    unlink(conn, name_id)
319
    lastname = uuid4().hex[0:30]
320

  
321
    # create family
322
    create_family_payload = copy.deepcopy(FAMILY_PAYLOAD)
323
    del create_family_payload['childList'][1]  # without Lisa
324
    del create_family_payload['rl2']  # without Homer
325
    create_family_payload['rl1']['lastname'] = lastname
326
    for child in create_family_payload['childList']:
327
        child['lastname'] = lastname
328

  
329
    url = conn + '/create-family?NameID=%s' % name_id
330
    resp = requests.post(url, json=create_family_payload)
331
    resp.raise_for_status()
332
    create_result = resp.json()
333
    assert create_result['err'] == 0
334
    print('\ncreate DUI: %s' % str(create_result['data']['number']))
335
    data = diff_family(conn, name_id, 'test_create_family.json')
336

  
337
    return {
338
        'name_id': name_id,  # linked
339
        'family_id': str(create_result['data']['number']),
340
        'lastname': lastname,
341
        'family_payload': create_family_payload,
342
        'data': data,
343
    }
344

  
345

  
346
@pytest.fixture(scope='session')
347
def update_data(request, conn):
348
    name_id = request.config.getoption('--nameid')
349
    unlink(conn, name_id)
350

  
351
    debug = False  # True allow to create then update a new family
352
    if debug:
353
        lastname = 'something new'
354
        FAMILY_PAYLOAD['rl1']['lastname'] = lastname
355
        FAMILY_PAYLOAD['rl2']['lastname'] = lastname
356
        for child in FAMILY_PAYLOAD['childList']:
357
            child['lastname'] = lastname
358

  
359
    # try to re-create test family
360
    url = conn + '/create-family?NameID=%s' % name_id
361
    resp = requests.post(url, json=FAMILY_PAYLOAD)
362
    resp.raise_for_status()
363
    create_result = resp.json()
364
    if not create_result['err']:
365
        # create DUI if it is the first time the test is run
366
        family_id = str(create_result['data']['number'])
367
        print('\ncreate DUI: %s' % family_id)
368
    elif 'E54a' in create_result['err']:
369
        # else find DUI number in the error message
370
        family_id = str(create_result['err_desc'][-7:-1])
371
        print('\nre-use DUI: %s' % family_id)
372
        # and link NameID to it
373
        url = conn + '/link?NameID=%s' % name_id
374
        link_payload = {
375
            'family_id': family_id,
376
            'firstname': FAMILY_PAYLOAD['rl1']['firstname'],
377
            'lastname': FAMILY_PAYLOAD['rl1']['lastname'],
378
            'dateBirth': FAMILY_PAYLOAD['rl1']['birth']['dateBirth'],
379
        }
380
        resp = requests.post(url, json=link_payload)
381
        resp.raise_for_status()
382
        assert not resp.json()['err']
383
    else:
384
        # FAMILY_PAYLOAD looks wrong
385
        assert False, create_result
386

  
387
    # update DUI
388
    data = read_family(conn, name_id)
389
    update_family_payload = copy.deepcopy(FAMILY_PAYLOAD)
390
    for i, child in enumerate(update_family_payload['childList']):
391
        child['num'] = data['childList'][i]['num']  # required for update
392

  
393
    url = conn + '/update-family?NameID=%s' % name_id
394
    resp = requests.post(url, json=update_family_payload)
395
    resp.raise_for_status()
396
    assert resp.json()['err'] == 0
397

  
398
    if debug:
399
        data = read_family(conn, name_id)
400
    else:
401
        data = diff_family(conn, name_id, 'test_update_family.json')
402

  
403
    return {
404
        'name_id': name_id,  # linked
405
        'family_id': family_id,
406
        'family_payload': update_family_payload,
407
        'rl2_num': data['RL2']['num'],
408
        'bart_num': data['childList'][0]['num'],
409
        'lisa_num': data['childList'][1]['num'],
410
        'maggie_num': data['childList'][2]['num'],
411
        'data': data,
412
    }
functests/toulouse_maelis/conftest.py~
1
import pytest
2

  
3

  
4
def pytest_addoption(parser):
5
    parser.addoption("--cmis-connector-url", help="Url of a passerelle CMIS connector instance")
6
    parser.addoption("--cmis-endpoint", help="Url of a passerelle CMIS endpoint")
7
    parser.addoption("--cmis-username", help="Username for the CMIS endpoint")
8
    parser.addoption("--cmis-password", help="Password for the CMIS endpoint")
9
    parser.addoption("--preserve-tree", action="store_true", default=False, help="Preserve test directory")
functests/toulouse_maelis/data/test_create_child.json
1
{
2
  "num": "N/A",
3
  "lastname": "N/A",
4
  "firstname": "LISA",
5
  "sexe": "M",
6
  "birth": {
7
    "dateBirth": "1980-05-09T00:00:00+02:00",
8
    "place": null,
9
    "communeCode": null,
10
    "countryCode": null
11
  },
12
  "dietcode": null,
13
  "bPhoto": false,
14
  "bLeaveAlone": false,
15
  "authorizedPersonList": [],
16
  "indicatorList": [],
17
  "medicalRecord": null,
18
  "insurance": null,
19
  "paiInfoBean": null,
20
  "mother": "N/A",
21
  "father": "N/A",
22
  "rl": null,
23
  "subscribeSchoolList": [],
24
  "subscribeActivityList": [],
25
  "sexe_text": "Masculin"
26
}
functests/toulouse_maelis/data/test_create_family.json
1
{
2
  "number": "N/A",
3
  "category": "BI",
4
  "situation": "VM",
5
  "flagCom": true,
6
  "nbChild": null,
7
  "nbTotalChild": null,
8
  "nbAES": null,
9
  "RL1": {
10
    "num": "N/A",
11
    "firstname": "MARGE",
12
    "lastname": "N/A",
13
    "maidenName": "BOUVIER",
14
    "quality": "MERE",
15
    "civility": "MME",
16
    "birth": {
17
      "dateBirth": "1950-10-01T00:00:00+01:00",
18
      "place": null,
19
      "communeCode": null,
20
      "countryCode": null
21
    },
22
    "adresse": {
23
      "idStreet": null,
24
      "num": 0,
25
      "numComp": null,
26
      "street1": "Evergreen Terrace",
27
      "street2": null,
28
      "town": "Springfield",
29
      "zipcode": "62701"
30
    },
31
    "contact": {
32
      "phone": null,
33
      "mobile": null,
34
      "mail": null,
35
      "isContactMail": false,
36
      "isContactSms": false,
37
      "isInvoicePdf": false
38
    },
39
    "profession": null,
40
    "CAFInfo": null,
41
    "indicatorList": [],
42
    "quotientList": [],
43
    "subscribeActivityList": [],
44
    "civility_text": "Madame",
45
    "quality_text": "MERE"
46
  },
47
  "RL2": null,
48
  "quotientList": [],
49
  "childList": [
50
    {
51
      "num": "N/A",
52
      "lastname": "N/A",
53
      "firstname": "BART",
54
      "sexe": "M",
55
      "birth": {
56
        "dateBirth": "1978-04-01T00:00:00+01:00",
57
        "place": null,
58
        "communeCode": null,
59
        "countryCode": null
60
      },
61
      "dietcode": "STD",
62
      "bPhoto": true,
63
      "bLeaveAlone": true,
64
      "authorizedPersonList": [
65
        {
66
          "personInfo": {
67
            "num": "N/A",
68
            "lastname": "SIMPSON",
69
            "firstname": "ABRAHAM JEBEDIAH",
70
            "dateBirth": "1927-05-24T00:00:00+01:00",
71
            "civility": "M.",
72
            "sexe": "M",
73
            "contact": {
74
              "phone": "0312345678",
75
              "mobile": null,
76
              "mail": "abe.simpson@example.org"
77
            },
78
            "civility_text": "Monsieur",
79
            "sexe_text": "Masculin"
80
          },
81
          "personQuality": {
82
            "code": "GPP",
83
            "libelle": "GRAND-PERE PATERNEL",
84
            "code_text": "GRAND-PERE PATERNEL"
85
          }
86
        },
87
        {
88
          "personInfo": {
89
            "num": "N/A",
90
            "lastname": "SIMPSON",
91
            "firstname": "MONA PENELOPE",
92
            "dateBirth": "1929-03-15T00:00:00Z",
93
            "civility": "MME",
94
            "sexe": "F",
95
            "contact": {
96
              "phone": "0412345678",
97
              "mobile": "0612345678",
98
              "mail": "mona.simpson@example.org"
99
            },
100
            "civility_text": "Madame",
101
            "sexe_text": "F\u00e9minin"
102
          },
103
          "personQuality": {
104
            "code": "GMP",
105
            "libelle": "GRAND-MERE PATERNELLE",
106
            "code_text": "GRAND-MERE PATERNELLE"
107
          }
108
        }
109
      ],
110
      "indicatorList": [],
111
      "medicalRecord": {
112
        "familyDoctor": {
113
          "name": "MONROE",
114
          "phone": "0612341234",
115
          "address": {
116
            "street1": "Alameda",
117
            "zipcode": "90701",
118
            "town": "Springfield"
119
          }
120
        },
121
        "allergy1": "butterscotch, imitation butterscotch, glow-in-the-dark monster make-up",
122
        "allergy2": "shrimp and cauliflower",
123
        "comment1": "the shrimp allergy isn't fully identified",
124
        "comment2": null,
125
        "observ1": "Ay Caramba!",
126
        "observ2": "Ay Caramba!",
127
        "isAuthHospital": false,
128
        "hospital": null,
129
        "vaccinList": [
130
          {
131
            "code": "ROR",
132
            "label": "ROUGEOLE-OREILLONS-RUBEOLE",
133
            "vaccinationDate": "2022-02-22T00:00:00+01:00"
134
          },
135
          {
136
            "code": "DTC",
137
            "label": "DIPHTERIE TETANOS COQUELUCHE",
138
            "vaccinationDate": "2011-01-11T00:00:00+01:00"
139
          }
140
        ]
141
      },
142
      "insurance": null,
143
      "paiInfoBean": {
144
        "code": "PAIMED",
145
        "dateDeb": "2022-09-01T00:00:00+02:00",
146
        "dateFin": "2023-07-01T00:00:00+02:00",
147
        "description": "mischievous, rebellious, misunderstood, disruptive",
148
        "code_text": "MEDICAL"
149
      },
150
      "mother": "N/A",
151
      "father": "N/A",
152
      "rl": null,
153
      "subscribeSchoolList": [],
154
      "subscribeActivityList": [],
155
      "sexe_text": "Masculin",
156
      "dietcode_text": "1- REPAS STANDARD"
157
    },
158
    {
159
      "num": "N/A",
160
      "lastname": "N/A",
161
      "firstname": "MAGGIE",
162
      "sexe": "F",
163
      "birth": {
164
        "dateBirth": "1989-12-17T00:00:00+01:00",
165
        "place": null,
166
        "communeCode": null,
167
        "countryCode": null
168
      },
169
      "dietcode": "BB",
170
      "bPhoto": false,
171
      "bLeaveAlone": false,
172
      "authorizedPersonList": [],
173
      "indicatorList": [],
174
      "medicalRecord": null,
175
      "insurance": null,
176
      "paiInfoBean": null,
177
      "mother": "N/A",
178
      "father": "N/A",
179
      "rl": null,
180
      "subscribeSchoolList": [],
181
      "subscribeActivityList": [],
182
      "sexe_text": "F\u00e9minin",
183
      "dietcode_text": "REPAS BEBE"
184
    }
185
  ],
186
  "emergencyPersonList": [
187
    {
188
      "numPerson": "N/A",
189
      "civility": "MME",
190
      "firstname": "PATTY",
191
      "lastname": "BOUVIER",
192
      "dateBirth": "1948-08-30T00:00:00+01:00",
193
      "sexe": "F",
194
      "quality": "T",
195
      "contact": {
196
        "phone": "0112345678",
197
        "mobile": "0612345678",
198
        "mail": "patty.bouvier@example.org"
199
      },
200
      "civility_text": "Madame",
201
      "quality_text": "TANTE",
202
      "sexe_text": "F\u00e9minin"
203
    },
204
    {
205
      "numPerson": "N/A",
206
      "civility": "MME",
207
      "firstname": "SELMA",
208
      "lastname": "BOUVIER",
209
      "dateBirth": "1946-04-29T00:00:00+01:00",
210
      "sexe": "F",
211
      "quality": "OS",
212
      "contact": {
213
        "phone": "0112345678",
214
        "mobile": "0612345678",
215
        "mail": "selma.bouvier@example.org"
216
      },
217
      "civility_text": "Madame",
218
      "quality_text": "ORGANISME SOCIAL",
219
      "sexe_text": "F\u00e9minin"
220
    }
221
  ],
222
  "indicatorList": [],
223
  "childErrorList": [],
224
  "category_text": "BIPARENTALE",
225
  "situation_text": "Vivant maritalement"
226
}
functests/toulouse_maelis/data/test_create_rl2.json
1
{
2
  "num": "N/A",
3
  "firstname": "HOMER",
4
  "lastname": "N/A",
5
  "maidenName": null,
6
  "quality": "PERE",
7
  "civility": "M.",
8
  "birth": {
9
    "dateBirth": "1956-05-12T00:00:00+01:00",
10
    "place": null,
11
    "communeCode": null,
12
    "countryCode": null
13
  },
14
  "adresse": {
15
    "idStreet": null,
16
    "num": 742,
17
    "numComp": null,
18
    "street1": "Evergreen Terrace",
19
    "street2": null,
20
    "town": "Springfield",
21
    "zipcode": "90701"
22
  },
23
  "contact": {
24
    "phone": null,
25
    "mobile": null,
26
    "mail": null,
27
    "isContactMail": false,
28
    "isContactSms": false,
29
    "isInvoicePdf": false
30
  },
31
  "profession": null,
32
  "CAFInfo": null,
33
  "indicatorList": [],
34
  "quotientList": [],
35
  "subscribeActivityList": [],
36
  "civility_text": "Monsieur",
37
  "quality_text": "PERE"
38
}
functests/toulouse_maelis/data/test_read_category_list.json
1
[
2
  {
3
    "id": "BI",
4
    "text": "BIPARENTALE"
5
  },
6
  {
7
    "id": "ACCEUI",
8
    "text": "FAMILLE D'ACCUEIL"
9
  },
10
  {
11
    "id": "MONO",
12
    "text": "MONOPARENTALE"
13
  }
14
]
functests/toulouse_maelis/data/test_read_civility_list.json
1
[
2
  {
3
    "id": "MME",
4
    "text": "Madame"
5
  },
6
  {
7
    "id": "M.",
8
    "text": "Monsieur"
9
  }
10
]
functests/toulouse_maelis/data/test_read_csp_list.json
1
[
2
  {
3
    "id": "14",
4
    "text": "AGENT DE MAITRISE"
5
  },
6
  {
7
    "id": "1",
8
    "text": "AGRICULTEUR"
9
  },
10
  {
11
    "id": "ART",
12
    "text": "ARTISAN"
13
  },
14
  {
15
    "id": "2",
16
    "text": "ARTISAN-COMMERCANT"
17
  },
18
  {
19
    "id": "15",
20
    "text": "AUTRES"
21
  },
22
  {
23
    "id": "CADR",
24
    "text": "CADRE"
25
  },
26
  {
27
    "id": "13",
28
    "text": "CADRE SUPERIEUR"
29
  },
30
  {
31
    "id": "3",
32
    "text": "CHEF D'ENTREPRISE"
33
  },
34
  {
35
    "id": "CHOM",
36
    "text": "CHOMEUR"
37
  },
38
  {
39
    "id": "COMM",
40
    "text": "COMMERCANT"
41
  },
42
  {
43
    "id": "10",
44
    "text": "DEMANDEUR D'EMPLOI"
45
  },
46
  {
47
    "id": "DIV",
48
    "text": "DIVERS"
49
  },
50
  {
51
    "id": "5",
52
    "text": "EMPLOYE"
53
  },
54
  {
55
    "id": "17",
56
    "text": "ENSEIGNANT"
57
  },
58
  {
59
    "id": "8",
60
    "text": "ETUDIANT"
61
  },
62
  {
63
    "id": "11",
64
    "text": "FONCTIONNAIRE"
65
  },
66
  {
67
    "id": "MAIR",
68
    "text": "MAIRIE DE NICE"
69
  },
70
  {
71
    "id": "6",
72
    "text": "OUVRIER"
73
  },
74
  {
75
    "id": "PERENS",
76
    "text": "PERISCO ENSEIGNANT"
77
  },
78
  {
79
    "id": "PEREXT",
80
    "text": "PERISCO EXTERNE"
81
  },
82
  {
83
    "id": "PERMAI",
84
    "text": "PERISCO MAIRIE DE NICE"
85
  },
86
  {
87
    "id": "PERANI",
88
    "text": "PERISCO S.ANIMATION"
89
  },
90
  {
91
    "id": "LIB",
92
    "text": "PROFESSION LIBERALE"
93
  },
94
  {
95
    "id": "12",
96
    "text": "RETRAITE"
97
  },
98
  {
99
    "id": "RMI",
100
    "text": "REVENU MINIMUM D'INSERTION"
101
  },
102
  {
103
    "id": "SANPRO",
104
    "text": "SANS PROFESSION"
105
  },
106
  {
107
    "id": "SEC",
108
    "text": "SECRETAIRE"
109
  }
110
]
functests/toulouse_maelis/data/test_read_dietcode_list.json
1
[
2
  {
3
    "id": "BB",
4
    "text": "REPAS BEBE"
5
  },
6
  {
7
    "id": "MSP",
8
    "text": "REPAS MOYEN SANS PORC"
9
  },
10
  {
11
    "id": "MSV",
12
    "text": "REPAS MOYEN SANS VIANDE"
13
  },
14
  {
15
    "id": "MST",
16
    "text": "REPAS MOYEN STANDARD"
17
  },
18
  {
19
    "id": "STD",
20
    "text": "1- REPAS STANDARD"
21
  },
22
  {
23
    "id": "RSP",
24
    "text": "2- R\u00c9GIME SANS PORC"
25
  },
26
  {
27
    "id": "RSV",
28
    "text": "3- R\u00c9GIME SANS VIANDE"
29
  },
30
  {
31
    "id": "PAI",
32
    "text": "4- PROTOCOLE D'ACCUEIL INDIVIDUALIS\u00c9"
33
  }
34
]
functests/toulouse_maelis/data/test_read_organ_list.json
1
[
2
  {
3
    "id": "A10004460232",
4
    "text": "LEVENS"
5
  },
6
  {
7
    "id": "A10007752822",
8
    "text": "LA COLLE SUR LOUP"
9
  },
10
  {
11
    "id": "A10001133770",
12
    "text": "ASSIM"
13
  },
14
  {
15
    "id": "A10007751483",
16
    "text": "EZE"
17
  },
18
  {
19
    "id": "A10008152785",
20
    "text": "LUCERAM"
21
  },
22
  {
23
    "id": "A10008170056",
24
    "text": "SAINT ANDRE LE MANOIR"
25
  },
26
  {
27
    "id": "A10008425613",
28
    "text": "LA TRINITE ENFANTS PLACES"
29
  },
30
  {
31
    "id": "A10001496896",
32
    "text": "MONTJOYE"
33
  },
34
  {
35
    "id": "A10001715627",
36
    "text": "FOYER DE L'ENFANCE DES AM"
37
  },
38
  {
39
    "id": "A10007182676",
40
    "text": "LA TRINITE"
41
  },
42
  {
43
    "id": "A10010030250",
44
    "text": "PUGET SUR ARGENS"
45
  },
46
  {
47
    "id": "A10001481849",
48
    "text": "BEAUSOLEIL"
49
  },
50
  {
51
    "id": "A10000980674",
52
    "text": "SAINT JEAN CAP FERRAT"
53
  },
54
  {
55
    "id": "A10000980692",
56
    "text": "BERRE LES ALPES"
57
  },
58
  {
59
    "id": "A10001314895",
60
    "text": "VILLE DE NICE"
61
  },
62
  {
63
    "id": "A10001474792",
64
    "text": "PEP 06 - CORNICHE"
65
  },
66
  {
67
    "id": "A10001474782",
68
    "text": "PEP 06 MADELEINE"
69
  },
70
  {
71
    "id": "A10007182941",
72
    "text": "VALBONNE SOPHIA ANTIPOLIS"
73
  },
74
  {
75
    "id": "A10007182961",
76
    "text": "GATTIERES"
77
  },
78
  {
79
    "id": "A10010601009",
80
    "text": "FONDATION DE NICE"
81
  },
82
  {
83
    "id": "A10001427675",
84
    "text": "CANNES"
85
  },
86
  {
87
    "id": "A10000802907",
88
    "text": "VILLEFRANCHE SUR MER"
89
  },
90
  {
91
    "id": "A10000802910",
92
    "text": "SAINT ANDRE DE LA ROCHE"
93
  },
94
  {
95
    "id": "A10007751693",
96
    "text": "SAINT LAURENT DU VAR"
97
  },
98
  {
99
    "id": "A10007751913",
100
    "text": "LA TOUR"
101
  },
102
  {
103
    "id": "A10001039676",
104
    "text": "IME CORNICHE FLEURIE"
105
  },
106
  {
107
    "id": "A10001612084",
108
    "text": "VENCE"
109
  },
110
  {
111
    "id": "A10000980566",
112
    "text": "ANTIBES"
113
  },
114
  {
115
    "id": "A10000980567",
116
    "text": "ASPREMONT"
117
  },
118
  {
119
    "id": "A10000980568",
120
    "text": "CAGNES SUR MER"
121
  },
122
  {
123
    "id": "A10000980569",
124
    "text": "CASTAGNIERS"
125
  },
126
  {
127
    "id": "A10000980570",
128
    "text": "CONTES"
129
  },
130
  {
131
    "id": "A10000980571",
132
    "text": "FALICON"
133
  },
134
  {
135
    "id": "A10000980572",
136
    "text": "GILETTE"
137
  },
138
  {
139
    "id": "A10000980573",
140
    "text": "TOUET DE L ESCARENE"
141
  },
142
  {
143
    "id": "A10001715572",
144
    "text": "CAP D AIL"
145
  },
146
  {
147
    "id": "A10000980575",
148
    "text": "MENTON"
149
  },
150
  {
151
    "id": "A10000980577",
152
    "text": "ROQUEBRUNE CAP MARTIN"
153
  },
154
  {
155
    "id": "A10000980584",
156
    "text": "VALLAURIS"
157
  },
158
  {
159
    "id": "A10001715581",
160
    "text": "TOURRETTE LEVENS"
161
  },
162
  {
163
    "id": "A10004071438",
164
    "text": "ASSOCIATION LOU MERILHOUN LEVENS"
165
  },
166
  {
167
    "id": "A10007179260",
168
    "text": "BEAULIEU SUR MER"
169
  },
170
  {
171
    "id": "A10000980388",
172
    "text": "APAJH"
173
  },
174
  {
175
    "id": "A10007751440",
176
    "text": "CARROS"
177
  },
178
  {
179
    "id": "A10007751441",
180
    "text": "BLAUSASC"
181
  },
182
  {
183
    "id": "A10000979354",
184
    "text": "ATIAM"
185
  },
186
  {
187
    "id": "A10000979370",
188
    "text": "UDAF"
189
  },
190
  {
191
    "id": "A10000979372",
192
    "text": "ALVA 06"
193
  },
194
  {
195
    "id": "A10000979373",
196
    "text": "IES CLEMENT ADER"
197
  },
198
  {
199
    "id": "A10000979374",
200
    "text": "ALC L OLIVIER"
201
  },
202
  {
203
    "id": "A10000979375",
204
    "text": "IESEDA LES CHANTERELLES"
205
  },
206
  {
207
    "id": "A10000979376",
208
    "text": "IME TERRASSES"
209
  },
210
  {
211
    "id": "A10007751879",
212
    "text": "SAINT PAUL DE VENCE"
213
  },
214
  {
215
    "id": "A10007753594",
216
    "text": "VILLENEUVE LOUBET"
217
  },
218
  {
219
    "id": "A10013129309",
220
    "text": "TOURETTES-SUR-LOUP"
221
  },
222
  {
223
    "id": "A10013447888",
224
    "text": "COLOMARS"
225
  },
226
  {
227
    "id": "A10015115495",
228
    "text": "BREIL SUR ROYA"
229
  },
230
  {
231
    "id": "A10015255908",
232
    "text": "GRASSE"
233
  },
234
  {
235
    "id": "A10016957436",
236
    "text": "SAINT BLAISE"
237
  },
238
  {
239
    "id": "A10013128210",
240
    "text": "BONSON"
241
  },
242
  {
243
    "id": "A10013128217",
244
    "text": "CANTARON"
245
  },
246
  {
247
    "id": "A10015126217",
248
    "text": "MANDELIEU"
249
  },
250
  {
251
    "id": "A10015528233",
252
    "text": "THEOULE SUR MER"
253
  },
254
  {
255
    "id": "A10016401771",
256
    "text": "ASCROS"
257
  },
258
  {
259
    "id": "A10016990309",
260
    "text": "CANNES LA BOCCA"
261
  },
262
  {
263
    "id": "A10012498607",
264
    "text": "LA GAUDE"
265
  },
266
  {
267
    "id": "A10013123067",
268
    "text": "DRAP"
269
  },
270
  {
271
    "id": "A10014621894",
272
    "text": "MALAUSSENE"
273
  },
274
  {
275
    "id": "A10014922597",
276
    "text": "ROQUEFORT LES PINS"
277
  },
278
  {
279
    "id": "A10014927854",
280
    "text": "L ESCARENE"
281
  },
282
  {
283
    "id": "A10014938988",
284
    "text": "MOUGINS"
285
  },
286
  {
287
    "id": "A10013129048",
288
    "text": "SOSPEL"
289
  },
290
  {
291
    "id": "A10013459160",
292
    "text": "LE CANNET"
293
  },
294
  {
295
    "id": "A10015677583",
296
    "text": "SAINT MARTIN DU VAR"
297
  },
298
  {
299
    "id": "A10017265908",
300
    "text": "BIOT"
301
  },
302
  {
303
    "id": "A10000980576",
304
    "text": "PEILLON"
305
  },
306
  {
307
    "id": "A10024933344",
308
    "text": "LES ARCS"
309
  },
310
  {
311
    "id": "A10024933368",
312
    "text": "LA TURBIE"
313
  },
314
  {
315
    "id": "A10024933442",
316
    "text": "SAINT JULIEN"
317
  },
318
  {
319
    "id": "A10021971554",
320
    "text": "SAINT JEANNET"
321
  },
322
  {
323
    "id": "A10019717953",
324
    "text": "PEILLE"
325
  },
326
  {
327
    "id": "g",
328
    "text": "REGIME GENERAL"
329
  },
330
  {
331
    "id": "a",
332
    "text": "REGIMES AUTRES"
333
  },
334
  {
335
    "id": "a11003995450",
336
    "text": "REGIME MSA"
337
  },
338
  {
339
    "id": "a11013011612",
340
    "text": "REGIME SNCF"
341
  },
342
  {
343
    "id": "a11017891473",
344
    "text": "REGIME GENERAL MONACO"
345
  },
346
  {
347
    "id": "a11015961838",
348
    "text": "REGIME EDF/GDF - TITULAIRE"
349
  },
350
  {
351
    "id": "a11015961839",
352
    "text": "REGIME MONACO"
353
  },
354
  {
355
    "id": "a11025419517",
356
    "text": "TRIBUNAL DE GRANDE INSTANCE DE NICE"
357
  },
358
  {
359
    "id": "A10026769374",
360
    "text": "LA ROQUETTE SUR VAR"
361
  },
362
  {
363
    "id": "A10027856948",
364
    "text": "BAR-SUR-LOUP"
365
  },
366
  {
367
    "id": "A10029519260",
368
    "text": "TOUET SUR VAR"
369
  }
370
]
functests/toulouse_maelis/data/test_read_pai_list.json
1
[
2
  {
3
    "id": "PAIALI",
4
    "text": "ALIMENTAIRE"
5
  },
6
  {
7
    "id": "PAIO",
8
    "text": "AUTRE"
9
  },
10
  {
11
    "id": "PAIMED",
12
    "text": "MEDICAL"
13
  },
14
  {
15
    "id": "PAI2",
16
    "text": "MEDICAL ET ALIMENTAIRE"
17
  }
18
]
functests/toulouse_maelis/data/test_read_quality_list.json
1
[
2
  {
3
    "id": "AU",
4
    "text": "AUTRE"
5
  },
6
  {
7
    "id": "BP",
8
    "text": "BEAU PERE"
9
  },
10
  {
11
    "id": "BM",
12
    "text": "BELLE MERE"
13
  },
14
  {
15
    "id": "CONSO",
16
    "text": "CONSOMMATEUR"
17
  },
18
  {
19
    "id": "EN",
20
    "text": "ENFANT"
21
  },
22
  {
23
    "id": "FS",
24
    "text": "FRERES ET SOEURS"
25
  },
26
  {
27
    "id": "GM",
28
    "text": "GRAND MERE MATERNELLE"
29
  },
30
  {
31
    "id": "GP",
32
    "text": "GRAND PERE MATERNEL"
33
  },
34
  {
35
    "id": "GMP",
36
    "text": "GRAND-MERE PATERNELLE"
37
  },
38
  {
39
    "id": "GPP",
40
    "text": "GRAND-PERE PATERNEL"
41
  },
42
  {
43
    "id": "MAIRIE",
44
    "text": "MAIRIE"
45
  },
46
  {
47
    "id": "MERE",
48
    "text": "MERE"
49
  },
50
  {
51
    "id": "O",
52
    "text": "ONCLE"
53
  },
54
  {
55
    "id": "OS",
56
    "text": "ORGANISME SOCIAL"
57
  },
58
  {
59
    "id": "PERE",
60
    "text": "PERE"
61
  },
62
  {
63
    "id": "T",
64
    "text": "TANTE"
65
  },
66
  {
67
    "id": "TUTEUR",
68
    "text": "TUTEUR"
69
  }
70
]
functests/toulouse_maelis/data/test_read_quotient_list.json
1
[
2
  {
3
    "id": "QF",
4
    "text": "GRILLE DE QUOTIENT"
5
  },
6
  {
7
    "id": "QCLSH",
8
    "text": "QUOTIENT CENTRE AERE"
9
  },
10
  {
11
    "id": "QJEU",
12
    "text": "QUOTIENT JEUNESSE"
13
  },
14
  {
15
    "id": "QS",
16
    "text": "QUOTIENT SCOLAIRE"
17
  },
18
  {
19
    "id": "QSPORT",
20
    "text": "QUOTIENT SPORT"
21
  },
22
  {
23
    "id": "MOY ECO",
24
    "text": "REVENU MOYEN ( MENSUEL OU ANNUEL)"
25
  }
26
]
functests/toulouse_maelis/data/test_read_situation_list.json
1
[
2
  {
3
    "id": "C",
4
    "text": "C\u00e9libataire"
5
  },
6
  {
7
    "id": "D",
8
    "text": "Divorc\u00e9 (e)"
9
  },
10
  {
11
    "id": "CS",
12
    "text": "EN COURS DE SEPARATION"
13
  },
14
  {
15
    "id": "M",
16
    "text": "Mari\u00e9 (e)"
17
  },
18
  {
19
    "id": "P",
20
    "text": "Pacs\u00e9 (e)"
21
  },
22
  {
23
    "id": "S",
24
    "text": "S\u00e9par\u00e9 (e)"
25
  },
26
  {
27
    "id": "UL",
28
    "text": "UNION LIBRE"
29
  },
30
  {
31
    "id": "V",
32
    "text": "Veuf (ve)"
33
  },
34
  {
35
    "id": "VM",
36
    "text": "Vivant maritalement"
37
  }
38
]
functests/toulouse_maelis/data/test_read_vaccin_list.json
1
[
2
  {
3
    "id": "BCG",
4
    "text": "BCG"
5
  },
6
  {
7
    "id": "CIB",
8
    "text": "CONTRE-INDICATION  TEMPORAIRE AU BCG"
9
  },
10
  {
11
    "id": "MONO",
12
    "text": "CONTROLE DU BCG (+)"
13
  },
14
  {
15
    "id": "MONON",
16
    "text": "CONTROLE DU BCG (-)"
17
  },
18
  {
19
    "id": "DTC",
20
    "text": "DIPHTERIE TETANOS COQUELUCHE"
21
  },
22
  {
23
    "id": "DTCP",
24
    "text": "DIPHTERIE-TETANOS-COQUELUCHE-POLIO"
25
  },
26
  {
27
    "id": "DTP",
28
    "text": "DIPHTERIE-TETANOS-POLIO"
29
  },
30
  {
31
    "id": "HEP",
32
    "text": "HEPATITE"
33
  },
34
  {
35
    "id": "HEPA B",
36
    "text": "HEPATITE B"
37
  },
38
  {
39
    "id": "IN",
40
    "text": "INFANRIX"
41
  },
42
  {
43
    "id": "HIB",
44
    "text": "MENINGITE"
45
  },
46
  {
47
    "id": "PENT",
48
    "text": "PENTACOQ"
49
  },
50
  {
51
    "id": "PENTH",
52
    "text": "PENT'HIBEST"
53
  },
54
  {
55
    "id": "P",
56
    "text": "POLIO"
57
  },
58
  {
59
    "id": "ROR",
60
    "text": "ROUGEOLE-OREILLONS-RUBEOLE"
61
  },
62
  {
63
    "id": "ROUX",
64
    "text": "ROUVAX"
65
  },
66
  {
67
    "id": "TETANOS",
68
    "text": "TETANOS"
69
  },
70
  {
71
    "id": "TPOLIO",
72
    "text": "TETANOS POLIO"
73
  },
74
  {
75
    "id": "TETR",
76
    "text": "TETRACOQ"
77
  },
78
  {
79
    "id": "T.POLIO",
80
    "text": "T.POLIO"
81
  }
82
]
functests/toulouse_maelis/data/test_update_child.json
1
{
2
  "num": "N/A",
3
  "lastname": "N/A",
4
  "firstname": "BARTOLOME",
5
  "sexe": "F",
6
  "birth": {
7
    "dateBirth": "1970-01-01T00:00:00+01:00",
8
    "place": null,
9
    "communeCode": null,
10
    "countryCode": null
11
  },
12
  "dietcode": "STD",
13
  "bPhoto": false,
14
  "bLeaveAlone": false,
15
  "authorizedPersonList": [
16
    {
17
      "personInfo": {
18
        "num": "N/A",
19
        "lastname": "SIMPSON",
20
        "firstname": "ABRAHAM JEBEDIAH",
21
        "dateBirth": "1927-05-24T00:00:00+01:00",
22
        "civility": "M.",
23
        "sexe": "M",
24
        "contact": {
25
          "phone": "0312345678",
26
          "mobile": null,
27
          "mail": "abe.simpson@example.org"
28
        },
29
        "civility_text": "Monsieur",
30
        "sexe_text": "Masculin"
31
      },
32
      "personQuality": {
33
        "code": "GPP",
34
        "libelle": "GRAND-PERE PATERNEL",
35
        "code_text": "GRAND-PERE PATERNEL"
36
      }
37
    },
38
    {
39
      "personInfo": {
40
        "num": "N/A",
41
        "lastname": "SIMPSON",
42
        "firstname": "MONA PENELOPE",
43
        "dateBirth": "1929-03-15T00:00:00Z",
44
        "civility": "MME",
45
        "sexe": "F",
46
        "contact": {
47
          "phone": "0412345678",
48
          "mobile": "0612345678",
49
          "mail": "mona.simpson@example.org"
50
        },
51
        "civility_text": "Madame",
52
        "sexe_text": "F\u00e9minin"
53
      },
54
      "personQuality": {
55
        "code": "GMP",
56
        "libelle": "GRAND-MERE PATERNELLE",
57
        "code_text": "GRAND-MERE PATERNELLE"
58
      }
59
    }
60
  ],
61
  "indicatorList": [],
62
  "medicalRecord": {
63
    "familyDoctor": {
64
      "name": "MONROE",
65
      "phone": "0612341234",
66
      "address": {
67
        "street1": "Alameda",
68
        "zipcode": "90701",
69
        "town": "Springfield"
70
      }
71
    },
72
    "allergy1": "butterscotch, imitation butterscotch, glow-in-the-dark monster make-up",
73
    "allergy2": "shrimp and cauliflower",
74
    "comment1": "the shrimp allergy isn't fully identified",
75
    "comment2": null,
76
    "observ1": "Ay Caramba!",
77
    "observ2": "Ay Caramba!",
78
    "isAuthHospital": true,
79
    "hospital": "Springfield General Hospital",
80
    "vaccinList": [
81
      {
82
        "code": "ROR",
83
        "label": "ROUGEOLE-OREILLONS-RUBEOLE",
84
        "vaccinationDate": "2022-02-22T00:00:00+01:00"
85
      },
86
      {
87
        "code": "DTC",
88
        "label": "DIPHTERIE TETANOS COQUELUCHE",
89
        "vaccinationDate": "2011-01-11T00:00:00+01:00"
90
      }
91
    ]
92
  },
93
  "insurance": null,
94
  "paiInfoBean": {
95
    "code": "PAIMED",
96
    "dateDeb": "2022-09-01T00:00:00+02:00",
97
    "dateFin": "2023-07-01T00:00:00+02:00",
98
    "description": "mischievous, rebellious, misunderstood, disruptive",
99
    "code_text": "MEDICAL"
100
  },
101
  "mother": "N/A",
102
  "father": "N/A",
103
  "rl": null,
104
  "subscribeSchoolList": [],
105
  "subscribeActivityList": [],
106
  "sexe_text": "F\u00e9minin",
107
  "dietcode_text": "1- REPAS STANDARD"
108
}
functests/toulouse_maelis/data/test_update_child_medical_record.json
1
{
2
  "familyDoctor": null,
3
  "allergy1": null,
4
  "allergy2": null,
5
  "comment1": null,
6
  "comment2": null,
7
  "observ1": null,
8
  "observ2": null,
9
  "isAuthHospital": false,
10
  "hospital": null,
11
  "vaccinList": [
12
    {
13
      "code": "ROR",
14
      "label": "ROUGEOLE-OREILLONS-RUBEOLE",
15
      "vaccinationDate": "2022-02-22T00:00:00+01:00"
16
    },
17
    {
18
      "code": "DTC",
19
      "label": "DIPHTERIE TETANOS COQUELUCHE",
20
      "vaccinationDate": "2011-01-11T00:00:00+01:00"
21
    }
22
  ]
23
}
functests/toulouse_maelis/data/test_update_child_pai.json
1
{
2
  "code": "PAIO",
3
  "dateDeb": "1970-01-01T00:00:00+01:00",
4
  "dateFin": "1970-01-01T00:00:00+01:00",
5
  "description": null,
6
  "code_text": "AUTRE"
7
}
functests/toulouse_maelis/data/test_update_child_person.json
1
[
2
  {
3
    "personInfo": {
4
      "num": "N/A",
5
      "lastname": "RESET",
6
      "firstname": "RESET",
7
      "dateBirth": "1970-01-01T00:00:00+01:00",
8
      "civility": null,
9
      "sexe": "M",
10
      "contact": null,
11
      "sexe_text": "Masculin"
12
    },
13
    "personQuality": {
14
      "code": "AU",
15
      "libelle": "AUTRE",
16
      "code_text": "AUTRE"
17
    }
18
  },
19
  {
20
    "personInfo": {
21
      "num": "N/A",
22
      "lastname": "SIMPSON",
23
      "firstname": "MONA PENELOPE",
24
      "dateBirth": "1929-03-15T00:00:00Z",
25
      "civility": "MME",
26
      "sexe": "F",
27
      "contact": {
28
        "phone": "0412345678",
29
        "mobile": "0612345678",
30
        "mail": "mona.simpson@example.org"
31
      },
32
      "civility_text": "Madame",
33
      "sexe_text": "F\u00e9minin"
34
    },
35
    "personQuality": {
36
      "code": "GMP",
37
      "libelle": "GRAND-MERE PATERNELLE",
38
      "code_text": "GRAND-MERE PATERNELLE"
39
    }
40
  }
41
]
functests/toulouse_maelis/data/test_update_coordinate.json
1
{
2
  "num": "N/A",
3
  "firstname": "HOMER",
4
  "lastname": "N/A",
5
  "maidenName": null,
6
  "quality": "PERE",
7
  "civility": "M.",
8
  "birth": {
9
    "dateBirth": "1956-05-12T00:00:00+01:00",
10
    "place": null,
11
    "communeCode": null,
12
    "countryCode": null
13
  },
14
  "adresse": {
15
    "idStreet": null,
16
    "num": 42,
17
    "numComp": "Q",
18
    "street1": "reset",
19
    "street2": null,
20
    "town": "reset",
21
    "zipcode": "reset",
22
    "numComp_text": "quater"
23
  },
24
  "contact": {
25
    "phone": null,
26
    "mobile": null,
27
    "mail": null,
28
    "isContactMail": false,
29
    "isContactSms": false,
30
    "isInvoicePdf": false
31
  },
32
  "profession": {
33
    "codeCSP": "15",
34
    "profession": null,
35
    "employerName": null,
36
    "phone": null,
37
    "addressPro": {
38
      "num": 42,
39
      "street": null,
40
      "zipcode": null,
41
      "town": null
42
    },
43
    "codeCSP_text": "AUTRES"
44
  },
45
  "CAFInfo": {
46
    "number": "reset",
47
    "organ": null
48
  },
49
  "indicatorList": [],
50
  "quotientList": [],
51
  "subscribeActivityList": [],
52
  "civility_text": "Monsieur",
53
  "quality_text": "PERE"
54
}
functests/toulouse_maelis/data/test_update_family.json
1
{
2
  "number": "N/A",
3
  "category": "BI",
4
  "situation": "VM",
5
  "flagCom": true,
6
  "nbChild": null,
7
  "nbTotalChild": null,
8
  "nbAES": null,
9
  "RL1": {
10
    "num": "N/A",
11
    "firstname": "MARGE",
12
    "lastname": "N/A",
13
    "maidenName": "BOUVIER",
14
    "quality": "MERE",
15
    "civility": "MME",
16
    "birth": {
17
      "dateBirth": "1950-10-01T00:00:00+01:00",
18
      "place": null,
19
      "communeCode": null,
20
      "countryCode": null
21
    },
22
    "adresse": {
23
      "idStreet": null,
24
      "num": 0,
25
      "numComp": null,
26
      "street1": "Evergreen Terrace",
27
      "street2": null,
28
      "town": "Springfield",
29
      "zipcode": "62701"
30
    },
31
    "contact": {
32
      "phone": null,
33
      "mobile": null,
34
      "mail": null,
35
      "isContactMail": false,
36
      "isContactSms": false,
37
      "isInvoicePdf": false
38
    },
39
    "profession": null,
40
    "CAFInfo": null,
41
    "indicatorList": [],
42
    "quotientList": [],
43
    "subscribeActivityList": [],
44
    "civility_text": "Madame",
45
    "quality_text": "MERE"
46
  },
47
  "RL2": {
48
    "num": "N/A",
49
    "firstname": "HOMER",
50
    "lastname": "N/A",
51
    "maidenName": null,
52
    "quality": "PERE",
53
    "civility": "M.",
54
    "birth": {
55
      "dateBirth": "1956-05-12T00:00:00+01:00",
56
      "place": null,
57
      "communeCode": null,
58
      "countryCode": null
59
    },
60
    "adresse": {
61
      "idStreet": null,
62
      "num": 742,
63
      "numComp": null,
64
      "street1": "Evergreen Terrace",
65
      "street2": null,
66
      "town": "Springfield",
67
      "zipcode": "90701"
68
    },
69
    "contact": {
70
      "phone": "0122222222",
71
      "mobile": "0622222222",
72
      "mail": "homer.simpson@example.org.com",
73
      "isContactMail": true,
74
      "isContactSms": true,
75
      "isInvoicePdf": true
76
    },
77
    "profession": {
78
      "codeCSP": "13",
79
      "profession": "Inspecteur de s\u00e9curit\u00e9",
80
      "employerName": "Burns",
81
      "phone": "0133333333",
82
      "addressPro": {
83
        "num": null,
84
        "street": null,
85
        "zipcode": "90701",
86
        "town": "Springfield"
87
      },
88
      "codeCSP_text": "CADRE SUPERIEUR"
89
    },
90
    "CAFInfo": {
91
      "number": "123",
92
      "organ": "A10007752822",
93
      "organ_text": "LA COLLE SUR LOUP"
94
    },
95
    "indicatorList": [],
96
    "quotientList": [],
97
    "subscribeActivityList": [],
98
    "civility_text": "Monsieur",
99
    "quality_text": "PERE"
100
  },
101
  "quotientList": [],
102
  "childList": [
103
    {
104
      "num": "N/A",
105
      "lastname": "N/A",
106
      "firstname": "BART",
107
      "sexe": "M",
108
      "birth": {
109
        "dateBirth": "1978-04-01T00:00:00+01:00",
110
        "place": null,
111
        "communeCode": null,
112
        "countryCode": null
113
      },
114
      "dietcode": "STD",
115
      "bPhoto": true,
116
      "bLeaveAlone": true,
117
      "authorizedPersonList": [
118
        {
119
          "personInfo": {
120
            "num": "N/A",
121
            "lastname": "SIMPSON",
122
            "firstname": "ABRAHAM JEBEDIAH",
123
            "dateBirth": "1927-05-24T00:00:00+01:00",
124
            "civility": "M.",
125
            "sexe": "M",
126
            "contact": {
127
              "phone": "0312345678",
128
              "mobile": null,
129
              "mail": "abe.simpson@example.org"
130
            },
131
            "civility_text": "Monsieur",
132
            "sexe_text": "Masculin"
133
          },
134
          "personQuality": {
135
            "code": "GPP",
136
            "libelle": "GRAND-PERE PATERNEL",
137
            "code_text": "GRAND-PERE PATERNEL"
138
          }
139
        },
140
        {
141
          "personInfo": {
142
            "num": "N/A",
143
            "lastname": "SIMPSON",
144
            "firstname": "MONA PENELOPE",
145
            "dateBirth": "1929-03-15T00:00:00Z",
146
            "civility": "MME",
147
            "sexe": "F",
148
            "contact": {
149
              "phone": "0412345678",
150
              "mobile": "0612345678",
151
              "mail": "mona.simpson@example.org"
152
            },
153
            "civility_text": "Madame",
154
            "sexe_text": "F\u00e9minin"
155
          },
156
          "personQuality": {
157
            "code": "GMP",
158
            "libelle": "GRAND-MERE PATERNELLE",
159
            "code_text": "GRAND-MERE PATERNELLE"
160
          }
161
        }
162
      ],
163
      "indicatorList": [],
164
      "medicalRecord": {
165
        "familyDoctor": {
166
          "name": "MONROE",
167
          "phone": "0612341234",
168
          "address": {
169
            "street1": "Alameda",
170
            "zipcode": "90701",
171
            "town": "Springfield"
172
          }
173
        },
174
        "allergy1": "butterscotch, imitation butterscotch, glow-in-the-dark monster make-up",
175
        "allergy2": "shrimp and cauliflower",
176
        "comment1": "the shrimp allergy isn't fully identified",
177
        "comment2": null,
178
        "observ1": "Ay Caramba!",
179
        "observ2": "Ay Caramba!",
180
        "isAuthHospital": true,
181
        "hospital": "Springfield General Hospital",
182
        "vaccinList": [
183
          {
184
            "code": "ROR",
185
            "label": "ROUGEOLE-OREILLONS-RUBEOLE",
186
            "vaccinationDate": "2022-02-22T00:00:00+01:00"
187
          },
188
          {
189
            "code": "DTC",
190
            "label": "DIPHTERIE TETANOS COQUELUCHE",
191
            "vaccinationDate": "2011-01-11T00:00:00+01:00"
192
          }
193
        ]
194
      },
195
      "insurance": null,
196
      "paiInfoBean": {
197
        "code": "PAIMED",
198
        "dateDeb": "2022-09-01T00:00:00+02:00",
199
        "dateFin": "2023-07-01T00:00:00+02:00",
200
        "description": "mischievous, rebellious, misunderstood, disruptive",
201
        "code_text": "MEDICAL"
202
      },
203
      "mother": "N/A",
204
      "father": "N/A",
205
      "rl": null,
206
      "subscribeSchoolList": [],
207
      "subscribeActivityList": [],
208
      "sexe_text": "Masculin",
209
      "dietcode_text": "1- REPAS STANDARD"
210
    },
211
    {
212
      "num": "N/A",
213
      "lastname": "N/A",
214
      "firstname": "LISA",
215
      "sexe": "F",
216
      "birth": {
217
        "dateBirth": "1980-05-09T00:00:00+02:00",
218
        "place": null,
219
        "communeCode": null,
220
        "countryCode": null
221
      },
222
      "dietcode": "RSV",
223
      "bPhoto": false,
224
      "bLeaveAlone": false,
225
      "authorizedPersonList": [],
226
      "indicatorList": [],
227
      "medicalRecord": null,
228
      "insurance": null,
229
      "paiInfoBean": {
230
        "code": "PAIALI",
231
        "dateDeb": null,
232
        "dateFin": null,
233
        "description": null,
234
        "code_text": "ALIMENTAIRE"
235
      },
236
      "mother": "N/A",
237
      "father": "N/A",
238
      "rl": null,
239
      "subscribeSchoolList": [],
240
      "subscribeActivityList": [],
241
      "sexe_text": "F\u00e9minin",
242
      "dietcode_text": "3- R\u00c9GIME SANS VIANDE"
243
    },
244
    {
245
      "num": "N/A",
246
      "lastname": "N/A",
247
      "firstname": "MAGGIE",
248
      "sexe": "F",
249
      "birth": {
250
        "dateBirth": "1989-12-17T00:00:00+01:00",
251
        "place": null,
252
        "communeCode": null,
253
        "countryCode": null
254
      },
255
      "dietcode": "BB",
256
      "bPhoto": false,
257
      "bLeaveAlone": false,
258
      "authorizedPersonList": [],
259
      "indicatorList": [],
260
      "medicalRecord": null,
261
      "insurance": null,
262
      "paiInfoBean": {
263
        "code": "PAIALI",
264
        "dateDeb": null,
265
        "dateFin": null,
266
        "description": null,
267
        "code_text": "ALIMENTAIRE"
268
      },
269
      "mother": "N/A",
270
      "father": "N/A",
271
      "rl": null,
272
      "subscribeSchoolList": [],
273
      "subscribeActivityList": [],
274
      "sexe_text": "F\u00e9minin",
275
      "dietcode_text": "REPAS BEBE"
276
    }
277
  ],
278
  "emergencyPersonList": [
279
    {
280
      "numPerson": "N/A",
281
      "civility": "MME",
282
      "firstname": "PATTY",
283
      "lastname": "BOUVIER",
284
      "dateBirth": "1948-08-30T00:00:00+01:00",
285
      "sexe": "F",
286
      "quality": "T",
287
      "contact": {
288
        "phone": "0112345678",
289
        "mobile": "0612345678",
290
        "mail": "patty.bouvier@example.org"
291
      },
292
      "civility_text": "Madame",
293
      "quality_text": "TANTE",
294
      "sexe_text": "F\u00e9minin"
295
    },
296
    {
297
      "numPerson": "N/A",
298
      "civility": "MME",
299
      "firstname": "SELMA",
300
      "lastname": "BOUVIER",
301
      "dateBirth": "1946-04-29T00:00:00+01:00",
302
      "sexe": "F",
303
      "quality": "OS",
304
      "contact": {
305
        "phone": "0112345678",
306
        "mobile": "0612345678",
307
        "mail": "selma.bouvier@example.org"
308
      },
309
      "civility_text": "Madame",
310
      "quality_text": "ORGANISME SOCIAL",
311
      "sexe_text": "F\u00e9minin"
312
    }
313
  ],
314
  "indicatorList": [],
315
  "childErrorList": [],
316
  "category_text": "BIPARENTALE",
317
  "situation_text": "Vivant maritalement"
318
}
functests/toulouse_maelis/data/test_update_family_ras.json
1
{
2
  "number": "N/A",
3
  "category": "MONO",
4
  "situation": "UL",
5
  "flagCom": true,
6
  "nbChild": null,
7
  "nbTotalChild": null,
8
  "nbAES": null,
9
  "RL1": {
10
    "num": "N/A",
11
    "firstname": "MARGE",
12
    "lastname": "N/A",
13
    "maidenName": "BOUVIER",
14
    "quality": "AU",
15
    "civility": "MME",
16
    "birth": {
17
      "dateBirth": "1950-10-01T00:00:00+01:00",
18
      "place": null,
19
      "communeCode": null,
20
      "countryCode": null
21
    },
22
    "adresse": {
23
      "idStreet": null,
24
      "num": 0,
25
      "numComp": null,
26
      "street1": "reset",
27
      "street2": null,
28
      "town": "reset",
29
      "zipcode": "reset"
30
    },
31
    "contact": {
32
      "phone": null,
33
      "mobile": null,
34
      "mail": null,
35
      "isContactMail": false,
36
      "isContactSms": false,
37
      "isInvoicePdf": false
38
    },
39
    "profession": null,
40
    "CAFInfo": null,
41
    "indicatorList": [],
42
    "quotientList": [],
43
    "subscribeActivityList": [],
44
    "civility_text": "Madame",
45
    "quality_text": "AUTRE"
46
  },
47
  "RL2": {
48
    "num": "N/A",
49
    "firstname": "HOMER",
50
    "lastname": "N/A",
51
    "maidenName": null,
52
    "quality": "AU",
53
    "civility": "M.",
54
    "birth": {
55
      "dateBirth": "1956-05-12T00:00:00+01:00",
56
      "place": null,
57
      "communeCode": null,
58
      "countryCode": null
59
    },
60
    "adresse": {
61
      "idStreet": null,
62
      "num": 42,
63
      "numComp": "Q",
64
      "street1": "reset",
65
      "street2": null,
66
      "town": "reset",
67
      "zipcode": "reset",
68
      "numComp_text": "quater"
69
    },
70
    "contact": {
71
      "phone": null,
72
      "mobile": null,
73
      "mail": null,
74
      "isContactMail": false,
75
      "isContactSms": false,
76
      "isInvoicePdf": false
77
    },
78
    "profession": {
79
      "codeCSP": "15",
80
      "profession": null,
81
      "employerName": null,
82
      "phone": null,
83
      "addressPro": {
84
        "num": 42,
85
        "street": null,
86
        "zipcode": null,
87
        "town": null
88
      },
89
      "codeCSP_text": "AUTRES"
90
    },
91
    "CAFInfo": {
92
      "number": "reset",
93
      "organ": null
94
    },
95
    "indicatorList": [],
96
    "quotientList": [],
97
    "subscribeActivityList": [],
98
    "civility_text": "Monsieur",
99
    "quality_text": "AUTRE"
100
  },
101
  "quotientList": [],
102
  "childList": [
103
    {
104
      "num": "N/A",
105
      "lastname": "N/A",
106
      "firstname": "BARTOLOME",
107
      "sexe": "F",
108
      "birth": {
109
        "dateBirth": "1970-01-01T00:00:00+01:00",
110
        "place": null,
111
        "communeCode": null,
112
        "countryCode": null
113
      },
114
      "dietcode": null,
115
      "bPhoto": false,
116
      "bLeaveAlone": false,
117
      "authorizedPersonList": [
118
        {
119
          "personInfo": {
120
            "num": "N/A",
121
            "lastname": "RESET",
122
            "firstname": "RESET",
123
            "dateBirth": "1970-01-01T00:00:00+01:00",
124
            "civility": null,
125
            "sexe": "M",
126
            "contact": null,
127
            "sexe_text": "Masculin"
128
          },
129
          "personQuality": {
130
            "code": "AU",
131
            "libelle": "AUTRE",
132
            "code_text": "AUTRE"
133
          }
134
        }
135
      ],
136
      "indicatorList": [],
137
      "medicalRecord": {
138
        "familyDoctor": null,
139
        "allergy1": null,
140
        "allergy2": null,
141
        "comment1": null,
142
        "comment2": null,
143
        "observ1": null,
144
        "observ2": null,
145
        "isAuthHospital": false,
146
        "hospital": null,
147
        "vaccinList": [
148
          {
149
            "code": "ROR",
150
            "label": "ROUGEOLE-OREILLONS-RUBEOLE",
151
            "vaccinationDate": "2022-02-22T00:00:00+01:00"
152
          },
153
          {
154
            "code": "DTC",
155
            "label": "DIPHTERIE TETANOS COQUELUCHE",
156
            "vaccinationDate": "2011-01-11T00:00:00+01:00"
157
          }
158
        ]
159
      },
160
      "insurance": null,
161
      "paiInfoBean": {
162
        "code": "PAIO",
163
        "dateDeb": "1970-01-01T00:00:00+01:00",
164
        "dateFin": "1970-01-01T00:00:00+01:00",
165
        "description": null,
166
        "code_text": "AUTRE"
167
      },
168
      "mother": "N/A",
169
      "father": "N/A",
170
      "rl": null,
171
      "subscribeSchoolList": [],
172
      "subscribeActivityList": [],
173
      "sexe_text": "F\u00e9minin"
174
    },
175
    {
176
      "num": "N/A",
177
      "lastname": "N/A",
178
      "firstname": "LISA",
179
      "sexe": "F",
180
      "birth": {
181
        "dateBirth": "1980-05-09T00:00:00+02:00",
182
        "place": null,
183
        "communeCode": null,
184
        "countryCode": null
185
      },
186
      "dietcode": "RSV",
187
      "bPhoto": false,
188
      "bLeaveAlone": false,
189
      "authorizedPersonList": [],
190
      "indicatorList": [],
191
      "medicalRecord": null,
192
      "insurance": null,
193
      "paiInfoBean": {
194
        "code": "PAIALI",
195
        "dateDeb": null,
196
        "dateFin": null,
197
        "description": null,
198
        "code_text": "ALIMENTAIRE"
199
      },
200
      "mother": "N/A",
201
      "father": "N/A",
202
      "rl": null,
203
      "subscribeSchoolList": [],
204
      "subscribeActivityList": [],
205
      "sexe_text": "F\u00e9minin",
206
      "dietcode_text": "3- R\u00c9GIME SANS VIANDE"
207
    },
208
    {
209
      "num": "N/A",
210
      "lastname": "N/A",
211
      "firstname": "MAGGIE",
212
      "sexe": "F",
213
      "birth": {
214
        "dateBirth": "1989-12-17T00:00:00+01:00",
215
        "place": null,
216
        "communeCode": null,
217
        "countryCode": null
218
      },
219
      "dietcode": "BB",
220
      "bPhoto": false,
221
      "bLeaveAlone": false,
222
      "authorizedPersonList": [],
223
      "indicatorList": [],
224
      "medicalRecord": null,
225
      "insurance": null,
226
      "paiInfoBean": {
227
        "code": "PAIALI",
228
        "dateDeb": null,
229
        "dateFin": null,
230
        "description": null,
231
        "code_text": "ALIMENTAIRE"
232
      },
233
      "mother": "N/A",
234
      "father": "N/A",
235
      "rl": null,
236
      "subscribeSchoolList": [],
237
      "subscribeActivityList": [],
238
      "sexe_text": "F\u00e9minin",
239
      "dietcode_text": "REPAS BEBE"
240
    }
241
  ],
242
  "emergencyPersonList": [
243
    {
244
      "numPerson": "N/A",
245
      "civility": null,
246
      "firstname": "RESET",
247
      "lastname": "RESET",
248
      "dateBirth": "1970-01-01T00:00:00+01:00",
249
      "sexe": "M",
250
      "quality": "AU",
251
      "contact": null,
252
      "quality_text": "AUTRE",
253
      "sexe_text": "Masculin"
254
    }
255
  ],
256
  "indicatorList": [],
257
  "childErrorList": [],
258
  "category_text": "MONOPARENTALE",
259
  "situation_text": "UNION LIBRE"
260
}
functests/toulouse_maelis/data/test_update_person.json
1
[
2
  {
3
    "numPerson": "N/A",
4
    "civility": "MME",
5
    "firstname": "PATTY",
6
    "lastname": "BOUVIER",
7
    "dateBirth": "1948-08-30T00:00:00+01:00",
8
    "sexe": "F",
9
    "quality": "T",
10
    "contact": {
11
      "phone": "0112345678",
12
      "mobile": "0612345678",
13
      "mail": "patty.bouvier@example.org"
14
    },
15
    "civility_text": "Madame",
16
    "quality_text": "TANTE",
17
    "sexe_text": "F\u00e9minin"
18
  },
19
  {
20
    "numPerson": "N/A",
21
    "civility": null,
22
    "firstname": "RESET",
23
    "lastname": "RESET",
24
    "dateBirth": "1970-01-01T00:00:00+01:00",
25
    "sexe": "M",
26
    "quality": "AU",
27
    "contact": null,
28
    "quality_text": "AUTRE",
29
    "sexe_text": "Masculin"
30
  }
31
]
functests/toulouse_maelis/data/test_update_rl1.json
1
{
2
  "num": "N/A",
3
  "firstname": "MARGE",
4
  "lastname": "N/A",
5
  "maidenName": "BOUVIER",
6
  "quality": "AU",
7
  "civility": "MME",
8
  "birth": {
9
    "dateBirth": "1950-10-01T00:00:00+01:00",
10
    "place": null,
11
    "communeCode": null,
12
    "countryCode": null
13
  },
14
  "adresse": {
15
    "idStreet": null,
16
    "num": 0,
17
    "numComp": null,
18
    "street1": "Evergreen Terrace",
19
    "street2": null,
20
    "town": "Springfield",
21
    "zipcode": "62701"
22
  },
23
  "contact": {
24
    "phone": null,
25
    "mobile": null,
26
    "mail": null,
27
    "isContactMail": false,
28
    "isContactSms": false,
29
    "isInvoicePdf": false
30
  },
31
  "profession": null,
32
  "CAFInfo": null,
33
  "indicatorList": [],
34
  "quotientList": [],
35
  "subscribeActivityList": [],
36
  "civility_text": "Madame",
37
  "quality_text": "AUTRE"
38
}
functests/toulouse_maelis/data/test_update_rl2.json
1
{
2
  "num": "N/A",
3
  "firstname": "HOMER",
4
  "lastname": "N/A",
5
  "maidenName": null,
6
  "quality": "AU",
7
  "civility": "M.",
8
  "birth": {
9
    "dateBirth": "1956-05-12T00:00:00+01:00",
10
    "place": null,
11
    "communeCode": null,
12
    "countryCode": null
13
  },
14
  "adresse": {
15
    "idStreet": null,
16
    "num": 742,
17
    "numComp": null,
18
    "street1": "Evergreen Terrace",
19
    "street2": null,
20
    "town": "Springfield",
21
    "zipcode": "90701"
22
  },
23
  "contact": {
24
    "phone": "0122222222",
25
    "mobile": "0622222222",
26
    "mail": "homer.simpson@example.org.com",
27
    "isContactMail": true,
28
    "isContactSms": true,
29
    "isInvoicePdf": true
30
  },
31
  "profession": {
32
    "codeCSP": "13",
33
    "profession": "Inspecteur de s\u00e9curit\u00e9",
34
    "employerName": "Burns",
35
    "phone": "0133333333",
36
    "addressPro": {
37
      "num": null,
38
      "street": null,
39
      "zipcode": "90701",
40
      "town": "Springfield"
41
    },
42
    "codeCSP_text": "CADRE SUPERIEUR"
43
  },
44
  "CAFInfo": {
45
    "number": "123",
46
    "organ": "A10007752822",
47
    "organ_text": "LA COLLE SUR LOUP"
48
  },
49
  "indicatorList": [],
50
  "quotientList": [],
51
  "subscribeActivityList": [],
52
  "civility_text": "Monsieur",
53
  "quality_text": "AUTRE"
54
}
functests/toulouse_maelis/read_family.py
1
#!/usr/bin/python3
2

  
3
import argparse
4

  
5
import requests
6
import zeep
7
from zeep.transports import Transport
8
from zeep.wsse.username import UsernameToken
9

  
10
WSSE = UsernameToken('maelis-webservice', 'maelis-password')
11
WSDL_URL = 'https://demo-toulouse.sigec.fr/maelisws-toulouse/services/FamilyService?wsdl'
12

  
13

  
14
def read_family(family_id, verbose):
15
    session = requests.Session()
16
    session.verify = False
17
    transport = Transport(session=session)
18
    settings = zeep.Settings(strict=False, xsd_ignore_sequence_order=True)
19
    client = zeep.Client(WSDL_URL, transport=transport, wsse=WSSE, settings=settings)
20

  
21
    result = client.service.readFamily(
22
        dossierNumber=family_id,
23
        # schoolYear=
24
        # incomeYear=2020,  # <-- pour avoir les quotients
25
        # referenceYear=2020,
26
    )
27
    print(result)
28

  
29

  
30
if __name__ == "__main__":
31
    parser = argparse.ArgumentParser()
32
    parser.add_argument('--verbose', '-v', type=int, default=2, help='display errors')
33
    parser.add_argument('family_id', help='196544', nargs='?', default='196544')
34
    args = parser.parse_args()
35
    read_family(args.family_id, verbose=args.verbose)
functests/toulouse_maelis/test_family.py
1
import copy
2

  
3
import pytest
4
import requests
5

  
6
from .conftest import diff, diff_child, diff_family, diff_rlg, link, read_family, unlink
7

  
8
FAMILY_RESET_PAYLOAD = {
9
    'category': 'MONO',
10
    'situation': 'UL',
11
    'rl1': {
12
        'civility': 'M.',  # no effect
13
        'firstname': 'Marge',  # must be
14
        'lastname': 'Simpson',  # must be
15
        'maidenName': 'reset',  # no effect
16
        'quality': 'AU',
17
        'birth': {'dateBirth': '1950-10-01'},  # must be
18
        'adresse': {'street1': 'reset', 'town': 'reset', 'zipcode': 'reset'},
19
    },
20
    'rl2': {
21
        'civility': 'MME',  # no effect
22
        'firstname': 'Homer',  # must be
23
        'lastname': 'Simpson',  # must be
24
        'quality': 'AU',
25
        'birth': {'dateBirth': '1956-05-12'},  # must be
26
        'adresse': {
27
            'num': '42',
28
            'numComp': 'Q',
29
            'street1': 'reset',  # E19 : La voie est obligatoire
30
            'street2': '',
31
            'town': 'reset',  # E17 : Le nom de la commune est obligatoire'
32
            'zipcode': 'reset',  # E16 : Le code postal est obligatoire
33
        },
34
        'contact': {  # contact is removed (set to None) by the bellow content
35
            'isContactMail': False,
36
            'isContactSms': False,
37
            'isInvoicePdf': False,
38
            'mail': '',
39
            'mobile': '',
40
            'phone': '',
41
        },
42
        'profession': {
43
            'addressPro': {'num': '42', 'street': '', 'town': '', 'zipcode': ''},
44
            'codeCSP': '15',
45
            'employerName': '',
46
            'phone': '',
47
            'profession': '',
48
        },
49
        'CAFInfo': {
50
            'number': 'reset',  # cannot be removed
51
            'organ': '',
52
        },
53
    },
54
    'childList': [
55
        {
56
            'num': 'place holder',  # required for update
57
            'sexe': 'F',
58
            'firstname': 'Bartolome',  # some side effects, cf test_update_child
59
            'lastname': 'Simps',
60
            'birth': {'dateBirth': '1970-01-01'},
61
            'bPhoto': False,
62
            'bLeaveAlone': False,
63
            'dietcode': '',
64
            'paiInfoBean': {
65
                'code': 'PAIO',
66
                'dateDeb': '1970-01-01',
67
                'dateFin': '1970-01-01',
68
                'description': '',
69
            },
70
            'medicalRecord': {
71
                'familyDoctor': {  # familyDoctor is removed (set to None) by the bellow content
72
                    'name': '',
73
                    'phone': '',
74
                    'address': {
75
                        'street1': '',
76
                        'zipcode': '',
77
                        'town': '',
78
                    },
79
                },
80
                'allergy1': '',
81
                'allergy2': '',
82
                'comment1': '',
83
                'comment2': '',
84
                'observ1': '',
85
                'observ2': '',
86
                'isAuthHospital': False,
87
                'hospital': '',
88
                'vaccinList': [],
89
            },
90
            # setting authorizedPersonList to None will remove the list
91
            'authorizedPersonList': [
92
                {
93
                    'personInfo': {
94
                        'civility': None,
95
                        'firstname': 'reset',  # E704 : Le prénom de la personne est obligatoire
96
                        'lastname': 'reset',  # E705 : Le nom de la personne est obligatoire
97
                        'dateBirth': '1970-01-01',
98
                        'sexe': 'M',
99
                        'contact': {  # contact is removed (set to None) by the bellow content
100
                            'phone': '',
101
                            'mobile': '',
102
                            'mail': '',
103
                        },
104
                    },
105
                    'personQuality': {
106
                        'code': 'AU',
107
                    },
108
                },
109
            ],
110
        },
111
    ],
112
    # setting emergencyPersonList to None will keep the list
113
    'emergencyPersonList': [
114
        {
115
            'civility': None,
116
            'firstname': 'reset',  # ORA-01400: impossible d'insérer NULL dans ("MAELIS"."H_PERS"."ER_PNOM")
117
            'lastname': 'reset',  # ORA-01400: impossible d'insérer NULL dans ("MAELIS"."H_PERS"."ER_NOM")
118
            'dateBirth': '1970-01-01',
119
            'sexe': 'M',
120
            'quality': 'AU',
121
            'contact': {
122
                'phone': '',
123
                'mobile': '',
124
                'mail': '',
125
            },
126
        },
127
    ],
128
}
129

  
130

  
131
# @pytest.mark.xfail(run=False)
132
@pytest.mark.parametrize(
133
    "ref",
134
    [
135
        'category',
136
        'civility',  # 'country', 'county',
137
        'csp',
138
        'dietcode',
139
        'organ',
140
        'pai',
141
        'quality',
142
        'quotient',
143
        'situation',
144
        # 'street','town',
145
        'vaccin',
146
    ],
147
)
148
def test_referentials(conn, ref):
149
    url = conn + '/read-%s-list' % ref
150
    resp = requests.get(url)
151
    resp.raise_for_status()
152
    res = resp.json()
153
    assert res['err'] == 0
154
    assert len(res['data']) > 1
155
    for item in res['data']:
156
        assert 'id' in item
157
        assert 'text' in item
158
    assert diff(res['data'], 'test_read_%s_list.json' % ref)
159

  
160

  
161
def test_update_family(conn, update_data):
162
    unlink(conn, update_data['name_id'])
163
    link(conn, update_data)
164
    url = conn + '/update-family?NameID=%s' % update_data['name_id']
165

  
166
    # reset fields
167
    family_reset_payload = copy.deepcopy(FAMILY_RESET_PAYLOAD)
168
    family_reset_payload['childList'][0]['num'] = update_data['family_payload']['childList'][0]['num']
169
    resp = requests.post(url, json=family_reset_payload)
170
    resp.raise_for_status()
171
    assert resp.json()['err'] == 0
172
    data = diff_family(conn, update_data['name_id'], 'test_update_family_ras.json')
173

  
174
    # unchanged values
175
    assert data['RL1']['civility'] != family_reset_payload['rl1']['civility']
176
    assert data['RL2']['civility'] != family_reset_payload['rl2']['civility']
177
    assert data['RL1']['maidenName'] != family_reset_payload['rl1']['maidenName']
178

  
179
    # changed values
180
    assert data['RL1']['quality'] == family_reset_payload['rl1']['quality']
181
    assert data['RL2']['quality'] == family_reset_payload['rl2']['quality']
182

  
183
    # without passing emergencyPersonList the list is keept
184
    assert len(data['emergencyPersonList']) == 1
185
    del family_reset_payload['emergencyPersonList']
186
    resp = requests.post(url, json=family_reset_payload)
187
    resp.raise_for_status()
188
    assert resp.json()['err'] == 0
189
    data = read_family(conn, update_data['name_id'])
190
    assert len(data['emergencyPersonList']) == 1
191

  
192
    # without passing authorizedPersonList the list is removed
193
    assert len(data['childList'][0]['authorizedPersonList']) == 1
194
    del family_reset_payload['childList'][0]['authorizedPersonList']
195
    resp = requests.post(url, json=family_reset_payload)
196
    resp.raise_for_status()
197
    assert resp.json()['err'] == 0
198
    data = read_family(conn, update_data['name_id'])
199
    assert data['childList'][0]['authorizedPersonList'] == []
200

  
201
    # update root fields
202
    payload = {
203
        'category': 'BI',
204
        'situation': 'VM',
205
    }
206
    resp = requests.post(url, json=payload)
207
    resp.raise_for_status()
208
    assert resp.json()['err'] == 0
209
    data = read_family(conn, update_data['name_id'])
210
    assert data['category'] == 'BI'
211
    assert data['situation'] == 'VM'
212
    assert data['category_text'] == 'BIPARENTALE'
213
    assert data['situation_text'] == 'Vivant maritalement'
214

  
215
    # restore family
216
    resp = requests.post(url, json=update_data['family_payload'])
217
    resp.raise_for_status()
218
    assert resp.json()['err'] == 0
219
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
220

  
221

  
222
def test_create_family(conn, create_data, update_data):
223
    unlink(conn, create_data['name_id'])
224
    link(conn, create_data)
225
    url = conn + '/create-family?NameID=%s' % create_data['name_id']
226

  
227
    # RL1 already exists (on update_data) error
228
    unlink(conn, create_data['name_id'])
229
    payload = copy.deepcopy(create_data['family_payload'])
230
    payload['rl1']['lastname'] = 'Simpson'
231
    resp = requests.post(url, json=payload)
232
    resp.raise_for_status()
233
    res = resp.json()
234
    assert 'E54a' in res['err']
235
    assert 'Il existe déjà un Responsable Légal correspondant' in res['err_desc']
236
    assert res['err_class'] == 'passerelle.utils.jsonresponse.APIError'
237

  
238
    # RL1 already exists (on update_data, as RL2) error
239
    payload['rl1']['firstname'] = 'Homer'
240
    payload['rl1']['birth']['dateBirth'] = '1956-05-12'
241
    resp = requests.post(url, json=payload)
242
    resp.raise_for_status()
243
    res = resp.json()
244
    assert 'E54a' in res['err']
245
    assert 'Il existe déjà un Responsable Légal correspondant' in res['err_desc']
246
    assert res['err_class'] == 'passerelle.utils.jsonresponse.APIError'
247

  
248

  
249
def test_is_rl_exists(conn, update_data):
250
    url = conn + '/is-rl-exists'
251
    payload = {'firstname': 'Marge', 'lastname': 'Simpson', 'dateBirth': '1950-10-01'}
252
    resp = requests.post(url, json=payload)
253
    resp.raise_for_status()
254
    assert resp.json() == {'err': 0, 'data': True}
255

  
256
    payload['firstname'] = payload['firstname'].upper()
257
    payload['lastname'] = payload['lastname'].lower()
258
    resp = requests.post(url, json=payload)
259
    resp.raise_for_status()
260
    assert resp.json() == {'err': 0, 'data': True}
261

  
262
    payload['dateBirth'] = '1970-01-01'
263
    resp = requests.post(url, json=payload)
264
    resp.raise_for_status()
265
    assert resp.json() == {'err': 0, 'data': False}
266

  
267
    # test on rl2
268
    payload = {'firstname': 'Homer', 'lastname': 'Simpson', 'dateBirth': '1956-05-12'}
269
    resp = requests.post(url, json=payload)
270
    resp.raise_for_status()
271
    assert resp.json() == {'err': 0, 'data': True}
272

  
273

  
274
def test_create_rl2(conn, create_data, update_data):
275
    unlink(conn, create_data['name_id'])
276
    link(conn, create_data)
277

  
278
    data = read_family(conn, create_data['name_id'])
279
    assert data['RL2'] is None
280

  
281
    # no unicity restriction on RL2 (duplicate RL2 from update_data)
282
    url = conn + '/create-rl2?NameID=%s' % create_data['name_id']
283
    payload = copy.deepcopy(update_data['family_payload']['rl2'])
284
    for key in 'contact', 'profession', 'CAFInfo':
285
        del payload[key]
286
    resp = requests.post(url, json=payload)
287
    resp.raise_for_status()
288
    assert resp.json()['err'] == 0
289
    assert diff_rlg(conn, create_data['name_id'], 2, 'test_create_rl2.json')
290

  
291

  
292
@pytest.mark.parametrize("rl", ['1', '2'])
293
def test_update_rlg(conn, update_data, rl):
294
    rlg = 'rl' + rl
295
    RLG = 'RL' + rl
296
    unlink(conn, update_data['name_id'])
297
    link(conn, update_data)
298
    url = conn + '/update-rl%s?NameID=%s' % (rl, update_data['name_id'])
299

  
300
    # reset responsable legal
301
    payload = copy.deepcopy(FAMILY_RESET_PAYLOAD[rlg])
302
    for key in 'adresse', 'contact', 'profession', 'CAFInfo':
303
        if key in payload:
304
            del payload[key]
305
    resp = requests.post(url, json=payload)
306
    resp.raise_for_status()
307
    assert resp.json()['err'] == 0
308
    data = diff_rlg(conn, update_data['name_id'], rl, 'test_update_rl%s.json' % rl)
309

  
310
    # unchanged values
311
    assert data[RLG]['civility'] != FAMILY_RESET_PAYLOAD[rlg]['civility']
312
    if rl == 1:
313
        assert data[RLG]['maidenName'] != FAMILY_RESET_PAYLOAD[rlg]['maidenName']
314

  
315
    # changed values
316
    assert data[RLG]['quality'] == FAMILY_RESET_PAYLOAD[rlg]['quality']
317

  
318
    # update firstname is refused
319
    payload['firstname'] = 'plop'
320
    resp = requests.post(url, json=payload)
321
    resp.raise_for_status()
322
    res = resp.json()
323
    assert res['err'] == 'Family-updateFamily-soap:Server'
324
    assert (
325
        "Le Responsable légal %s transmis n'est pas celui qui existe pour la famille" % rl in res['err_desc']
326
    )
327

  
328
    # update lastname is refused
329
    payload['firstname'] = update_data['family_payload'][rlg]['firstname']
330
    payload['lastname'] = 'plop'
331
    resp = requests.post(url, json=payload)
332
    resp.raise_for_status()
333
    res = resp.json()
334
    assert res['err'] == 'Family-updateFamily-soap:Server'
335
    assert (
336
        "Le Responsable légal %s transmis n'est pas celui qui existe pour la famille" % rl in res['err_desc']
337
    )
338

  
339
    # update birtday is refused
340
    payload['lastname'] = 'Simpson'
341
    payload['birth']['dateBirth'] = '1970-01-01'
342
    resp = requests.post(url, json=payload)
343
    resp.raise_for_status()
344
    res = resp.json()
345
    assert res['err'] == 'Family-updateFamily-soap:Server'
346
    if rl == 1:
347
        assert (
348
            "Le Responsable légal %s transmis n'est pas celui qui existe pour la famille" % rl
349
            in res['err_desc']
350
        )
351
    else:
352
        assert "La date de naissance ne peut pas être modifiée" in res['err_desc']
353

  
354
    # restore RL1
355
    payload = copy.deepcopy(update_data['family_payload'][rlg])
356
    for key in 'adresse', 'contact', 'profession', 'CAFInfo':
357
        if payload.get(key):
358
            del payload[key]
359
    resp = requests.post(url, json=payload)
360
    resp.raise_for_status()
361
    assert resp.json()['err'] == 0
362
    data = diff_family(conn, update_data['name_id'], 'test_update_family.json')
363

  
364

  
365
def test_update_coordinate(conn, update_data):
366
    unlink(conn, update_data['name_id'])
367
    link(conn, update_data)
368

  
369
    # reset RL2 coordinates
370
    url = conn + '/update-coordinate?NameID=%s&rl_id=%s' % (update_data['name_id'], update_data['rl2_num'])
371
    payload = {}
372
    for key in 'adresse', 'contact', 'profession', 'CAFInfo':
373
        payload[key] = FAMILY_RESET_PAYLOAD['rl2'][key]
374
    resp = requests.post(url, json=payload)
375
    resp.raise_for_status()
376
    assert resp.json()['err'] == 0
377
    assert diff_rlg(conn, update_data['name_id'], 2, 'test_update_coordinate.json')
378

  
379
    # restore RL2 coordinates
380
    payload = {}
381
    for key in 'adresse', 'contact', 'profession', 'CAFInfo':
382
        payload[key] = update_data['family_payload']['rl2'][key]
383
    resp = requests.post(url, json=payload)
384
    resp.raise_for_status()
385
    assert resp.json()['err'] == 0
386
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
387

  
388

  
389
def test_is_child_exists(conn, create_data):
390
    url = conn + '/is-child-exists'
391
    payload = {
392
        'firstname': 'Maggie',
393
        'lastname': create_data['lastname'],
394
        'dateBirth': '1989-12-17',
395
    }
396
    resp = requests.post(url, json=payload)
397
    resp.raise_for_status()
398
    assert resp.json() == {'err': 0, 'data': True}
399

  
400
    payload['firstname'] = payload['firstname'].upper()
401
    payload['lastname'] = payload['lastname'].lower()
402
    resp = requests.post(url, json=payload)
403
    resp.raise_for_status()
404
    assert resp.json() == {'err': 0, 'data': True}
405

  
406
    payload['firstname'] = 'plop'
407
    resp = requests.post(url, json=payload)
408
    resp.raise_for_status()
409
    assert resp.json() == {'err': 0, 'data': False}
410

  
411

  
412
def test_create_child(conn, create_data, update_data):
413
    unlink(conn, create_data['name_id'])
414
    link(conn, create_data)
415

  
416
    data = read_family(conn, create_data['name_id'])
417
    assert len(data['childList']) == 2
418

  
419
    url = conn + '/create-child?NameID=%s' % create_data['name_id']
420
    payload = {
421
        'sexe': 'M',
422
        'firstname': 'Lisa',
423
        'lastname': create_data['lastname'],
424
        'birth': {'dateBirth': '1980-05-09'},
425
    }
426
    resp = requests.post(url, json=payload)
427
    resp.raise_for_status()
428
    assert resp.json()['err'] == 0
429
    assert diff_child(conn, create_data['name_id'], 2, 'test_create_child.json')
430

  
431
    # child already exists error (Lisa form same family)
432
    resp = requests.post(url, json=payload)
433
    resp.raise_for_status()
434
    res = resp.json()
435
    assert 'Il existe déjà un enfant correspondant' in res['err_desc']
436
    res['err_desc'] = 'N/A'
437
    assert res == {
438
        'err': 'Family-createChild-soap:Server',
439
        'err_class': 'passerelle.utils.jsonresponse.APIError',
440
        'err_desc': 'N/A',
441
        'data': None,
442
    }
443

  
444
    # child already exists error (Lisa form update_data)
445
    payload['lastname'] = 'Simpson'
446
    resp = requests.post(url, json=payload)
447
    resp.raise_for_status()
448
    res = resp.json()
449
    assert 'Il existe déjà un enfant correspondant' in res['err_desc']
450
    res['err_desc'] = 'N/A'
451
    assert res == {
452
        'err': 'already-child',  # error is return into childErrorList
453
        'err_class': 'passerelle.utils.jsonresponse.APIError',
454
        'err_desc': 'N/A',
455
        'data': None,
456
    }
457

  
458

  
459
def test_update_child(conn, update_data, create_data):
460
    unlink(conn, update_data['name_id'])
461
    link(conn, update_data)
462

  
463
    # renaming using existing child names on same family will in fact target the existing child
464
    # side effect: the authorized person list is copied by the connector (from Lisa to Maggie)
465
    url = conn + '/update-child?NameID=%s&child_id=%s' % (update_data['name_id'], update_data['lisa_num'])
466
    payload = copy.deepcopy(update_data['family_payload']['childList'][2])  # Maggie content
467
    for key in 'dietcode', 'paiInfoBean', 'medicalRecord', 'authorizedPersonList':
468
        if key in payload:
469
            del payload[key]
470
    assert payload['firstname'] == 'Maggie'
471
    payload['sexe'] = 'M'
472
    resp = requests.post(url, json=payload)  # use Lisa id in url
473
    resp.raise_for_status()
474
    assert resp.json()['err'] == 0
475
    data = read_family(conn, update_data['name_id'])
476
    assert data['childList'][1]['num'] == update_data['lisa_num']
477
    assert data['childList'][1]['firstname'] == 'LISA'  # Lisa unchanged
478
    assert data['childList'][2]['sexe'] == 'M'  # Maggie updated
479

  
480
    # restore Maggie
481
    url = conn + '/update-child?NameID=%s&child_id=%s' % (update_data['name_id'], update_data['maggie_num'])
482
    payload = copy.deepcopy(update_data['family_payload']['childList'][2])
483
    for key in 'dietcode', 'paiInfoBean', 'medicalRecord', 'authorizedPersonList':
484
        if key in payload:
485
            del payload[key]
486
    resp = requests.post(url, json=payload)
487
    resp.raise_for_status()
488
    assert resp.json()['err'] == 0
489
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
490

  
491
    # rename to an existing child on other family
492
    url = conn + '/update-child?NameID=%s&child_id=%s' % (update_data['name_id'], update_data['bart_num'])
493
    payload = copy.deepcopy(create_data['family_payload']['childList'][1])
494
    for key in 'dietcode', 'paiInfoBean', 'medicalRecord', 'authorizedPersonList':
495
        if key in payload:
496
            del payload[key]
497
    resp = requests.post(url, json=payload)
498
    resp.raise_for_status()
499
    assert resp.json()['err'] == 0
500
    data = read_family(conn, update_data['name_id'])
501
    assert data['childList'][0]['num'] == update_data['bart_num']
502
    assert data['childList'][0]['firstname'] == 'MAGGIE'
503

  
504
    # reset Bart
505
    payload = copy.deepcopy(FAMILY_RESET_PAYLOAD['childList'][0])
506
    for key in 'dietcode', 'paiInfoBean', 'medicalRecord', 'authorizedPersonList':
507
        if key in payload:
508
            del payload[key]
509
    resp = requests.post(url, json=payload)
510
    resp.raise_for_status()
511
    assert resp.json()['err'] == 0
512
    assert diff_child(conn, update_data['name_id'], 0, 'test_update_child.json')
513

  
514
    # restore Bart
515
    payload = copy.deepcopy(update_data['family_payload']['childList'][0])
516
    for key in 'dietcode', 'paiInfoBean', 'medicalRecord', 'authorizedPersonList':
517
        if key in payload:
518
            del payload[key]
519
    resp = requests.post(url, json=payload)
520
    resp.raise_for_status()
521
    assert resp.json()['err'] == 0
522
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
523

  
524

  
525
def test_update_child_dietcode(conn, update_data):
526
    unlink(conn, update_data['name_id'])
527
    link(conn, update_data)
528
    url = conn + '/update-child-dietcode?NameID=%s&child_id=%s&dietcode=' % (
529
        update_data['name_id'],
530
        update_data['bart_num'],
531
    )
532

  
533
    data = read_family(conn, update_data['name_id'])
534
    assert data['childList'][0]['dietcode'] == 'STD'
535
    assert data['childList'][0]['dietcode_text'] == '1- REPAS STANDARD'
536

  
537
    # change dietcode
538
    resp = requests.post(url + 'RSP')
539
    resp.raise_for_status()
540
    assert resp.json()['err'] == 0
541
    data = read_family(conn, update_data['name_id'])
542
    assert data['childList'][0]['dietcode'] == 'RSP'
543
    assert data['childList'][0]['dietcode_text'] == '2- R\u00c9GIME SANS PORC'
544

  
545
    # empty dietcode
546
    resp = requests.post(url + '')
547
    resp.raise_for_status()
548
    assert resp.json()['err'] == 0
549
    data = read_family(conn, update_data['name_id'])
550
    assert data['childList'][0]['dietcode'] == None
551
    assert 'dietcode_text' not in data['childList'][0]
552

  
553
    # restore dietcode
554
    resp = requests.post(url + 'STD')
555
    resp.raise_for_status()
556
    assert resp.json()['err'] == 0
557
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
558

  
559

  
560
def test_update_child_pai(conn, update_data):
561
    unlink(conn, update_data['name_id'])
562
    link(conn, update_data)
563
    url = conn + '/update-child-pai?NameID=%s&child_id=%s' % (update_data['name_id'], update_data['bart_num'])
564

  
565
    # reset PAI
566
    payload = FAMILY_RESET_PAYLOAD['childList'][0]['paiInfoBean']
567
    resp = requests.post(url, json=payload)
568
    resp.raise_for_status()
569
    assert resp.json()['err'] == 0
570
    assert diff_child(conn, update_data['name_id'], 0, 'test_update_child_pai.json', key='paiInfoBean')
571

  
572
    # restore PAI
573
    payload = update_data['family_payload']['childList'][0]['paiInfoBean']
574
    resp = requests.post(url, json=payload)
575
    resp.raise_for_status()
576
    assert resp.json()['err'] == 0
577
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
578

  
579

  
580
def test_update_child_medical_record(conn, update_data):
581
    unlink(conn, update_data['name_id'])
582
    link(conn, update_data)
583
    url = conn + '/update-child-medical-record?NameID=%s&child_id=%s' % (
584
        update_data['name_id'],
585
        update_data['bart_num'],
586
    )
587

  
588
    # observation 2 is wrong
589
    assert (
590
        update_data['data']['childList'][0]['medicalRecord']['observ2']
591
        != update_data['family_payload']['childList'][0]['medicalRecord']['observ2']
592
    )
593
    assert (
594
        update_data['data']['childList'][0]['medicalRecord']['observ2']
595
        == update_data['family_payload']['childList'][0]['medicalRecord']['observ1']
596
    )
597

  
598
    # reset medical record
599
    payload = FAMILY_RESET_PAYLOAD['childList'][0]['medicalRecord']
600
    resp = requests.post(url, json=payload)
601
    resp.raise_for_status()
602
    assert resp.json()['err'] == 0
603
    assert diff_child(
604
        conn, update_data['name_id'], 0, 'test_update_child_medical_record.json', key='medicalRecord'
605
    )
606

  
607
    # restore medical record
608
    payload = update_data['family_payload']['childList'][0]['medicalRecord']
609
    resp = requests.post(url, json=payload)
610
    resp.raise_for_status()
611
    assert resp.json()['err'] == 0
612
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
613

  
614

  
615
def test_person(conn, update_data):
616
    unlink(conn, update_data['name_id'])
617
    link(conn, update_data)
618
    data = read_family(conn, update_data['name_id'])
619
    assert len(data['emergencyPersonList']) == 2
620

  
621
    # delete Patty
622
    selma_num = data['emergencyPersonList'][1]['numPerson']
623
    url = conn + '/delete-person?NameID=%s&person_id=%s' % (update_data['name_id'], selma_num)
624
    resp = requests.post(url)
625
    resp.raise_for_status()
626
    assert resp.json()['err'] == 0
627
    data = read_family(conn, update_data['name_id'])
628
    assert len(data['emergencyPersonList']) == 1
629

  
630
    # re-create Selma
631
    # last inserted person is added on the tail of the list
632
    url = conn + '/create-person?NameID=%s' % (update_data['name_id'])
633
    payload = FAMILY_RESET_PAYLOAD['emergencyPersonList'][0]
634
    resp = requests.post(url, json=payload)
635
    resp.raise_for_status()
636
    assert resp.json()['err'] == 0
637
    data = diff_family(conn, update_data['name_id'], 'test_update_person.json', 'emergencyPersonList')
638

  
639
    # update Selma (and restore family person list)
640
    selma_num = data['emergencyPersonList'][1]['numPerson']
641
    url = conn + '/update-person?NameID=%s&person_id=%s' % (update_data['name_id'], selma_num)
642
    payload = update_data['family_payload']['emergencyPersonList'][1]
643
    resp = requests.post(url, json=payload)
644
    resp.raise_for_status()
645
    assert resp.json()['err'] == 0
646
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
647

  
648

  
649
def test_child_person(conn, update_data):
650
    unlink(conn, update_data['name_id'])
651
    link(conn, update_data)
652
    data = read_family(conn, update_data['name_id'])
653
    assert len(data['childList'][0]['authorizedPersonList']) == 2
654

  
655
    # delete Abi
656
    abi_num = data['childList'][0]['authorizedPersonList'][0]['personInfo']['num']
657
    url = conn + '/delete-child-person?NameID=%s&child_id=%s&person_id=%s' % (
658
        update_data['name_id'],
659
        update_data['bart_num'],
660
        abi_num,
661
    )
662
    resp = requests.post(url)
663
    resp.raise_for_status()
664
    assert resp.json()['err'] == 0
665
    data = read_family(conn, update_data['name_id'])
666
    assert len(data['childList'][0]['authorizedPersonList']) == 1
667

  
668
    # re-create Abi
669
    # last inserted person is added on the head of the list
670
    url = conn + '/create-child-person?NameID=%s&child_id=%s' % (
671
        update_data['name_id'],
672
        update_data['bart_num'],
673
    )
674
    payload = FAMILY_RESET_PAYLOAD['childList'][0]['authorizedPersonList'][0]
675
    resp = requests.post(url, json=payload)
676
    resp.raise_for_status()
677
    assert resp.json()['err'] == 0
678
    data = diff_child(
679
        conn, update_data['name_id'], 0, 'test_update_child_person.json', 'authorizedPersonList'
680
    )
681

  
682
    # update Abi (and restore child person list)
683
    abi_num = data['childList'][0]['authorizedPersonList'][0]['personInfo']['num']
684
    url = conn + '/update-child-person?NameID=%s&child_id=%s&person_id=%s' % (
685
        update_data['name_id'],
686
        update_data['bart_num'],
687
        abi_num,
688
    )
689
    payload = update_data['family_payload']['childList'][0]['authorizedPersonList'][0]
690
    resp = requests.post(url, json=payload)
691
    resp.raise_for_status()
692
    assert resp.json()['err'] == 0
693
    assert diff_family(conn, update_data['name_id'], 'test_update_family.json')
functests/toulouse_maelis/test_misc.py
1
import requests
2

  
3
from .conftest import link, unlink
4

  
5

  
6
def test_up(conn):
7
    url = conn + '/up'
8
    resp = requests.get(url)
9
    resp.raise_for_status()
10
    res = resp.json()
11
    assert res['err'] == 0
12

  
13

  
14
def test_unlink(conn, update_data):
15
    resp = unlink(conn, update_data['name_id'])
16
    resp = unlink(conn, update_data['name_id'])
17
    res = resp.json()
18
    assert res['err'] == 'not-linked'
19

  
20

  
21
def test_link(conn, update_data):
22
    unlink(conn, update_data['name_id'])
23
    link(conn, update_data)
24
    link(conn, update_data)
25

  
26
    # wrong DUI number
27
    url = conn + '/link?NameID=%s' % update_data['name_id']
28
    payload = {
29
        'family_id': '999999',
30
        'firstname': update_data['family_payload']['rl1']['firstname'],
31
        'lastname': update_data['family_payload']['rl1']['lastname'],
32
        'dateBirth': update_data['family_payload']['rl1']['birth']['dateBirth'],
33
    }
34
    resp = requests.post(url, json=payload)
35
    resp.raise_for_status()
36
    res = resp.json()
37
    assert res == {
38
        'err': 'Family-readFamily-soap:Server',
39
        'err_class': 'passerelle.utils.jsonresponse.APIError',
40
        'err_desc': 'E02 : Le dossier numéro [999999] ne correspond à aucune famille',
41
        'data': None,
42
    }
43

  
44
    # wrong DUI firstname
45
    payload = {
46
        'family_id': update_data['family_id'],
47
        'firstname': 'plop',
48
        'lastname': update_data['family_payload']['rl1']['lastname'],
49
        'dateBirth': update_data['family_payload']['rl1']['birth']['dateBirth'],
50
    }
51
    resp = requests.post(url, json=payload)
52
    resp.raise_for_status()
53
    res = resp.json()
54
    assert res == {
55
        'err': 'not-found',
56
        'err_class': 'passerelle.utils.jsonresponse.APIError',
57
        'err_desc': "RL1 does not match '196947' family",
58
        'data': None,
59
    }
0
-