41 lines
978 B
Python
41 lines
978 B
Python
from datetime import datetime
|
||
from typing import Any, Dict, Optional
|
||
|
||
from orm.tables.process import ProcessStatus, NodeType
|
||
from pydantic import Field
|
||
|
||
from api.schemas.base import Base
|
||
from api.schemas.process.ps_node import Ps_NodeFrontResponse
|
||
|
||
|
||
class ProcessSchema(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 ProcessSchemaSettingsNodeLink(Base):
|
||
id: int
|
||
link_name: str
|
||
parent_port_number: int
|
||
from_id: int
|
||
to_id: int
|
||
|
||
|
||
class ProcessSchemaSettingsNode(Base):
|
||
id: int
|
||
node_type: NodeType
|
||
from_node: Optional[Dict[str, Any]] = None
|
||
data: Dict[str, Any]# Переименовано с 'from' на 'from_node'
|
||
links: Optional[ProcessSchemaSettingsNodeLink] = None
|
||
|
||
|
||
class ProcessSchemaResponse(Base):
|
||
process_schema: ProcessSchema
|
||
node_start: Ps_NodeFrontResponse
|