toulouse-maelis: avoir la liste des activités auquelles sont inscrit un enfants ou un résponsable légal (#75472) #143
|
@ -296,6 +296,17 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
return child
|
||||
raise APIError("no '%s' child on '%s' family" % (child_id, family_id))
|
||||
|
||||
def get_rl_or_child_raw(self, family_id, person_id):
|
||||
data = self.get_family_raw(family_id)
|
||||
if data['RL1']['num'] == person_id:
|
||||
return data['RL1']
|
||||
elif data['RL2'] and data['RL2']['num'] == person_id:
|
||||
return data['RL2']
|
||||
for child in data['childList']:
|
||||
if child['num'] == person_id:
|
||||
return child
|
||||
raise APIError("no '%s' RL or child on '%s' family" % (person_id, family_id))
|
||||
|
||||
def get_child_person_raw(self, family_id, child_id, person_id):
|
||||
data = self.get_child_raw(family_id, child_id)
|
||||
for person in data['authorizedPersonList']:
|
||||
|
@ -1229,6 +1240,54 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
response = self.call('Family', 'isChildExists', **post_data)
|
||||
return {'data': response}
|
||||
|
||||
@endpoint(
|
||||
display_category='Famille',
|
||||
description="Lister les activités auxquelles un RL ou un enfant est inscrit",
|
||||
perm='can_access',
|
||||
name='read-subscribe-activity-list',
|
||||
parameters={
|
||||
'child_id': {'description': "Numéro du représentant légal ou de l'enfant"},
|
||||
'NameID': {'description': 'Publik NameID'},
|
||||
'family_id': {'description': 'Numéro de DUI'},
|
||||
'nature': {
|
||||
'description': "Natures des activités : PERICSO, EXTRASCO ou LOISIR (toutes par défaut)",
|
||||
},
|
||||
'type_ids': {
|
||||
'description': "Codes des types des activités (tous par défaut), séparés par des virgules",
|
||||
'example_value': 'ACCSOIR,RESTSCOL',
|
||||
},
|
||||
},
|
||||
)
|
||||
def read_subscribe_activity_list(
|
||||
self, request, person_id, NameID=None, family_id=None, nature=None, type_ids=None
|
||||
):
|
||||
family_id = family_id or self.get_link(NameID).family_id
|
||||
result = self.get_rl_or_child_raw(family_id, person_id)
|
||||
if str(nature).lower() == 'perisco':
|
||||
nature_filter_codes = self.get_perisco_nature_codes()
|
||||
elif str(nature).lower() == 'extrasco':
|
||||
nature_filter_codes = self.get_extrasco_nature_codes()
|
||||
elif str(nature).lower() == 'loisir':
|
||||
nature_filter_codes = self.get_loisir_nature_codes()
|
||||
else:
|
||||
nature_filter_codes = None
|
||||
type_filter_codes = [x.strip() for x in str(type_ids or '').split(',') if x.strip()]
|
||||
|
||||
data = []
|
||||
for item in result['subscribeActivityList'] or []:
|
||||
activity_type = item.get('typeActivity')
|
||||
activity_nature = activity_type.get('natureSpec') if activity_type else None
|
||||
if type_filter_codes:
|
||||
if not activity_type or activity_type['code'] not in type_filter_codes:
|
||||
continue
|
||||
if nature_filter_codes:
|
||||
if not activity_nature or activity_nature['code'] not in nature_filter_codes:
|
||||
continue
|
||||
item['id'] = item['idActivity']
|
||||
item['text'] = item['libelle']
|
||||
data.append(item)
|
||||
return {'data': data}
|
||||
|
||||
@endpoint(
|
||||
display_category='Famille',
|
||||
description='Créer la famille',
|
||||
|
|
|
@ -99,6 +99,23 @@
|
|||
<number>789</number>
|
||||
<organ>A10007752822</organ>
|
||||
</CAFInfo>
|
||||
<subscribeActivityList>
|
||||
<libelle>CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10053179465</idUnit>
|
||||
<libelle>CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-22T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-03-22T00:00:00+01:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>RANGUEIL</place>
|
||||
<typeConsum>INS</typeConsum>
|
||||
<libelleTypeConsum>INSCRIT</libelleTypeConsum>
|
||||
<idActivity>A10053179463</idActivity>
|
||||
<typeActivity/>
|
||||
</subscribeActivityList>
|
||||
</RL2>
|
||||
<emergencyPersonList>
|
||||
<numPerson>614059</numPerson>
|
||||
|
@ -212,6 +229,129 @@
|
|||
<dateFin>2022-12-31T00:00:00+01:00</dateFin>
|
||||
<description>bla bla PAI</description>
|
||||
</paiInfoBean>
|
||||
<subscribeActivityList>
|
||||
<libelle>RESTAURATION SCOLAIRE 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327683</idUnit>
|
||||
<libelle>RESTAURATION SCOLAIRE 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>DUPONT PIERRE ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327682</idActivity>
|
||||
<typeActivity>
|
||||
<code>RESTSCOL</code>
|
||||
<libelle>Restauration scolaire</libelle>
|
||||
<natureSpec>
|
||||
<code>R</code>
|
||||
<libelle>Restauration Scolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>CLAE MIDI 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327687</idUnit>
|
||||
<libelle>CLAE MIDI 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327686</idActivity>
|
||||
<typeActivity>
|
||||
<code>ACCPERI</code>
|
||||
<libelle>Accueil périscolaire</libelle>
|
||||
<natureSpec>
|
||||
<code>A</code>
|
||||
<libelle>Accueil Périscolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>CLAE MATIN 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327690</idUnit>
|
||||
<libelle>CLAE MATIN 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>DUPONT PIERRE ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327689</idActivity>
|
||||
<typeActivity>
|
||||
<code>ACCMAT</code>
|
||||
<libelle>Accueil du matin</libelle>
|
||||
<natureSpec>
|
||||
<code>A</code>
|
||||
<libelle>Accueil Périscolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>SEMST2 ADL MERC. ELEM Maourine 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049354915</idUnit>
|
||||
<libelle>SEMST2 ADL MERC. ELEM Maourine 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-02-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>MAOURINE (la) ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>1101111</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049354913</idActivity>
|
||||
<typeActivity>
|
||||
<code>EXTMERC</code>
|
||||
<libelle>Mercredi</libelle>
|
||||
<natureSpec>
|
||||
<code>X</code>
|
||||
<libelle>Extrascolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10053179800</idUnit>
|
||||
<libelle>ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-02-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-06-30T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>ARGOULETS</place>
|
||||
<typeConsum>INS</typeConsum>
|
||||
<libelleTypeConsum>INSCRIT</libelleTypeConsum>
|
||||
<idActivity>A10053179798</idActivity>
|
||||
<typeActivity>
|
||||
<code>25</code>
|
||||
<libelle>ACTIVITE REGULIERE - SPORT</libelle>
|
||||
<natureSpec>
|
||||
<code>8</code>
|
||||
<libelle>SPORT</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
</childList>
|
||||
<childList>
|
||||
<num>613987</num>
|
||||
|
|
|
@ -99,6 +99,23 @@
|
|||
<number>789</number>
|
||||
<organ>A10007752822</organ>
|
||||
</CAFInfo>
|
||||
<subscribeActivityList>
|
||||
<libelle>CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10053179465</idUnit>
|
||||
<libelle>CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-22T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-03-22T00:00:00+01:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>RANGUEIL</place>
|
||||
<typeConsum>INS</typeConsum>
|
||||
<libelleTypeConsum>INSCRIT</libelleTypeConsum>
|
||||
<idActivity>A10053179463</idActivity>
|
||||
<typeActivity/>
|
||||
</subscribeActivityList>
|
||||
</RL2>
|
||||
<emergencyPersonList>
|
||||
<numPerson>614059</numPerson>
|
||||
|
@ -211,6 +228,129 @@
|
|||
<dateFin>2022-12-31T00:00:00+01:00</dateFin>
|
||||
<description>bla bla PAI</description>
|
||||
</paiInfoBean>
|
||||
<subscribeActivityList>
|
||||
<libelle>RESTAURATION SCOLAIRE 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327683</idUnit>
|
||||
<libelle>RESTAURATION SCOLAIRE 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>DUPONT PIERRE ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327682</idActivity>
|
||||
<typeActivity>
|
||||
<code>RESTSCOL</code>
|
||||
<libelle>Restauration scolaire</libelle>
|
||||
<natureSpec>
|
||||
<code>R</code>
|
||||
<libelle>Restauration Scolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>CLAE MIDI 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327687</idUnit>
|
||||
<libelle>CLAE MIDI 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327686</idActivity>
|
||||
<typeActivity>
|
||||
<code>ACCPERI</code>
|
||||
<libelle>Accueil périscolaire</libelle>
|
||||
<natureSpec>
|
||||
<code>A</code>
|
||||
<libelle>Accueil Périscolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>CLAE MATIN 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327690</idUnit>
|
||||
<libelle>CLAE MATIN 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>DUPONT PIERRE ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327689</idActivity>
|
||||
<typeActivity>
|
||||
<code>ACCMAT</code>
|
||||
<libelle>Accueil du matin</libelle>
|
||||
<natureSpec>
|
||||
<code>A</code>
|
||||
<libelle>Accueil Périscolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>SEMST2 ADL MERC. ELEM Maourine 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049354915</idUnit>
|
||||
<libelle>SEMST2 ADL MERC. ELEM Maourine 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-02-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>MAOURINE (la) ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>1101111</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049354913</idActivity>
|
||||
<typeActivity>
|
||||
<code>EXTMERC</code>
|
||||
<libelle>Mercredi</libelle>
|
||||
<natureSpec>
|
||||
<code>X</code>
|
||||
<libelle>Extrascolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10053179800</idUnit>
|
||||
<libelle>ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-02-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-06-30T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>ARGOULETS</place>
|
||||
<typeConsum>INS</typeConsum>
|
||||
<libelleTypeConsum>INSCRIT</libelleTypeConsum>
|
||||
<idActivity>A10053179798</idActivity>
|
||||
<typeActivity>
|
||||
<code>25</code>
|
||||
<libelle>ACTIVITE REGULIERE - SPORT</libelle>
|
||||
<natureSpec>
|
||||
<code>8</code>
|
||||
<libelle>SPORT</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
</childList>
|
||||
<childList>
|
||||
<num>613987</num>
|
||||
|
|
|
@ -99,6 +99,23 @@
|
|||
<number>789</number>
|
||||
<organ>A10007752822</organ>
|
||||
</CAFInfo>
|
||||
<subscribeActivityList>
|
||||
<libelle>CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10053179465</idUnit>
|
||||
<libelle>CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-22T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-03-22T00:00:00+01:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>RANGUEIL</place>
|
||||
<typeConsum>INS</typeConsum>
|
||||
<libelleTypeConsum>INSCRIT</libelleTypeConsum>
|
||||
<idActivity>A10053179463</idActivity>
|
||||
<typeActivity/>
|
||||
</subscribeActivityList>
|
||||
</RL2>
|
||||
<emergencyPersonList>
|
||||
<numPerson>614059</numPerson>
|
||||
|
@ -212,6 +229,129 @@
|
|||
<dateFin>2022-12-31T00:00:00+01:00</dateFin>
|
||||
<description>bla bla PAI</description>
|
||||
</paiInfoBean>
|
||||
<subscribeActivityList>
|
||||
<libelle>RESTAURATION SCOLAIRE 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327683</idUnit>
|
||||
<libelle>RESTAURATION SCOLAIRE 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>DUPONT PIERRE ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327682</idActivity>
|
||||
<typeActivity>
|
||||
<code>RESTSCOL</code>
|
||||
<libelle>Restauration scolaire</libelle>
|
||||
<natureSpec>
|
||||
<code>R</code>
|
||||
<libelle>Restauration Scolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>CLAE MIDI 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327687</idUnit>
|
||||
<libelle>CLAE MIDI 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327686</idActivity>
|
||||
<typeActivity>
|
||||
<code>ACCPERI</code>
|
||||
<libelle>Accueil périscolaire</libelle>
|
||||
<natureSpec>
|
||||
<code>A</code>
|
||||
<libelle>Accueil Périscolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>CLAE MATIN 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049327690</idUnit>
|
||||
<libelle>CLAE MATIN 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-03-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>DUPONT PIERRE ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>0010011</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049327689</idActivity>
|
||||
<typeActivity>
|
||||
<code>ACCMAT</code>
|
||||
<libelle>Accueil du matin</libelle>
|
||||
<natureSpec>
|
||||
<code>A</code>
|
||||
<libelle>Accueil Périscolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>SEMST2 ADL MERC. ELEM Maourine 22/23</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10049354915</idUnit>
|
||||
<libelle>SEMST2 ADL MERC. ELEM Maourine 22/23</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-02-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-07-07T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>MAOURINE (la) ELEMENTAIRE</place>
|
||||
<planningHebdomadaire>1101111</planningHebdomadaire>
|
||||
<typeConsum>ENF</typeConsum>
|
||||
<libelleTypeConsum>ENFANT</libelleTypeConsum>
|
||||
<idActivity>A10049354913</idActivity>
|
||||
<typeActivity>
|
||||
<code>EXTMERC</code>
|
||||
<libelle>Mercredi</libelle>
|
||||
<natureSpec>
|
||||
<code>X</code>
|
||||
<libelle>Extrascolaire</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
<subscribeActivityList>
|
||||
<libelle>ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES</libelle>
|
||||
<typeIns>1</typeIns>
|
||||
<libelleTypeIns>DEFINITIVE</libelleTypeIns>
|
||||
<subscribesUnit>
|
||||
<idUnit>A10053179800</idUnit>
|
||||
<libelle>ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES</libelle>
|
||||
<bUniStd>true</bUniStd>
|
||||
<dateStart>2023-02-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-06-30T00:00:00+02:00</dateEnd>
|
||||
</subscribesUnit>
|
||||
<place>ARGOULETS</place>
|
||||
<typeConsum>INS</typeConsum>
|
||||
<libelleTypeConsum>INSCRIT</libelleTypeConsum>
|
||||
<idActivity>A10053179798</idActivity>
|
||||
<typeActivity>
|
||||
<code>25</code>
|
||||
<libelle>ACTIVITE REGULIERE - SPORT</libelle>
|
||||
<natureSpec>
|
||||
<code>8</code>
|
||||
<libelle>SPORT</libelle>
|
||||
</natureSpec>
|
||||
</typeActivity>
|
||||
</subscribeActivityList>
|
||||
</childList>
|
||||
<childList>
|
||||
<num>613987</num>
|
||||
|
|
|
@ -1282,6 +1282,7 @@ def test_read_family(family_service, xml, con, app):
|
|||
del data['paiInfoBean']
|
||||
del data['indicatorList']
|
||||
del data['indicators']
|
||||
del data['subscribeActivityList']
|
||||
assert data == {
|
||||
'num': '613880',
|
||||
'lastname': 'DOE',
|
||||
|
@ -1309,7 +1310,6 @@ def test_read_family(family_service, xml, con, app):
|
|||
'mother': {'num': 613963, 'civility': 'MME', 'firstname': 'JANE', 'lastname': 'DOE'},
|
||||
'father': {'num': 613878, 'civility': 'M.', 'firstname': 'JHON', 'lastname': 'DOE'},
|
||||
'rl': None,
|
||||
'subscribeActivityList': [],
|
||||
}
|
||||
if xml != 'R_read_family_relax.xml':
|
||||
assert resp.json['data']['childList'][0]['paiInfoBean'] == {
|
||||
|
@ -1421,6 +1421,13 @@ def test_read_family(family_service, xml, con, app):
|
|||
'note': None,
|
||||
},
|
||||
]
|
||||
assert [x['libelle'] for x in resp.json['data']['childList'][0]['subscribeActivityList']] == [
|
||||
'RESTAURATION SCOLAIRE 22/23',
|
||||
'CLAE MIDI 22/23',
|
||||
'CLAE MATIN 22/23',
|
||||
'SEMST2 ADL MERC. ELEM Maourine 22/23',
|
||||
'ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES',
|
||||
]
|
||||
|
||||
|
||||
def test_read_family_not_linked_error(con, app):
|
||||
|
@ -1589,7 +1596,29 @@ def test_read_rl2(family_service, con, app):
|
|||
'typeDesc': 'NONE',
|
||||
},
|
||||
},
|
||||
'subscribeActivityList': [],
|
||||
'subscribeActivityList': [
|
||||
{
|
||||
'libelle': 'CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22',
|
||||
'typeIns': '1',
|
||||
'libelleTypeIns': 'DEFINITIVE',
|
||||
'subscribesUnit': [
|
||||
{
|
||||
'idUnit': 'A10053179465',
|
||||
'libelle': 'CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22',
|
||||
'bUniStd': True,
|
||||
'dateStart': '2023-03-22T00:00:00+01:00',
|
||||
'dateEnd': '2023-03-22T00:00:00+01:00',
|
||||
}
|
||||
],
|
||||
'place': 'RANGUEIL',
|
||||
'planningHebdomadaire': None,
|
||||
'typeConsum': 'INS',
|
||||
'libelleTypeConsum': 'INSCRIT',
|
||||
'comment': None,
|
||||
'idActivity': 'A10053179463',
|
||||
'typeActivity': None,
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
|
@ -1611,6 +1640,85 @@ def test_read_rl_not_found(family_service, con, app):
|
|||
assert resp.json['err_desc'] == "no '000000' RL on '1312' family"
|
||||
|
||||
|
||||
def test_read_subscribe_activity_list(family_service, con, app):
|
||||
family_service.add_soap_response('readFamily', get_xml_file('R_read_family.xml'))
|
||||
url = get_endpoint('read-subscribe-activity-list')
|
||||
|
||||
resp = app.get(url + '?family_id=1312&person_id=613880')
|
||||
assert resp.json['err'] == 0
|
||||
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
||||
|
||||
# RL2
|
||||
resp = app.get(url + '?NameID=local&person_id=613879')
|
||||
assert [(x['id'], x['text']) for x in resp.json['data']] == [
|
||||
('A10053179463', 'CSocial Adult 2021/2022 - Bijoux en cuirs 21/03/22')
|
||||
]
|
||||
|
||||
# child
|
||||
resp = app.get(url + '?NameID=local&person_id=613880')
|
||||
assert [
|
||||
(x['id'], x['text'], x['typeActivity']['natureSpec']['code'], x['typeActivity']['code'])
|
||||
for x in resp.json['data']
|
||||
] == [
|
||||
('A10049327682', 'RESTAURATION SCOLAIRE 22/23', 'R', 'RESTSCOL'),
|
||||
('A10049327686', 'CLAE MIDI 22/23', 'A', 'ACCPERI'),
|
||||
('A10049327689', 'CLAE MATIN 22/23', 'A', 'ACCMAT'),
|
||||
('A10049354913', 'SEMST2 ADL MERC. ELEM Maourine 22/23', 'X', 'EXTMERC'),
|
||||
('A10053179798', 'ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES', '8', '25'),
|
||||
]
|
||||
|
||||
resp = app.get(url + '?NameID=local&person_id=613880&nature=PERISCO')
|
||||
assert resp.json['err'] == 0
|
||||
assert [
|
||||
(x['id'], x['text'], x['typeActivity']['natureSpec']['code'], x['typeActivity']['code'])
|
||||
for x in resp.json['data']
|
||||
] == [
|
||||
('A10049327682', 'RESTAURATION SCOLAIRE 22/23', 'R', 'RESTSCOL'),
|
||||
('A10049327686', 'CLAE MIDI 22/23', 'A', 'ACCPERI'),
|
||||
('A10049327689', 'CLAE MATIN 22/23', 'A', 'ACCMAT'),
|
||||
]
|
||||
|
||||
resp = app.get(url + '?NameID=local&person_id=613880&nature=EXTRASCO')
|
||||
assert [
|
||||
(x['id'], x['text'], x['typeActivity']['natureSpec']['code'], x['typeActivity']['code'])
|
||||
for x in resp.json['data']
|
||||
] == [
|
||||
('A10049354913', 'SEMST2 ADL MERC. ELEM Maourine 22/23', 'X', 'EXTMERC'),
|
||||
]
|
||||
|
||||
resp = app.get(url + '?NameID=local&person_id=613880&nature=LOISIR')
|
||||
assert [
|
||||
(x['id'], x['text'], x['typeActivity']['natureSpec']['code'], x['typeActivity']['code'])
|
||||
for x in resp.json['data']
|
||||
] == [
|
||||
('A10053179798', 'ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES', '8', '25'),
|
||||
]
|
||||
|
||||
resp = app.get(url + '?NameID=local&person_id=613880&type_ids=ACCMAT')
|
||||
assert resp.json['err'] == 0
|
||||
assert [
|
||||
(x['id'], x['text'], x['typeActivity']['natureSpec']['code'], x['typeActivity']['code'])
|
||||
for x in resp.json['data']
|
||||
] == [('A10049327689', 'CLAE MATIN 22/23', 'A', 'ACCMAT')]
|
||||
|
||||
|
||||
def test_read_subscribe_activity_list_not_linked_error(con, app):
|
||||
url = get_endpoint('read-subscribe-activity-list')
|
||||
|
||||
resp = app.get(url + '?NameID=local&person_id=613880')
|
||||
assert resp.json['err'] == 1
|
||||
assert resp.json['err_desc'] == 'User not linked to family'
|
||||
|
||||
|
||||
def test_read_subscribe_activity_list_not_found(family_service, con, app):
|
||||
family_service.add_soap_response('readFamily', get_xml_file('R_read_family.xml'))
|
||||
url = get_endpoint('read-subscribe-activity-list')
|
||||
|
||||
resp = app.get(url + '?family_id=1312&person_id=000000')
|
||||
assert resp.json['err'] == 1
|
||||
assert resp.json['err_desc'] == "no '000000' RL or child on '1312' family"
|
||||
|
||||
|
||||
def test_read_person(family_service, con, app):
|
||||
family_service.add_soap_response('readFamily', get_xml_file('R_read_family.xml'))
|
||||
url = get_endpoint('read-person')
|
||||
|
|
Loading…
Reference in New Issue