toulouse-maelis: add conveyance data in get_person_subscription_info endpoint (#74762)
gitea/passerelle/pipeline/head This commit looks good
Details
gitea/passerelle/pipeline/head This commit looks good
Details
This commit is contained in:
parent
e38710c4fa
commit
dd6d315394
|
@ -2745,6 +2745,14 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
}
|
||||
)
|
||||
response['recurrent_week'] = recurrent_week
|
||||
|
||||
if response.get('conveyance'):
|
||||
for part_of_day in response['conveyance'].values():
|
||||
for bus_stop in part_of_day['depositPlaceList'] or []:
|
||||
place = bus_stop['place']
|
||||
bus_stop['id'] = place['id']
|
||||
bus_stop['text'] = place['lib2'] or place['lib']
|
||||
|
||||
return {'data': response}
|
||||
|
||||
@endpoint(
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
||||
<soap:Body>
|
||||
<ns2:getPersonUnitInfoResponse xmlns:ns2="activity.ws.maelis.sigec.com" xmlns:ns3="bean.persistence.activity.ws.maelis.sigec.com" xmlns:ns4="bean.persistence.school.ws.maelis.sigec.com">
|
||||
<getPersonUnitInfoResponseBean>
|
||||
<controlResult>
|
||||
<controlOK>true</controlOK>
|
||||
</controlResult>
|
||||
<personInfo>
|
||||
<idMaelis>S10055586371</idMaelis>
|
||||
<num>261768</num>
|
||||
<lastname>NICO</lastname>
|
||||
<firstname>BART</firstname>
|
||||
<dateBirth>2014-04-01T00:00:00+02:00</dateBirth>
|
||||
<sexe>M</sexe>
|
||||
</personInfo>
|
||||
<activity>
|
||||
<idActivity>A10053179798</idActivity>
|
||||
<libelle1>ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES</libelle1>
|
||||
<activityType>
|
||||
<code>25</code>
|
||||
<libelle>ACTIVITE REGULIERE - SPORT</libelle>
|
||||
<natureSpec>
|
||||
<code>8</code>
|
||||
<libelle>SPORT</libelle>
|
||||
</natureSpec>
|
||||
</activityType>
|
||||
<typInsPortal>I</typInsPortal>
|
||||
<paiementPortal>I</paiementPortal>
|
||||
</activity>
|
||||
<unit>
|
||||
<idUnit>A10053179803</idUnit>
|
||||
<libelle>MERCREDI - 13h45/17h - 8/15Ans</libelle>
|
||||
<dateStart>2023-02-01T00:00:00+01:00</dateStart>
|
||||
<dateEnd>2023-06-30T00:00:00+02:00</dateEnd>
|
||||
</unit>
|
||||
<place>
|
||||
<idPlace>A10053179757</idPlace>
|
||||
<lib1>ARGOULETS</lib1>
|
||||
</place>
|
||||
<calendarGeneration>
|
||||
<code>FORBIDDEN</code>
|
||||
<value>I</value>
|
||||
</calendarGeneration>
|
||||
<weeklyCalendarActivity>
|
||||
<dayWeekInfoList>
|
||||
<dayNum>1</dayNum>
|
||||
<isOpen>false</isOpen>
|
||||
</dayWeekInfoList>
|
||||
<dayWeekInfoList>
|
||||
<dayNum>2</dayNum>
|
||||
<isOpen>false</isOpen>
|
||||
</dayWeekInfoList>
|
||||
<dayWeekInfoList>
|
||||
<dayNum>3</dayNum>
|
||||
<isOpen>true</isOpen>
|
||||
</dayWeekInfoList>
|
||||
<dayWeekInfoList>
|
||||
<dayNum>4</dayNum>
|
||||
<isOpen>false</isOpen>
|
||||
</dayWeekInfoList>
|
||||
<dayWeekInfoList>
|
||||
<dayNum>5</dayNum>
|
||||
<isOpen>false</isOpen>
|
||||
</dayWeekInfoList>
|
||||
<dayWeekInfoList>
|
||||
<dayNum>6</dayNum>
|
||||
<isOpen>false</isOpen>
|
||||
</dayWeekInfoList>
|
||||
<dayWeekInfoList>
|
||||
<dayNum>7</dayNum>
|
||||
<isOpen>false</isOpen>
|
||||
</dayWeekInfoList>
|
||||
</weeklyCalendarActivity>
|
||||
<unitScheduleList>
|
||||
<unit>
|
||||
<idUnit>A10053179803</idUnit>
|
||||
<libelle>MERCREDI - 13h45/17h - 8/15Ans</libelle>
|
||||
<calendarLetter>B</calendarLetter>
|
||||
<dateDeb>2023-02-01T00:00:00+01:00</dateDeb>
|
||||
<dateFin>2023-06-30T00:00:00+02:00</dateFin>
|
||||
</unit>
|
||||
</unitScheduleList>
|
||||
<billingInformation/>
|
||||
<action>ADD_SUBSCRIBE</action>
|
||||
<conveyance>
|
||||
<morningJourney>
|
||||
<libelle>Matin</libelle>
|
||||
<comment>test</comment>
|
||||
<depositPlaceList>
|
||||
<place>
|
||||
<id>A10053179757</id>
|
||||
<lib>ARGOULETS</lib>
|
||||
</place>
|
||||
<comment>test 1</comment>
|
||||
</depositPlaceList>
|
||||
<depositPlaceList>
|
||||
<place>
|
||||
<id>A10053179757</id>
|
||||
<lib>ARGOULETS</lib>
|
||||
</place>
|
||||
</depositPlaceList>
|
||||
</morningJourney>
|
||||
<afternoonJourney>
|
||||
<libelle>Soir</libelle>
|
||||
<comment>test soir</comment>
|
||||
<depositPlaceList>
|
||||
<place>
|
||||
<id>A10053179757</id>
|
||||
<lib>ARGOULETS</lib>
|
||||
</place>
|
||||
<comment>test 3</comment>
|
||||
</depositPlaceList>
|
||||
<depositPlaceList>
|
||||
<place>
|
||||
<id>A10053179757</id>
|
||||
<lib>ARGOULETS</lib>
|
||||
</place>
|
||||
<comment>test 4</comment>
|
||||
</depositPlaceList>
|
||||
</afternoonJourney>
|
||||
</conveyance>
|
||||
</getPersonUnitInfoResponseBean>
|
||||
</ns2:getPersonUnitInfoResponse>
|
||||
</soap:Body>
|
||||
</soap:Envelope>
|
|
@ -5955,6 +5955,32 @@ def test_get_person_subscription_info_with_recurrent_week(activity_service, con,
|
|||
assert resp.json['err'] == 0
|
||||
|
||||
|
||||
def test_get_person_subscription_info_with_conveyance(activity_service, con, app):
|
||||
activity_service.add_soap_response(
|
||||
'getPersonUnitInfo',
|
||||
get_xml_file('R_get_person_unit_info_with_conveyance.xml'),
|
||||
)
|
||||
url = get_endpoint('get-person-subscription-info')
|
||||
|
||||
params = {
|
||||
'NameID': '',
|
||||
'family_id': '322423',
|
||||
'person_id': '261768',
|
||||
'activity_id': 'A10053179798',
|
||||
'unit_id': 'A10053179803',
|
||||
'place_id': 'A10053179757',
|
||||
'ref_date': '',
|
||||
}
|
||||
resp = app.get(url, params=params)
|
||||
assert resp.json['err'] == 0
|
||||
assert [
|
||||
(x['id'], x['text']) for x in resp.json['data']['conveyance']['morningJourney']['depositPlaceList']
|
||||
] == [('A10053179757', 'ARGOULETS'), ('A10053179757', 'ARGOULETS')]
|
||||
assert [
|
||||
(x['id'], x['text']) for x in resp.json['data']['conveyance']['afternoonJourney']['depositPlaceList']
|
||||
] == [('A10053179757', 'ARGOULETS'), ('A10053179757', 'ARGOULETS')]
|
||||
|
||||
|
||||
def test_get_person_subscription_info_error(activity_service, con, app):
|
||||
activity_service.add_soap_response(
|
||||
'getPersonUnitInfo',
|
||||
|
|
Loading…
Reference in New Issue