first commit
This commit is contained in:
52
backend/app/schemas/transaction.py
Normal file
52
backend/app/schemas/transaction.py
Normal file
@@ -0,0 +1,52 @@
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.models.evidence_image import SourceApp
|
||||
from app.models.transaction import Direction
|
||||
|
||||
|
||||
class TransactionOut(BaseModel):
|
||||
id: UUID
|
||||
case_id: UUID
|
||||
source_app: SourceApp
|
||||
trade_time: datetime
|
||||
amount: float
|
||||
direction: Direction
|
||||
counterparty_name: str
|
||||
counterparty_account: str
|
||||
self_account_tail_no: str
|
||||
order_no: str
|
||||
remark: str
|
||||
evidence_image_id: UUID | None = None
|
||||
confidence: float
|
||||
cluster_id: UUID | None = None
|
||||
is_duplicate: bool
|
||||
is_transit: bool
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class TransactionListOut(BaseModel):
|
||||
items: list[TransactionOut]
|
||||
total: int
|
||||
|
||||
|
||||
class FlowNodeOut(BaseModel):
|
||||
id: str
|
||||
label: str
|
||||
type: str
|
||||
|
||||
|
||||
class FlowEdgeOut(BaseModel):
|
||||
source: str
|
||||
target: str
|
||||
amount: float
|
||||
count: int
|
||||
trade_time: str
|
||||
|
||||
|
||||
class FlowGraphOut(BaseModel):
|
||||
nodes: list[FlowNodeOut]
|
||||
edges: list[FlowEdgeOut]
|
||||
Reference in New Issue
Block a user