2023-01-14 17:38:03 +01:00
|
|
|
from marshmallow import Schema, fields, validate
|
2022-10-26 12:41:22 +02:00
|
|
|
|
2023-01-14 17:38:03 +01:00
|
|
|
|
|
|
|
class ProjectSupervisorSchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
first_name = fields.Str()
|
|
|
|
last_name = fields.Str()
|
|
|
|
email = fields.Str()
|
|
|
|
limit_group = fields.Integer()
|
2022-10-26 12:41:22 +02:00
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class ProjectSupervisorQuerySchema(Schema):
|
2022-10-26 12:41:22 +02:00
|
|
|
fullname = fields.Str()
|
|
|
|
order_by_first_name = fields.Str()
|
|
|
|
order_by_last_name = fields.Str()
|
|
|
|
page = fields.Integer()
|
|
|
|
per_page = fields.Integer()
|
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class ProjectSupervisorsPaginationSchema(Schema):
|
2022-10-26 12:41:22 +02:00
|
|
|
project_supervisors = fields.List(fields.Nested(ProjectSupervisorSchema))
|
|
|
|
max_pages = fields.Integer()
|
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class ProjectSupervisorCreateSchema(Schema):
|
2022-10-26 12:41:22 +02:00
|
|
|
first_name = fields.Str(validate=validate.Length(min=1, max=255), required=True)
|
|
|
|
last_name = fields.Str(validate=validate.Length(min=1, max=255), required=True)
|
2023-01-14 17:38:03 +01:00
|
|
|
email = fields.Str(
|
|
|
|
validate=[validate.Length(min=1, max=255), validate.Email()], required=True
|
|
|
|
)
|
2023-01-14 01:37:31 +01:00
|
|
|
limit_group = fields.Integer(required=True)
|
2022-10-26 12:41:22 +02:00
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class ProjectSupervisorEditSchema(Schema):
|
2023-01-14 01:37:31 +01:00
|
|
|
first_name = fields.Str(validate=validate.Length(min=1, max=255))
|
|
|
|
last_name = fields.Str(validate=validate.Length(min=1, max=255))
|
|
|
|
email = fields.Str(validate=[validate.Length(min=0, max=255), validate.Email()])
|
2023-01-14 17:38:03 +01:00
|
|
|
limit_group = fields.Integer()
|