将后端迁入 backend/,完善根目录 .gitignore,删除误提交的 .mypy_cache 缓存文件。 Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
894 B
Python
27 lines
894 B
Python
"""手术消耗明细的领域对象(服务端内部流转 / 持久化使用)。"""
|
||
|
||
from __future__ import annotations
|
||
|
||
from dataclasses import dataclass
|
||
from datetime import datetime
|
||
|
||
|
||
@dataclass
|
||
class SurgeryConsumptionStored:
|
||
"""内存 / 数据库持久化用的明细行(含 source,仅服务端内部使用,不随 HTTP 返回)。
|
||
|
||
HTTP 层面的表示为 ``app.schemas.SurgeryConsumptionDetail``;
|
||
转换由上层(pipeline)在返回给客户端前完成,以隔离领域与 API。
|
||
|
||
``pending_confirmation_id``:非空表示该行仍为医生待确认占位(展示名为「耗材名(待确认)」);
|
||
确认后由注册表替换为最终耗材行并清空此字段。
|
||
"""
|
||
|
||
item_id: str
|
||
item_name: str
|
||
qty: int
|
||
doctor_id: str
|
||
timestamp: datetime
|
||
source: str = "vision"
|
||
pending_confirmation_id: str | None = None
|