34 lines
976 B
Python
34 lines
976 B
Python
from marshmallow import Schema, fields, validate
|
|
|
|
|
|
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))
|
|
|
|
|
|
class ListOfTermOfDefenceSchema(Schema):
|
|
term_of_defences = fields.List(fields.Nested(FreeTimeSchema))
|
|
|
|
|
|
class TimeAvailabilityCreateSchema(Schema):
|
|
start_date = fields.DateTime(required=True)
|
|
end_date = fields.DateTime(required=True)
|
|
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)
|
|
|
|
|
|
class ProjectSupervisorTermQuerySchema(Schema):
|
|
id = fields.Integer(required=True)
|
|
term = fields.Integer(required=True, validate=validate.OneOf([1, 2]))
|