feat: CRUD ProcessSchema
This commit is contained in:
36
api/api/schemas/endpoints/process_schema.py
Normal file
36
api/api/schemas/endpoints/process_schema.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from pydantic import Field, TypeAdapter
|
||||
from typing import Optional, Dict, Any, List
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
from api.schemas.base import Base
|
||||
from api.db.tables.process import ProcessStatus
|
||||
|
||||
|
||||
class ProcessSchemaUpdate(Base):
|
||||
title: Optional[str] = Field(None, max_length=100)
|
||||
description: Optional[str] = None
|
||||
owner_id: Optional[int] = None
|
||||
settings: Optional[Dict[str, Any]] = None
|
||||
status: Optional[ProcessStatus] = None
|
||||
|
||||
class AllProcessSchema(Base):
|
||||
id: int
|
||||
title: str = Field(..., max_length=100)
|
||||
description: str
|
||||
owner_id: int
|
||||
creator_id: int
|
||||
created_at: datetime
|
||||
settings: Dict[str, Any]
|
||||
status: ProcessStatus
|
||||
|
||||
|
||||
class AllProcessSchemaResponse(Base):
|
||||
process_schema: List[AllProcessSchema]
|
||||
amount_count: int
|
||||
amount_pages: int
|
||||
current_page: int
|
||||
limit: int
|
||||
|
||||
|
||||
all_process_schema_adapter = TypeAdapter(List[AllProcessSchema])
|
||||
Reference in New Issue
Block a user