Project

General

Profile

0001-toulouse_maelis-pass-top-level-fields-to-updateFamil.patch

Nicolas Roche, 23 September 2022 06:23 PM

Download (12.1 KB)

View differences:

Subject: [PATCH] toulouse_maelis: pass top level fields to updateFamily
 (#69535)

 passerelle/contrib/toulouse_maelis/models.py  | 28 +++++++++++++++++++
 .../data/toulouse_maelis/Q_create_person.xml  |  2 ++
 tests/data/toulouse_maelis/Q_create_rl2.xml   |  2 ++
 .../data/toulouse_maelis/Q_delete_person.xml  |  2 ++
 tests/data/toulouse_maelis/Q_update_child.xml |  2 ++
 .../data/toulouse_maelis/Q_update_person.xml  |  2 ++
 tests/data/toulouse_maelis/Q_update_rl1.xml   |  2 ++
 tests/data/toulouse_maelis/Q_update_rl2.xml   |  2 ++
 8 files changed, 42 insertions(+)
passerelle/contrib/toulouse_maelis/models.py
513 513

  
514 514
        rl1 = post_data
515 515
        rl1['num'] = family['RL1']['num']
516 516
        rl1['adresse'] = family['RL1']['adresse']
517 517
        payload = {
518 518
            'dossierNumber': family_id,
519 519
            'categorie': family['category'],
520 520
            'situation': family['situation'],
521
            'flagCom': family['flagCom'],
522
            'nbChild': family['nbChild'],
523
            'nbTotalChild': family['nbTotalChild'],
524
            'nbAES': family['nbAES'],
521 525
            'rl1': rl1,
522 526
        }
523 527
        self.call('Family', 'updateFamily', **payload)
524 528
        return {'data': 'ok'}
525 529

  
526 530
    @endpoint(
527 531
        display_category='Famille',
528 532
        description='Création du RL2',
......
536 540
        family = self.get_family_raw(family_id)
537 541
        if family['RL2']:
538 542
            raise APIError('RL2 already defined on family', err_code='already-rl2')
539 543

  
540 544
        payload = {
541 545
            'dossierNumber': family_id,
542 546
            'categorie': family['category'],
543 547
            'situation': family['situation'],
548
            'flagCom': family['flagCom'],
549
            'nbChild': family['nbChild'],
550
            'nbTotalChild': family['nbTotalChild'],
551
            'nbAES': family['nbAES'],
544 552
            'rl2': post_data,
545 553
        }
546 554
        self.call('Family', 'updateFamily', **payload)
547 555
        return {'data': 'ok'}
548 556

  
549 557
    @endpoint(
550 558
        display_category='Famille',
551 559
        description='Modification du RL2',
......
563 571

  
564 572
        rl2 = post_data
565 573
        rl2['num'] = family['RL2']['num']
566 574
        rl2['adresse'] = family['RL2']['adresse']
567 575
        payload = {
568 576
            'dossierNumber': family_id,
569 577
            'categorie': family['category'],
570 578
            'situation': family['situation'],
579
            'flagCom': family['flagCom'],
580
            'nbChild': family['nbChild'],
581
            'nbTotalChild': family['nbTotalChild'],
582
            'nbAES': family['nbAES'],
571 583
            'rl2': rl2,
572 584
        }
573 585
        self.call('Family', 'updateFamily', **payload)
574 586
        return {'data': 'ok'}
575 587

  
576 588
    @endpoint(
577 589
        display_category='Famille',
578 590
        description="Ajout d'un enfant",
......
623 635
        self.replace_null_values(post_data)
624 636

  
625 637
        child = post_data
626 638
        child['num'] = child_id
627 639
        payload = {
628 640
            'dossierNumber': family_id,
629 641
            'categorie': family['category'],
630 642
            'situation': family['situation'],
643
            'flagCom': family['flagCom'],
644
            'nbChild': family['nbChild'],
645
            'nbTotalChild': family['nbTotalChild'],
646
            'nbAES': family['nbAES'],
631 647
            'childList': [child],
632 648
        }
633 649
        self.call('Family', 'updateFamily', **payload)
634 650
        return {'data': 'ok'}
635 651

  
636 652
    @endpoint(
637 653
        display_category='Famille',
638 654
        description="Mise à jour des coordonnées d'une personne",
......
670 686
        self.replace_null_values(post_data)
671 687

  
672 688
        personList = family[kind + 'PersonList']
673 689
        personList.append(post_data)
674 690
        payload = {
675 691
            'dossierNumber': family_id,
676 692
            'categorie': family['category'],
677 693
            'situation': family['situation'],
694
            'flagCom': family['flagCom'],
695
            'nbChild': family['nbChild'],
696
            'nbTotalChild': family['nbTotalChild'],
697
            'nbAES': family['nbAES'],
678 698
            kind + 'PersonList': [{'personList': personList}],
679 699
        }
680 700
        self.call('Family', 'updateFamily', **payload)
681 701
        return {'data': 'ok'}
682 702

  
683 703
    @endpoint(
684 704
        display_category='Famille',
685 705
        description="Mise à jour d'une personne autorisée à récupérer les enfants ou à prévenir en cas d'urgence",
......
708 728
        else:
709 729
            raise APIError(
710 730
                "no '%s' authorized person on '%s' family" % (person_id, family_id), err_code='not-found'
711 731
            )
712 732
        payload = {
713 733
            'dossierNumber': family_id,
714 734
            'categorie': family['category'],
715 735
            'situation': family['situation'],
736
            'flagCom': family['flagCom'],
737
            'nbChild': family['nbChild'],
738
            'nbTotalChild': family['nbTotalChild'],
739
            'nbAES': family['nbAES'],
716 740
            kind + 'PersonList': [{'personList': personList}],
717 741
        }
718 742
        self.call('Family', 'updateFamily', **payload)
719 743
        return {'data': 'ok'}
720 744

  
721 745
    @endpoint(
722 746
        display_category='Famille',
723 747
        description="Suppression d'une personne autorisée à récupérer les enfants ou à prévenir en cas d'urgence",
......
744 768
        else:
745 769
            raise APIError(
746 770
                "no '%s' authorized person on '%s' family" % (person_id, family_id), err_code='not-found'
747 771
            )
748 772
        payload = {
749 773
            'dossierNumber': family_id,
750 774
            'categorie': family['category'],
751 775
            'situation': family['situation'],
776
            'flagCom': family['flagCom'],
777
            'nbChild': family['nbChild'],
778
            'nbTotalChild': family['nbTotalChild'],
779
            'nbAES': family['nbAES'],
752 780
            kind + 'PersonList': [{'personList': personList}],
753 781
        }
754 782
        self.call('Family', 'updateFamily', **payload)
755 783
        return {'data': 'ok'}
756 784

  
757 785
    @endpoint(
758 786
        display_category='Famille',
759 787
        description="Créer ou mettre à jour le régime alimentaire d'un enfant",
tests/data/toulouse_maelis/Q_create_person.xml
8 8
      </wsse:UsernameToken>
9 9
    </wsse:Security>
10 10
  </soap-env:Header>
11 11
  <soap-env:Body>
12 12
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
13 13
      <dossierNumber>1312</dossierNumber>
14 14
      <categorie>BI</categorie>
15 15
      <situation>M</situation>
16
      <flagCom>true</flagCom>
17
      <nbChild>2</nbChild>
16 18
      <emergencyPersonList>
17 19
        <personList>
18 20
          <numPerson>614059</numPerson>
19 21
          <civility>MME</civility>
20 22
          <firstname>KENY</firstname>
21 23
          <lastname>ARKANA</lastname>
22 24
          <dateBirth>1982-12-20T00:00:00+01:00</dateBirth>
23 25
          <quality>T</quality>
tests/data/toulouse_maelis/Q_create_rl2.xml
7 7
      </wsse:UsernameToken>
8 8
    </wsse:Security>
9 9
  </soap-env:Header>
10 10
  <soap-env:Body>
11 11
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
12 12
      <dossierNumber>1312</dossierNumber>
13 13
      <categorie>BI</categorie>
14 14
      <situation>M</situation>
15
      <flagCom>true</flagCom>
16
      <nbChild>2</nbChild>
15 17
      <rl2>
16 18
        <lastname>DOE</lastname>
17 19
        <firstname>JANE</firstname>
18 20
        <quality>MERE</quality>
19 21
        <civility>MME</civility>
20 22
        <dateBirth>1940-06-22</dateBirth>
21 23
        <adresse>
22 24
          <num>170</num>
tests/data/toulouse_maelis/Q_delete_person.xml
8 8
      </wsse:UsernameToken>
9 9
    </wsse:Security>
10 10
  </soap-env:Header>
11 11
  <soap-env:Body>
12 12
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
13 13
      <dossierNumber>1312</dossierNumber>
14 14
      <categorie>BI</categorie>
15 15
      <situation>M</situation>
16
      <flagCom>true</flagCom>
17
      <nbChild>2</nbChild>
16 18
      <emergencyPersonList/>
17 19
    </ns0:updateFamily>
18 20
  </soap-env:Body>
19 21
</soap-env:Envelope>
tests/data/toulouse_maelis/Q_update_child.xml
7 7
      </wsse:UsernameToken>
8 8
    </wsse:Security>
9 9
  </soap-env:Header>
10 10
  <soap-env:Body>
11 11
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
12 12
      <dossierNumber>1312</dossierNumber>
13 13
      <categorie>BI</categorie>
14 14
      <situation>M</situation>
15
      <flagCom>true</flagCom>
16
      <nbChild>2</nbChild>
15 17
      <childList>
16 18
        <num>613880</num>
17 19
        <lastname>DOE</lastname>
18 20
        <firstname>JANNIS</firstname>
19 21
        <sexe>F</sexe>
20 22
        <birth>
21 23
          <dateBirth>1943-01-19</dateBirth>
22 24
          <place>Port Arthur</place>
tests/data/toulouse_maelis/Q_update_person.xml
8 8
      </wsse:UsernameToken>
9 9
    </wsse:Security>
10 10
  </soap-env:Header>
11 11
  <soap-env:Body>
12 12
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
13 13
      <dossierNumber>1312</dossierNumber>
14 14
      <categorie>BI</categorie>
15 15
      <situation>M</situation>
16
      <flagCom>true</flagCom>
17
      <nbChild>2</nbChild>
16 18
      <emergencyPersonList>
17 19
        <personList>
18 20
          <numPerson>614059</numPerson>
19 21
          <civility/>
20 22
          <firstname>Mathias</firstname>
21 23
          <lastname>Cassel</lastname>
22 24
          <dateBirth>1972-01-01</dateBirth>
23 25
          <quality>O</quality>
tests/data/toulouse_maelis/Q_update_rl1.xml
8 8
      </wsse:UsernameToken>
9 9
    </wsse:Security>
10 10
  </soap-env:Header>
11 11
  <soap-env:Body>
12 12
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
13 13
      <dossierNumber>1312</dossierNumber>
14 14
      <categorie>BI</categorie>
15 15
      <situation>M</situation>
16
      <flagCom>true</flagCom>
17
      <nbChild>2</nbChild>
16 18
      <rl1>
17 19
        <num>613878</num>
18 20
        <lastname>Doe</lastname>
19 21
        <firstname>Jhonny</firstname>
20 22
        <quality>PERE</quality>
21 23
        <civility>M.</civility>
22 24
        <dateBirth>1943-06-15</dateBirth>
23 25
        <adresse>
tests/data/toulouse_maelis/Q_update_rl2.xml
7 7
      </wsse:UsernameToken>
8 8
    </wsse:Security>
9 9
  </soap-env:Header>
10 10
  <soap-env:Body>
11 11
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
12 12
      <dossierNumber>1312</dossierNumber>
13 13
      <categorie>BI</categorie>
14 14
      <situation>M</situation>
15
      <flagCom>true</flagCom>
16
      <nbChild>2</nbChild>
15 17
      <rl2>
16 18
        <num>613879</num>
17 19
        <lastname>DOE</lastname>
18 20
        <firstname>JANE</firstname>
19 21
        <quality>MERE</quality>
20 22
        <civility>MME</civility>
21 23
        <dateBirth>1940-06-22</dateBirth>
22 24
        <adresse>
23
-