toulouse-maelis: [functests] update loisirs basket tests (#77634)
This commit is contained in:
parent
ffde70564a
commit
0b3d06e932
|
@ -33,7 +33,7 @@ FAMILY_PAYLOAD = {
|
|||
'num': '4',
|
||||
'street1': 'requeried having idStreet provided',
|
||||
'town': 'Toulouse',
|
||||
'zipcode': '31000',
|
||||
'zipcode': '31400',
|
||||
},
|
||||
},
|
||||
'rl2': {
|
||||
|
@ -455,8 +455,8 @@ def create_data(request, conn, reference_year):
|
|||
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',
|
||||
'dateStart': '%s-09-01' % (reference_year),
|
||||
'dateEnd': '3000-08-31',
|
||||
'mtt': '5000.0',
|
||||
'cdquo': '1',
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"street1": "RUE ACHILLE VIADIEU",
|
||||
"street2": null,
|
||||
"town": "Toulouse",
|
||||
"zipcode": "31000",
|
||||
"zipcode": "31400",
|
||||
"idStreet_text": "RUE ACHILLE VIADIEU"
|
||||
},
|
||||
"contact": {
|
||||
|
@ -45,8 +45,8 @@
|
|||
"quotientList": [
|
||||
{
|
||||
"yearRev": 2022,
|
||||
"dateStart": "2023-05-15T00:00:00+02:00",
|
||||
"dateEnd": "3000-12-31T00:00:00+01:00",
|
||||
"dateStart": "2022-09-01T00:00:00+02:00",
|
||||
"dateEnd": "3000-08-31T00:00:00+02:00",
|
||||
"mtt": 5000.0,
|
||||
"cdquo": "1",
|
||||
"codeUti": null,
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
"street1": "RUE ACHILLE VIADIEU",
|
||||
"street2": null,
|
||||
"town": "Toulouse",
|
||||
"zipcode": "31000",
|
||||
"zipcode": "31400",
|
||||
"idStreet_text": "RUE ACHILLE VIADIEU"
|
||||
},
|
||||
"contact": {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"street1": "RUE ACHILLE VIADIEU",
|
||||
"street2": null,
|
||||
"town": "Toulouse",
|
||||
"zipcode": "31000",
|
||||
"zipcode": "31400",
|
||||
"idStreet_text": "RUE ACHILLE VIADIEU"
|
||||
},
|
||||
"contact": {
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
},
|
||||
{
|
||||
"yearRev": 2022,
|
||||
"dateStart": "2023-05-15T00:00:00+02:00",
|
||||
"dateEnd": "3000-12-31T00:00:00+01:00",
|
||||
"dateStart": "2022-09-01T00:00:00+02:00",
|
||||
"dateEnd": "3000-08-31T00:00:00+02:00",
|
||||
"mtt": 5000.0,
|
||||
"cdquo": "1",
|
||||
"codeUti": null,
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"street1": "RUE ACHILLE VIADIEU",
|
||||
"street2": null,
|
||||
"town": "Toulouse",
|
||||
"zipcode": "31000",
|
||||
"zipcode": "31400",
|
||||
"idStreet_text": "RUE ACHILLE VIADIEU"
|
||||
},
|
||||
"contact": {
|
||||
|
|
|
@ -3,7 +3,7 @@ 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.
|
||||
|
@ -57,6 +57,7 @@ def test_catalog_general_loisirs(conn, update_data):
|
|||
},
|
||||
'day': {'text': 'Jours', 'data': {'3': 'Mercredi'}, 'order': ['3']},
|
||||
'place': {'text': 'Lieu', 'data': {'A10053179757': 'ARGOULETS'}, 'order': ['A10053179757']},
|
||||
'service': {'text': 'Service', 'data': {'A10049329046': 'Sports'}, 'order': ['A10049329046']},
|
||||
}
|
||||
if item['text'] == 'Promenade forêt enchantée, TEST promenade forêt enchantée, TERRITOIRE OUEST':
|
||||
assert item['criterias'] == {
|
||||
|
@ -81,6 +82,7 @@ def test_catalog_general_loisirs(conn, update_data):
|
|||
'data': {'A10056517597': 'TERRITOIRE OUEST'},
|
||||
'order': ['A10056517597'],
|
||||
},
|
||||
'service': {'text': 'Service', 'data': {'A10049329050': 'Sports'}, 'order': ['A10049329050']},
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,16 +91,40 @@ def test_catalog_personnalise_loisirs(loisirs_subscribe_info):
|
|||
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']] == [
|
||||
('3-F', 'Mercredi')
|
||||
]
|
||||
assert loisirs_subscribe_info['info']['billingInformation'] == {
|
||||
'modeFact': 'PRESENCE',
|
||||
'quantity': None,
|
||||
'modeFact': 'FORFAIT',
|
||||
'quantity': 1.0,
|
||||
'unitPrice': 88.5,
|
||||
}
|
||||
|
||||
|
||||
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 = {
|
||||
|
@ -106,8 +132,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()
|
||||
|
@ -119,6 +145,8 @@ def test_direct_subscribe(conn, create_data, loisirs_subscribe_info, reference_y
|
|||
|
||||
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)
|
||||
|
||||
url = conn + '/add-person-subscription?NameID=%s' % create_data2['name_id']
|
||||
payload = {
|
||||
|
@ -126,8 +154,8 @@ def test_direct_subscribe_out_town(conn, create_data2, loisirs_subscribe_info2,
|
|||
'activity_id': loisirs_subscribe_info2['activity']['id'],
|
||||
'unit_id': loisirs_subscribe_info2['unit']['id'],
|
||||
'place_id': loisirs_subscribe_info2['place']['id'],
|
||||
'start_date': '%s-09-01' % reference_year,
|
||||
'end_date': '%s-08-31' % (reference_year + 1),
|
||||
'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()
|
||||
|
@ -137,19 +165,10 @@ def test_direct_subscribe_out_town(conn, create_data2, loisirs_subscribe_info2,
|
|||
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):
|
||||
def test_subscribe_to_basket(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
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
|
||||
unlink(conn, create_data['name_id'])
|
||||
link(conn, create_data)
|
||||
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data['name_id']
|
||||
payload = {
|
||||
|
@ -157,10 +176,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()
|
||||
|
@ -173,55 +190,3 @@ def test_subscribe_with_conveyance(conn, create_data, loisirs_subscribe_info, re
|
|||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
|
||||
|
||||
@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'),
|
||||
]
|
||||
|
||||
url = conn + '/add-person-basket-subscription?NameID=%s' % create_data['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'],
|
||||
}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
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),
|
||||
}
|
||||
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'])
|
||||
|
||||
# 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
|
||||
|
|
|
@ -205,7 +205,6 @@ def test_basket_subscribe(conn, create_data, extrasco_subscribe_info, reference_
|
|||
assert len(subscriptions(create_data['maggie_num'])) == 1
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_basket_subscribe_bis(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
|
@ -223,8 +222,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 +239,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 +260,8 @@ 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']) == []
|
||||
assert len(subscriptions(create_data['bart_num'])) == 2 # 1 expected
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
# basket
|
||||
data = get_baskets()
|
||||
|
@ -282,6 +271,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 +286,18 @@ 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
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 2 # 1 expected
|
||||
|
||||
# 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 +327,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 len(subscriptions(create_data['bart_num'])) == 0
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 2
|
||||
|
||||
# delete basket
|
||||
url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
|
@ -337,4 +338,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 len(subscriptions(create_data['maggie_num'])) == 0
|
||||
|
|
|
@ -39,7 +39,6 @@ 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):
|
||||
assert loisirs_subscribe_info['info']['controlResult']['controlOK'] is True
|
||||
|
||||
|
@ -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,7 @@ 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
|
||||
|
|
|
@ -217,8 +217,8 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
'Activity',
|
||||
'readActivityList',
|
||||
schoolyear=year,
|
||||
dateStartCalend='%s-09-01' % year,
|
||||
dateEndCalend='%s-08-31' % (year + 1),
|
||||
dateStartCalend='%s-01-01' % year,
|
||||
dateEndCalend='%s-12-31' % (year + 1),
|
||||
)
|
||||
|
||||
def update_activity_referentials(self):
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue