Projet

Général

Profil

0001-toulouse-maelis-auth-persons-no-more-managed-on-fami.patch

Nicolas Roche, 17 novembre 2022 08:50

Télécharger (20 ko)

Voir les différences:

Subject: [PATCH] toulouse-maelis: auth persons no more managed on family
 (#71388)

 passerelle/contrib/toulouse_maelis/schemas.py | 10 ---
 tests/data/toulouse_maelis/FamilyService.wsdl | 63 -------------------
 tests/data/toulouse_maelis/R_read_family.xml  | 10 ---
 .../toulouse_maelis/R_read_family_relax.xml   | 10 ---
 .../R_read_family_reordered.xml               | 10 ---
 tests/test_toulouse_maelis.py                 |  1 -
 6 files changed, 104 deletions(-)
passerelle/contrib/toulouse_maelis/schemas.py
495 495
            'oneOf': [{'type': 'string'}, {'type': 'null'}],
496 496
        },
497 497
        'nbAES': {
498 498
            'description': "Nombre d'AES",
499 499
            'oneOf': [{'type': 'string'}, {'type': 'null'}],
500 500
        },
501 501
        'rl1': RLINFO_SCHEMA,
502 502
        'rl2': RLINFO_SCHEMA,
503
        'authorizedPersonList': {
504
            'oneOf': [
505
                {
506
                    'type': 'array',
507
                    'items': AUTHORIZEDPERSON_SCHEMA,
508
                },
509
                {'type': 'null'},
510
            ],
511
        },
512 503
        'emergencyPersonList': {
513 504
            'oneOf': [
514 505
                {
515 506
                    'type': 'array',
516 507
                    'items': AUTHORIZEDPERSON_SCHEMA,
517 508
                },
518 509
                {'type': 'null'},
519 510
            ],
......
536 527
CREATE_FAMILY_SCHEMA['required'] = ['rl1', 'categorie', 'situation']
537 528
create_family_child_schema = CREATE_FAMILY_SCHEMA['properties']['childList']['oneOf'][0]['items']
538 529
del create_family_child_schema['properties']['bPhoto']
539 530
del create_family_child_schema['properties']['bLeaveAlone']
540 531
del create_family_child_schema['properties']['paiInfoBean']
541 532

  
542 533
CREATE_RL1_SCHEMA = copy.deepcopy(CREATE_FAMILY_SCHEMA)
543 534
del CREATE_RL1_SCHEMA['properties']['rl2']
544
del CREATE_RL1_SCHEMA['properties']['authorizedPersonList']
545 535
del CREATE_RL1_SCHEMA['properties']['emergencyPersonList']
546 536
del CREATE_RL1_SCHEMA['properties']['childList']
547 537
del CREATE_RL1_SCHEMA['properties']['rl1']['properties']['contact']
548 538
del CREATE_RL1_SCHEMA['properties']['rl1']['properties']['profession']
549 539
del CREATE_RL1_SCHEMA['properties']['rl1']['properties']['CAFInfo']
550 540

  
551 541
UPDATE_RL1_SCHEMA = copy.deepcopy(RLINFO_SCHEMA)
552 542
UPDATE_RL1_SCHEMA['required'] = ['firstname', 'lastname', 'civility', 'quality', 'dateBirth']
tests/data/toulouse_maelis/FamilyService.wsdl
64 64
  <xs:element name="updateChildIndicatorsResponse" type="tns:updateChildIndicatorsResponse"/>
65 65
  <xs:element name="updateChildMedicalRecord" type="tns:updateChildMedicalRecord"/>
66 66
  <xs:element name="updateChildMedicalRecordResponse" type="tns:updateChildMedicalRecordResponse"/>
67 67
  <xs:element name="updateChildPAI" type="tns:updateChildPAI"/>
68 68
  <xs:element name="updateChildPAIResponse" type="tns:updateChildPAIResponse"/>
69 69
  <xs:element name="updateCoordinate" type="tns:updateCoordinate"/>
70 70
  <xs:element name="updateCoordinateResponse" type="tns:updateCoordinateResponse"/>
71 71
  <xs:element name="updateFamily" type="tns:updateFamily"/>
72
  <xs:element name="updateFamilyAuthorizedPersonList" type="tns:updateFamilyAuthorizedPersonList"/>
73
  <xs:element name="updateFamilyAuthorizedPersonListResponse" type="tns:updateFamilyAuthorizedPersonListResponse"/>
74 72
  <xs:element name="updateFamilyEmergencyPersonList" type="tns:updateFamilyEmergencyPersonList"/>
75 73
  <xs:element name="updateFamilyEmergencyPersonListResponse" type="tns:updateFamilyEmergencyPersonListResponse"/>
76 74
  <xs:element name="updateFamilyResponse" type="tns:updateFamilyResponse"/>
77 75
  <xs:element name="updateFamilySituation" type="tns:updateFamilySituation"/>
78 76
  <xs:element name="updateFamilySituationResponse" type="tns:updateFamilySituationResponse"/>
79 77
  <xs:complexType name="deletesubscribe">
80 78
    <xs:sequence>
81 79
      <xs:element name="numPerson" type="xs:int"/>
......
151 149
      <xs:element minOccurs="0" name="flagCom" type="xs:boolean"/>
152 150
      <xs:element minOccurs="0" name="nbChild" type="xs:int"/>
153 151
      <xs:element minOccurs="0" name="nbTotalChild" type="xs:int"/>
154 152
      <xs:element minOccurs="0" name="nbAES" type="xs:string"/>
155 153
      <xs:element minOccurs="0" name="RL1" type="tns:rlInfoBean"/>
156 154
      <xs:element minOccurs="0" name="RL2" type="tns:rlInfoBean"/>
157 155
      <xs:element maxOccurs="unbounded" minOccurs="0" name="quotientList" nillable="true" type="ns1:familyQuotientBean"/>
158 156
      <xs:element maxOccurs="unbounded" minOccurs="0" name="emergencyPersonList" nillable="true" type="ns1:emergencyPersonBean"/>
159
      <xs:element maxOccurs="unbounded" minOccurs="0" name="authorizedPersonList" nillable="true" type="ns1:familyPersonBean"/>
160 157
      <xs:element maxOccurs="unbounded" minOccurs="0" name="childList" nillable="true" type="ns1:childInfoBean"/>
161 158
      <xs:element maxOccurs="unbounded" minOccurs="0" name="indicatorList" nillable="true" type="ns1:indicatorValueBean"/>
162 159
      <xs:element maxOccurs="unbounded" minOccurs="0" name="childErrorList" nillable="true" type="xs:string"/>
163 160
    </xs:sequence>
164 161
  </xs:complexType>
165 162
  <xs:complexType name="rlInfoBean">
166 163
    <xs:sequence>
167 164
      <xs:element minOccurs="0" name="num" type="xs:string"/>
......
366 363
      <xs:element minOccurs="0" name="flagCom" type="xs:boolean"/>
367 364
      <xs:element minOccurs="0" name="nbChild" type="xs:int"/>
368 365
      <xs:element minOccurs="0" name="nbTotalChild" type="xs:int"/>
369 366
      <xs:element minOccurs="0" name="nbAES" type="xs:int"/>
370 367
      <xs:element minOccurs="0" name="rl1" type="tns:rlInfoBean"/>
371 368
      <xs:element minOccurs="0" name="rl2" type="tns:rlInfoBean"/>
372 369
      <xs:element maxOccurs="unbounded" minOccurs="0" name="childList" type="ns1:childInfoBean"/>
373 370
      <xs:element minOccurs="0" name="isForceCreateChild" type="xs:boolean"/>
374
      <xs:element minOccurs="0" name="authorizedPersonList" type="tns:authorizedPersonListBean"/>
375 371
      <xs:element maxOccurs="unbounded" minOccurs="0" name="indicatorList" type="ns1:indicatorValueUpdBean"/>
376 372
      <xs:element minOccurs="0" name="emergencyPersonList" type="ns1:emergencyPersonListBean"/>
377 373
    </xs:sequence>
378 374
  </xs:complexType>
379
  <xs:complexType name="authorizedPersonListBean">
380
    <xs:complexContent>
381
      <xs:extension base="tns:abstractSpecRequestBean">
382
        <xs:sequence>
383
          <xs:element maxOccurs="unbounded" minOccurs="0" name="personList" nillable="true" type="ns1:familyPersonBean"/>
384
        </xs:sequence>
385
      </xs:extension>
386
    </xs:complexContent>
387
  </xs:complexType>
388 375
  <xs:complexType name="updateFamilyResponse">
389 376
    <xs:sequence>
390 377
      <xs:element minOccurs="0" name="familyResult" type="tns:familyBean"/>
391 378
    </xs:sequence>
392 379
  </xs:complexType>
393 380
  <xs:complexType name="createUpdateQuotient">
394 381
    <xs:sequence>
395 382
      <xs:element name="dossierNumber" type="xs:int"/>
......
522 509
      <xs:element minOccurs="0" name="flagCom" type="xs:boolean"/>
523 510
      <xs:element minOccurs="0" name="nbChild" type="xs:int"/>
524 511
      <xs:element minOccurs="0" name="nbTotalChild" type="xs:int"/>
525 512
      <xs:element minOccurs="0" name="nbAES" type="xs:int"/>
526 513
      <xs:element name="rl1" type="tns:rlInfoBean"/>
527 514
      <xs:element minOccurs="0" name="rl2" type="tns:rlInfoBean"/>
528 515
      <xs:element maxOccurs="unbounded" minOccurs="0" name="childList" type="ns1:childBean"/>
529 516
      <xs:element minOccurs="0" name="isForceCreateChild" type="xs:boolean"/>
530
      <xs:element maxOccurs="unbounded" minOccurs="0" name="authorizedPersonList" type="ns1:familyPersonBean"/>
531 517
      <xs:element maxOccurs="unbounded" minOccurs="0" name="indicatorList" type="ns1:indicatorValueAddBean"/>
532 518
      <xs:element maxOccurs="unbounded" minOccurs="0" name="emergencyPersonList" type="ns1:emergencyPersonBean"/>
533 519
    </xs:sequence>
534 520
  </xs:complexType>
535 521
  <xs:complexType name="createFamilyResponse">
536 522
    <xs:sequence>
537 523
      <xs:element minOccurs="0" name="createFamilyResult" type="ns1:resultFamilyBean"/>
538 524
    </xs:sequence>
......
548 534
  <xs:complexType name="readPAIList">
549 535
    <xs:sequence/>
550 536
  </xs:complexType>
551 537
  <xs:complexType name="readPAIListResponse">
552 538
    <xs:sequence>
553 539
      <xs:element maxOccurs="unbounded" minOccurs="0" name="itemList" type="ns2:itemBean"/>
554 540
    </xs:sequence>
555 541
  </xs:complexType>
556
  <xs:complexType name="updateFamilyAuthorizedPersonList">
557
    <xs:sequence>
558
      <xs:element name="numDossier" type="xs:int"/>
559
      <xs:element name="authorizedPersonList" type="tns:authorizedPersonListBean"/>
560
    </xs:sequence>
561
  </xs:complexType>
562
  <xs:complexType name="updateFamilyAuthorizedPersonListResponse">
563
    <xs:sequence/>
564
  </xs:complexType>
565 542
  <xs:complexType name="readCategoryList">
566 543
    <xs:sequence/>
567 544
  </xs:complexType>
568 545
  <xs:complexType name="readCategoryListResponse">
569 546
    <xs:sequence>
570 547
      <xs:element maxOccurs="unbounded" minOccurs="0" name="itemList" type="ns2:itemBean"/>
571 548
    </xs:sequence>
572 549
  </xs:complexType>
......
1289 1266
  <wsdl:message name="readStreetListResponse">
1290 1267
    <wsdl:part element="tns:readStreetListResponse" name="parameters">
1291 1268
    </wsdl:part>
1292 1269
  </wsdl:message>
1293 1270
  <wsdl:message name="readPAIList">
1294 1271
    <wsdl:part element="tns:readPAIList" name="parameters">
1295 1272
    </wsdl:part>
1296 1273
  </wsdl:message>
1297
  <wsdl:message name="updateFamilyAuthorizedPersonList">
1298
    <wsdl:part element="tns:updateFamilyAuthorizedPersonList" name="parameters">
1299
    </wsdl:part>
1300
  </wsdl:message>
1301 1274
  <wsdl:message name="updateChildIndicatorsResponse">
1302 1275
    <wsdl:part element="tns:updateChildIndicatorsResponse" name="parameters">
1303 1276
    </wsdl:part>
1304 1277
  </wsdl:message>
1305 1278
  <wsdl:message name="readPAIListResponse">
1306 1279
    <wsdl:part element="tns:readPAIListResponse" name="parameters">
1307 1280
    </wsdl:part>
1308 1281
  </wsdl:message>
......
1445 1418
  <wsdl:message name="isWSRunningResponse">
1446 1419
    <wsdl:part element="tns:isWSRunningResponse" name="parameters">
1447 1420
    </wsdl:part>
1448 1421
  </wsdl:message>
1449 1422
  <wsdl:message name="readVaccinList">
1450 1423
    <wsdl:part element="tns:readVaccinList" name="parameters">
1451 1424
    </wsdl:part>
1452 1425
  </wsdl:message>
1453
  <wsdl:message name="updateFamilyAuthorizedPersonListResponse">
1454
    <wsdl:part element="tns:updateFamilyAuthorizedPersonListResponse" name="parameters">
1455
    </wsdl:part>
1456
  </wsdl:message>
1457 1426
  <wsdl:message name="readCategoryList">
1458 1427
    <wsdl:part element="tns:readCategoryList" name="parameters">
1459 1428
    </wsdl:part>
1460 1429
  </wsdl:message>
1461 1430
  <wsdl:message name="readFamilyByPassword">
1462 1431
    <wsdl:part element="tns:readFamilyByPassword" name="parameters">
1463 1432
    </wsdl:part>
1464 1433
  </wsdl:message>
......
1773 1742
 flagCom : code/hors commune 
1774 1743
 nbChild : nombre d'enfants à charge max 99
1775 1744
 nbTotalChild : nombre d'enfants  max 99
1776 1745
 nbAES : nombre d'AES max 99
1777 1746
 rl1 : responsable légal 1 (facultatif) 
1778 1747
 rl2 : résponsable légal 2 (facultatif)  
1779 1748
 childList : la liste des enfants (facultatif)
1780 1749
 isForceCreateChild : null ou false et doublon de RL1 ou d'enfant détecté
1781
 authorizedPersonList : liste des personnes autorisées à récupérer les enfants  
1782 1750
 indicatorList : liste des indicateurs 
1783 1751
 emergencyPersonList : la liste des personnes à prévenir  
1784 1752

  
1785 1753
 ----------------------
1786 1754
 Traitement : 
1787 1755
 Le service modifie les données correspondant aux paramètres passés dans la requête :
1788 1756
 -	Une donnée non renseignée (paramètre non présent) n'est pas mise à jour
1789 1757
 -	Une donnée vide (paramètre présent mais chaine vide) efface la donnée 
......
2128 2096
 flagCom : code/hors commune 
2129 2097
 nbChild : nombre d'enfants à charge max 99
2130 2098
 nbTotalChild : nombre d'enfants  max 99
2131 2099
 nbAES : nombre d'AES max 99
2132 2100
 rl1 : responsable légal 1 (obligatoire)
2133 2101
 rl2 : résponsable légal 2 (facultatif)  
2134 2102
 childList : la liste des enfants 
2135 2103
 isForceCreateChild : null ou false et doublon de RL1 ou d'enfant détecté
2136
 authorizedPersonList : liste des personnes autorisées à récupérer les enfants  
2137 2104
 indicatorList : liste des indicateurs 
2138 2105
 emergencyPersonList : la liste des personnes à prévenir  
2139 2106
 Retourne le dossier famille
2140 2107

  
2141 2108
 -------------------------
2142 2109
 Traitement : 
2143 2110
 Un traitement de recherche de doublon est fait pour la création du RL1 et des enfants.
2144 2111
 Pour le RL1, lorsque la date de naissance est fournie, on recherche si on trouve une personne de type RL1 ou RL2 qui existe avec les mêmes nom, prénom et date de naissance.
......
2196 2163
 Retourne la liste des code valeur pour les PAI</wsdl:documentation>
2197 2164
      <wsdl:input message="tns:readPAIList" name="readPAIList">
2198 2165
    </wsdl:input>
2199 2166
      <wsdl:output message="tns:readPAIListResponse" name="readPAIListResponse">
2200 2167
    </wsdl:output>
2201 2168
      <wsdl:fault message="tns:MaelisFamilyException" name="MaelisFamilyException">
2202 2169
    </wsdl:fault>
2203 2170
    </wsdl:operation>
2204
    <wsdl:operation name="updateFamilyAuthorizedPersonList">
2205
<wsdl:documentation>Méthode de mise à jour de la liste des personnes autorisées sur la famille
2206
 La liste comporte toutes les personnes autorisées. 
2207
 Les personnes non présentes dans cette liste sont supprimées en tant que personne autorisée.
2208
 Déprécié : il faut utiliser la méthode updateChildAutorization car nouvelle gestion par enfant (famille recomposée)  
2209

  
2210
 ------------------------------
2211
 numDossier : numéro de dossier famille  (obligatoire)
2212
 authorizedPersonList : liste des personnes autorisées
2213

  
2214
 -----------------------------</wsdl:documentation>
2215
      <wsdl:input message="tns:updateFamilyAuthorizedPersonList" name="updateFamilyAuthorizedPersonList">
2216
    </wsdl:input>
2217
      <wsdl:output message="tns:updateFamilyAuthorizedPersonListResponse" name="updateFamilyAuthorizedPersonListResponse">
2218
    </wsdl:output>
2219
      <wsdl:fault message="tns:MaelisFamilyException" name="MaelisFamilyException">
2220
    </wsdl:fault>
2221
    </wsdl:operation>
2222 2171
    <wsdl:operation name="readCategoryList">
2223 2172
<wsdl:documentation>Méthodes de lecture du paramétrage de référence
2224 2173
 La liste des catégories 
2225 2174

  
2226 2175
 -------------------------
2227 2176
 Retourne la liste des code valeur pour les catégories</wsdl:documentation>
2228 2177
      <wsdl:input message="tns:readCategoryList" name="readCategoryList">
2229 2178
    </wsdl:input>
......
2652 2601
      </wsdl:input>
2653 2602
      <wsdl:output name="readPAIListResponse">
2654 2603
        <soap:body use="literal"/>
2655 2604
      </wsdl:output>
2656 2605
      <wsdl:fault name="MaelisFamilyException">
2657 2606
        <soap:fault name="MaelisFamilyException" use="literal"/>
2658 2607
      </wsdl:fault>
2659 2608
    </wsdl:operation>
2660
    <wsdl:operation name="updateFamilyAuthorizedPersonList">
2661
      <soap:operation soapAction="" style="document"/>
2662
      <wsdl:input name="updateFamilyAuthorizedPersonList">
2663
        <soap:body use="literal"/>
2664
      </wsdl:input>
2665
      <wsdl:output name="updateFamilyAuthorizedPersonListResponse">
2666
        <soap:body use="literal"/>
2667
      </wsdl:output>
2668
      <wsdl:fault name="MaelisFamilyException">
2669
        <soap:fault name="MaelisFamilyException" use="literal"/>
2670
      </wsdl:fault>
2671
    </wsdl:operation>
2672 2609
    <wsdl:operation name="readCategoryList">
2673 2610
      <soap:operation soapAction="" style="document"/>
2674 2611
      <wsdl:input name="readCategoryList">
2675 2612
        <soap:body use="literal"/>
2676 2613
      </wsdl:input>
2677 2614
      <wsdl:output name="readCategoryListResponse">
2678 2615
        <soap:body use="literal"/>
2679 2616
      </wsdl:output>
tests/data/toulouse_maelis/R_read_family.xml
73 73
          <lastname>ARKANA</lastname>
74 74
          <dateBirth>1982-12-20T00:00:00+01:00</dateBirth>
75 75
          <quality>T</quality>
76 76
          <contact>
77 77
            <phone>0123456789</phone>
78 78
            <mail>pueblo@example.org</mail>
79 79
          </contact>
80 80
        </emergencyPersonList>
81
        <authorizedPersonList>
82
          <numPerson>614121</numPerson>
83
          <firstname>CATHY</firstname>
84
          <lastname>PALENNE</lastname>
85
          <dateBirth>1975-06-28T00:00:00+01:00</dateBirth>
86
          <quality>O</quality>
87
          <contact>
88
            <mobile>0623456789</mobile>
89
          </contact>
90
        </authorizedPersonList>
91 81
        <childList>
92 82
          <num>613880</num>
93 83
          <lastname>DOE</lastname>
94 84
          <firstname>JANNIS</firstname>
95 85
          <sexe>F</sexe>
96 86
          <birth>
97 87
            <dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
98 88
          </birth>
tests/data/toulouse_maelis/R_read_family_relax.xml
72 72
          <lastname>ARKANA</lastname>
73 73
          <dateBirth>1982-12-20T00:00:00+01:00</dateBirth>
74 74
          <quality>T</quality>
75 75
          <contact>
76 76
            <phone>0123456789</phone>
77 77
            <mail>pueblo@example.org</mail>
78 78
          </contact>
79 79
        </emergencyPersonList>
80
        <authorizedPersonList>
81
          <numPerson>614121</numPerson>
82
          <firstname>CATHY</firstname>
83
          <lastname>PALENNE</lastname>
84
          <dateBirth>1975-06-28T00:00:00+01:00</dateBirth>
85
          <quality>O</quality>
86
          <contact>
87
            <mobile>0623456789</mobile>
88
          </contact>
89
        </authorizedPersonList>
90 80
        <childList>
91 81
          <num>613880</num>
92 82
          <lastname>DOE</lastname>
93 83
          <firstname>JANNIS</firstname>
94 84
          <sexe>F</sexe>
95 85
          <birth>
96 86
            <dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
97 87
          </birth>
tests/data/toulouse_maelis/R_read_family_reordered.xml
73 73
          <dateBirth>1982-12-20T00:00:00+01:00</dateBirth>
74 74
          <quality>T</quality>
75 75
          <civility>MME</civility>
76 76
          <contact>
77 77
            <phone>0123456789</phone>
78 78
            <mail>pueblo@example.org</mail>
79 79
          </contact>
80 80
        </emergencyPersonList>
81
        <authorizedPersonList>
82
          <numPerson>614121</numPerson>
83
          <firstname>CATHY</firstname>
84
          <lastname>PALENNE</lastname>
85
          <dateBirth>1975-06-28T00:00:00+01:00</dateBirth>
86
          <quality>O</quality>
87
          <contact>
88
            <mobile>0623456789</mobile>
89
          </contact>
90
        </authorizedPersonList>
91 81
        <childList>
92 82
          <num>613880</num>
93 83
          <lastname>DOE</lastname>
94 84
          <firstname>JANNIS</firstname>
95 85
          <sexe>F</sexe>
96 86
          <birth>
97 87
            <dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
98 88
          </birth>
tests/test_toulouse_maelis.py
558 558
    Link.objects.create(resource=con, family_id='1312', name_id='local')
559 559

  
560 560
    resp = app.get(url + '?NameID=local')
561 561
    assert resp.json['err'] == 0
562 562
    data = resp.json['data']
563 563
    del data['RL1']
564 564
    del data['RL2']
565 565
    del data['childList']
566
    del data['authorizedPersonList']
567 566
    del data['emergencyPersonList']
568 567
    assert data == {
569 568
        'number': 1312,
570 569
        'category': 'BI',
571 570
        'situation': 'M',
572 571
        'flagCom': True,
573 572
        'nbChild': 2,
574 573
        'nbTotalChild': None,
575
-