Files
operating-room-monitor-server/backend/app/domain/consumption.py
Kevin 1af442481e 重组为 backend/clients/docs 三层结构,并清理 git 污染。
将后端迁入 backend/,完善根目录 .gitignore,删除误提交的 .mypy_cache 缓存文件。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:02:25 +08:00

27 lines
894 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""手术消耗明细的领域对象(服务端内部流转 / 持久化使用)。"""
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