Project

General

Profile

0003-toulouse-maelis-RL-num-is-no-more-not-needed-on-upda.patch

Nicolas Roche, 24 November 2022 11:38 AM

Download (3.74 KB)

View differences:

Subject: [PATCH 3/5] toulouse-maelis: RL num is no more not needed on
 updateFamily (#71642)

 passerelle/contrib/toulouse_maelis/models.py | 2 --
 tests/data/toulouse_maelis/Q_update_rl1.xml  | 1 -
 tests/data/toulouse_maelis/Q_update_rl2.xml  | 1 -
 3 files changed, 4 deletions(-)
passerelle/contrib/toulouse_maelis/models.py
670 670
    )
671 671
    def update_rl1(self, request, NameID, post_data):
672 672
        family_id = self.get_link(NameID).family_id
673 673
        family = self.get_family_raw(family_id)
674 674
        self.assert_rl_payload_in_referential(post_data)
675 675
        self.replace_null_values(post_data)
676 676

  
677 677
        rl1 = post_data
678
        rl1['num'] = family['RL1']['num']
679 678
        rl1['adresse'] = family['RL1']['adresse']
680 679
        payload = {
681 680
            'dossierNumber': family_id,
682 681
            'category': family['category'],
683 682
            'situation': family['situation'],
684 683
            'flagCom': family['flagCom'],
685 684
            'nbChild': family['nbChild'],
686 685
            'nbTotalChild': family['nbTotalChild'],
......
730 729
        family_id = self.get_link(NameID).family_id
731 730
        family = self.get_family_raw(family_id)
732 731
        if not family['RL2']:
733 732
            raise APIError('No RL2 to update on family', err_code='no-rl2')
734 733
        self.assert_rl_payload_in_referential(post_data)
735 734
        self.replace_null_values(post_data)
736 735

  
737 736
        rl2 = post_data
738
        rl2['num'] = family['RL2']['num']
739 737
        rl2['adresse'] = family['RL2']['adresse']
740 738
        payload = {
741 739
            'dossierNumber': family_id,
742 740
            'category': family['category'],
743 741
            'situation': family['situation'],
744 742
            'flagCom': family['flagCom'],
745 743
            'nbChild': family['nbChild'],
746 744
            'nbTotalChild': family['nbTotalChild'],
tests/data/toulouse_maelis/Q_update_rl1.xml
11 11
  <soap-env:Body>
12 12
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
13 13
      <dossierNumber>1312</dossierNumber>
14 14
      <category>BI</category>
15 15
      <situation>M</situation>
16 16
      <flagCom>true</flagCom>
17 17
      <nbChild>2</nbChild>
18 18
      <rl1>
19
        <num>613878</num>
20 19
        <firstname>Jhonny</firstname>
21 20
        <lastname>Doe</lastname>
22 21
        <quality>PERE</quality>
23 22
        <civility>M.</civility>
24 23
        <birth>
25 24
          <dateBirth>1943-06-15</dateBirth>
26 25
        </birth>
27 26
        <adresse>
tests/data/toulouse_maelis/Q_update_rl2.xml
10 10
  <soap-env:Body>
11 11
    <ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
12 12
      <dossierNumber>1312</dossierNumber>
13 13
      <category>BI</category>
14 14
      <situation>M</situation>
15 15
      <flagCom>true</flagCom>
16 16
      <nbChild>2</nbChild>
17 17
      <rl2>
18
        <num>613879</num>
19 18
        <firstname>JANE</firstname>
20 19
        <lastname>DOE</lastname>
21 20
        <maidenName>Smith</maidenName>
22 21
        <quality>MERE</quality>
23 22
        <civility>MME</civility>
24 23
        <birth>
25 24
          <dateBirth>1940-06-22</dateBirth>
26 25
        </birth>
27
-