2022-10-27 15:59:02 +02:00
|
|
|
from marshmallow import fields, validate, Schema
|
|
|
|
|
|
|
|
|
|
|
|
class MessageSchema(Schema):
|
|
|
|
message = fields.Str()
|
|
|
|
|
|
|
|
|
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)
|
2022-10-27 15:59:02 +02:00
|
|
|
project_supervisor_id = fields.Integer(required=True) # temporary field it will be removed in the future
|
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
class ProjectSupervisorTermQuerySchema(Schema):
|
|
|
|
id = fields.Integer(required=True)
|
|
|
|
term = fields.Integer(required=True, validate=validate.OneOf([1, 2]))
|