2023-01-14 17:38:03 +01:00
|
|
|
from marshmallow import Schema, fields, validate
|
2022-10-27 15:59:02 +02:00
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class FreeTimeSchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
start_date = fields.DateTime(required=True)
|
|
|
|
end_date = fields.DateTime(required=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ListOfFreeTimesSchema(Schema):
|
|
|
|
free_times = fields.List(fields.Nested(FreeTimeSchema))
|
|
|
|
|
|
|
|
|
2022-11-16 20:42:40 +01:00
|
|
|
class ListOfTermOfDefenceSchema(Schema):
|
|
|
|
term_of_defences = fields.List(fields.Nested(FreeTimeSchema))
|
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class TimeAvailabilityCreateSchema(Schema):
|
|
|
|
start_date = fields.DateTime(required=True)
|
|
|
|
end_date = fields.DateTime(required=True)
|
2023-01-14 17:38:03 +01:00
|
|
|
project_supervisor_id = fields.Integer(
|
|
|
|
required=True
|
|
|
|
) # temporary field it will be removed in the future
|
2022-10-27 15:59:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
# temporary class it will be removed in the future
|
|
|
|
class TemporaryProjectSupervisorSchema(Schema):
|
|
|
|
id = fields.Integer(required=True)
|
2022-12-15 20:44:03 +01:00
|
|
|
|
2023-01-14 01:37:31 +01:00
|
|
|
|
2022-12-15 20:44:03 +01:00
|
|
|
class ProjectSupervisorTermQuerySchema(Schema):
|
|
|
|
id = fields.Integer(required=True)
|
|
|
|
term = fields.Integer(required=True, validate=validate.OneOf([1, 2]))
|