2023-01-05 10:20:42 +01:00
|
|
|
# Copyright (C) 2023 Entr'ouvert
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Affero General Public License as published
|
|
|
|
# by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
BOOKING_SCHEMA = {
|
|
|
|
'type': 'object',
|
|
|
|
'properties': {
|
|
|
|
'child_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'minLength': 1,
|
|
|
|
'maxLength': 8,
|
|
|
|
},
|
|
|
|
'booking_list': {
|
|
|
|
'type': 'array',
|
|
|
|
'items': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '[A-Za-z0-9]+:[- A-Za-z0-9]+:[0-9]{4}-[0-9]{2}-[0-9]{2}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'start_date': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
|
|
},
|
|
|
|
'end_date': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'required': [
|
|
|
|
'child_id',
|
|
|
|
'booking_list',
|
|
|
|
'start_date',
|
|
|
|
'end_date',
|
|
|
|
],
|
|
|
|
}
|
2023-01-22 19:09:01 +01:00
|
|
|
|
2023-03-19 10:20:48 +01:00
|
|
|
BOOKING_ACTIVITY_SCHEMA = {
|
|
|
|
'type': 'object',
|
|
|
|
'properties': {
|
|
|
|
'person_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'minLength': 1,
|
|
|
|
'maxLength': 8,
|
|
|
|
},
|
|
|
|
'activity_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[A-Za-z0-9]+$',
|
|
|
|
},
|
|
|
|
'booking_list': {
|
|
|
|
'type': 'array',
|
|
|
|
'items': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[A-Za-z0-9]+:[A-Za-z0-9]+:[A-Za-z0-9]+:[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'start_date': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
|
|
},
|
|
|
|
'end_date': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'required': [
|
|
|
|
'person_id',
|
|
|
|
'activity_id',
|
|
|
|
'booking_list',
|
|
|
|
'start_date',
|
|
|
|
'end_date',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2023-02-19 16:02:15 +01:00
|
|
|
UPDATE_RECURRENT_WEEK_SCHEMA = {
|
|
|
|
'type': 'object',
|
|
|
|
'properties': {
|
|
|
|
'person_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[0-9]+$',
|
|
|
|
},
|
|
|
|
'activity_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[A-Za-z0-9]+$',
|
|
|
|
},
|
|
|
|
'start_date': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
|
|
},
|
|
|
|
'end_date': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^([0-9]{4}-[0-9]{2}-[0-9]{2}){0,1}$',
|
|
|
|
},
|
|
|
|
'recurrent_week': {
|
|
|
|
'type': 'array',
|
|
|
|
'items': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[1-7]-[A-Z]$',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'required': [
|
|
|
|
'person_id',
|
|
|
|
'activity_id',
|
|
|
|
'start_date',
|
|
|
|
'end_date',
|
|
|
|
'recurrent_week',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2023-01-22 19:09:01 +01:00
|
|
|
SUBSCRIPTION_SCHEMA = {
|
|
|
|
'type': 'object',
|
|
|
|
'properties': {
|
|
|
|
'person_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'minLength': 1,
|
|
|
|
'maxLength': 8,
|
|
|
|
},
|
|
|
|
'activity_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '[A-Za-z0-9]+',
|
|
|
|
},
|
|
|
|
'unit_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '[A-Za-z0-9]+',
|
|
|
|
},
|
|
|
|
'place_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '[A-Za-z0-9]+',
|
|
|
|
},
|
|
|
|
'start_date': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
|
|
},
|
|
|
|
'end_date': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
|
|
|
},
|
2023-02-09 16:32:13 +01:00
|
|
|
'recurrent_week': {
|
2023-02-24 11:48:42 +01:00
|
|
|
'oneOf': [
|
|
|
|
{
|
|
|
|
'type': 'array',
|
|
|
|
'items': {'type': 'string'},
|
|
|
|
},
|
|
|
|
{'type': 'null'},
|
|
|
|
],
|
2023-02-09 16:32:13 +01:00
|
|
|
},
|
2023-02-23 17:44:44 +01:00
|
|
|
'conveyanceSubscribe': {
|
|
|
|
'type': 'object',
|
|
|
|
'properties': {
|
|
|
|
'idPlaceMorning': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[A-Za-z0-9]*$',
|
|
|
|
},
|
|
|
|
'idPlaceAfternoon': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[A-Za-z0-9]*$',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2023-01-22 19:09:01 +01:00
|
|
|
},
|
|
|
|
'required': [
|
|
|
|
'person_id',
|
|
|
|
'activity_id',
|
|
|
|
'unit_id',
|
|
|
|
'place_id',
|
|
|
|
'start_date',
|
|
|
|
'end_date',
|
|
|
|
],
|
2023-02-23 17:44:44 +01:00
|
|
|
'unflatten': True,
|
2023-01-22 19:09:01 +01:00
|
|
|
}
|
2023-02-04 22:07:05 +01:00
|
|
|
|
2023-03-19 20:54:17 +01:00
|
|
|
BASKET_SCHEMA = {
|
2023-02-04 22:07:05 +01:00
|
|
|
'type': 'object',
|
|
|
|
'properties': {
|
2023-03-19 20:54:17 +01:00
|
|
|
'basket_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[A-Za-z0-9]+$',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'required': [
|
|
|
|
'basket_id',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
BASKET_LINE_SCHEMA = {
|
|
|
|
'type': 'object',
|
|
|
|
'properties': {
|
|
|
|
'basket_id': {
|
|
|
|
'type': 'string',
|
|
|
|
'pattern': '^[A-Za-z0-9]+$',
|
|
|
|
},
|
2023-02-04 22:07:05 +01:00
|
|
|
'line_id': {
|
|
|
|
'type': 'string',
|
2023-03-19 20:54:17 +01:00
|
|
|
'pattern': '^[A-Za-z0-9]+$',
|
2023-02-04 22:07:05 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'required': [
|
2023-03-19 20:54:17 +01:00
|
|
|
'basket_id',
|
2023-02-04 22:07:05 +01:00
|
|
|
'line_id',
|
|
|
|
],
|
|
|
|
}
|