2023-01-14 17:38:03 +01:00
|
|
|
from marshmallow import Schema, fields, validate
|
2022-10-26 12:41:22 +02:00
|
|
|
|
|
|
|
from ..validators import validate_datetime_greater_than_now
|
|
|
|
|
|
|
|
|
|
|
|
class ExaminationScheduleSchema(Schema):
|
|
|
|
title = fields.Str(validate=validate.Length(min=1, max=100), required=True)
|
2023-01-14 17:38:03 +01:00
|
|
|
start_date = fields.DateTime(
|
|
|
|
validate=validate_datetime_greater_than_now, required=True
|
|
|
|
)
|
|
|
|
end_date = fields.DateTime(
|
|
|
|
validate=validate_datetime_greater_than_now, required=True
|
|
|
|
)
|
2022-10-26 12:41:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ExaminationScheduleListItemSchema(Schema):
|
2022-11-12 16:18:07 +01:00
|
|
|
id = fields.Integer()
|
|
|
|
title = fields.Str()
|
2023-01-14 17:38:03 +01:00
|
|
|
open_enrollments = fields.String()
|
2022-11-12 16:18:07 +01:00
|
|
|
start_date = fields.DateTime()
|
|
|
|
end_date = fields.DateTime()
|
2022-10-26 12:41:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ExaminationSchedulesPaginationSchema(Schema):
|
2023-01-14 17:38:03 +01:00
|
|
|
examination_schedules = fields.List(
|
|
|
|
fields.Nested(ExaminationScheduleListItemSchema)
|
|
|
|
)
|
2022-10-26 12:41:22 +02:00
|
|
|
max_pages = fields.Integer()
|
|
|
|
|
|
|
|
|
|
|
|
class ExaminationSchedulesQuerySchema(Schema):
|
|
|
|
page = fields.Integer()
|
|
|
|
per_page = fields.Integer()
|
2022-10-27 19:53:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ProjectSupervisorStatisticsSchema(Schema):
|
2023-01-02 23:17:37 +01:00
|
|
|
full_name = fields.Str()
|
2022-10-27 19:53:39 +02:00
|
|
|
assigned_to_committee = fields.Integer()
|
|
|
|
groups_assigned_to_his_committee = fields.Integer()
|
|
|
|
|
|
|
|
|
|
|
|
class WorkloadSchema(Schema):
|
|
|
|
workloads = fields.List(fields.Nested(ProjectSupervisorStatisticsSchema))
|