From 66955385d5017d07f09aa95c1be4cf5f3299a749 Mon Sep 17 00:00:00 2001
From: Nicolas ROCHE <nroche@entrouvert.com>
Date: Tue, 12 Jan 2021 09:33:21 +0100
Subject: [PATCH] maelis: provide dates to subscription web-service (#50059)

---
 passerelle/apps/maelis/models.py           |  3 +-
 passerelle/apps/maelis/utils.py            |  8 +++-
 passerelle/locale/fr/LC_MESSAGES/django.po |  2 +-
 tests/data/maelis/child_activities.json    | 46 ++++++++++++++++++++++
 4 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/passerelle/apps/maelis/models.py b/passerelle/apps/maelis/models.py
index dfa0547a..52e5ec44 100644
--- a/passerelle/apps/maelis/models.py
+++ b/passerelle/apps/maelis/models.py
@@ -427,27 +427,28 @@ class Maelis(BaseResource):
                 raise APIError("input isn't well formatted, YYYY-MM-DD expected")
         if not queryDate:
             start_date = timezone.now().date()
         if start_date.strftime('%m-%d') >= '05-01':
             # start displaying next year activities on may
             school_year = start_date.year
         else:
             school_year = start_date.year - 1
+        start_date = utils.get_datetime('%s-08-01' % (school_year)).date()
         end_date = utils.get_datetime('%s-07-31' % (school_year + 1)).date()
 
         child_info = self.get_child_info(NameID, childID)
         r = self.call('ActivityService?wsdl', 'readActivityList',
                       schoolyear=school_year,
                       numPerson=childID,
                       dateStartCalend=start_date,
                       dateEndCalend=end_date)
 
         flatted_activities = utils.flatten_activities(
-            serialize_object(r), [school_year, school_year + 1])
+            serialize_object(r), start_date, end_date)
         utils.mark_subscribed_flatted_activities(flatted_activities, child_info)
         data = utils.flatted_activities_as_list(flatted_activities, subscribingStatus)
         return {'data': data}
 
     @endpoint(
         display_category=_('Activities'),
         perm='can_access',
         display_order=3,
diff --git a/passerelle/apps/maelis/utils.py b/passerelle/apps/maelis/utils.py
index 66905eba..afecda57 100644
--- a/passerelle/apps/maelis/utils.py
+++ b/passerelle/apps/maelis/utils.py
@@ -201,17 +201,17 @@ def decompose_event(event):
         new_event['datetime'] = '%s %s' % (date_string, component['time'])
         new_event['slot_id'] = "%s%s" % (composition['virtual_unit'], component_id)
         new_event['id'] = '%s-%s-%s' % (
             date_string, event['category_id'], new_event['slot_id'])
         new_event['text'] = component['text']
         yield new_event
 
 
-def flatten_activities(activities, years):
+def flatten_activities(activities, start_date, end_date):
     data = {}
     for activity in activities:
         if activity.get('openDayList'):
             del activity['openDayList']
         activity_id = activity['activityPortail']['idAct']
         activity_text = activity['activityPortail']['label']
         activity_obj = deepcopy(activity)
         del activity_obj['unitPortailList']
@@ -219,20 +219,22 @@ def flatten_activities(activities, years):
             activity_obj['activityPortail']['activityType'] = {
                 "code" : "?",
                 "libelle" : "Inconnu",
                 "natureSpec" : {
                     "code" : "?",
                     "libelle" : "Inconnu"
                 }
             }
+        activity_start_date = activity['activityPortail']['dateStart'] or start_date
+        activity_end_date = activity['activityPortail']['dateEnd'] or end_date
 
         # compute weekly planning mask parameter to use for subscribing
         planning_masks = []
-        for year in years:
+        for year in range(start_date.year, end_date.year+1):
             for item in activity['activityPortail']['weeklyCalendarActivityList']:
                 if item['yearCalendar'] == year:
                     planning_masks.append(item['weeklyCalendarStr'])
                     break
         if planning_masks:
             activity_weekly_planning_mask = ""
             for letters in zip(*planning_masks):
                 if '1' in letters:
@@ -267,16 +269,18 @@ def flatten_activities(activities, years):
                     'text': '%s / %s / %s' % (activity_text, unit_text, place_text),
                     'activity_id': activity_id,
                     'unit_id': unit_id,
                     'place_id': place_id,
                     'activity_text': activity_text,
                     'unit_text': unit_text,
                     'place_text': place_text,
                     'activity_weekly_planning_mask': activity_weekly_planning_mask,
+                    'activity_start_date': activity_start_date,
+                    'activity_end_date': activity_end_date,
                     'unit_calendar_letter': unit_calendar_letter,
                     'unit_weekly_planning': unit_weekly_planning,
                     'activity_object': activity_obj,
                     'unit_object': unit_obj,
                     'place_object': place,
                 }
             units[unit_id] = places
         data[activity_id] = units
diff --git a/passerelle/locale/fr/LC_MESSAGES/django.po b/passerelle/locale/fr/LC_MESSAGES/django.po
index 3bfc86a7..ff7ced99 100644
--- a/passerelle/locale/fr/LC_MESSAGES/django.po
+++ b/passerelle/locale/fr/LC_MESSAGES/django.po
@@ -2153,17 +2153,17 @@ msgstr ""
 "Décompose les événements reliés à des parties de journées si positionné"
 
 #: apps/maelis/models.py:504
 msgid "Subscribe"
 msgstr "Inscription"
 
 #: apps/maelis/models.py:508 apps/maelis/models.py:540
 msgid "Activity ID"
-msgstr "Identifiant de l'activités"
+msgstr "Identifiant de l'activité"
 
 #: apps/maelis/models.py:509
 msgid "Unit ID"
 msgstr "Identifiant de l'unité"
 
 #: apps/maelis/models.py:510
 msgid "Place ID"
 msgstr "Identifiant du lieu"
diff --git a/tests/data/maelis/child_activities.json b/tests/data/maelis/child_activities.json
index 0fa62928..2a03cf87 100644
--- a/tests/data/maelis/child_activities.json
+++ b/tests/data/maelis/child_activities.json
@@ -1,11 +1,12 @@
 {
     "data": [
         {
+            "activity_end_date": "2021-07-06T00:00:00+02:00",
             "activity_id": "A10003121692",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "ACCMAT",
                         "libelle": "Accueil du matin",
                         "natureSpec": {
                             "code": "A",
@@ -33,16 +34,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0010011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-09-01T00:00:00+02:00",
             "activity_text": "1 2020-2021 GARDERIE MATIN",
             "activity_weekly_planning_mask": "0010011",
             "id": "A10003121692-A10003121694-A10000000201",
             "place_id": "A10000000201",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -96,16 +98,17 @@
                 "topCESU": "O",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "1 2020-2021 GARDERIE MATIN",
             "unit_weekly_planning": "XX1XX11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-06T00:00:00+02:00",
             "activity_id": "A10003121692",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "ACCMAT",
                         "libelle": "Accueil du matin",
                         "natureSpec": {
                             "code": "A",
@@ -133,16 +136,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0010011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-09-01T00:00:00+02:00",
             "activity_text": "1 2020-2021 GARDERIE MATIN",
             "activity_weekly_planning_mask": "0010011",
             "id": "A10003121692-A10003121694-A10000000211",
             "place_id": "A10000000211",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -196,16 +200,17 @@
                 "topCESU": "O",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "1 2020-2021 GARDERIE MATIN",
             "unit_weekly_planning": "XX1XX11",
             "user_subscribing_status": "subscribed"
         },
         {
+            "activity_end_date": "2021-07-03T00:00:00+02:00",
             "activity_id": "A10003123490",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "RESTSCOL",
                         "libelle": "Restauration scolaire",
                         "natureSpec": {
                             "code": "R",
@@ -233,16 +238,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0010011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-09-02T00:00:00+02:00",
             "activity_text": "2 2020-2021  RESTAURATION SCOLAIRE",
             "activity_weekly_planning_mask": "0010011",
             "id": "A10003123490-A10003123492-A10000000211",
             "place_id": "A10000000211",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -333,16 +339,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "2 2020-2021  RESTAURATION SCOLAIRE",
             "unit_weekly_planning": "XX1XX11",
             "user_subscribing_status": "subscribed"
         },
         {
+            "activity_end_date": "2021-07-03T00:00:00+02:00",
             "activity_id": "A10003123507",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "ACCSOIR",
                         "libelle": "Accueil du soir",
                         "natureSpec": {
                             "code": "A",
@@ -366,16 +373,17 @@
                     "schoolControl": null,
                     "schoolNature": null,
                     "schoolYear": 2020,
                     "waitIfComplete": "N",
                     "weeklyCalendarActivityList": []
                 },
                 "openDayList": []
             },
+            "activity_start_date": "2020-09-02T00:00:00+02:00",
             "activity_text": "3 2020-2021 GARDERIE SOIR",
             "activity_weekly_planning_mask": "0000000",
             "id": "A10003123507-A10003123509-A10000000201",
             "place_id": "A10000000201",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -429,16 +437,17 @@
                 "topCESU": "O",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "3 2020-2021 GARDERIE SOIR",
             "unit_weekly_planning": "XXXXXXX",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-03T00:00:00+02:00",
             "activity_id": "A10003123507",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "ACCSOIR",
                         "libelle": "Accueil du soir",
                         "natureSpec": {
                             "code": "A",
@@ -462,16 +471,17 @@
                     "schoolControl": null,
                     "schoolNature": null,
                     "schoolYear": 2020,
                     "waitIfComplete": "N",
                     "weeklyCalendarActivityList": []
                 },
                 "openDayList": []
             },
+            "activity_start_date": "2020-09-02T00:00:00+02:00",
             "activity_text": "3 2020-2021 GARDERIE SOIR",
             "activity_weekly_planning_mask": "0000000",
             "id": "A10003123507-A10003123509-A10000000211",
             "place_id": "A10000000211",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -525,16 +535,17 @@
                 "topCESU": "O",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "3 2020-2021 GARDERIE SOIR",
             "unit_weekly_planning": "XXXXXXX",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -562,16 +573,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131861-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -636,16 +648,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "HIVER 2EME SEMAINE",
             "unit_weekly_planning": "ccccc11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -673,16 +686,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131861-A10002132200",
             "place_id": "A10002132200",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -747,16 +761,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "HIVER 2EME SEMAINE",
             "unit_weekly_planning": "ccccc11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -784,16 +799,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131879-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -858,16 +874,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "TOUSSAINT 2EME SEMAINE",
             "unit_weekly_planning": "DDDDD11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -895,16 +912,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131879-A10002132200",
             "place_id": "A10002132200",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -969,16 +987,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "TOUSSAINT 2EME SEMAINE",
             "unit_weekly_planning": "DDDDD11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1006,16 +1025,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131882-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1080,16 +1100,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "TOUSSAINT 1 ERE SEMAINE",
             "unit_weekly_planning": "CCCCC11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1117,16 +1138,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131882-A10002132200",
             "place_id": "A10002132200",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1191,16 +1213,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "TOUSSAINT 1 ERE SEMAINE",
             "unit_weekly_planning": "CCCCC11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1228,16 +1251,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131903-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1302,16 +1326,17 @@
                 "topCESU": "O",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "NOEL 2EME SEMAINE",
             "unit_weekly_planning": "BBBBB11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1339,16 +1364,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131903-A10002132200",
             "place_id": "A10002132200",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1413,16 +1439,17 @@
                 "topCESU": "O",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "NOEL 2EME SEMAINE",
             "unit_weekly_planning": "BBBBB11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1450,16 +1477,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131909-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1524,16 +1552,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "NOEL 1ERE SEMAINE",
             "unit_weekly_planning": "JJJJJ11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-02T00:00:00+02:00",
             "activity_id": "A10003131850",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1561,16 +1590,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-07-01T00:00:00+02:00",
             "activity_text": "2020-2021 ALSH VACANCES PAGNOL (CAPA)",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003131850-A10003131909-A10002132200",
             "place_id": "A10002132200",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1635,16 +1665,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "NOEL 1ERE SEMAINE",
             "unit_weekly_planning": "JJJJJ11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-03T00:00:00+02:00",
             "activity_id": "A10003132030",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1672,16 +1703,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "1101111",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-09-02T00:00:00+02:00",
             "activity_text": "2020-2021 CENTRE DE LOISIRS MERCREDI",
             "activity_weekly_planning_mask": "1101111",
             "id": "A10003132030-A10003132034-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1735,16 +1767,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "JOURNEE",
             "unit_weekly_planning": "11A1111",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-03T00:00:00+02:00",
             "activity_id": "A10003132030",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1772,16 +1805,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "1101111",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-09-02T00:00:00+02:00",
             "activity_text": "2020-2021 CENTRE DE LOISIRS MERCREDI",
             "activity_weekly_planning_mask": "1101111",
             "id": "A10003132030-A10003132036-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1835,16 +1869,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "MATIN",
             "unit_weekly_planning": "11B1111",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-03T00:00:00+02:00",
             "activity_id": "A10003132030",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1872,16 +1907,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "1101111",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-09-02T00:00:00+02:00",
             "activity_text": "2020-2021 CENTRE DE LOISIRS MERCREDI",
             "activity_weekly_planning_mask": "1101111",
             "id": "A10003132030-A10003132038-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -1935,16 +1971,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "MATIN ET REPAS",
             "unit_weekly_planning": "11C1111",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-03T00:00:00+02:00",
             "activity_id": "A10003132030",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "?",
                         "libelle": "Inconnu",
                         "natureSpec": {
                             "code": "?",
@@ -1972,16 +2009,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "1101111",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-09-02T00:00:00+02:00",
             "activity_text": "2020-2021 CENTRE DE LOISIRS MERCREDI",
             "activity_weekly_planning_mask": "1101111",
             "id": "A10003132030-A10003132040-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -2035,16 +2073,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "APRES MIDI",
             "unit_weekly_planning": "11D1111",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-31",
             "activity_id": "A10003132090",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "LOIVAC",
                         "libelle": "(Loisirs Vacances)",
                         "natureSpec": {
                             "code": "L",
@@ -2072,16 +2111,17 @@
                     "weeklyCalendarActivityList": [
                         {
                             "weeklyCalendarStr": "0000011",
                             "yearCalendar": 2020
                         }
                     ]
                 }
             },
+            "activity_start_date": "2020-01-01T00:00:00+02:00",
             "activity_text": "COURS DE DANSE",
             "activity_weekly_planning_mask": "0000011",
             "id": "A10003132090-A10003132091-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -2123,16 +2163,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "COURS DE DANSE",
             "unit_weekly_planning": "XXXXX11",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-31",
             "activity_id": "A10003132150",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "LOIVAC",
                         "libelle": "(Loisirs Vacances)",
                         "natureSpec": {
                             "code": "L",
@@ -2156,16 +2197,17 @@
                     "schoolControl": null,
                     "schoolNature": null,
                     "schoolYear": 2020,
                     "waitIfComplete": "N",
                     "weeklyCalendarActivityList": []
                 },
                 "openDayList": []
             },
+            "activity_start_date": "2020-01-01T00:00:00+02:00",
             "activity_text": "LASERQUEST",
             "activity_weekly_planning_mask": "0000000",
             "id": "A10003132150-A10003132152-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -2207,16 +2249,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "LASERQUEST",
             "unit_weekly_planning": "XXXXXXX",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-31",
             "activity_id": "A10003132271",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "LOIVAC",
                         "libelle": "(Loisirs Vacances)",
                         "natureSpec": {
                             "code": "L",
@@ -2240,16 +2283,17 @@
                     "schoolControl": null,
                     "schoolNature": null,
                     "schoolYear": 2020,
                     "waitIfComplete": "N",
                     "weeklyCalendarActivityList": []
                 },
                 "openDayList": []
             },
+            "activity_start_date": "2020-09-02T00:00:00+02:00",
             "activity_text": "EQUITATION",
             "activity_weekly_planning_mask": "0000000",
             "id": "A10003132271-A10003132273-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
@@ -2291,16 +2335,17 @@
                 "topCESU": "N",
                 "typeCtrlPlace": "N"
             },
             "unit_text": "EQUITATION",
             "unit_weekly_planning": "XXXXXXX",
             "user_subscribing_status": "not-subscribed"
         },
         {
+            "activity_end_date": "2021-07-31",
             "activity_id": "A10003132293",
             "activity_object": {
                 "activityPortail": {
                     "activityType": {
                         "code": "LOIVAC",
                         "libelle": "(Loisirs Vacances)",
                         "natureSpec": {
                             "code": "L",
@@ -2324,16 +2369,17 @@
                     "schoolControl": null,
                     "schoolNature": null,
                     "schoolYear": 2020,
                     "waitIfComplete": "N",
                     "weeklyCalendarActivityList": []
                 },
                 "openDayList": []
             },
+            "activity_start_date": "2020-01-01T00:00:00+02:00",
             "activity_text": "SORTIE MUSEE",
             "activity_weekly_planning_mask": "0000000",
             "id": "A10003132293-A10003132295-A10000000212",
             "place_id": "A10000000212",
             "place_object": {
                 "adresse": {
                     "idStreet": null,
                     "num": 0,
-- 
2.29.2

