101 lines
2.9 KiB
Python
101 lines
2.9 KiB
Python
"""场外基金接口请求结构。"""
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from app.core.offsite_fund_contracts import OperationDecision
|
|
|
|
|
|
class OffsiteConfirmRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
decision: OperationDecision
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
|
|
|
|
class OffsiteRecalculateRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
fund_code: str | None = Field(default=None, max_length=32)
|
|
application_date: str = Field(min_length=8, max_length=32)
|
|
|
|
|
|
class OffsiteNotificationRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
notification_type: str = Field(
|
|
pattern="^(risk|settlement|mail_return|normal_return|exception_return)$"
|
|
)
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
|
|
|
|
class OffsiteNotificationSendRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
operator_confirmed: bool
|
|
final_content: str | None = Field(default=None, max_length=10000)
|
|
|
|
|
|
class OffsiteTriggerNl2SqlRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
manual_confirmed: bool
|
|
|
|
|
|
class OffsiteRecognitionRetryRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
|
|
|
|
class OffsiteMailboxRecoveryRequest(BaseModel):
|
|
"""收件游标解除阻塞请求。"""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
|
|
|
|
class OffsiteMailDeletionRequest(BaseModel):
|
|
"""邮件删除请求:只隐藏运营列表,不删除原始邮件和识别链路。"""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
|
|
|
|
class OffsiteRuleRecalculationRequest(BaseModel):
|
|
"""重新判定规则只接受操作人身份,数值一律取自已落库的识别与查询结果。"""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
|
|
|
|
class OffsiteRecognitionCorrectionItem(BaseModel):
|
|
"""单个附件的 OCR 识别字段人工修正值。"""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
attachment_id: str = Field(min_length=1, max_length=24)
|
|
fields: dict[str, str] = Field(default_factory=dict)
|
|
|
|
|
|
class OffsiteRecognitionCorrectionRequest(BaseModel):
|
|
"""OCR 识别字段人工修正请求:一次提交一封邮件下的一个或多个附件。"""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
attachments: list[OffsiteRecognitionCorrectionItem] = Field(min_length=1)
|
|
|
|
|
|
class OffsiteNl2SqlCorrectionRequest(BaseModel):
|
|
"""NL2SQL 返回字段人工修正请求。"""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
operator_id: str = Field(min_length=1, max_length=64)
|
|
fields: dict[str, str] = Field(default_factory=dict)
|