56 lines
871 B
Python
56 lines
871 B
Python
from schemas.attribute import AttributeSchema
|
|
from schemas.base import BaseSchema, OkMessageSchema
|
|
from schemas.module import ModuleSchema
|
|
|
|
|
|
# region Entities
|
|
|
|
|
|
class BaseProjectSchema(BaseSchema):
|
|
name: str
|
|
|
|
|
|
class ProjectSchema(BaseProjectSchema):
|
|
id: int
|
|
attributes: list[AttributeSchema]
|
|
modules: list[ModuleSchema]
|
|
|
|
|
|
class FullProjectSchema(ProjectSchema):
|
|
boards_count: int
|
|
|
|
|
|
# endregion
|
|
|
|
# region Requests
|
|
|
|
class CreateProjectRequest(BaseSchema):
|
|
project: BaseProjectSchema
|
|
|
|
|
|
class UpdateProjectRequest(BaseSchema):
|
|
project: ProjectSchema
|
|
|
|
|
|
# endregion
|
|
|
|
|
|
# region Responses
|
|
|
|
class GetProjectsResponse(BaseSchema):
|
|
projects: list[FullProjectSchema]
|
|
|
|
|
|
class CreateProjectResponse(OkMessageSchema):
|
|
pass
|
|
|
|
|
|
class UpdateProjectResponse(OkMessageSchema):
|
|
pass
|
|
|
|
|
|
class DeleteProjectResponse(OkMessageSchema):
|
|
pass
|
|
|
|
# endregion
|