docs/test(P19ERP3-5,P19ERP3-6): 收口资产ERP文档矩阵与回归脚本
这个提交包含在:
+11
-8
@@ -1,7 +1,7 @@
|
||||
# 领域事件清单(P19 / P19+IM-1 / P19+ERP-2)
|
||||
# 领域事件清单(P19 / P19+IM-1 / P19+ERP-3)
|
||||
|
||||
**快照日期**:2026-03-08
|
||||
**目标**:冻结 `hyb-oa` 当前采购与资产域的标准领域事件名,并补充 `P19+IM-1` 已实际消费的 IM 通知类型清单,以及 `P19+ERP-1 / ERP-2` 已实际落地的 ERP 消费映射,作为后续 ERP / IM / AI 适配的事实源。
|
||||
**快照日期**:2026-03-09
|
||||
**目标**:冻结 `hyb-oa` 当前采购与资产域的标准领域事件名,并补充 `P19+IM-1` 已实际消费的 IM 通知类型清单,以及 `P19+ERP-1 / ERP-3` 已实际落地的 ERP 消费映射,作为后续 ERP / IM / AI 适配的事实源。
|
||||
|
||||
## 1. 使用原则
|
||||
- 本文档同时维护两类事实:
|
||||
@@ -22,7 +22,7 @@
|
||||
| `asset.card.created` | 资产卡片创建成功后 | `asset_card` | `assetId`, `assetNo`, `name`, `categoryId`, `legalEntityId`, `costCenterId`, `purchaseRequestId`, `status` | ERP、IM、AI | 资产域不接 workflow |
|
||||
| `asset.assigned` | 资产领用成功后 | `asset_card` | `assetId`, `assetNo`, `employeeId`, `assignedAt`, `location`, `status` | IM、AI | 对应新增 open assignment |
|
||||
| `asset.returned` | 资产归还成功后 | `asset_card` | `assetId`, `assetNo`, `employeeId`, `returnedAt`, `location`, `status` | IM、AI | 对应关闭 open assignment |
|
||||
| `asset.transferred` | 资产调拨成功后 | `asset_card` | `assetId`, `assetNo`, `fromEmployeeId`, `toEmployeeId`, `fromLocation`, `toLocation`, `transferredAt`, `status` | ERP、IM、AI | 可只改位置,不一定改归属人 |
|
||||
| `asset.transferred` | 资产调拨成功后 | `asset_card` | `assetId`, `assetNo`, `fromEmployeeId`, `toEmployeeId`, `fromLocation`, `toLocation`, `transferredAt`, `status` | IM、AI | 可只改位置,不一定改归属人;ERP-3 一期不消费 |
|
||||
| `inventory_check.completed` | 盘点任务完成后 | `inventory_check` | `inventoryCheckId`, `checkNo`, `scopeType`, `scopeRefId`, `completedAt`, `itemCount`, `summary` | ERP、IM、AI | `summary` 建议包含 matched / missing / extra / damaged 计数 |
|
||||
|
||||
## 3. 事件名与运行时对象映射
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
## 7. 推荐消费场景
|
||||
- IM:采购审批结果、报销结果、资产领用归还、盘点完成提醒
|
||||
- ERP:采购审批 commitment、PO/合同归档 accrual / summary、资产卡片新增摘要、盘点完成摘要
|
||||
- ERP:采购审批 commitment、PO/合同归档 accrual / summary、资产卡片 ledger summary、盘点完成摘要
|
||||
- AI:审批摘要、异常提示、主数据重复建议、盘点结果总结
|
||||
|
||||
## 8. P19+IM-1 已消费通知类型
|
||||
@@ -93,12 +93,15 @@
|
||||
|
||||
这些事件名称仍保留在长期蓝图中,但不属于 `P19+IM-1` 的首批协同覆盖范围。
|
||||
|
||||
## 10. P19+ERP-1 / ERP-2 已实现消费映射
|
||||
## 10. P19+ERP-1 / ERP-3 已实现消费映射
|
||||
- `P19+ERP-1` 没有新增新的领域事件名;ERP 一期真正落地消费的既有业务事实是 `reimbursement.paid`,运行时会先构建标准化 `ReimbursementJournalSlice`,再通过 `erp.journal.export` 写入 `IntegrationOutbox` 异步派发。
|
||||
- `ReimbursementJournalSlice.sourceEventName` 固定为 `reimbursement.paid`,用于标记该凭证切片来源于“报销付款完成”这一既有业务事实;历史 `erp.reimbursement.paid` outbox 仍继续兼容。
|
||||
- `P19+ERP-2` 正式冻结新增领域事件名 `purchase_order.archived`,并消费两类采购事实:
|
||||
- `purchase_request.approved` → `PurchaseCommitmentJournalSlice` → `erp.journal.export`
|
||||
- `purchase_order.archived` → `PurchaseAccrualJournalSlice` + `purchase_order_archive` summary → `erp.journal.export` / `erp.procurement.export`
|
||||
- 采购 ERP 成功派发后,运行时统一把外部 ERP 编号回写到 `integration_bindings`,分别对应 `purchase_request_commitment_journal`、`purchase_order_accrual_journal`、`purchase_order_po`、`purchase_order_contract`。
|
||||
- ERP 主数据同步(`LegalEntity` / `CostCenter` / `Supplier`)仍属于主动 Pull,不作为新的领域事件名纳入本表;`IntegrationSyncState` 也继续只承载主数据资源级同步状态,而不承载采购单据轨道。
|
||||
- `asset.card.created`、`inventory_check.completed` 等事件继续只冻结名称与最小载荷;真实 ERP 导出留待后续 `P19+ERP-3`。
|
||||
- ERP 主数据同步(`LegalEntity` / `CostCenter` / `Supplier`)仍属于主动 Pull,不作为新的领域事件名纳入本表;`IntegrationSyncState` 也继续只承载主数据资源级同步状态,而不承载采购或资产单据轨道。
|
||||
- `P19+ERP-3` 一期已落地资产消费映射:
|
||||
- `asset.card.created` → `AssetLedgerSummaryPayload` → `erp.asset.export`
|
||||
- `PATCH /api/assets/:id` 导致 `legalEntityId / costCenterId / status(retired|archived)` 变化 → 资产 ERP 内部集成事实 → `erp.asset.export`
|
||||
- 资产 ERP 成功派发后,运行时统一把外部 ERP 资产编号回写到 `integration_bindings(provider=erp, entity_type=asset_erp_card)`;领用 / 归还 / 位置调拨仍不进入 ERP 消费映射。
|
||||
|
||||
在新工单中引用
屏蔽一个用户