toulouse-maelis: send authorized person list on update-child (#71645)

This commit is contained in:
Nicolas Roche 2022-11-23 21:18:53 +01:00
parent 561fcb8471
commit 2fbdbf19d7
2 changed files with 25 additions and 2 deletions

View File

@ -794,13 +794,17 @@ class ToulouseMaelis(BaseResource, HTTPResource):
def update_child(self, request, NameID, child_id, post_data):
family_id = self.get_link(NameID).family_id
family = self.get_family_raw(family_id)
if child_id not in [x['num'] for x in family['childList']]:
raise APIError('No child %s to update on family' % child_id, err_code='no-child')
self.assert_child_payload_in_referential(post_data)
self.replace_null_values(post_data)
child = post_data
child['num'] = child_id
for known_child in family['childList']:
if str(known_child['num']) == child_id:
child['authorizedPersonList'] = known_child['authorizedPersonList']
break
else:
raise APIError('No child %s to update on family' % child_id, err_code='no-child')
payload = {
'dossierNumber': family_id,
'category': family['category'],

View File

@ -25,6 +25,25 @@
</birth>
<bPhoto>true</bPhoto>
<bLeaveAlone>false</bLeaveAlone>
<authorizedPersonList>
<personInfo>
<num>614719</num>
<lastname>BENT</lastname>
<firstname>AMEL</firstname>
<dateBirth>1985-06-21T00:00:00+02:00</dateBirth>
<civility>MME</civility>
<sexe>F</sexe>
<contact>
<phone>0123456789</phone>
<mobile>0623456789</mobile>
<mail>abent@example.org</mail>
</contact>
</personInfo>
<personQuality>
<code>T</code>
<libelle>TANTE</libelle>
</personQuality>
</authorizedPersonList>
</childList>
</ns0:updateFamily>
</soap-env:Body>