62 lines
998 B
Python
62 lines
998 B
Python
from typing import Optional
|
|
|
|
from schemas.base import BaseSchema, BaseResponse
|
|
from schemas.deal_tag import DealTagSchema
|
|
from schemas.module import BuiltInModuleSchema
|
|
|
|
|
|
# region Entity
|
|
|
|
|
|
class ProjectSchema(BaseSchema):
|
|
id: int
|
|
name: str
|
|
built_in_modules: list[BuiltInModuleSchema]
|
|
tags: list[DealTagSchema]
|
|
|
|
|
|
class CreateProjectSchema(BaseSchema):
|
|
name: str
|
|
|
|
|
|
class UpdateProjectSchema(BaseSchema):
|
|
name: Optional[str] = None
|
|
built_in_modules: list[BuiltInModuleSchema] = None
|
|
|
|
|
|
# endregion
|
|
|
|
# region Requests
|
|
|
|
|
|
class CreateProjectRequest(BaseSchema):
|
|
entity: CreateProjectSchema
|
|
|
|
|
|
class UpdateProjectRequest(BaseSchema):
|
|
entity: UpdateProjectSchema
|
|
|
|
|
|
# endregion
|
|
|
|
# region Responses
|
|
|
|
|
|
class GetProjectsResponse(BaseSchema):
|
|
items: list[ProjectSchema]
|
|
|
|
|
|
class CreateProjectResponse(BaseResponse):
|
|
entity: ProjectSchema
|
|
|
|
|
|
class UpdateProjectResponse(BaseResponse):
|
|
pass
|
|
|
|
|
|
class DeleteProjectResponse(BaseResponse):
|
|
pass
|
|
|
|
|
|
# endregion Responses
|