system-pri/backend/app/coordinator/schemas/examination_schedule.py

44 lines
1.2 KiB
Python
Raw Normal View History

from marshmallow import Schema, fields, validate
from ..validators import validate_datetime_greater_than_now
class ExaminationScheduleSchema(Schema):
title = fields.Str(validate=validate.Length(min=1, max=100), required=True)
start_date = fields.DateTime(
validate=validate_datetime_greater_than_now, required=True
)
end_date = fields.DateTime(
validate=validate_datetime_greater_than_now, required=True
)
class ExaminationScheduleListItemSchema(Schema):
id = fields.Integer()
title = fields.Str()
open_enrollments = fields.String()
start_date = fields.DateTime()
end_date = fields.DateTime()
class ExaminationSchedulesPaginationSchema(Schema):
examination_schedules = fields.List(
fields.Nested(ExaminationScheduleListItemSchema)
)
max_pages = fields.Integer()
class ExaminationSchedulesQuerySchema(Schema):
page = fields.Integer()
per_page = fields.Integer()
class ProjectSupervisorStatisticsSchema(Schema):
2023-01-02 23:17:37 +01:00
full_name = fields.Str()
assigned_to_committee = fields.Integer()
groups_assigned_to_his_committee = fields.Integer()
class WorkloadSchema(Schema):
workloads = fields.List(fields.Nested(ProjectSupervisorStatisticsSchema))