toulouse-maelis: [funtests] remettre en place les tests sur les inscriptions (#77634) #254
|
@ -21,7 +21,7 @@ FAMILY_PAYLOAD = {
|
|||
'rl1': {
|
||||
'civility': 'MME',
|
||||
'firstname': 'Marge',
|
||||
'lastname': 'Simpson',
|
||||
'lastname': 'Test_Simpson',
|
||||
'maidenName': 'Bouvier',
|
||||
'quality': 'MERE',
|
||||
'birth': {
|
||||
|
@ -32,14 +32,14 @@ FAMILY_PAYLOAD = {
|
|||
'idStreet': '2317',
|
||||
'num': '4',
|
||||
'street1': 'requeried having idStreet provided',
|
||||
'town': 'Springfield',
|
||||
'zipcode': '62701',
|
||||
'town': 'Toulouse',
|
||||
'zipcode': '31400',
|
||||
},
|
||||
},
|
||||
'rl2': {
|
||||
'civility': 'MR',
|
||||
'firstname': 'Homer',
|
||||
'lastname': 'Simpson',
|
||||
'lastname': 'Test_Simpson',
|
||||
'quality': 'PERE',
|
||||
'birth': {
|
||||
'dateBirth': '1956-05-12',
|
||||
|
@ -96,7 +96,7 @@ FAMILY_PAYLOAD = {
|
|||
{
|
||||
'sexe': 'M',
|
||||
'firstname': 'Bart',
|
||||
'lastname': 'Simpson',
|
||||
'lastname': 'Test_Simpson',
|
||||
'birth': {
|
||||
'dateBirth': '2014-04-01',
|
||||
'place': 'Brive-la-Gaillarde',
|
||||
|
@ -158,7 +158,7 @@ FAMILY_PAYLOAD = {
|
|||
'personInfo': {
|
||||
'civility': 'MR',
|
||||
'firstname': 'Abraham Jebediah',
|
||||
'lastname': 'Simpson',
|
||||
'lastname': 'Test_Simpson',
|
||||
'dateBirth': '1927-05-24',
|
||||
'sexe': 'M',
|
||||
'contact': {
|
||||
|
@ -175,7 +175,7 @@ FAMILY_PAYLOAD = {
|
|||
'personInfo': {
|
||||
'civility': 'MME',
|
||||
'firstname': 'Mona Penelope',
|
||||
'lastname': 'Simpson',
|
||||
'lastname': 'Test_Simpson',
|
||||
'dateBirth': '1929-03-15',
|
||||
'sexe': 'F',
|
||||
'contact': {
|
||||
|
@ -193,7 +193,7 @@ FAMILY_PAYLOAD = {
|
|||
{
|
||||
'sexe': 'F',
|
||||
'firstname': 'Lisa',
|
||||
'lastname': 'Simpson',
|
||||
'lastname': 'Test_Simpson',
|
||||
'birth': {'dateBirth': '2016-05-09'},
|
||||
'dietcode': 'MENU_SV',
|
||||
'paiInfoBean': {
|
||||
|
@ -203,7 +203,7 @@ FAMILY_PAYLOAD = {
|
|||
{
|
||||
'sexe': 'F',
|
||||
'firstname': 'Maggie',
|
||||
'lastname': 'Simpson',
|
||||
'lastname': 'Test_Simpson',
|
||||
'birth': {'dateBirth': '2018-12-17'},
|
||||
'dietcode': 'MENU_PAI',
|
||||
'paiInfoBean': {
|
||||
|
@ -213,7 +213,7 @@ FAMILY_PAYLOAD = {
|
|||
{
|
||||
'sexe': 'M',
|
||||
'firstname': 'Hugo',
|
||||
'lastname': 'Simpson',
|
||||
'lastname': 'Test_Simpson',
|
||||
'birth': {'dateBirth': '2018-04-01'},
|
||||
'dietcode': 'MENU_AV',
|
||||
'paiInfoBean': {
|
||||
|
@ -261,7 +261,10 @@ def pytest_addoption(parser):
|
|||
parser.addoption('--nameid', help='Publik Name ID', default='functest')
|
||||
parser.addoption('--dui', help='DUI number', default='')
|
||||
parser.addoption(
|
||||
'--lastname', help='override lastname to create a new "update" family', default='Simpson'
|
||||
'--lastname', help='override lastname to create a new "update" family', default='Test_Simpson'
|
||||
)
|
||||
parser.addoption(
|
||||
'--quick', action='store_true', help='do not reload referentials to speed-up tests', default=False
|
||||
)
|
||||
|
||||
|
||||
|
@ -403,7 +406,10 @@ def conn(request):
|
|||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def referentials(conn):
|
||||
def referentials(request, conn):
|
||||
quick = request.config.getoption('--quick')
|
||||
if quick:
|
||||
return
|
||||
url = urlparse.urlparse(conn)
|
||||
slug = url.path.split('/')[2]
|
||||
cmd = (
|
||||
|
@ -416,10 +422,10 @@ def referentials(conn):
|
|||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def create_data(request, conn):
|
||||
def create_data(request, conn, reference_year):
|
||||
name_id = request.config.getoption('--nameid')
|
||||
unlink(conn, name_id)
|
||||
lastname = 'EO_' + uuid4().hex[0:27]
|
||||
lastname = 'TEST_' + uuid4().hex[0:25]
|
||||
|
||||
# create family
|
||||
create_family_payload = copy.deepcopy(FAMILY_PAYLOAD)
|
||||
|
@ -443,6 +449,21 @@ def create_data(request, conn):
|
|||
resp.raise_for_status()
|
||||
create_result = resp.json()
|
||||
assert create_result['err'] == 0
|
||||
|
||||
# add requiered quotient for subscriptions
|
||||
data = read_family(conn, name_id)
|
||||
url = conn + '/update-quotient?NameID=%s&rl_id=%s' % (name_id, data['RL1']['num'])
|
||||
payload = {
|
||||
'yearRev': str(reference_year),
|
||||
'dateStart': '%s-09-01' % (reference_year),
|
||||
'dateEnd': '3000-08-31',
|
||||
'mtt': '5000.0',
|
||||
'cdquo': '1',
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
print('\ncreate DUI: %s' % str(create_result['data']['number']))
|
||||
data = diff_family(conn, name_id, 'test_create_family.json')
|
||||
|
||||
|
@ -459,6 +480,58 @@ def create_data(request, conn):
|
|||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def create_data2(request, conn, reference_year):
|
||||
name_id = request.config.getoption('--nameid')
|
||||
unlink(conn, name_id)
|
||||
lastname = 'TEST_' + uuid4().hex[0:25]
|
||||
|
||||
# create family that is not located into Toulouse
|
||||
create_family_payload = copy.deepcopy(FAMILY_PAYLOAD)
|
||||
create_family_payload['rl1']['lastname'] = lastname
|
||||
create_family_payload['rl1']['adresse'] = create_family_payload['rl2']['adresse']
|
||||
create_family_payload['rl2']['adresse'] = copy.deepcopy(FAMILY_PAYLOAD['rl1']['adresse'])
|
||||
for child in create_family_payload['childList']:
|
||||
child['lastname'] = lastname
|
||||
|
||||
url = conn + '/create-family?NameID=%s' % name_id
|
||||
resp = requests.post(url, json=create_family_payload)
|
||||
resp.raise_for_status()
|
||||
create_result = resp.json()
|
||||
assert create_result['err'] == 0
|
||||
|
||||
# add requiered quotient for subscriptions
|
||||
data = read_family(conn, name_id)
|
||||
url = conn + '/update-quotient?NameID=%s&rl_id=%s' % (name_id, data['RL1']['num'])
|
||||
payload = {
|
||||
'yearRev': str(reference_year),
|
||||
'dateStart': '2023-05-15',
|
||||
'dateEnd': '3000-12-31',
|
||||
'mtt': '5000.0',
|
||||
'cdquo': '1',
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
print('\ncreate DUI again: %s' % str(create_result['data']['number']))
|
||||
data = diff_family(conn, name_id, 'test_create_family_out_town.json')
|
||||
|
||||
return {
|
||||
'name_id': name_id, # linked
|
||||
'family_id': str(create_result['data']['number']),
|
||||
'family_payload': create_family_payload,
|
||||
'lastname': lastname,
|
||||
'rl1_num': data['RL1']['num'],
|
||||
'rl2_num': data['RL2']['num'],
|
||||
'bart_num': data['childList'][0]['num'],
|
||||
'lisa_num': data['childList'][1]['num'],
|
||||
'maggie_num': data['childList'][2]['num'],
|
||||
'hugo_num': data['childList'][3]['num'],
|
||||
'data': data,
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def update_data(request, conn):
|
||||
name_id = request.config.getoption('--nameid')
|
||||
|
@ -617,40 +690,102 @@ def get_subscription_info(nature, activity_text, unit_text, place_text, con, nam
|
|||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def loisirs_subscribe_info(conn, create_data, reference_year):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
def get_loisirs_subscribe_info(con, data, year):
|
||||
return get_subscription_info(
|
||||
'LOISIRS',
|
||||
# Sigec made this loisirs activity available for functests
|
||||
'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES',
|
||||
'MERCREDI - 15h30/17h - 8/15Ans',
|
||||
'ARGOULETS',
|
||||
conn,
|
||||
create_data['name_id'],
|
||||
create_data['bart_num'],
|
||||
reference_year,
|
||||
con,
|
||||
data['name_id'],
|
||||
data['bart_num'],
|
||||
year,
|
||||
)
|
||||
|
||||
|
||||
def get_loisirs_subscribe_info3(con, data, year):
|
||||
return get_subscription_info(
|
||||
'LOISIRS',
|
||||
# Sigec made this loisirs activity available for functests
|
||||
'Vitrail Fusing 1/2 Je Adultes',
|
||||
'Inscription annuelle',
|
||||
'Centre Culturel ALBAN MINVILLE',
|
||||
con,
|
||||
data['name_id'],
|
||||
data['bart_num'],
|
||||
year,
|
||||
)
|
||||
|
||||
|
||||
def get_extrasco_subscribe_info(con, data, year):
|
||||
return get_subscription_info(
|
||||
'EXTRASCO',
|
||||
# Sigec made this extra-sco activity available for functests
|
||||
'ADL ELEMENTAIRE Maourine Juin',
|
||||
'PUBLIK ADL ELEMENTAIRE Maourine JUIN 22/23(NE PAS UTILISER)',
|
||||
'MAOURINE (la) ELEMENTAIRE',
|
||||
con,
|
||||
data['name_id'],
|
||||
data['bart_num'],
|
||||
year,
|
||||
)
|
||||
|
||||
|
||||
def get_extrasco_subscribe_info2(con, data, year):
|
||||
return get_subscription_info(
|
||||
'EXTRASCO',
|
||||
# Sigec made this extra-sco activity available for functests
|
||||
'ADL MATERNELLE Lardenne Juin',
|
||||
'PUBLIK ADL MATER JOURNEE AVEC REPAS',
|
||||
'LARDENNE MATERNELLE',
|
||||
con,
|
||||
data['name_id'],
|
||||
data['bart_num'],
|
||||
year,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def loisirs_subscribe_info(conn, create_data, reference_year):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
return get_loisirs_subscribe_info(conn, create_data, reference_year)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def loisirs_subscribe_info2(conn, create_data2, reference_year):
|
||||
unlink(conn, create_data2['name_id'])
|
||||
link(conn, create_data2)
|
||||
return get_loisirs_subscribe_info(conn, create_data2, reference_year)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def loisirs_subscribe_info3(conn, create_data2, reference_year):
|
||||
unlink(conn, create_data2['name_id'])
|
||||
link(conn, create_data2)
|
||||
return get_loisirs_subscribe_info3(conn, create_data2, reference_year)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def extrasco_subscribe_info(conn, create_data, reference_year):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
return get_extrasco_subscribe_info(conn, create_data, reference_year)
|
||||
|
||||
return get_subscription_info(
|
||||
'EXTRASCO',
|
||||
# Sigec made this extra-sco activity available for functests
|
||||
'ADL ELEMENTAIRE Maourine Avril 2023',
|
||||
'ADL ELEMENTAIRE Maourine Avril 2023',
|
||||
'MAOURINE (la) ELEMENTAIRE',
|
||||
conn,
|
||||
create_data['name_id'],
|
||||
create_data['bart_num'],
|
||||
reference_year,
|
||||
)
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def extrasco_subscribe_info2(conn, create_data, reference_year):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
return get_extrasco_subscribe_info2(conn, create_data, reference_year)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def extrasco_subscribe_info3(conn, create_data2, reference_year):
|
||||
unlink(conn, create_data2['name_id'])
|
||||
link(conn, create_data2)
|
||||
return get_extrasco_subscribe_info2(conn, create_data2, reference_year)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
|
@ -664,11 +799,32 @@ def perisco_subscribe_info(conn, create_data, reference_year):
|
|||
return get_subscription_info(
|
||||
None,
|
||||
# Sigec made this peri-sco activity available for functests
|
||||
'TEMPS DU MIDI',
|
||||
'Temps du midi',
|
||||
'TEST TEMPS DU MIDI 22/23',
|
||||
'DOLTO FRANCOISE MATERNELLE',
|
||||
'AMIDONNIERS ELEMENTAIRE',
|
||||
conn,
|
||||
create_data['name_id'],
|
||||
create_data['bart_num'],
|
||||
reference_year,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def perisco_subscribe_adulte_info(conn, create_data2, reference_year):
|
||||
'''This fixture is a configuration trick from Sigec
|
||||
as peri-sco should not be available for subscription
|
||||
and as a consequence, should not be displayed from catalogs'''
|
||||
unlink(conn, create_data2['name_id'])
|
||||
link(conn, create_data2)
|
||||
|
||||
return get_subscription_info(
|
||||
None,
|
||||
# Sigec made this peri-sco activity available for functests
|
||||
'RESTAURATION ADULTE',
|
||||
'TEST RESTAURATION ADULTE 22/23',
|
||||
'DOLTO FRANCOISE MATERNELLE',
|
||||
conn,
|
||||
create_data2['name_id'],
|
||||
create_data2['bart_num'],
|
||||
reference_year,
|
||||
)
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
"numComp": null,
|
||||
"street1": "RUE ACHILLE VIADIEU",
|
||||
"street2": null,
|
||||
"town": "Springfield",
|
||||
"zipcode": "62701",
|
||||
"town": "Toulouse",
|
||||
"zipcode": "31400",
|
||||
"idStreet_text": "RUE ACHILLE VIADIEU"
|
||||
},
|
||||
"contact": {
|
||||
|
@ -42,7 +42,17 @@
|
|||
"profession": null,
|
||||
"CAFInfo": null,
|
||||
"indicatorList": [],
|
||||
"quotientList": [],
|
||||
"quotientList": [
|
||||
{
|
||||
"yearRev": 2022,
|
||||
"dateStart": "2022-09-01T00:00:00+02:00",
|
||||
"dateEnd": "3000-08-31T00:00:00+02:00",
|
||||
"mtt": 5000.0,
|
||||
"cdquo": "1",
|
||||
"codeUti": null,
|
||||
"cdquo_text": "Revenus fiscaux"
|
||||
}
|
||||
],
|
||||
"subscribeActivityList": [],
|
||||
"civility_text": "MADAME",
|
||||
"quality_text": "M\u00e8re"
|
||||
|
@ -62,7 +72,8 @@
|
|||
"countryCode": null,
|
||||
"cdDepartment": "19",
|
||||
"communeCode_text": "BRIVE-LA-GAILLARDE",
|
||||
"cdDepartment_text": "CORREZE"
|
||||
"cdDepartment_text": "CORREZE",
|
||||
"zipCode": "19100"
|
||||
},
|
||||
"dietcode": "MENU_AV",
|
||||
"bPhoto": true,
|
||||
|
@ -71,7 +82,7 @@
|
|||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "SIMPSON",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "ABRAHAM JEBEDIAH",
|
||||
"dateBirth": "1927-05-24T00:00:00+01:00",
|
||||
"civility": "MR",
|
||||
|
@ -93,7 +104,7 @@
|
|||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "SIMPSON",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "MONA PENELOPE",
|
||||
"dateBirth": "1929-03-15T00:00:00Z",
|
||||
"civility": "MME",
|
||||
|
|
|
@ -0,0 +1,408 @@
|
|||
{
|
||||
"number": "N/A",
|
||||
"category": "BI",
|
||||
"situation": "MARI",
|
||||
"flagCom": false,
|
||||
"nbChild": 3,
|
||||
"nbTotalChild": 4,
|
||||
"nbAES": "1",
|
||||
"RL1": {
|
||||
"num": "N/A",
|
||||
"firstname": "MARGE",
|
||||
"lastname": "N/A",
|
||||
"maidenName": "BOUVIER",
|
||||
"quality": "MERE",
|
||||
"civility": "MME",
|
||||
"birth": {
|
||||
"dateBirth": "1950-10-01T00:00:00+01:00",
|
||||
"place": null,
|
||||
"communeCode": null,
|
||||
"countryCode": "404",
|
||||
"cdDepartment": null,
|
||||
"countryCode_text": "USA"
|
||||
},
|
||||
"adresse": {
|
||||
"idStreet": null,
|
||||
"num": 742,
|
||||
"numComp": null,
|
||||
"street1": "Evergreen Terrace",
|
||||
"street2": null,
|
||||
"town": "Springfield",
|
||||
"zipcode": "90701"
|
||||
},
|
||||
"contact": {
|
||||
"phone": null,
|
||||
"mobile": null,
|
||||
"mail": null,
|
||||
"isContactMail": false,
|
||||
"isContactSms": false,
|
||||
"isInvoicePdf": false
|
||||
},
|
||||
"profession": null,
|
||||
"CAFInfo": null,
|
||||
"indicatorList": [],
|
||||
"quotientList": [
|
||||
{
|
||||
"yearRev": 2022,
|
||||
"dateStart": "2023-05-15T00:00:00+02:00",
|
||||
"dateEnd": "3000-12-31T00:00:00+01:00",
|
||||
"mtt": 5000.0,
|
||||
"cdquo": "1",
|
||||
"codeUti": null,
|
||||
"cdquo_text": "Revenus fiscaux"
|
||||
}
|
||||
],
|
||||
"subscribeActivityList": [],
|
||||
"civility_text": "MADAME",
|
||||
"quality_text": "M\u00e8re"
|
||||
},
|
||||
"RL2": {
|
||||
"num": "N/A",
|
||||
"firstname": "HOMER",
|
||||
"lastname": "N/A",
|
||||
"maidenName": null,
|
||||
"quality": "PERE",
|
||||
"civility": "MR",
|
||||
"birth": {
|
||||
"dateBirth": "1956-05-12T00:00:00+01:00",
|
||||
"place": "Brive-la-Gaillarde",
|
||||
"communeCode": "19031",
|
||||
"countryCode": null,
|
||||
"cdDepartment": "19",
|
||||
"communeCode_text": "BRIVE-LA-GAILLARDE",
|
||||
"cdDepartment_text": "CORREZE",
|
||||
"zipCode": "19100"
|
||||
},
|
||||
"adresse": {
|
||||
"idStreet": "2317",
|
||||
"num": 4,
|
||||
"numComp": null,
|
||||
"street1": "RUE ACHILLE VIADIEU",
|
||||
"street2": null,
|
||||
"town": "Toulouse",
|
||||
"zipcode": "31400",
|
||||
"idStreet_text": "RUE ACHILLE VIADIEU"
|
||||
},
|
||||
"contact": {
|
||||
"phone": "0122222222",
|
||||
"mobile": "0622222222",
|
||||
"mail": "homer.simpson@example.org.com",
|
||||
"isContactMail": true,
|
||||
"isContactSms": true,
|
||||
"isInvoicePdf": true
|
||||
},
|
||||
"profession": {
|
||||
"codeCSP": "46",
|
||||
"profession": "Inspecteur de s\u00e9curit\u00e9",
|
||||
"employerName": "Burns",
|
||||
"phone": "0133333333",
|
||||
"addressPro": {
|
||||
"num": null,
|
||||
"street": null,
|
||||
"zipcode": "90701",
|
||||
"town": "Springfield"
|
||||
},
|
||||
"situation": null,
|
||||
"weeklyHours": null,
|
||||
"codeCSP_text": "EMPLOYES"
|
||||
},
|
||||
"CAFInfo": {
|
||||
"number": "123",
|
||||
"organ": "GENE",
|
||||
"organ_text": "CAF 31"
|
||||
},
|
||||
"indicatorList": [
|
||||
{
|
||||
"code": "AVL",
|
||||
"libelle": "Auxiliaire de Vie loisirs",
|
||||
"note": null,
|
||||
"choice": null,
|
||||
"code_text": "Auxiliaire de Vie loisirs"
|
||||
},
|
||||
{
|
||||
"code": "ETABSPEC",
|
||||
"libelle": "Etablissement sp\u00e9cialis\u00e9",
|
||||
"note": "SNPP",
|
||||
"choice": null,
|
||||
"code_text": "Etablissement sp\u00e9cialis\u00e9"
|
||||
}
|
||||
],
|
||||
"quotientList": [],
|
||||
"subscribeActivityList": [],
|
||||
"civility_text": "MONSIEUR",
|
||||
"quality_text": "P\u00e8re"
|
||||
},
|
||||
"quotientList": [],
|
||||
"childList": [
|
||||
{
|
||||
"num": "N/A",
|
||||
"lastname": "N/A",
|
||||
"firstname": "BART",
|
||||
"sexe": "M",
|
||||
"birth": {
|
||||
"dateBirth": "2014-04-01T00:00:00+02:00",
|
||||
"place": "Brive-la-Gaillarde",
|
||||
"communeCode": "19031",
|
||||
"countryCode": null,
|
||||
"cdDepartment": "19",
|
||||
"communeCode_text": "BRIVE-LA-GAILLARDE",
|
||||
"cdDepartment_text": "CORREZE",
|
||||
"zipCode": "19100"
|
||||
},
|
||||
"dietcode": "MENU_AV",
|
||||
"bPhoto": true,
|
||||
"bLeaveAlone": true,
|
||||
"authorizedPersonList": [
|
||||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "ABRAHAM JEBEDIAH",
|
||||
"dateBirth": "1927-05-24T00:00:00+01:00",
|
||||
"civility": "MR",
|
||||
"sexe": "M",
|
||||
"contact": {
|
||||
"phone": "0312345678",
|
||||
"mobile": null,
|
||||
"mail": "abe.simpson@example.org"
|
||||
},
|
||||
"civility_text": "MONSIEUR",
|
||||
"sexe_text": "Masculin"
|
||||
},
|
||||
"personQuality": {
|
||||
"code": "13",
|
||||
"libelle": "Famille",
|
||||
"code_text": "Famille"
|
||||
}
|
||||
},
|
||||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "MONA PENELOPE",
|
||||
"dateBirth": "1929-03-15T00:00:00Z",
|
||||
"civility": "MME",
|
||||
"sexe": "F",
|
||||
"contact": {
|
||||
"phone": "0412345678",
|
||||
"mobile": "0612345678",
|
||||
"mail": "mona.simpson@example.org"
|
||||
},
|
||||
"civility_text": "MADAME",
|
||||
"sexe_text": "F\u00e9minin"
|
||||
},
|
||||
"personQuality": {
|
||||
"code": "13",
|
||||
"libelle": "Famille",
|
||||
"code_text": "Famille"
|
||||
}
|
||||
}
|
||||
],
|
||||
"indicatorList": [
|
||||
{
|
||||
"code": "AUTRE",
|
||||
"libelle": "Autre",
|
||||
"note": "rebellious",
|
||||
"choice": null,
|
||||
"code_text": "Autre"
|
||||
},
|
||||
{
|
||||
"code": "LUNETTE",
|
||||
"libelle": "Port de lunettes",
|
||||
"note": null,
|
||||
"choice": null,
|
||||
"code_text": "Port de lunettes"
|
||||
}
|
||||
],
|
||||
"medicalRecord": {
|
||||
"familyDoctor": {
|
||||
"name": "MONROE",
|
||||
"phone": "0612341234",
|
||||
"address": {
|
||||
"street1": "Alameda",
|
||||
"zipcode": "90701",
|
||||
"town": "Springfield"
|
||||
}
|
||||
},
|
||||
"allergy1": "butterscotch, imitation butterscotch, glow-in-the-dark monster make-up",
|
||||
"allergy2": "shrimp and cauliflower",
|
||||
"comment1": "the shrimp allergy isn't fully identified",
|
||||
"comment2": null,
|
||||
"observ1": "Ay Caramba!",
|
||||
"observ2": "Eat my shorts!",
|
||||
"isAuthHospital": false,
|
||||
"hospital": null,
|
||||
"vaccinList": [
|
||||
{
|
||||
"code": "24",
|
||||
"libelle": "IMOVAX OREILLONS",
|
||||
"vaccinationDate": "2022-02-22T00:00:00+01:00"
|
||||
},
|
||||
{
|
||||
"code": "45",
|
||||
"libelle": "DT TETANOS COQ",
|
||||
"vaccinationDate": "2011-01-11T00:00:00+01:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
"insurance": null,
|
||||
"paiInfoBean": {
|
||||
"code": "PAI_01",
|
||||
"dateDeb": "2022-09-01T00:00:00+02:00",
|
||||
"dateFin": "2023-07-01T00:00:00+02:00",
|
||||
"description": "mischievous, rebellious, misunderstood, disruptive",
|
||||
"code_text": "PAI Alimentaire Int\u00e9gral"
|
||||
},
|
||||
"mother": "N/A",
|
||||
"father": "N/A",
|
||||
"rl": null,
|
||||
"subscribeSchoolList": [],
|
||||
"subscribeActivityList": [],
|
||||
"sexe_text": "Masculin",
|
||||
"dietcode_text": "Avec viande"
|
||||
},
|
||||
{
|
||||
"num": "N/A",
|
||||
"lastname": "N/A",
|
||||
"firstname": "LISA",
|
||||
"sexe": "F",
|
||||
"birth": {
|
||||
"dateBirth": "2016-05-09T00:00:00+02:00",
|
||||
"place": null,
|
||||
"communeCode": null,
|
||||
"countryCode": null,
|
||||
"cdDepartment": null
|
||||
},
|
||||
"dietcode": "MENU_SV",
|
||||
"bPhoto": false,
|
||||
"bLeaveAlone": false,
|
||||
"authorizedPersonList": [],
|
||||
"indicatorList": [],
|
||||
"medicalRecord": null,
|
||||
"insurance": null,
|
||||
"paiInfoBean": {
|
||||
"code": "PAI_02",
|
||||
"dateDeb": null,
|
||||
"dateFin": null,
|
||||
"description": null,
|
||||
"code_text": "PAI Alimentaire Partiel"
|
||||
},
|
||||
"mother": "N/A",
|
||||
"father": "N/A",
|
||||
"rl": null,
|
||||
"subscribeSchoolList": [],
|
||||
"subscribeActivityList": [],
|
||||
"sexe_text": "F\u00e9minin",
|
||||
"dietcode_text": "Sans viande"
|
||||
},
|
||||
{
|
||||
"num": "N/A",
|
||||
"lastname": "N/A",
|
||||
"firstname": "MAGGIE",
|
||||
"sexe": "F",
|
||||
"birth": {
|
||||
"dateBirth": "2018-12-17T00:00:00+01:00",
|
||||
"place": null,
|
||||
"communeCode": null,
|
||||
"countryCode": null,
|
||||
"cdDepartment": null
|
||||
},
|
||||
"dietcode": "MENU_PAI",
|
||||
"bPhoto": false,
|
||||
"bLeaveAlone": false,
|
||||
"authorizedPersonList": [],
|
||||
"indicatorList": [],
|
||||
"medicalRecord": null,
|
||||
"insurance": null,
|
||||
"paiInfoBean": {
|
||||
"code": "PAI_02",
|
||||
"dateDeb": null,
|
||||
"dateFin": null,
|
||||
"description": null,
|
||||
"code_text": "PAI Alimentaire Partiel"
|
||||
},
|
||||
"mother": "N/A",
|
||||
"father": "N/A",
|
||||
"rl": null,
|
||||
"subscribeSchoolList": [],
|
||||
"subscribeActivityList": [],
|
||||
"sexe_text": "F\u00e9minin",
|
||||
"dietcode_text": "Panier PAI"
|
||||
},
|
||||
{
|
||||
"num": "N/A",
|
||||
"lastname": "N/A",
|
||||
"firstname": "HUGO",
|
||||
"sexe": "M",
|
||||
"birth": {
|
||||
"dateBirth": "2018-04-01T00:00:00+02:00",
|
||||
"place": null,
|
||||
"communeCode": null,
|
||||
"countryCode": null,
|
||||
"cdDepartment": null
|
||||
},
|
||||
"dietcode": "MENU_AV",
|
||||
"bPhoto": false,
|
||||
"bLeaveAlone": false,
|
||||
"authorizedPersonList": [],
|
||||
"indicatorList": [],
|
||||
"medicalRecord": null,
|
||||
"insurance": null,
|
||||
"paiInfoBean": {
|
||||
"code": "PAI_01",
|
||||
"dateDeb": null,
|
||||
"dateFin": null,
|
||||
"description": null,
|
||||
"code_text": "PAI Alimentaire Int\u00e9gral"
|
||||
},
|
||||
"mother": "N/A",
|
||||
"father": "N/A",
|
||||
"rl": null,
|
||||
"subscribeSchoolList": [],
|
||||
"subscribeActivityList": [],
|
||||
"sexe_text": "Masculin",
|
||||
"dietcode_text": "Avec viande"
|
||||
}
|
||||
],
|
||||
"emergencyPersonList": [
|
||||
{
|
||||
"numPerson": "N/A",
|
||||
"civility": "MME",
|
||||
"firstname": "PATTY",
|
||||
"lastname": "BOUVIER",
|
||||
"dateBirth": "1948-08-30T00:00:00+01:00",
|
||||
"sexe": "F",
|
||||
"quality": "13",
|
||||
"contact": {
|
||||
"phone": "0112345678",
|
||||
"mobile": "0612345678",
|
||||
"mail": "patty.bouvier@example.org"
|
||||
},
|
||||
"civility_text": "MADAME",
|
||||
"quality_text": "Famille",
|
||||
"sexe_text": "F\u00e9minin"
|
||||
},
|
||||
{
|
||||
"numPerson": "N/A",
|
||||
"civility": "MME",
|
||||
"firstname": "SELMA",
|
||||
"lastname": "BOUVIER",
|
||||
"dateBirth": "1946-04-29T00:00:00+01:00",
|
||||
"sexe": "F",
|
||||
"quality": "13",
|
||||
"contact": {
|
||||
"phone": "0112345678",
|
||||
"mobile": "0612345678",
|
||||
"mail": "selma.bouvier@example.org"
|
||||
},
|
||||
"civility_text": "MADAME",
|
||||
"quality_text": "Famille",
|
||||
"sexe_text": "F\u00e9minin"
|
||||
}
|
||||
],
|
||||
"indicatorList": [],
|
||||
"childErrorList": [],
|
||||
"category_text": "BIPARENTALE",
|
||||
"situation_text": "MARIE(E)",
|
||||
"family_id": "N/A"
|
||||
}
|
|
@ -12,7 +12,8 @@
|
|||
"countryCode": null,
|
||||
"cdDepartment": "19",
|
||||
"communeCode_text": "BRIVE-LA-GAILLARDE",
|
||||
"cdDepartment_text": "CORREZE"
|
||||
"cdDepartment_text": "CORREZE",
|
||||
"zipCode": "19100"
|
||||
},
|
||||
"adresse": {
|
||||
"idStreet": null,
|
||||
|
|
|
@ -5,14 +5,8 @@
|
|||
"level": "INDI_APE_ENF",
|
||||
"indicatorList": [
|
||||
{
|
||||
"code": "APE-MINE",
|
||||
"libelle": "SP-parent mineur",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_ALLO",
|
||||
"libelle": "SP-accompagnement enfant allophone",
|
||||
"code": "APE_COMPO3",
|
||||
"libelle": "CF-0/1 actif",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
|
@ -28,6 +22,12 @@
|
|||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_MULTIACC",
|
||||
"libelle": "CF-2 enfants \u00e0 accueillir",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_SITUP",
|
||||
"libelle": "SP-situation particuli\u00e8re personne",
|
||||
|
@ -41,24 +41,12 @@
|
|||
"text": "INDI_APE_FAM",
|
||||
"level": "INDI_APE_FAM",
|
||||
"indicatorList": [
|
||||
{
|
||||
"code": "APE_COMPO1",
|
||||
"libelle": "CF-100% actif",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_COMPO2",
|
||||
"libelle": "CF-1/2 actif",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_COMPO3",
|
||||
"libelle": "CF-0/1 actif",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_COMPO4",
|
||||
"libelle": "CF-0/2 actif",
|
||||
|
@ -66,14 +54,45 @@
|
|||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_NAIM",
|
||||
"libelle": "CF-naissance multiple",
|
||||
"code": "APE_FIRSTC",
|
||||
"libelle": "CF-premier enfant",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_MULTIACC",
|
||||
"libelle": "CF-2 enfants \u00e0 accueillir",
|
||||
"code": "APE_HAND",
|
||||
"libelle": "H-handicap ou maladie chronique",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_NAIM",
|
||||
"libelle": "CF-naissance multiple",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "INDI_APE_RES",
|
||||
"text": "INDI_APE_RES",
|
||||
"level": "INDI_APE_RES",
|
||||
"indicatorList": [
|
||||
{
|
||||
"code": "APE_COMPO1",
|
||||
"libelle": "CF-100% actif",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_FRAT",
|
||||
"libelle": "CF-Fratrie d\u00e9j\u00e0 en accueil",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_KOFRAT",
|
||||
"libelle": "CF-sans proposition pour une partie de la fratrie",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
|
@ -88,35 +107,16 @@
|
|||
"libelle": "SP-situation particuli\u00e8re logement",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "INDI_APE_RES",
|
||||
"text": "INDI_APE_RES",
|
||||
"level": "INDI_APE_RES",
|
||||
"indicatorList": [
|
||||
},
|
||||
{
|
||||
"code": "APE_FIRSTC",
|
||||
"libelle": "CF-premier enfant",
|
||||
"code": "APE_ALLO",
|
||||
"libelle": "SP-accompagnement enfant allophone",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_FRAT",
|
||||
"libelle": "CF-Fratrie d\u00e9j\u00e0 en accueil",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_HAND",
|
||||
"libelle": "H-handicap ou maladie chronique",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
},
|
||||
{
|
||||
"code": "APE_KOFRAT",
|
||||
"libelle": "CF-sans proposition pour une partie de la fratrie",
|
||||
"code": "APE-MINE",
|
||||
"libelle": "SP-parent mineur",
|
||||
"typeDesc": "NONE",
|
||||
"choiceList": []
|
||||
}
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
[
|
||||
{
|
||||
"id": "87",
|
||||
"code": "87",
|
||||
"rang": "PERSON",
|
||||
"text": "Acte de d\u00e9c\u00e8s",
|
||||
"libelle": "Acte de d\u00e9c\u00e8s"
|
||||
},
|
||||
{
|
||||
"id": "43",
|
||||
"code": "43",
|
||||
|
@ -188,6 +195,13 @@
|
|||
"text": "Certificat de scolarit\u00e9",
|
||||
"libelle": "Certificat de scolarit\u00e9"
|
||||
},
|
||||
{
|
||||
"id": "93",
|
||||
"code": "93",
|
||||
"rang": "PERSON",
|
||||
"text": "Certificat de travail",
|
||||
"libelle": "Certificat de travail"
|
||||
},
|
||||
{
|
||||
"id": "74",
|
||||
"code": "74",
|
||||
|
|
|
@ -13,17 +13,8 @@
|
|||
"text": "2023",
|
||||
"schoolYear": 2023,
|
||||
"dateEndYearSchool": "2024-07-07T00:00:00+02:00",
|
||||
"dateStartYearSchool": "2023-09-01T00:00:00+02:00",
|
||||
"dateStartYearSchool": "2023-09-04T00:00:00+02:00",
|
||||
"dateEndSubscribeSchool": "2023-09-01T00:00:00+02:00",
|
||||
"dateStartSubscribeSchool": "2022-09-01T00:00:00+02:00"
|
||||
},
|
||||
{
|
||||
"id": 2024,
|
||||
"text": "2024",
|
||||
"schoolYear": 2024,
|
||||
"dateEndYearSchool": "2024-07-04T00:00:00+02:00",
|
||||
"dateStartYearSchool": "2023-09-04T00:00:00+02:00",
|
||||
"dateEndSubscribeSchool": null,
|
||||
"dateStartSubscribeSchool": null
|
||||
}
|
||||
]
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
{
|
||||
"id": "30",
|
||||
"code": "30",
|
||||
"text": "B.C.G.",
|
||||
"libelle": "B.C.G."
|
||||
"text": "BCG",
|
||||
"libelle": "BCG"
|
||||
},
|
||||
{
|
||||
"id": "56",
|
||||
|
@ -74,8 +74,8 @@
|
|||
{
|
||||
"id": "8",
|
||||
"code": "8",
|
||||
"text": "DT POLIO",
|
||||
"libelle": "DT POLIO"
|
||||
"text": "DTPOLIO",
|
||||
"libelle": "DTPOLIO"
|
||||
},
|
||||
{
|
||||
"id": "45",
|
||||
|
@ -128,8 +128,8 @@
|
|||
{
|
||||
"id": "29",
|
||||
"code": "29",
|
||||
"text": "HEPATITE B",
|
||||
"libelle": "HEPATITE B"
|
||||
"text": "HEPATITEB",
|
||||
"libelle": "HEPATITEB"
|
||||
},
|
||||
{
|
||||
"id": "146",
|
||||
|
@ -149,6 +149,12 @@
|
|||
"text": "HIB",
|
||||
"libelle": "HIB"
|
||||
},
|
||||
{
|
||||
"id": "152",
|
||||
"code": "152",
|
||||
"text": "IIP",
|
||||
"libelle": "IIP"
|
||||
},
|
||||
{
|
||||
"id": "24",
|
||||
"code": "24",
|
||||
|
@ -221,6 +227,12 @@
|
|||
"text": "MENINGITEC",
|
||||
"libelle": "MENINGITEC"
|
||||
},
|
||||
{
|
||||
"id": "151",
|
||||
"code": "151",
|
||||
"text": "MENINGOCOQUE",
|
||||
"libelle": "MENINGOCOQUE"
|
||||
},
|
||||
{
|
||||
"id": "123",
|
||||
"code": "123",
|
||||
|
@ -287,6 +299,12 @@
|
|||
"text": "PENTAVAC",
|
||||
"libelle": "PENTAVAC"
|
||||
},
|
||||
{
|
||||
"id": "150",
|
||||
"code": "150",
|
||||
"text": "POLIO",
|
||||
"libelle": "POLIO"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"code": "2",
|
||||
|
@ -320,8 +338,8 @@
|
|||
{
|
||||
"id": "28",
|
||||
"code": "28",
|
||||
"text": "R O R",
|
||||
"libelle": "R O R"
|
||||
"text": "ROR",
|
||||
"libelle": "ROR"
|
||||
},
|
||||
{
|
||||
"id": "127",
|
||||
|
@ -386,8 +404,8 @@
|
|||
{
|
||||
"id": "12",
|
||||
"code": "12",
|
||||
"text": "TETRA COQ",
|
||||
"libelle": "TETRA COQ"
|
||||
"text": "TETRACOQ",
|
||||
"libelle": "TETRACOQ"
|
||||
},
|
||||
{
|
||||
"id": "46",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "SIMPSON",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "ABRAHAM JEBEDIAH",
|
||||
"dateBirth": "1927-05-24T00:00:00+01:00",
|
||||
"civility": "MR",
|
||||
|
@ -40,7 +40,7 @@
|
|||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "SIMPSON",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "MONA PENELOPE",
|
||||
"dateBirth": "1929-03-15T00:00:00Z",
|
||||
"civility": "MME",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "SIMPSON",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "MONA PENELOPE",
|
||||
"dateBirth": "1929-03-15T00:00:00Z",
|
||||
"civility": "MME",
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
"numComp": null,
|
||||
"street1": "RUE ACHILLE VIADIEU",
|
||||
"street2": null,
|
||||
"town": "Springfield",
|
||||
"zipcode": "62701",
|
||||
"town": "Toulouse",
|
||||
"zipcode": "31400",
|
||||
"idStreet_text": "RUE ACHILLE VIADIEU"
|
||||
},
|
||||
"contact": {
|
||||
|
@ -61,7 +61,8 @@
|
|||
"countryCode": null,
|
||||
"cdDepartment": "19",
|
||||
"communeCode_text": "BRIVE-LA-GAILLARDE",
|
||||
"cdDepartment_text": "CORREZE"
|
||||
"cdDepartment_text": "CORREZE",
|
||||
"zipCode": "19100"
|
||||
},
|
||||
"adresse": {
|
||||
"idStreet": null,
|
||||
|
@ -135,7 +136,8 @@
|
|||
"countryCode": null,
|
||||
"cdDepartment": "19",
|
||||
"communeCode_text": "BRIVE-LA-GAILLARDE",
|
||||
"cdDepartment_text": "CORREZE"
|
||||
"cdDepartment_text": "CORREZE",
|
||||
"zipCode": "19100"
|
||||
},
|
||||
"dietcode": "MENU_AV",
|
||||
"bPhoto": true,
|
||||
|
@ -144,7 +146,7 @@
|
|||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "SIMPSON",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "ABRAHAM JEBEDIAH",
|
||||
"dateBirth": "1927-05-24T00:00:00+01:00",
|
||||
"civility": "MR",
|
||||
|
@ -166,7 +168,7 @@
|
|||
{
|
||||
"personInfo": {
|
||||
"num": "N/A",
|
||||
"lastname": "SIMPSON",
|
||||
"lastname": "TEST_SIMPSON",
|
||||
"firstname": "MONA PENELOPE",
|
||||
"dateBirth": "1929-03-15T00:00:00Z",
|
||||
"civility": "MME",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"number": "N/A",
|
||||
"category": "AUTR",
|
||||
"situation": "AUTR",
|
||||
"flagCom": true,
|
||||
"flagCom": false,
|
||||
"nbChild": 0,
|
||||
"nbTotalChild": 0,
|
||||
"nbAES": "0",
|
||||
|
|
|
@ -4,24 +4,33 @@
|
|||
"dateStart": "2022-01-02T00:00:00+01:00",
|
||||
"dateEnd": "2022-12-31T00:00:00+01:00",
|
||||
"mtt": 1500.33,
|
||||
"cdquo": "1",
|
||||
"cdquo": "2",
|
||||
"codeUti": null,
|
||||
"cdquo_text": "Revenus fiscaux"
|
||||
"cdquo_text": "Revenus Petite enfance"
|
||||
},
|
||||
{
|
||||
"yearRev": 2021,
|
||||
"dateStart": "2022-01-01T00:00:00+01:00",
|
||||
"dateEnd": "2022-01-01T00:00:00+01:00",
|
||||
"mtt": 1500.33,
|
||||
"cdquo": "1",
|
||||
"cdquo": "2",
|
||||
"codeUti": null,
|
||||
"cdquo_text": "Revenus fiscaux"
|
||||
"cdquo_text": "Revenus Petite enfance"
|
||||
},
|
||||
{
|
||||
"yearRev": 2021,
|
||||
"dateStart": "2022-01-02T00:00:00+01:00",
|
||||
"dateEnd": "2022-12-31T00:00:00+01:00",
|
||||
"mtt": 1500.33,
|
||||
"cdquo": "2",
|
||||
"codeUti": null,
|
||||
"cdquo_text": "Revenus Petite enfance"
|
||||
},
|
||||
{
|
||||
"yearRev": 2022,
|
||||
"dateStart": "2022-09-01T00:00:00+02:00",
|
||||
"dateEnd": "3000-08-31T00:00:00+02:00",
|
||||
"mtt": 5000.0,
|
||||
"cdquo": "1",
|
||||
"codeUti": null,
|
||||
"cdquo_text": "Revenus fiscaux"
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
"numComp": null,
|
||||
"street1": "RUE ACHILLE VIADIEU",
|
||||
"street2": null,
|
||||
"town": "Springfield",
|
||||
"zipcode": "62701",
|
||||
"town": "Toulouse",
|
||||
"zipcode": "31400",
|
||||
"idStreet_text": "RUE ACHILLE VIADIEU"
|
||||
},
|
||||
"contact": {
|
||||
|
|
|
@ -15,7 +15,7 @@ FAMILY_RESET_PAYLOAD = {
|
|||
'rl1': {
|
||||
'civility': 'MR', # no effect
|
||||
'firstname': 'Marge', # must be
|
||||
'lastname': 'Simpson', # must be
|
||||
'lastname': 'Test_Simpson', # must be
|
||||
'maidenName': 'reset', # no effect
|
||||
'quality': 'AU',
|
||||
'birth': {
|
||||
|
@ -27,7 +27,7 @@ FAMILY_RESET_PAYLOAD = {
|
|||
'rl2': {
|
||||
'civility': 'MME', # no effect
|
||||
'firstname': 'Homer', # must be
|
||||
'lastname': 'Simpson', # must be
|
||||
'lastname': 'Test_Simpson', # must be
|
||||
'quality': 'AU',
|
||||
'birth': {
|
||||
'dateBirth': '1956-05-12', # must be
|
||||
|
@ -236,13 +236,18 @@ def test_update_family(conn, update_data):
|
|||
|
||||
def test_create_family(conn, create_data, update_data):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
# search the 'Test_Simpson' default test family
|
||||
resp = requests.get(conn + '/search-family?q=Test_Simpson')
|
||||
resp.raise_for_status()
|
||||
assert len(resp.json()['data']) >= 1
|
||||
assert any(data['RL1']['lastname'] == 'TEST_SIMPSON' for data in resp.json()['data'])
|
||||
|
||||
url = conn + '/create-family?NameID=%s' % create_data['name_id']
|
||||
|
||||
# RL1 already exists (on update_data) error
|
||||
unlink(conn, create_data['name_id'])
|
||||
payload = copy.deepcopy(create_data['family_payload'])
|
||||
payload['rl1']['lastname'] = 'Simpson'
|
||||
payload['rl1']['lastname'] = 'Test_Simpson'
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
res = resp.json()
|
||||
|
@ -263,7 +268,7 @@ def test_create_family(conn, create_data, update_data):
|
|||
|
||||
def test_is_rl_exists(conn, update_data):
|
||||
url = conn + '/is-rl-exists'
|
||||
payload = {'firstname': 'Marge', 'lastname': 'Simpson', 'dateBirth': '1950-10-01'}
|
||||
payload = {'firstname': 'Marge', 'lastname': 'Test_Simpson', 'dateBirth': '1950-10-01'}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json() == {'err': 0, 'data': True}
|
||||
|
@ -280,7 +285,7 @@ def test_is_rl_exists(conn, update_data):
|
|||
assert resp.json() == {'err': 0, 'data': False}
|
||||
|
||||
# test on rl2
|
||||
payload = {'firstname': 'Homer', 'lastname': 'Simpson', 'dateBirth': '1956-05-12'}
|
||||
payload = {'firstname': 'Homer', 'lastname': 'Test_Simpson', 'dateBirth': '1956-05-12'}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json() == {'err': 0, 'data': True}
|
||||
|
@ -454,7 +459,7 @@ def test_create_child(conn, create_data, update_data):
|
|||
assert 'E65 : Il existe déjà un enfant correspondant' in res['err_desc']
|
||||
|
||||
# child already exists error (Lisa form update_data)
|
||||
payload['lastname'] = 'Simpson'
|
||||
payload['lastname'] = 'Test_Simpson'
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
res = resp.json()
|
||||
|
@ -776,21 +781,22 @@ def test_update_quotient(conn, create_data):
|
|||
'dateStart': '2022-01-01',
|
||||
'dateEnd': '2022-12-31',
|
||||
'mtt': '1500.33',
|
||||
'cdquo': '1',
|
||||
'cdquo': '2',
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = read_family(conn, create_data['name_id'])
|
||||
assert data['RL1']['quotientList'] == [
|
||||
assert len(data['RL1']['quotientList']) == 2
|
||||
assert data['RL1']['quotients']['2'] == [
|
||||
{
|
||||
'yearRev': 2021,
|
||||
'dateStart': '2022-01-01T00:00:00+01:00',
|
||||
'dateEnd': '2022-12-31T00:00:00+01:00',
|
||||
'mtt': 1500.33,
|
||||
'cdquo': '1',
|
||||
'cdquo': '2',
|
||||
'codeUti': None,
|
||||
'cdquo_text': 'Revenus fiscaux',
|
||||
'cdquo_text': 'Revenus Petite enfance',
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -800,7 +806,7 @@ def test_update_quotient(conn, create_data):
|
|||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = read_family(conn, create_data['name_id'])
|
||||
assert len(data['RL1']['quotientList']) == 2
|
||||
assert len(data['RL1']['quotients']['2']) == 2
|
||||
|
||||
# add quotient on another income year
|
||||
payload['yearRev'] = '2020'
|
||||
|
@ -808,7 +814,7 @@ def test_update_quotient(conn, create_data):
|
|||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = diff_rlg(conn, create_data['name_id'], 1, 'test_update_quotient.json', 'quotientList')
|
||||
assert len(data['RL1']['quotientList']) == 3
|
||||
assert len(data['RL1']['quotients']['2']) == 3
|
||||
|
||||
# test read-family with reference year
|
||||
url = conn + '/read-family?NameID=%s&income_year=%s' % (create_data['name_id'], '2020')
|
||||
|
@ -916,6 +922,8 @@ def test_add_supplied_document(conn, create_data):
|
|||
payload = {
|
||||
'documentList/0/code': '46',
|
||||
'documentList/0/depositDate': '2022-12-20',
|
||||
'documentList/0/visaDate': '2022-12-21',
|
||||
'documentList/0/validityDate': '2022-12-22',
|
||||
'documentList/0/file': { # w.c.s. file field
|
||||
'filename': '201x201.jpg',
|
||||
'content_type': 'image/jpeg',
|
||||
|
|
|
@ -3,9 +3,13 @@ import datetime
|
|||
import pytest
|
||||
import requests
|
||||
|
||||
from .conftest import link, unlink
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_create_nursery_demand_on_existing_child(conn, create_data):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
url = conn + '/get-nursery-geojson'
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
|
@ -23,10 +27,10 @@ def test_create_nursery_demand_on_existing_child(conn, create_data):
|
|||
url = conn + '/create-nursery-demand'
|
||||
payload = {
|
||||
'family_id': create_data['family_id'],
|
||||
'family_indicators/0/code': 'APE_COMPO1',
|
||||
'family_indicators/0/code': 'APE_FIRSTC',
|
||||
'family_indicators/0/isActive': True,
|
||||
'child_id': create_data['maggie_num'],
|
||||
'demand_indicators/0/code': 'APE_FIRSTC',
|
||||
'demand_indicators/0/code': 'APE_COMPO1',
|
||||
'demand_indicators/0/isActive': True,
|
||||
'start_date': datetime.date.today().strftime('%Y-%m-%d'),
|
||||
'number_of_days': '2',
|
||||
|
@ -57,8 +61,10 @@ def test_create_nursery_demand_on_existing_child(conn, create_data):
|
|||
assert len(res['data']['childList']) == nb_childs
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_create_nursery_demand_adding_new_child(conn, create_data):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
url = conn + '/get-nursery-geojson'
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
|
@ -72,6 +78,7 @@ def test_create_nursery_demand_adding_new_child(conn, create_data):
|
|||
res = resp.json()
|
||||
assert res['err'] == 0
|
||||
nb_childs = len(res['data']['childList'])
|
||||
assert 'NELSON' not in [x['firstname'] for x in res['data']['childList']]
|
||||
|
||||
url = conn + '/create-nursery-demand'
|
||||
payload = {
|
||||
|
@ -104,4 +111,5 @@ def test_create_nursery_demand_adding_new_child(conn, create_data):
|
|||
res = resp.json()
|
||||
assert res['err'] == 0
|
||||
assert len(res['data']['childList']) == nb_childs + 1
|
||||
assert 'NELSON' in [x['firstname'] for x in res['data']['childList']]
|
||||
assert res['data']['childList'][nb_childs]['num'] == child_id
|
||||
|
|
|
@ -12,7 +12,7 @@ def school_year(conn):
|
|||
res = resp.json()
|
||||
assert res['err'] == 0
|
||||
year = res['data'][0]['text']
|
||||
return str(int(year) + 1) # bug ?
|
||||
return year
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
|
@ -26,6 +26,59 @@ def exemption(conn):
|
|||
return res['data'][0]['id']
|
||||
|
||||
|
||||
def test_displaying_school_subscribed(conn, create_data, school_year, exemption):
|
||||
"""
|
||||
Read-family ramène les inscriptions aux date de visualisation paramétrées
|
||||
sur le référential YearSchool
|
||||
"""
|
||||
school_year = str(int(school_year) + 1)
|
||||
|
||||
# create a 7 year-old child
|
||||
url = conn + '/create-child?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'sexe': 'F',
|
||||
'firstname': 'Claris',
|
||||
'lastname': create_data['lastname'],
|
||||
'birth': {'dateBirth': '2016-09-12'},
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
claris_id = str(resp.json()['data']['child_id'])
|
||||
|
||||
# book
|
||||
url = conn + '/create-child-school-pre-registration'
|
||||
payload = {
|
||||
'numPerson': claris_id,
|
||||
'schoolYear': school_year,
|
||||
'levelCode': 'CE1',
|
||||
'dateSubscribe': school_year + '-01-01',
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['data']['returnMessage'] is None
|
||||
assert resp.json()['data']['subscribeSchoolBean']['schoolName'] == 'DUPONT PIERRE ELEMENTAIRE'
|
||||
assert resp.json()['data']['subscribeSchoolBean']['adresse'] == '101 GRANDE-RUE SAINT MICHEL'
|
||||
|
||||
# get Claris school from read-family
|
||||
url = conn + '/read-school-years-list'
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
res = resp.json()['data']
|
||||
date_start = [x['dateStartYearSchool'] for x in res if x['text'] == school_year][0]
|
||||
assert date_start[10] > datetime.datetime.now().strftime('%Y-%m-%d')
|
||||
|
||||
url = conn + '/read-family?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
res = resp.json()
|
||||
assert res['err'] == 0
|
||||
schools = [x['subscribeSchoolList'] for x in res['data']['childList'] if x['num'] == claris_id][0]
|
||||
assert len(schools) == 0 # school is filtered, but it is related to an hidden school year
|
||||
# field, not dateStartYearSchool, checked before : #2425
|
||||
|
||||
|
||||
def test_school_pre_registration_by_sector(conn, create_data, school_year, exemption):
|
||||
"""
|
||||
Pré-inscription de l'enfant de 7 ans dans son secteur
|
||||
|
@ -88,21 +141,23 @@ def test_school_pre_registration_by_sector(conn, create_data, school_year, exemp
|
|||
assert resp.json()['data']['subscribeSchoolBean']['adresse'] == '101 GRANDE-RUE SAINT MICHEL'
|
||||
|
||||
# get Sego school from read-family
|
||||
url = conn + '/read-school-years-list'
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
res = resp.json()['data']
|
||||
date_start = [x['dateStartYearSchool'] for x in res if x['text'] == school_year][0]
|
||||
assert date_start[10] > datetime.datetime.now().strftime('%Y-%m-%d')
|
||||
# school is filtered, but it is related to an hidden school year
|
||||
# field, not dateStartYearSchool, see #2425
|
||||
|
||||
url = conn + '/read-family?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
res = resp.json()
|
||||
assert res['err'] == 0
|
||||
schools = res['data']['childList'][-1]['subscribeSchoolList']
|
||||
assert len(schools) == 0 # school is filtered, see dateStartYearSchool bellow
|
||||
|
||||
url = conn + '/read-school-years-list'
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
res = resp.json()['data']
|
||||
assert school_year == '2023'
|
||||
assert res[1]['text'] == school_year
|
||||
assert res[1]['dateStartYearSchool'][10] > datetime.datetime.now().strftime('%Y-%m-%d')
|
||||
schools = [x['subscribeSchoolList'] for x in res['data']['childList'] if x['num'] == sego_id][0]
|
||||
assert len(schools) == 1
|
||||
assert schools[0]['schoolName'] == 'DUPONT PIERRE ELEMENTAIRE'
|
||||
|
||||
"""
|
||||
Pré-inscription d'un enfant de 5 ans en CP avec rappprochement de fratrie pour celui de 7 ans :
|
||||
|
@ -184,6 +239,41 @@ def test_school_pre_registration_by_exemption(conn, create_data, school_year, ex
|
|||
avec rapprochement de fratrie pour celui de 9 ans :
|
||||
rapprochement hors du secteur de l'enfant.
|
||||
"""
|
||||
|
||||
# check E124 error
|
||||
# get a school that do not provide a level in its sector
|
||||
url = conn + '/read-child-school-informations?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
'child_id': create_data['hugo_num'],
|
||||
'year': school_year,
|
||||
'level': 'GS',
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert [
|
||||
x['idSchool']
|
||||
for x in data['childSubscribeSchoolInformation']['subscribeSchoolInformation']['derogSchoolList']
|
||||
if x['text'] == 'DIEUZAIDE JEAN MATERNELLE'
|
||||
] == ['2437']
|
||||
|
||||
# try to book on a sector that do not provide the requested level
|
||||
url = conn + '/create-child-school-pre-registration-with-sibling'
|
||||
payload = {
|
||||
'numPerson': create_data['hugo_num'],
|
||||
'schoolYear': school_year,
|
||||
'levelCode': 'CP',
|
||||
'datePresubscribe': school_year + '-01-01',
|
||||
'idSchoolRequested': '2437',
|
||||
'numPersonSibling': create_data['bart_num'],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 1
|
||||
assert resp.json()['err_class'] == 'passerelle.utils.soap.SOAPFault'
|
||||
assert 'E124' in resp.json()['err_desc']
|
||||
|
||||
# get Bart school
|
||||
url = conn + '/read-child-school-informations?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
|
|
|
@ -1,13 +1,23 @@
|
|||
import datetime
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
from .conftest import link, unlink
|
||||
|
||||
|
||||
def test_perisco(perisco_subscribe_info):
|
||||
assert perisco_subscribe_info['info']['activity']['libelle1'] == 'TEST TEMPS DU MIDI 22/23'
|
||||
|
||||
|
||||
def test_perisco_adulte(perisco_subscribe_adulte_info):
|
||||
assert perisco_subscribe_adulte_info['info']['activity']['libelle1'] == 'TEST RESTAURATION ADULTE 22/23'
|
||||
|
||||
|
||||
def test_perisco_agenda(conn, create_data, perisco_subscribe_info):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
# subscription
|
||||
url = conn + '/add-person-subscription?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
|
@ -40,6 +50,7 @@ def test_perisco_agenda(conn, create_data, perisco_subscribe_info):
|
|||
else:
|
||||
raise Exception("no booking available")
|
||||
assert booking['details']['activity_id'] == perisco_subscribe_info['activity']['id']
|
||||
assert booking['details']['activity_label'] == 'Temps du midi'
|
||||
assert booking['prefill'] is False
|
||||
|
||||
# book activity
|
||||
|
@ -59,7 +70,7 @@ def test_perisco_agenda(conn, create_data, perisco_subscribe_info):
|
|||
{
|
||||
'booked': True,
|
||||
'activity_id': booking['details']['activity_id'],
|
||||
'activity_label': 'Restauration scolaire',
|
||||
'activity_label': 'Temps du midi',
|
||||
'day': booking['details']['day_str'],
|
||||
}
|
||||
],
|
||||
|
@ -79,7 +90,86 @@ def test_perisco_agenda(conn, create_data, perisco_subscribe_info):
|
|||
assert [x['prefill'] for x in resp.json()['data'] if x['id'] == booking['id']][0] is True
|
||||
|
||||
|
||||
def test_perisco_agenda_adulte(conn, create_data2, perisco_subscribe_adulte_info):
|
||||
unlink(conn, create_data2['name_id'])
|
||||
link(conn, create_data2)
|
||||
|
||||
# subscription
|
||||
url = conn + '/add-person-subscription?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
'person_id': create_data2['rl1_num'],
|
||||
'activity_id': perisco_subscribe_adulte_info['activity']['id'],
|
||||
'unit_id': perisco_subscribe_adulte_info['unit']['id'],
|
||||
'place_id': perisco_subscribe_adulte_info['place']['id'],
|
||||
'start_date': perisco_subscribe_adulte_info['unit']['dateStart'][:10],
|
||||
'end_date': perisco_subscribe_adulte_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
# find first available booking
|
||||
url = conn + '/read-child-agenda?NameID=%s' % create_data2['name_id']
|
||||
params = {
|
||||
'child_id': create_data2['rl1_num'],
|
||||
'start_date': perisco_subscribe_adulte_info['unit']['dateStart'][:10],
|
||||
'end_date': perisco_subscribe_adulte_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert len(resp.json()['data']) > 0
|
||||
booking = None
|
||||
for booking in resp.json()['data']:
|
||||
if booking['disabled'] is False:
|
||||
break
|
||||
else:
|
||||
raise Exception("no booking available")
|
||||
assert booking['details']['activity_id'] == perisco_subscribe_adulte_info['activity']['id']
|
||||
assert booking['details']['activity_label'] == 'RESTAURATION ADULTE'
|
||||
assert booking['prefill'] is False
|
||||
|
||||
# book activity
|
||||
url = conn + '/update-child-agenda?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
'child_id': create_data2['rl1_num'],
|
||||
'start_date': perisco_subscribe_adulte_info['unit']['dateStart'][:10],
|
||||
'end_date': perisco_subscribe_adulte_info['unit']['dateEnd'][:10],
|
||||
'booking_list': [booking['id']],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json() == {
|
||||
'updated': True,
|
||||
'count': 1,
|
||||
'changes': [
|
||||
{
|
||||
'booked': True,
|
||||
'activity_id': booking['details']['activity_id'],
|
||||
'activity_label': 'RESTAURATION ADULTE',
|
||||
'day': booking['details']['day_str'],
|
||||
}
|
||||
],
|
||||
'err': 0,
|
||||
}
|
||||
|
||||
# check booking
|
||||
url = conn + '/read-child-agenda?NameID=%s' % create_data2['name_id']
|
||||
params = {
|
||||
'child_id': create_data2['rl1_num'],
|
||||
'start_date': perisco_subscribe_adulte_info['unit']['dateStart'][:10],
|
||||
'end_date': perisco_subscribe_adulte_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert [x['prefill'] for x in resp.json()['data'] if x['id'] == booking['id']][0] is True
|
||||
|
||||
|
||||
def test_perisco_recurrent_week(conn, create_data, perisco_subscribe_info, reference_year):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
# no subscribed activity
|
||||
url = conn + '/read-subscribe-activity-list?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
|
@ -117,6 +207,9 @@ def test_perisco_recurrent_week(conn, create_data, perisco_subscribe_info, refer
|
|||
assert resp.json()['err'] == 0
|
||||
assert len(resp.json()['data']) == 1
|
||||
assert resp.json()['data'][0]['id'] == perisco_subscribe_info['activity']['id']
|
||||
assert [(x['text'], x['libelle'], x['libelle2']) for x in resp.json()['data']] == [
|
||||
('Temps du midi', 'TEST TEMPS DU MIDI 22/23', 'Temps du midi'),
|
||||
]
|
||||
|
||||
# get recurent-week gabarit
|
||||
url = conn + '/get-recurrent-week?NameID=%s' % create_data['name_id']
|
||||
|
@ -172,3 +265,105 @@ def test_perisco_recurrent_week(conn, create_data, perisco_subscribe_info, refer
|
|||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert any(x['prefill'] for x in resp.json()['data'])
|
||||
|
||||
|
||||
def test_perisco_recurrent_week_adulte(conn, create_data2, perisco_subscribe_adulte_info, reference_year):
|
||||
unlink(conn, create_data2['name_id'])
|
||||
link(conn, create_data2)
|
||||
|
||||
# no subscribed activity
|
||||
url = conn + '/read-subscribe-activity-list?NameID=%s' % create_data2['name_id']
|
||||
params = {
|
||||
'person_id': create_data2['rl2_num'],
|
||||
'nature': 'PERISCO',
|
||||
'school_year': '%s-%s' % (reference_year, reference_year + 1),
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert len(resp.json()['data']) == 0
|
||||
|
||||
# subscription
|
||||
url = conn + '/add-person-subscription?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
'person_id': create_data2['rl2_num'],
|
||||
'activity_id': perisco_subscribe_adulte_info['activity']['id'],
|
||||
'unit_id': perisco_subscribe_adulte_info['unit']['id'],
|
||||
'place_id': perisco_subscribe_adulte_info['place']['id'],
|
||||
'start_date': perisco_subscribe_adulte_info['unit']['dateStart'][:10],
|
||||
'end_date': perisco_subscribe_adulte_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
url = conn + '/read-subscribe-activity-list?NameID=%s' % create_data2['name_id']
|
||||
params = {
|
||||
'person_id': create_data2['rl2_num'],
|
||||
'nature': 'PERISCO',
|
||||
'school_year': '%s-%s' % (reference_year, reference_year + 1),
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert len(resp.json()['data']) == 1
|
||||
assert resp.json()['data'][0]['id'] == perisco_subscribe_adulte_info['activity']['id']
|
||||
assert [(x['text'], x['libelle'], x['libelle2']) for x in resp.json()['data']] == [
|
||||
('RESTAURATION ADULTE', 'TEST RESTAURATION ADULTE 22/23', 'RESTAURATION ADULTE')
|
||||
]
|
||||
|
||||
# get recurent-week gabarit
|
||||
url = conn + '/get-recurrent-week?NameID=%s' % create_data2['name_id']
|
||||
params = {
|
||||
'person_id': create_data2['rl2_num'],
|
||||
'activity_id': perisco_subscribe_adulte_info['activity']['id'],
|
||||
'ref_date': datetime.date.today().strftime('%Y-%m-%d'),
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert [(x['id'], x['day']) for x in resp.json()['data']] == [
|
||||
('1-X', 'Lundi'),
|
||||
('2-X', 'Mardi'),
|
||||
('3-X', 'Mercredi'),
|
||||
('4-X', 'Jeudi'),
|
||||
('5-X', 'Vendredi'),
|
||||
]
|
||||
|
||||
# no booking
|
||||
url = conn + '/read-child-agenda?NameID=%s' % create_data2['name_id']
|
||||
params = {
|
||||
'child_id': create_data2['rl2_num'],
|
||||
'start_date': perisco_subscribe_adulte_info['unit']['dateStart'][:10],
|
||||
'end_date': perisco_subscribe_adulte_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert not any(x['prefill'] for x in resp.json()['data'])
|
||||
|
||||
# set recurent-week gabarit
|
||||
url = conn + '/update-recurrent-week?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
'person_id': create_data2['rl2_num'],
|
||||
'activity_id': perisco_subscribe_adulte_info['activity']['id'],
|
||||
'start_date': perisco_subscribe_adulte_info['unit']['dateStart'][:10],
|
||||
'end_date': perisco_subscribe_adulte_info['unit']['dateEnd'][:10],
|
||||
'recurrent_week': ['1-X', '2-X'],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['data'] == 'ok'
|
||||
|
||||
# there is now some bookings
|
||||
url = conn + '/read-child-agenda?NameID=%s' % create_data2['name_id']
|
||||
params = {
|
||||
'child_id': create_data2['rl2_num'],
|
||||
'start_date': perisco_subscribe_adulte_info['unit']['dateStart'][:10],
|
||||
'end_date': perisco_subscribe_adulte_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert any(x['prefill'] for x in resp.json()['data'])
|
||||
|
|
|
@ -3,14 +3,13 @@ import datetime
|
|||
import pytest
|
||||
import requests
|
||||
|
||||
from .conftest import link, unlink
|
||||
from .conftest import get_subscription_info, link, unlink
|
||||
|
||||
# LOISIR is like EXTRACO (most tests are redondants) but :
|
||||
# * there is no calendar (days) to provide.
|
||||
# * there is a general catalog to display
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_catalog_general_loisirs(conn, update_data):
|
||||
unlink(conn, update_data['name_id'])
|
||||
link(conn, update_data)
|
||||
|
@ -33,30 +32,107 @@ def test_catalog_general_loisirs(conn, update_data):
|
|||
'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES, MERCREDI - 15h30/17h - 8/15Ans, ARGOULETS'
|
||||
in labels
|
||||
)
|
||||
assert 'TEST Promenade forêt enchantée, TEST Promenade forêt enchantée, TERRITOIRE OUEST' in labels
|
||||
assert (
|
||||
'TEST Promenade lac de plaisance du T., TEST Promenade lac de plaisance du T., TERRITOIRE OUEST'
|
||||
in labels
|
||||
)
|
||||
assert 'Promenade forêt enchantée, TEST promenade forêt enchantée, TERRITOIRE OUEST' in labels
|
||||
assert 'Vitrail Fusing 1/2 Je Adultes, Inscription annuelle, Centre Culturel ALBAN MINVILLE' in labels
|
||||
|
||||
for item in resp.json()['data']:
|
||||
if (
|
||||
item['text']
|
||||
== 'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES, MERCREDI - 13h45/17h - 8/15Ans, ARGOULETS'
|
||||
):
|
||||
assert item['criterias'] == {
|
||||
'service': {'text': 'Service', 'data': {'sports': 'Sports'}, 'order': ['sports']},
|
||||
'nature': {
|
||||
'text': "Nature de l'activité",
|
||||
'data': {'1': 'Activités Régulières'},
|
||||
'order': ['1'],
|
||||
},
|
||||
'type': {
|
||||
'text': "Type de l'activité",
|
||||
'data': {'activites-aquatiques': 'Activités Aquatiques'},
|
||||
'order': ['activites-aquatiques'],
|
||||
},
|
||||
'public': {
|
||||
'text': 'Public',
|
||||
'data': {'1': 'Enfant (3-11 ans)', '2': 'Ado (12-17 ans)'},
|
||||
'order': ['1', '2'],
|
||||
},
|
||||
'day': {'text': 'Jours', 'data': {'3': 'Mercredi'}, 'order': ['3']},
|
||||
'place': {'text': 'Lieu', 'data': {'A10053179757': 'ARGOULETS'}, 'order': ['A10053179757']},
|
||||
}
|
||||
assert item['activity']['activityPortail']['blocNoteList'] == [
|
||||
{
|
||||
'note': "Activité ayant lieu le Mercredi, merci de choisir votre tranche horraire en fonction de l'âge de votre enfant.",
|
||||
'numIndex': 1,
|
||||
}
|
||||
]
|
||||
if item['text'] == 'Promenade forêt enchantée, TEST promenade forêt enchantée, TERRITOIRE OUEST':
|
||||
assert item['criterias'] == {
|
||||
'service': {'text': 'Service', 'data': {'sports': 'Sports'}, 'order': ['sports']},
|
||||
'nature': {
|
||||
'text': "Nature de l'activité",
|
||||
'data': {'1': 'Activités Régulières'},
|
||||
'order': ['1'],
|
||||
},
|
||||
'type': {
|
||||
'text': "Type de l'activité",
|
||||
'data': {'activite-pedestre': 'Activité Pédestre'},
|
||||
'order': ['activite-pedestre'],
|
||||
},
|
||||
'public': {'text': 'Public', 'data': {'5': 'Sénior (60 ans et plus)'}, 'order': ['5']},
|
||||
'day': {
|
||||
'text': 'Jours',
|
||||
'data': {'1': 'Lundi', '2': 'Mardi', '3': 'Mercredi', '4': 'Jeudi', '5': 'Vendredi'},
|
||||
'order': ['1', '2', '3', '4', '5'],
|
||||
},
|
||||
'place': {
|
||||
'text': 'Lieu',
|
||||
'data': {'A10056517597': 'TERRITOIRE OUEST'},
|
||||
'order': ['A10056517597'],
|
||||
},
|
||||
}
|
||||
assert item['activity']['activityPortail']['blocNoteList'] == [
|
||||
{'note': 'Activité de promenade en forêt.', 'numIndex': 1}
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_catalog_personnalise_loisirs(loisirs_subscribe_info):
|
||||
assert (
|
||||
loisirs_subscribe_info['info']['activity']['libelle1']
|
||||
== 'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES'
|
||||
)
|
||||
assert loisirs_subscribe_info['info']['calendarGeneration']['code'] == 'FORBIDDEN'
|
||||
assert loisirs_subscribe_info['info']['calendarGeneration']['code'] == 'REQUIRED'
|
||||
assert [(x['id'], x['day']) for x in loisirs_subscribe_info['info']['recurrent_week']] == []
|
||||
assert loisirs_subscribe_info['info']['billingInformation'] == {
|
||||
'modeFact': 'FORFAIT',
|
||||
'quantity': 1.0,
|
||||
'unitPrice': 150.0,
|
||||
'unitPrice': 88.5,
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_catalog_personnalise_loisirs_not_allowed(conn, create_data, reference_year):
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
try:
|
||||
get_subscription_info(
|
||||
'LOISIRS',
|
||||
'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES',
|
||||
'MERCREDI - 15h30/17h - 8/15Ans',
|
||||
'ARGOULETS',
|
||||
conn,
|
||||
create_data['name_id'],
|
||||
create_data['rl1_num'],
|
||||
reference_year,
|
||||
)
|
||||
except Exception:
|
||||
return
|
||||
assert False, 'Adult can subscribe to child activity'
|
||||
|
||||
|
||||
def test_direct_subscribe(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
url = conn + '/add-person-subscription?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
|
@ -64,8 +140,8 @@ def test_direct_subscribe(conn, create_data, loisirs_subscribe_info, reference_y
|
|||
'activity_id': loisirs_subscribe_info['activity']['id'],
|
||||
'unit_id': loisirs_subscribe_info['unit']['id'],
|
||||
'place_id': loisirs_subscribe_info['place']['id'],
|
||||
'start_date': '%s-09-01' % reference_year,
|
||||
'end_date': '%s-08-31' % (reference_year + 1),
|
||||
'start_date': loisirs_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': loisirs_subscribe_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
|
@ -75,19 +151,32 @@ def test_direct_subscribe(conn, create_data, loisirs_subscribe_info, reference_y
|
|||
assert resp.json()['data'] == {'controlOK': True, 'message': None}
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_subscribe_with_conveyance(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
def test_direct_subscribe_out_town(conn, create_data2, loisirs_subscribe_info2, reference_year):
|
||||
assert loisirs_subscribe_info2['info']['controlResult']['controlOK'] is True
|
||||
unlink(conn, create_data2['name_id'])
|
||||
link(conn, create_data2)
|
||||
|
||||
assert loisirs_subscribe_info['info']['conveyance'] is not None
|
||||
morning = [
|
||||
x['id'] for x in loisirs_subscribe_info['info']['conveyance']['morningJourney']['depositPlaceList']
|
||||
]
|
||||
afternoon = [
|
||||
x['id'] for x in loisirs_subscribe_info['info']['conveyance']['afternoonJourney']['depositPlaceList']
|
||||
]
|
||||
assert len(morning) > 0
|
||||
assert len(afternoon) > 0
|
||||
url = conn + '/add-person-subscription?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
'person_id': create_data2['hugo_num'],
|
||||
'activity_id': loisirs_subscribe_info2['activity']['id'],
|
||||
'unit_id': loisirs_subscribe_info2['unit']['id'],
|
||||
'place_id': loisirs_subscribe_info2['place']['id'],
|
||||
'start_date': loisirs_subscribe_info2['unit']['dateStart'][:10],
|
||||
'end_date': loisirs_subscribe_info2['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
# no idIns provided to remove subscription later
|
||||
assert resp.json()['data'] == {'controlOK': True, 'message': None}
|
||||
|
||||
|
||||
def test_subscribe_to_basket(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
|
@ -95,10 +184,8 @@ def test_subscribe_with_conveyance(conn, create_data, loisirs_subscribe_info, re
|
|||
'activity_id': loisirs_subscribe_info['activity']['id'],
|
||||
'unit_id': loisirs_subscribe_info['unit']['id'],
|
||||
'place_id': loisirs_subscribe_info['place']['id'],
|
||||
'start_date': '%s-09-01' % reference_year,
|
||||
'end_date': '%s-08-31' % (reference_year + 1),
|
||||
'conveyanceSubscribe/idPlaceMorning': morning[0],
|
||||
'conveyanceSubscribe/idPlaceAfternoon': afternoon[0],
|
||||
'start_date': loisirs_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': loisirs_subscribe_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
|
@ -114,52 +201,61 @@ def test_subscribe_with_conveyance(conn, create_data, loisirs_subscribe_info, re
|
|||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_subscribe_with_recurrent_week(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
assert [(x['id'], x['day']) for x in loisirs_subscribe_info['info']['recurrent_week']] == [
|
||||
('1-C', 'Lundi'),
|
||||
('1-B', 'Lundi'),
|
||||
('2-C', 'Mardi'),
|
||||
('2-B', 'Mardi'),
|
||||
('3-C', 'Mercredi'),
|
||||
('3-B', 'Mercredi'),
|
||||
('4-C', 'Jeudi'),
|
||||
('4-B', 'Jeudi'),
|
||||
('5-C', 'Vendredi'),
|
||||
('5-B', 'Vendredi'),
|
||||
]
|
||||
def test_global_capacity(conn, create_data2, loisirs_subscribe_info3, reference_year):
|
||||
assert loisirs_subscribe_info3['info']['controlResult']['controlOK'] is True
|
||||
unlink(conn, create_data2['name_id'])
|
||||
link(conn, create_data2)
|
||||
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data['name_id']
|
||||
# subscribe Bart
|
||||
url = conn + '/add-person-subscription?NameID=%s' % create_data2['name_id']
|
||||
# url = conn + '/add-person-basket-subscription?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
'person_id': create_data['bart_num'],
|
||||
'activity_id': loisirs_subscribe_info['activity']['id'],
|
||||
'unit_id': loisirs_subscribe_info['unit']['id'],
|
||||
'place_id': loisirs_subscribe_info['place']['id'],
|
||||
'start_date': '%s-09-01' % reference_year,
|
||||
'end_date': '%s-08-31' % (reference_year + 1),
|
||||
'recurrent_week': ['1-B', '2-C'],
|
||||
'person_id': create_data2['bart_num'],
|
||||
'activity_id': loisirs_subscribe_info3['activity']['id'],
|
||||
'unit_id': loisirs_subscribe_info3['unit']['id'],
|
||||
'place_id': loisirs_subscribe_info3['place']['id'],
|
||||
'start_date': loisirs_subscribe_info3['unit']['dateStart'][:10],
|
||||
'end_date': loisirs_subscribe_info3['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
basket_id = resp.json()['data']['basket']['id']
|
||||
# basket_id = resp.json()['data']['basket']['id']
|
||||
|
||||
# there is now some bookings
|
||||
url = conn + '/read-activity-agenda?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
'person_id': create_data['bart_num'],
|
||||
'activity_id': loisirs_subscribe_info['activity']['id'],
|
||||
'start_date': '%s-09-01' % reference_year,
|
||||
'end_date': '%s-08-31' % (reference_year + 1),
|
||||
}
|
||||
# subscribe Lisa
|
||||
payload['person_id'] = create_data2['lisa_num']
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
# subscribe Maggie
|
||||
payload['person_id'] = create_data2['maggie_num']
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
# can't subscribe Huggo
|
||||
payload['person_id'] = create_data2['hugo_num']
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 1
|
||||
assert resp.json()['err_desc'] == ''
|
||||
|
||||
# check capacity on main catalog
|
||||
url = conn + '/read-activity-list'
|
||||
params = {'ref_date': datetime.date.today().strftime('%Y-%m-%d')}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert any(x['prefill'] for x in resp.json()['data'])
|
||||
for item in resp.json()['data']:
|
||||
if item['activity']['libelle'] == 'PUBLIK Vitrail Fusing 1/2 Je Adultes 2022/2023 - Mardi 14h-1':
|
||||
import pdb
|
||||
|
||||
# remove subscription
|
||||
url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
payload = {'basket_id': basket_id}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
pdb.set_trace()
|
||||
|
||||
# # remove subscriptions
|
||||
# url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
# payload = {'basket_id': basket_id}
|
||||
# resp = requests.post(url, json=payload)
|
||||
# resp.raise_for_status()
|
||||
# assert resp.json()['err'] == 0
|
||||
|
|
|
@ -2,18 +2,48 @@ import pytest
|
|||
import requests
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_catalog_personnalise_extrasco(extrasco_subscribe_info):
|
||||
assert extrasco_subscribe_info['info']['activity']['libelle1'] == 'ADL ELEMENTAIRE Maourine Avril 2023'
|
||||
assert extrasco_subscribe_info['info']['calendarGeneration']['code'] == 'REQUIRED'
|
||||
assert (
|
||||
extrasco_subscribe_info['info']['activity']['libelle1']
|
||||
== 'PUBLIK ADL ELEMENTAIRE Maourine JUIN 22/23(NE PAS UTILISER)'
|
||||
)
|
||||
assert extrasco_subscribe_info['info']['calendarGeneration']['code'] == 'NOT_REQUIRED'
|
||||
assert extrasco_subscribe_info['info']['billingInformation'] == {
|
||||
'modeFact': 'PRESENCE',
|
||||
'quantity': None,
|
||||
'unitPrice': 43.0,
|
||||
'unitPrice': 11.5,
|
||||
}
|
||||
assert extrasco_subscribe_info['info']['activity']['blocNoteList'] == [
|
||||
{
|
||||
'note': 'Lien vers le réglement intérieur :\r\nhttps://portail-parsifal.test.entrouvert.org/media/uploads/2023/03/23/flyer-sejour.pdf\r\nLien vers arrêté municipal :\r\nhttps://portail-parsifal.test.entrouvert.org/media/uploads/2023/04/05/arrete-municipal.pdf',
|
||||
'numIndex': 1,
|
||||
}
|
||||
]
|
||||
assert (
|
||||
extrasco_subscribe_info['info']['agenda'][0]['details']['activity_label']
|
||||
== 'ADL ELEMENTAIRE Maourine Juin'
|
||||
)
|
||||
|
||||
|
||||
def test_catalog_personnalise_extrasco2(extrasco_subscribe_info2):
|
||||
assert (
|
||||
extrasco_subscribe_info2['info']['activity']['libelle1']
|
||||
== 'PUBLIK ADL MATERNELLE Lardenne JUIN 22/23 (NEPAS UTILISER)'
|
||||
)
|
||||
assert extrasco_subscribe_info2['info']['calendarGeneration']['code'] == 'FORBIDDEN'
|
||||
assert extrasco_subscribe_info2['info']['billingInformation'] == {
|
||||
'modeFact': 'PRESENCE',
|
||||
'quantity': None,
|
||||
'unitPrice': 11.5,
|
||||
}
|
||||
assert extrasco_subscribe_info2['info']['activity']['blocNoteList'] == [
|
||||
{
|
||||
'note': 'Lien vers le réglement intérieur :\r\nhttps://portail-parsifal.test.entrouvert.org/media/uploads/2023/03/23/flyer-sejour.pdf\r\nLien vers arrêté municipal :\r\nhttps://portail-parsifal.test.entrouvert.org/media/uploads/2023/04/05/arrete-municipal.pdf',
|
||||
'numIndex': 1,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_direct_subscribe(conn, create_data, extrasco_subscribe_info, reference_year):
|
||||
assert extrasco_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
|
@ -34,7 +64,6 @@ def test_direct_subscribe(conn, create_data, extrasco_subscribe_info, reference_
|
|||
assert resp.json()['data'] == {'controlOK': True, 'message': None}
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_subscribe_with_conveyance(conn, create_data, extrasco_subscribe_info):
|
||||
assert extrasco_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
|
@ -72,20 +101,14 @@ def test_subscribe_with_conveyance(conn, create_data, extrasco_subscribe_info):
|
|||
assert resp.json()['err'] == 0
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_subscribe_with_recurrent_week(conn, create_data, extrasco_subscribe_info):
|
||||
assert extrasco_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
assert [(x['id'], x['day']) for x in extrasco_subscribe_info['info']['recurrent_week']] == [
|
||||
('1-C', 'Lundi'),
|
||||
('1-B', 'Lundi'),
|
||||
('2-C', 'Mardi'),
|
||||
('2-B', 'Mardi'),
|
||||
('3-C', 'Mercredi'),
|
||||
('3-B', 'Mercredi'),
|
||||
('4-C', 'Jeudi'),
|
||||
('4-B', 'Jeudi'),
|
||||
('5-C', 'Vendredi'),
|
||||
('5-B', 'Vendredi'),
|
||||
('1-X', 'Lundi'),
|
||||
('2-X', 'Mardi'),
|
||||
('3-X', 'Mercredi'),
|
||||
('4-X', 'Jeudi'),
|
||||
('5-X', 'Vendredi'),
|
||||
]
|
||||
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data['name_id']
|
||||
|
@ -96,7 +119,7 @@ def test_subscribe_with_recurrent_week(conn, create_data, extrasco_subscribe_inf
|
|||
'place_id': extrasco_subscribe_info['place']['id'],
|
||||
'start_date': extrasco_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info['unit']['dateEnd'][:10],
|
||||
'recurrent_week': ['1-B', '2-C'],
|
||||
'recurrent_week': ['1-X', '2-X'],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
|
@ -116,6 +139,16 @@ def test_subscribe_with_recurrent_week(conn, create_data, extrasco_subscribe_inf
|
|||
assert resp.json()['err'] == 0
|
||||
assert any(x['prefill'] for x in resp.json()['data'])
|
||||
|
||||
# check quantity into basket
|
||||
url = conn + '/get-baskets?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
line = resp.json()['data'][0]['lignes'][0]
|
||||
assert line['prixUnit'] == 11.5
|
||||
assert line['qte'] > 0
|
||||
assert line['montant'] == line['prixUnit'] * line['qte']
|
||||
|
||||
# remove subscription
|
||||
url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
payload = {'basket_id': basket_id}
|
||||
|
@ -124,7 +157,6 @@ def test_subscribe_with_recurrent_week(conn, create_data, extrasco_subscribe_inf
|
|||
assert resp.json()['err'] == 0
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_subscribe_with_agenda(conn, create_data, extrasco_subscribe_info):
|
||||
assert extrasco_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
|
@ -141,7 +173,23 @@ def test_subscribe_with_agenda(conn, create_data, extrasco_subscribe_info):
|
|||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
|
||||
# subscribe witout providing calendar
|
||||
def get_perisco_bookings():
|
||||
url = conn + '/read-child-agenda?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
'child_id': create_data['bart_num'],
|
||||
'start_date': extrasco_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return [
|
||||
item
|
||||
for item in resp.json()['data']
|
||||
if item['details']['activity_id'] == extrasco_subscribe_info['activity']['id']
|
||||
]
|
||||
|
||||
# subscribe without providing calendar
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'person_id': create_data['bart_num'],
|
||||
|
@ -158,6 +206,7 @@ def test_subscribe_with_agenda(conn, create_data, extrasco_subscribe_info):
|
|||
|
||||
# no booking
|
||||
assert not any(x['prefill'] for x in get_bookings())
|
||||
assert not any(x['prefill'] for x in get_perisco_bookings())
|
||||
|
||||
# book using info calendar gabarit (booking registered from w.c.s. form)
|
||||
assert len(extrasco_subscribe_info['info']['agenda']) > 0
|
||||
|
@ -179,6 +228,17 @@ def test_subscribe_with_agenda(conn, create_data, extrasco_subscribe_info):
|
|||
|
||||
# there is now 2 bookings
|
||||
assert len([x['prefill'] for x in get_bookings() if x['prefill'] is True]) == 2
|
||||
perisco_bookings = get_perisco_bookings()
|
||||
assert len([x['prefill'] for x in perisco_bookings if x['prefill'] is True]) == 2
|
||||
assert perisco_bookings[0]['details']['activity_label'] == 'ADL ELEMENTAIRE Maourine Juin'
|
||||
|
||||
# check quantity into basket
|
||||
url = conn + '/get-baskets?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
line = resp.json()['data'][0]['lignes'][0]
|
||||
assert (line['prixUnit'], line['qte'], line['montant']) == (11.5, 0.0, 0.0)
|
||||
|
||||
# unbook slots
|
||||
url = conn + '/update-activity-agenda/?NameID=%s' % create_data['name_id']
|
||||
|
@ -202,3 +262,61 @@ def test_subscribe_with_agenda(conn, create_data, extrasco_subscribe_info):
|
|||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_daily_capacity(conn, create_data2, extrasco_subscribe_info3):
|
||||
assert extrasco_subscribe_info3['info']['controlResult']['controlOK'] is True
|
||||
|
||||
def subscribe(child):
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
'person_id': create_data2['%s_num' % child],
|
||||
'activity_id': extrasco_subscribe_info3['activity']['id'],
|
||||
'unit_id': extrasco_subscribe_info3['unit']['id'],
|
||||
'place_id': extrasco_subscribe_info3['place']['id'],
|
||||
'start_date': extrasco_subscribe_info3['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info3['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']['basket']['id']
|
||||
|
||||
def book(child, slot):
|
||||
url = conn + '/update-activity-agenda/?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
'person_id': create_data2['%s_num' % child],
|
||||
'activity_id': extrasco_subscribe_info3['activity']['id'],
|
||||
'start_date': extrasco_subscribe_info3['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info3['unit']['dateEnd'][:10],
|
||||
'booking_list': [slot],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
return resp
|
||||
|
||||
# subscribe all family childs
|
||||
basket_id = subscribe('bart')
|
||||
for child in 'lisa', 'maggie', 'hugo':
|
||||
assert subscribe(child) == basket_id
|
||||
|
||||
# book all childs on the same day
|
||||
assert len(extrasco_subscribe_info3['info']['agenda']) > 0
|
||||
assert not any(x['prefill'] for x in extrasco_subscribe_info3['info']['agenda'])
|
||||
slots = [x['id'] for x in extrasco_subscribe_info3['info']['agenda'] if x['disabled'] is False]
|
||||
for child in 'bart', 'lisa', 'maggie':
|
||||
resp = book(child, slots[-1])
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['updated'] is True
|
||||
assert [x['booked'] for x in resp.json()['changes']] == [True]
|
||||
resp = book('hugo', slots[-1])
|
||||
assert resp.json()['err'] == 1
|
||||
assert resp.json()['err_desc'] == 0
|
||||
|
||||
# # remove subscriptions
|
||||
# url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
# payload = {'basket_id': basket_id}
|
||||
# resp = requests.post(url, json=payload)
|
||||
# resp.raise_for_status()
|
||||
# assert resp.json()['err'] == 0
|
||||
|
|
|
@ -2,8 +2,7 @@ import pytest
|
|||
import requests
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_basket_subscribe(conn, create_data, extrasco_subscribe_info, reference_year):
|
||||
def test_basket_subscribe_extrasco(conn, create_data, extrasco_subscribe_info, reference_year):
|
||||
assert extrasco_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
def get_baskets():
|
||||
|
@ -66,21 +65,23 @@ def test_basket_subscribe(conn, create_data, extrasco_subscribe_info, reference_
|
|||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert data['basket']['codeRegie'] == 105
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 1
|
||||
assert len({x['idIns'] for x in data['basket']['lignes']}) == 3
|
||||
assert len({x['idIns'] for x in data['basket']['lignes']}) == 1 # 3 sur Larden
|
||||
|
||||
assert len(subscriptions(create_data['bart_num'])) == 1
|
||||
subs = subscriptions(create_data['bart_num'])
|
||||
assert len(subs) == 1
|
||||
assert len(subs[0]['subscribesUnit']) == 1
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
# basket
|
||||
data = get_baskets()
|
||||
assert len(data) == 1
|
||||
assert data[0]['codeRegie'] == 105
|
||||
assert data[0]['text'] == 'ENFANCE LOISIRS ET PE'
|
||||
assert len(data[0]['lignes']) == 3
|
||||
assert data[0]['text'] == 'ENFANCE LOISIRS'
|
||||
assert len(data[0]['lignes']) == 1 # 3 sur Larden
|
||||
assert len({x['personneInfo']['numPerson'] for x in data[0]['lignes']}) == 1
|
||||
|
||||
# get 3 idIns because we subscribe a generic unit
|
||||
assert len({x['idIns'] for x in data[0]['lignes']}) == 3
|
||||
assert len({x['idIns'] for x in data[0]['lignes']}) == 1 # 3 sur Larden
|
||||
basket_id = data[0]['id']
|
||||
|
||||
# cannot subscribe Bart twice
|
||||
|
@ -114,12 +115,14 @@ def test_basket_subscribe(conn, create_data, extrasco_subscribe_info, reference_
|
|||
data = resp.json()['data']
|
||||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 2
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 1
|
||||
subs = subscriptions(create_data['maggie_num'])
|
||||
assert len(subs) == 1
|
||||
assert len(subs[0]['subscribesUnit']) == 1
|
||||
|
||||
# delete (generic) basket line for Bart
|
||||
data = get_baskets()
|
||||
assert len(data) == 1
|
||||
assert len(data[0]['lignes']) == 6
|
||||
assert len(data[0]['lignes']) == 2 # 6 sur Larden
|
||||
basket_id = data[0]['id']
|
||||
# line for the generic unit for Bart
|
||||
line_id = [
|
||||
|
@ -140,11 +143,11 @@ def test_basket_subscribe(conn, create_data, extrasco_subscribe_info, reference_
|
|||
data = resp.json()['data']
|
||||
assert data['codeRegie'] == 105
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['lignes']}) == 1
|
||||
assert len({x['idIns'] for x in data['lignes']}) == 3
|
||||
assert len({x['idIns'] for x in data['lignes']}) == 1 # 3 sur Larden
|
||||
data = get_baskets()
|
||||
assert len(data) == 1
|
||||
assert len(get_baskets()) == 1
|
||||
assert len(data[0]['lignes']) == 3
|
||||
assert len(data[0]['lignes']) == 1 # 3 sur Larden
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 1
|
||||
|
||||
|
@ -190,23 +193,227 @@ def test_basket_subscribe(conn, create_data, extrasco_subscribe_info, reference_
|
|||
assert [x['booked'] for x in resp.json()['changes']] == [True, True]
|
||||
assert len([x['prefill'] for x in get_bookings(create_data['maggie_num']) if x['prefill'] is True]) == 2
|
||||
|
||||
# validate basket
|
||||
url = conn + '/validate-basket?NameID=%s' % create_data['name_id']
|
||||
# delete basket
|
||||
# should be call by user or by cron job
|
||||
url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
payload = {'basket_id': basket_id}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert len(data['idInsLst']) == 6
|
||||
assert len(data['factureLst']) == 0 # No invoice #2187
|
||||
assert resp.json()['data'] == 'ok'
|
||||
assert get_baskets() == []
|
||||
|
||||
assert len(subscriptions(create_data['bart_num'])) == 1
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 1
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
def test_basket_subscribe_extrasco2(conn, create_data, extrasco_subscribe_info2, reference_year):
|
||||
"""Subscribing to a generic unit"""
|
||||
assert extrasco_subscribe_info2['info']['controlResult']['controlOK'] is True
|
||||
|
||||
def get_baskets():
|
||||
url = conn + '/get-baskets?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
|
||||
def subscribe(person_id):
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'person_id': person_id,
|
||||
'activity_id': extrasco_subscribe_info2['activity']['id'],
|
||||
'unit_id': extrasco_subscribe_info2['unit']['id'],
|
||||
'place_id': extrasco_subscribe_info2['place']['id'],
|
||||
'start_date': extrasco_subscribe_info2['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info2['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
return resp
|
||||
|
||||
def subscriptions(person_id):
|
||||
url = conn + '/read-subscribe-activity-list?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
'person_id': person_id,
|
||||
'nature': 'EXTRASCO',
|
||||
'school_year': '%s-%s' % (reference_year, reference_year + 1),
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
|
||||
def get_bookings(person_id):
|
||||
url = conn + '/read-activity-agenda?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
'person_id': person_id,
|
||||
'activity_id': extrasco_subscribe_info2['activity']['id'],
|
||||
'start_date': extrasco_subscribe_info2['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info2['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
|
||||
# no subscription
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
# empty basket
|
||||
assert get_baskets() == []
|
||||
|
||||
# subscribe Bart
|
||||
resp = subscribe(create_data['bart_num'])
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert data['basket']['codeRegie'] == 105
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 1
|
||||
assert len({x['idIns'] for x in data['basket']['lignes']}) == 1 # 3 expected
|
||||
|
||||
subs = subscriptions(create_data['bart_num'])
|
||||
assert len(subs) == 1
|
||||
assert len(subs[0]['subscribesUnit']) == 2
|
||||
assert [x['libelle'] for x in subs[0]['subscribesUnit']] == [
|
||||
'PUBLIK ADL MATERNELLE Lardenne JUIN 22/23 (NEPAS UTILISER)',
|
||||
'PUBLIK ADL MATER JOURNEE AVEC REPAS',
|
||||
]
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
# basket
|
||||
data = get_baskets()
|
||||
assert len(data) == 1
|
||||
assert data[0]['codeRegie'] == 105
|
||||
assert data[0]['text'] == 'ENFANCE LOISIRS'
|
||||
assert len(data[0]['lignes']) == 1 # 3 expected
|
||||
assert len({x['personneInfo']['numPerson'] for x in data[0]['lignes']}) == 1
|
||||
|
||||
# we should get 3 idIns because we subscribe a generic unit
|
||||
assert len({x['idIns'] for x in data[0]['lignes']}) == 1 # 3 expected
|
||||
basket_id = data[0]['id']
|
||||
|
||||
# cannot subscribe Bart twice
|
||||
resp = subscribe(create_data['bart_num'])
|
||||
assert resp.json()['err'] == 1
|
||||
assert 'E1019' in resp.json()['err_desc']
|
||||
assert len(get_baskets()) == 1
|
||||
|
||||
# delete basket
|
||||
# should be call by user or by cron job
|
||||
url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
payload = {'basket_id': basket_id}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['data'] == 'ok'
|
||||
assert get_baskets() == []
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
|
||||
# subscribe Bart
|
||||
resp = subscribe(create_data['bart_num'])
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 1
|
||||
assert len(subscriptions(create_data['bart_num'])) == 1
|
||||
|
||||
# subscribe Maggie
|
||||
resp = subscribe(create_data['maggie_num'])
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 2
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 1
|
||||
|
||||
# delete (generic) basket line for Bart
|
||||
data = get_baskets()
|
||||
assert len(data) == 1
|
||||
assert len(data[0]['lignes']) == 2 # 6 sur Larden
|
||||
basket_id = data[0]['id']
|
||||
# line for the generic unit for Bart
|
||||
line_id = [
|
||||
y['id']
|
||||
for x in data
|
||||
for y in x['lignes']
|
||||
if y['personneInfo']['numPerson'] == int(create_data['bart_num'])
|
||||
if y['inscription']['idUnit'] == extrasco_subscribe_info2['unit']['id']
|
||||
][0]
|
||||
url = conn + '/delete-basket-line?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'basket_id': basket_id,
|
||||
'line_id': line_id,
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert data['codeRegie'] == 105
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['lignes']}) == 1
|
||||
assert len({x['idIns'] for x in data['lignes']}) == 1 # 3 sur Larden
|
||||
data = get_baskets()
|
||||
assert len(data) == 1
|
||||
assert len(get_baskets()) == 1
|
||||
assert len(data[0]['lignes']) == 1 # 3 sur Larden
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 1
|
||||
|
||||
# re-subscribe Bart
|
||||
resp = subscribe(create_data['bart_num'])
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 2
|
||||
assert len(subscriptions(create_data['bart_num'])) == 1
|
||||
|
||||
# add bookings to Bart
|
||||
slots = [x['id'] for x in extrasco_subscribe_info2['info']['agenda'] if x['disabled'] is False]
|
||||
url = conn + '/update-activity-agenda/?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'person_id': create_data['bart_num'],
|
||||
'activity_id': extrasco_subscribe_info2['activity']['id'],
|
||||
'start_date': extrasco_subscribe_info2['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info2['unit']['dateEnd'][:10],
|
||||
'booking_list': [slots[0], slots[-1]],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['updated'] is True
|
||||
assert [x['booked'] for x in resp.json()['changes']] == [True, True]
|
||||
assert len([x['prefill'] for x in get_bookings(create_data['bart_num']) if x['prefill'] is True]) == 2
|
||||
|
||||
# add bookings to Maggie
|
||||
slots = [':'.join([create_data['maggie_num']] + x.split(':')[1:]) for x in slots]
|
||||
url = conn + '/update-activity-agenda/?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'person_id': create_data['maggie_num'],
|
||||
'activity_id': extrasco_subscribe_info2['activity']['id'],
|
||||
'start_date': extrasco_subscribe_info2['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info2['unit']['dateEnd'][:10],
|
||||
'booking_list': [slots[0], slots[-1]],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['updated'] is True
|
||||
assert [x['booked'] for x in resp.json()['changes']] == [True, True]
|
||||
assert len([x['prefill'] for x in get_bookings(create_data['maggie_num']) if x['prefill'] is True]) == 2
|
||||
|
||||
# delete basket
|
||||
url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
payload = {'basket_id': basket_id}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['data'] == 'ok'
|
||||
assert get_baskets() == []
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
|
||||
def test_basket_subscribe_loisirs(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
def get_baskets():
|
||||
|
@ -223,8 +430,8 @@ def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, referen
|
|||
'activity_id': loisirs_subscribe_info['activity']['id'],
|
||||
'unit_id': loisirs_subscribe_info['unit']['id'],
|
||||
'place_id': loisirs_subscribe_info['place']['id'],
|
||||
'start_date': '%s-09-01' % reference_year,
|
||||
'end_date': '%s-08-31' % (reference_year + 1),
|
||||
'start_date': loisirs_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': loisirs_subscribe_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
|
@ -240,24 +447,15 @@ def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, referen
|
|||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
|
||||
def get_bookings(person_id):
|
||||
url = conn + '/read-activity-agenda?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
'person_id': person_id,
|
||||
'activity_id': loisirs_subscribe_info['activity']['id'],
|
||||
'start_date': '%s-09-01' % reference_year,
|
||||
'end_date': '%s-08-31' % (reference_year + 1),
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
return [
|
||||
x
|
||||
for x in resp.json()['data']
|
||||
if x['libelle'] == 'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES'
|
||||
]
|
||||
|
||||
# no subscription
|
||||
# assert subscriptions(create_data['bart_num']) == []
|
||||
# assert subscriptions(create_data['maggie_num']) == []
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
# empty basket
|
||||
assert get_baskets() == []
|
||||
|
@ -270,9 +468,14 @@ def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, referen
|
|||
assert data['basket']['codeRegie'] == 109
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 1
|
||||
assert len({x['idIns'] for x in data['basket']['lignes']}) == 1
|
||||
|
||||
# assert len(subscriptions(create_data['bart_num'])) == 2 # 1 expected
|
||||
# assert subscriptions(create_data['maggie_num']) == []
|
||||
subs = subscriptions(create_data['bart_num'])
|
||||
assert len(subs) == 1
|
||||
assert len(subs[0]['subscribesUnit']) == 2
|
||||
assert [x['libelle'] for x in subs[0]['subscribesUnit']] == [
|
||||
'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES',
|
||||
'MERCREDI - 15h30/17h - 8/15Ans',
|
||||
]
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
# basket
|
||||
data = get_baskets()
|
||||
|
@ -282,6 +485,7 @@ def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, referen
|
|||
assert len(data[0]['lignes']) == 1
|
||||
assert len({x['personneInfo']['numPerson'] for x in data[0]['lignes']}) == 1
|
||||
assert len({x['idIns'] for x in data[0]['lignes']}) == 1
|
||||
assert data[0]['lignes'][0]['montant'] == 88.5
|
||||
basket_id = data[0]['id']
|
||||
|
||||
# cannot subscribe Bart twice
|
||||
|
@ -296,7 +500,20 @@ def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, referen
|
|||
data = resp.json()['data']
|
||||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 2
|
||||
# assert len(subscriptions(create_data['maggie_num'])) == 2 # 1 expected
|
||||
subs = subscriptions(create_data['maggie_num'])
|
||||
assert len(subs) == 1
|
||||
assert len(subs[0]['subscribesUnit']) == 2
|
||||
|
||||
# basket
|
||||
data = get_baskets()
|
||||
assert len(data) == 1
|
||||
assert data[0]['id'] == basket_id
|
||||
assert data[0]['codeRegie'] == 109
|
||||
assert data[0]['text'] == 'SPORT'
|
||||
assert len(data[0]['lignes']) == 2
|
||||
assert len({x['personneInfo']['numPerson'] for x in data[0]['lignes']}) == 2
|
||||
assert len({x['idIns'] for x in data[0]['lignes']}) == 2
|
||||
assert all(x['montant'] == 88.5 for x in data[0]['lignes'])
|
||||
|
||||
# delete basket line for Bart
|
||||
data = get_baskets()
|
||||
|
@ -326,8 +543,8 @@ def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, referen
|
|||
assert len(data) == 1
|
||||
assert len(get_baskets()) == 1
|
||||
assert len(data[0]['lignes']) == 1
|
||||
# assert len(subscriptions(create_data['bart_num'])) == 1 # 0 expected
|
||||
# assert len(subscriptions(create_data['maggie_num'])) == 2 # 1 expected
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 1
|
||||
|
||||
# delete basket
|
||||
url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
|
@ -337,4 +554,4 @@ def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, referen
|
|||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['data'] == 'ok'
|
||||
assert get_baskets() == []
|
||||
# assert len(subscriptions(create_data['bart_num'])) == 1 # 0 expected
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
|
|
@ -39,8 +39,7 @@ def test_direct_debit_order(conn, create_data):
|
|||
assert diff(res['data'], 'test_get_rl1_direct_debit_order.json')
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_pay_invoice(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
def test_pay_invoice_loisirs(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
def get_baskets():
|
||||
|
@ -57,8 +56,8 @@ def test_pay_invoice(conn, create_data, loisirs_subscribe_info, reference_year):
|
|||
'activity_id': loisirs_subscribe_info['activity']['id'],
|
||||
'unit_id': loisirs_subscribe_info['unit']['id'],
|
||||
'place_id': loisirs_subscribe_info['place']['id'],
|
||||
'start_date': '%s-09-01' % reference_year,
|
||||
'end_date': '%s-08-31' % (reference_year + 1),
|
||||
'start_date': loisirs_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': loisirs_subscribe_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
|
@ -121,7 +120,7 @@ def test_pay_invoice(conn, create_data, loisirs_subscribe_info, reference_year):
|
|||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert len(data) == 1
|
||||
assert data[0]['amount'] == '300'
|
||||
assert data[0]['amount'] == '177' # ou juste > 0 ?
|
||||
assert data[0]['online_payment'] is True
|
||||
assert data[0]['paid'] is False
|
||||
assert len({x['idIns'] for x in data[0]['maelis_item']['lineInvoiceList']}) == 2
|
||||
|
@ -153,7 +152,193 @@ def test_pay_invoice(conn, create_data, loisirs_subscribe_info, reference_year):
|
|||
data = resp.json()['data']
|
||||
assert len(data) == 1
|
||||
assert data[0]['amount'] == '0'
|
||||
assert data[0]['total_amount'] == '300'
|
||||
assert data[0]['total_amount'] == '177' # ou juste > 0 ?
|
||||
assert data[0]['online_payment'] is False
|
||||
assert data[0]['paid'] is True
|
||||
assert len({x['idIns'] for x in data[0]['maelis_item']['lineInvoiceList']}) == 2
|
||||
assert data[0]['maelis_item']['idInvoice'] == invoice_id
|
||||
assert data[0]['maelis_item']['numInvoice'] == invoice_num
|
||||
|
||||
|
||||
def test_payinvoice_extrasco(conn, create_data, extrasco_subscribe_info, reference_year):
|
||||
assert extrasco_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
def get_baskets():
|
||||
url = conn + '/get-baskets?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
|
||||
def subscribe(person_id):
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'person_id': person_id,
|
||||
'activity_id': extrasco_subscribe_info['activity']['id'],
|
||||
'unit_id': extrasco_subscribe_info['unit']['id'],
|
||||
'place_id': extrasco_subscribe_info['place']['id'],
|
||||
'start_date': extrasco_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
return resp
|
||||
|
||||
def subscriptions(person_id):
|
||||
url = conn + '/read-subscribe-activity-list?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
'person_id': person_id,
|
||||
'nature': 'EXTRASCO',
|
||||
'school_year': '%s-%s' % (reference_year, reference_year + 1),
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
|
||||
def get_bookings(person_id):
|
||||
url = conn + '/read-activity-agenda?NameID=%s' % create_data['name_id']
|
||||
params = {
|
||||
'person_id': person_id,
|
||||
'activity_id': extrasco_subscribe_info['activity']['id'],
|
||||
'start_date': extrasco_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info['unit']['dateEnd'][:10],
|
||||
}
|
||||
resp = requests.get(url, params=params)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
return resp.json()['data']
|
||||
|
||||
# no subscription
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
# empty basket
|
||||
assert get_baskets() == []
|
||||
|
||||
# subscribe Bart
|
||||
resp = subscribe(create_data['bart_num'])
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert data['basket']['codeRegie'] == 105
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 1
|
||||
assert len({x['idIns'] for x in data['basket']['lignes']}) == 1
|
||||
|
||||
assert len(subscriptions(create_data['bart_num'])) == 1
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
# basket
|
||||
data = get_baskets()
|
||||
assert len(data) == 1
|
||||
assert data[0]['codeRegie'] == 105
|
||||
assert len(data[0]['lignes']) == 1
|
||||
assert len({x['personneInfo']['numPerson'] for x in data[0]['lignes']}) == 1
|
||||
|
||||
assert len({x['idIns'] for x in data[0]['lignes']}) == 1
|
||||
basket_id = data[0]['id']
|
||||
|
||||
# subscribe Maggie
|
||||
resp = subscribe(create_data['maggie_num'])
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert data['controlResult'] == {'controlOK': True, 'message': None}
|
||||
assert len({x['personneInfo']['numPerson'] for x in data['basket']['lignes']}) == 2
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 1
|
||||
|
||||
# add bookings to Bart
|
||||
slots = [x['id'] for x in extrasco_subscribe_info['info']['agenda'] if x['disabled'] is False]
|
||||
url = conn + '/update-activity-agenda/?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'person_id': create_data['bart_num'],
|
||||
'activity_id': extrasco_subscribe_info['activity']['id'],
|
||||
'start_date': extrasco_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info['unit']['dateEnd'][:10],
|
||||
'booking_list': [slots[0], slots[-1]],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['updated'] is True
|
||||
assert len([x['prefill'] for x in get_bookings(create_data['bart_num']) if x['prefill'] is True]) > 0
|
||||
|
||||
# add bookings to Maggie
|
||||
slots = [':'.join([create_data['maggie_num']] + x.split(':')[1:]) for x in slots]
|
||||
url = conn + '/update-activity-agenda/?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
'person_id': create_data['maggie_num'],
|
||||
'activity_id': extrasco_subscribe_info['activity']['id'],
|
||||
'start_date': extrasco_subscribe_info['unit']['dateStart'][:10],
|
||||
'end_date': extrasco_subscribe_info['unit']['dateEnd'][:10],
|
||||
'booking_list': [slots[0], slots[-1]],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
assert resp.json()['updated'] is True
|
||||
assert len([x['prefill'] for x in get_bookings(create_data['maggie_num']) if x['prefill'] is True]) > 0
|
||||
|
||||
# validate basket
|
||||
url = conn + '/validate-basket?NameID=%s' % create_data['name_id']
|
||||
payload = {'basket_id': basket_id}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert len(data['idInsLst']) == 2
|
||||
assert len(data['factureLst']) == 1
|
||||
assert get_baskets() == []
|
||||
assert len(data['factureLst'][0]['lineInvoiceList']) == 2
|
||||
assert data['factureLst'][0]['regie']['code'] == 105
|
||||
invoice_num = data['factureLst'][0]['numInvoice']
|
||||
invoice_id = data['factureLst'][0]['idInvoice']
|
||||
|
||||
# get invoices paid
|
||||
url = conn + '/regie/105/invoices/history?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
assert resp.json() == {'data': [], 'err': 0}
|
||||
|
||||
# get invoices to be paid
|
||||
url = conn + '/regie/105/invoices?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert len(data) == 1
|
||||
assert int(data[0]['amount']) > 0
|
||||
assert data[0]['online_payment'] is True
|
||||
assert data[0]['paid'] is False
|
||||
assert len({x['idIns'] for x in data[0]['maelis_item']['lineInvoiceList']}) == 2
|
||||
assert data[0]['maelis_item']['idInvoice'] == invoice_id
|
||||
assert data[0]['maelis_item']['numInvoice'] == invoice_num
|
||||
|
||||
# payInvoice
|
||||
url = conn + '/regie/105/invoice/%s-%s/pay/' % (create_data['family_id'], invoice_num)
|
||||
payload = {
|
||||
'transaction_date': datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%S'),
|
||||
'transaction_id': 'xxx',
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
res = resp.json()
|
||||
assert res['data'] == 'ok'
|
||||
|
||||
# get invoices to be paid
|
||||
url = conn + '/regie/105/invoices?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
assert resp.json() == {'has_invoice_for_payment': True, 'data': [], 'err': 0}
|
||||
|
||||
# get invoices history
|
||||
url = conn + '/regie/105/invoices/history?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert len(data) == 1
|
||||
assert data[0]['amount'] == '0'
|
||||
assert int(data[0]['total_amount']) > 0
|
||||
assert data[0]['online_payment'] is False
|
||||
assert data[0]['paid'] is True
|
||||
assert len({x['idIns'] for x in data[0]['maelis_item']['lineInvoiceList']}) == 2
|
||||
|
|
|
@ -63,6 +63,8 @@ Réservations (agenda)
|
|||
.....................
|
||||
$ ./get_person_schedule_list.py -e dev -f 322423 -P 261768 A10055585940 -y 2023 -m 4
|
||||
$ ./update_person_schedule_list.py -e dev -f 322423 -P 261768 -a A10055585940 -u A10055585942 -D "2023-04-12" -A ADD_PRES_PREVI
|
||||
$ ./get_calendar_period_quantity.py -e dev -P 218841 -a A10056523296 -u A10056523298 -S 2023-06-12 -E 2023-06-23
|
||||
$ ./update_person_unit_basket.py -e dev -l S10056971773 -q 2
|
||||
|
||||
Réservations (semaine type)
|
||||
...........................
|
||||
|
|
|
@ -41,5 +41,5 @@ if __name__ == "__main__":
|
|||
parser.add_argument('--unit', '-u', default=UNIT_ID, help='unit id')
|
||||
parser.add_argument('--place', '-p', default=PLACE_ID, help='place id')
|
||||
parser.add_argument('--start', '-S', default=START_DATE, help='start date (ex: 2023-02-01)')
|
||||
parser.add_argument('--end', '-E', default=START_DATE, help='end date (ex: 2023-07-01)')
|
||||
parser.add_argument('--end', '-E', default=END_DATE, help='end date (ex: 2023-07-01)')
|
||||
check(parser.parse_args())
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
|
||||
import utils
|
||||
|
||||
PERSON_ID = '263781' # BART
|
||||
ACTIVITY_ID = 'A10055227963'
|
||||
UNIT_ID = 'A10055227965'
|
||||
START_DATE = '2023-02-01'
|
||||
END_DATE = '2023-07-01'
|
||||
|
||||
|
||||
def check(args):
|
||||
utils.configure_logging(args.verbose)
|
||||
client = utils.get_client(args.env, 'Activity')
|
||||
|
||||
result = client.service.getCalendarPeriodQuantity(
|
||||
numPerson=args.person,
|
||||
idAct=args.activity,
|
||||
idUni=args.unit,
|
||||
dateStart=args.start,
|
||||
dateEnd=args.end,
|
||||
)
|
||||
print(result)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--verbose', '-v', type=int, default=2, help='display errors')
|
||||
parser.add_argument('--env', '-e', default='integ', help='dev, test, integ, prod')
|
||||
parser.add_argument('--person', '-P', default=PERSON_ID, help='person id')
|
||||
parser.add_argument('--activity', '-a', default=ACTIVITY_ID, help='activity id')
|
||||
parser.add_argument('--unit', '-u', default=UNIT_ID, help='unit id')
|
||||
parser.add_argument('--start', '-S', default=START_DATE, help='start date (ex: 2023-02-01)')
|
||||
parser.add_argument('--end', '-E', default=END_DATE, help='end date (ex: 2023-07-01)')
|
||||
check(parser.parse_args())
|
|
@ -8,6 +8,9 @@ from zeep.helpers import serialize_object
|
|||
|
||||
FAMILY_ID = '322573' # NICO
|
||||
PERSON_ID = '263781' # BART
|
||||
YEAR = '2022'
|
||||
START_DATE = '2022-01-01'
|
||||
END_DATE = '2023-12-31'
|
||||
|
||||
|
||||
def check(args):
|
||||
|
@ -18,12 +21,9 @@ def check(args):
|
|||
getPersonCatalogueActivityRequestBean={
|
||||
'numDossier': args.family,
|
||||
'numPerson': args.person,
|
||||
# facultatif, pour fitrer sur une nature d'activité
|
||||
#'codeNatureActivity': None, # 'P' ou 'V'
|
||||
# facultatif, ne fait que retirer des lignes
|
||||
#'yearSchool': '2022', # aucune influence ici
|
||||
#'dateStartActivity': '2022-09-01',
|
||||
#'dateEndActivity': '2023-08-01',
|
||||
'yearSchool': args.year, # required to match sector (on extrasco only)
|
||||
'dateStartActivity': args.start,
|
||||
'dateEndActivity': args.end,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -90,4 +90,7 @@ if __name__ == "__main__":
|
|||
parser.add_argument('--family', '-f', default=FAMILY_ID, help='family id')
|
||||
parser.add_argument('--person', '-P', default=PERSON_ID, help='person id')
|
||||
parser.add_argument('--nature', '-n', default=None, help='code nature, ex: "X"')
|
||||
parser.add_argument('--year', '-y', default=YEAR, help='year (ex: 2022)')
|
||||
parser.add_argument('--start', '-S', default=START_DATE, help='start date (ex: 2022-01-01)')
|
||||
parser.add_argument('--end', '-E', default=END_DATE, help='end date (ex: 2023-12-31)')
|
||||
check(parser.parse_args())
|
||||
|
|
|
@ -7,17 +7,19 @@ import pprint
|
|||
import utils
|
||||
from zeep.helpers import serialize_object
|
||||
|
||||
YEAR = '2022'
|
||||
START_DATE = '2023-01-01'
|
||||
END_DATE = '2023-12-31'
|
||||
|
||||
|
||||
def check(args):
|
||||
utils.configure_logging(args.verbose)
|
||||
client = utils.get_client(args.env, 'Activity')
|
||||
|
||||
results = client.service.readActivityList(
|
||||
schoolyear=2022,
|
||||
# schoolyear=2023, # si je fais ça je perd "A10049327682 / RESTAURATION SCOLAIRE 22/23"
|
||||
dateStartCalend='2022-09-01',
|
||||
dateEndCalend='2023-08-31',
|
||||
# dateEndCalend='2022-09-01' # si je fais ça je perd "A10053187065 / Vacances Hivers 2023" et "A10053187089 / Vacances Ete 2023"
|
||||
schoolyear=args.year,
|
||||
dateStartCalend=args.start,
|
||||
dateEndCalend=args.end,
|
||||
)
|
||||
|
||||
if args.dump:
|
||||
|
@ -108,5 +110,8 @@ if __name__ == "__main__":
|
|||
parser.add_argument('--verbose', '-v', type=int, default=2, help='display errors')
|
||||
parser.add_argument('--env', '-e', default='integ', help='dev, test, integ, prod')
|
||||
parser.add_argument('--dump', '-d', default=False, action='store_true', help='dump')
|
||||
parser.add_argument('--year', '-y', default=YEAR, help='year (ex: 2022)')
|
||||
parser.add_argument('--start', '-S', default=START_DATE, help='start date (ex: 2022-01-01)')
|
||||
parser.add_argument('--end', '-E', default=END_DATE, help='end date (ex: 2023-12-31)')
|
||||
args = parser.parse_args()
|
||||
check(args)
|
||||
|
|
|
@ -35,7 +35,7 @@ if __name__ == "__main__":
|
|||
parser.add_argument('--env', '-e', default='integ', help='dev, test, integ, prod')
|
||||
parser.add_argument('--year', '-y', default=YEAR, help='year (ex: 2023)')
|
||||
parser.add_argument('--level', '-l', default=LEVEL, help='level (facultatif, ex: CP)')
|
||||
parser.add_argument('--street', '-s', default=STREET, help='year (ex: 2023)')
|
||||
parser.add_argument('--num', '-n', default=NUM, help='level (ex: CE1)')
|
||||
parser.add_argument('--num_comp', '-c', default=NUM_COMP, help='level (ex: CP)')
|
||||
parser.add_argument('--street', '-s', default=STREET, help='street id (ex: 2317)')
|
||||
parser.add_argument('--num', '-n', default=NUM, help='house number (ex: 4)')
|
||||
parser.add_argument('--num_comp', '-c', default=NUM_COMP, help='house number complement (ex: bis)')
|
||||
check(parser.parse_args())
|
||||
|
|
Loading…
Reference in New Issue