toulouse-maelis: add endpoint for school pre-registration with sibling (#73136) #33
|
@ -893,3 +893,47 @@ SCHOOL_PRE_REGISTRATION_WITH_EXEMPTION_SCHEMA = {
|
|||
'unflatten': True,
|
||||
'additionalProperties': False,
|
||||
}
|
||||
|
||||
|
||||
SCHOOL_PRE_REGISTRATION_WITH_SIBLING_SCHEMA = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
'title': 'School pre-registration',
|
||||
'description': 'Crée une pré-inscription scolaire pour un enfant avec rapprochement de fratrie',
|
||||
'type': 'object',
|
||||
'required': [
|
||||
'numPerson',
|
||||
'schoolYear',
|
||||
'datePresubscribe',
|
||||
'levelCode',
|
||||
'idSchoolRequested',
|
||||
'numPersonSibling',
|
||||
],
|
||||
'properties': {
|
||||
'numPerson': {
|
||||
'description': "Numéro de l'enfant",
|
||||
'type': 'string',
|
||||
},
|
||||
'schoolYear': {
|
||||
'description': "Année scolaire",
|
||||
'type': 'string',
|
||||
},
|
||||
'datePresubscribe': {
|
||||
'description': "Date d'inscription",
|
||||
'type': 'string',
|
||||
},
|
||||
'levelCode': {
|
||||
'description': "Le code du niveau scolaire",
|
||||
'type': 'string',
|
||||
},
|
||||
'idSchoolRequested': {
|
||||
'description': "Identifiant de l'établissement demandé",
|
||||
'type': 'string',
|
||||
},
|
||||
'numPersonSibling': {
|
||||
'description': "Identifiant du membre de la fratrie pour lequel le rapprochement est demandé",
|
||||
'type': 'string',
|
||||
},
|
||||
},
|
||||
'unflatten': True,
|
||||
'additionalProperties': False,
|
||||
}
|
||||
|
|
|
@ -2028,6 +2028,21 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
response = self.call('Family', 'presubscribeSchoolDerog', **post_data)
|
||||
return {'data': serialize_object(response)}
|
||||
|
||||
@endpoint(
|
||||
display_category='Inscriptions',
|
||||
description="Création d'une pré-inscription scolaire avec rapprochement de fratrie",
|
||||
name='create-child-school-pre-registration-with-sibling',
|
||||
perm='can_access',
|
||||
post={
|
||||
'request_body': {
|
||||
'schema': {'application/json': family_schemas.SCHOOL_PRE_REGISTRATION_WITH_SIBLING_SCHEMA}
|
||||
}
|
||||
},
|
||||
)
|
||||
def create_child_school_pre_registration_with_sibling(self, request, post_data):
|
||||
response = self.call('Family', 'presubscribeSchoolSibling', **post_data)
|
||||
return {'data': serialize_object(response)}
|
||||
|
||||
|
||||
class Link(models.Model):
|
||||
resource = models.ForeignKey(ToulouseMaelis, on_delete=models.CASCADE)
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
||||
<soap:Body>
|
||||
<ns2:presubscribeSchoolSiblingResponse xmlns:ns2="family.ws.maelis.sigec.com">
|
||||
<subscribeSchool3Bean>
|
||||
<idInssco>S10053187965</idInssco>
|
||||
<year>2023</year>
|
||||
<idSchool>2435</idSchool>
|
||||
<schoolName>DUPONT PIERRE ELEMENTAIRE</schoolName>
|
||||
<levelBean>
|
||||
<code>CM1</code>
|
||||
<libelle>Cours moyen 1</libelle>
|
||||
</levelBean>
|
||||
<adresse> GRANDE-RUE SAINT MICHEL</adresse>
|
||||
<headmaster>FOURCADE MARIE-SYLVIE</headmaster>
|
||||
<dateIns>2023-09-01T00:00:00+02:00</dateIns>
|
||||
<preSubscribeDate>2023-09-01T00:00:00+02:00</preSubscribeDate>
|
||||
<isWaitList>true</isWaitList>
|
||||
<codeWait>MO_FRATERIE</codeWait>
|
||||
<libWait>GRU</libWait>
|
||||
<isDerog>true</isDerog>
|
||||
<derogReason>01PRIO-5</derogReason>
|
||||
<derogState>E</derogState>
|
||||
<derogComment>SERGHEI3 LISA</derogComment>
|
||||
</subscribeSchool3Bean>
|
||||
</ns2:presubscribeSchoolSiblingResponse>
|
||||
</soap:Body>
|
||||
</soap:Envelope>
|
|
@ -4376,10 +4376,35 @@ def test_create_child_school_pre_registration_with_exemption(family_service, con
|
|||
},
|
||||
)
|
||||
assert resp.json['err'] == 0
|
||||
print(resp.json['data'])
|
||||
assert resp.json['data']['idSchool'] == '2435'
|
||||
assert resp.json['data']['schoolName'] == 'DUPONT PIERRE ELEMENTAIRE'
|
||||
assert resp.json['data']['isWaitList']
|
||||
assert resp.json['data']['isDerog']
|
||||
assert resp.json['data']['derogReason'] == '11DERO-1'
|
||||
assert resp.json['data']['derogComment'] == 'exemption comment'
|
||||
|
||||
|
||||
def test_create_child_school_pre_registration_with_sibling(family_service, con, app):
|
||||
family_service.add_soap_response(
|
||||
'presubscribeSchoolSibling', get_xml_file('R_create_child_school_pre_registration_with_sibling.xml')
|
||||
)
|
||||
url = get_endpoint('create-child-school-pre-registration-with-sibling')
|
||||
resp = app.post_json(
|
||||
url,
|
||||
params={
|
||||
'numPerson': '248565',
|
||||
'schoolYear': '2023',
|
||||
'levelCode': 'CM1',
|
||||
'datePresubscribe': '2023-09-01T00:00:00+02:00',
|
||||
'idSchoolRequested': '2435',
|
||||
'numPersonSibling': '248562',
|
||||
},
|
||||
)
|
||||
assert resp.json['err'] == 0
|
||||
assert resp.json['data']['idSchool'] == '2435'
|
||||
assert resp.json['data']['schoolName'] == 'DUPONT PIERRE ELEMENTAIRE'
|
||||
assert resp.json['data']['isWaitList']
|
||||
assert resp.json['data']['isDerog']
|
||||
assert resp.json['data']['codeWait'] == 'MO_FRATERIE'
|
||||
assert resp.json['data']['derogReason'] == '01PRIO-5'
|
||||
assert resp.json['data']['derogComment'] == 'SERGHEI3 LISA'
|
||||
|
|
Loading…
Reference in New Issue