diff --git a/PROJECT_STATE.md b/PROJECT_STATE.md index ab696bc..ebac31e 100644 --- a/PROJECT_STATE.md +++ b/PROJECT_STATE.md @@ -34,7 +34,8 @@ - `docs/import/` 下按日期导入的资料是输入材料,不等同于当前权威开发契约;当前开发应优先看 `docs/project/README.md` 标记为当前有效或权威契约的文档。 - 后续每完成一个 Feature 或 Checkpoint,需要更新本文件,避免项目状态继续沉淀在聊天记录里。 - M010 Rooming List Excel 生成后端 CP1 和前端 V1 已实现:前端 `/reservation/rooming-lists/new` 上传来源名单和手工字段,后端同步生成 `.xlsx` 直接下载,第一版不落库、不上传 OSS。 -- M002 V4 CP1 当前已完成入站解析和现有任务链路过渡适配;M002 V4 CP2 已完成订单任务与多卡领域模型设计;M002 V4 CP3 已完成 V4 订单任务、多卡和 S10/S99 来源通知表结构与 Repository 基线;M002 V4 CP4 已完成入站写入新模型;M002 V4 CP5 已完成前端查询接口并补齐订单详情 `v4_order_tasks[]` 时间线;M002 V4 CP6 已完成普通卡片确认和 S10/S99 来源通知 ack;M002 V4 CP7 已完成 `REVIEW_REQUIRED` 卡复核解阻和复核场景订单归属确认;M002 V4 CP8 已完成目录校验、V4 卡片 `fields[]` 字段白名单、确认写入白名单收口和嵌套业务字段目录校验;M002 V4 CP11 已完成数据库目录、初始化种子、启动补种子、Account / Room Type / Rate Code lookup API,并把 V4 入站、确认、复核目录校验切换到当前酒店数据库目录;M002 V4 CP12 已完成前端 lookup 接入第一版和 V4 订单任务时间线消费。目录管理后台、真实 PMS 同步和 SuperAgent 目录机器接口仍未完成。 +- M011 Booking Excel 附件预处理 CP1/CP2/CP3 已实现:后端可排除人员名单类 Excel,按最近 6 个月候选窗口选择实际存在的最新 3 个业务月,抽取 Booking Update / 附加费表高亮行业务 JSON;Debug EML 和 AgentBus dispatch 在各自 include 开关与总开关同时启用时,会在调用 SuperAgent 前追加 `attachment_extractions[]`。AgentBus 生产链路默认关闭,测试机验证后再评估开启。 +- M002 V4 CP1 当前已完成入站解析和现有任务链路过渡适配;M002 V4 CP2 已完成订单任务与多卡领域模型设计;M002 V4 CP3 已完成 V4 订单任务、多卡和 S10/S99 来源通知表结构与 Repository 基线;M002 V4 CP4 已完成入站写入新模型;M002 V4 CP5 已完成前端查询接口并补齐订单详情 `v4_order_tasks[]` 时间线;M002 V4 CP6 已完成普通卡片确认和 S10/S99 来源通知 ack;M002 V4 CP7 已完成 `REVIEW_REQUIRED` 卡复核解阻和复核场景订单归属确认;M002 V4 CP8 已完成目录校验、V4 卡片 `fields[]` 字段白名单、确认写入白名单收口和嵌套业务字段目录校验;M002 V4 CP11 已完成数据库目录、初始化种子、启动补种子、Account / Room Type / Rate Code lookup API,并把 V4 入站、确认、复核目录校验切换到当前酒店数据库目录;M002 V4 CP12 已完成前端 lookup 接入第一版和 V4 订单任务时间线消费;M002 V4 CP13 目录管理后台 CP1 已完成前后端列表、新增、启用 / 停用闭环。真实 PMS 同步和 SuperAgent 目录机器接口仍未完成。 - M002 V4 CP2 已确认:V4 工作台统一列表草案为 `/api/reservation/workbench-items`,业务订单任务接口新开 `/api/reservation/order-tasks/**`,S10/S99 来源通知详情草案为 `/api/reservation/source-notifications/{notificationId}`;S10/S99 使用来源通知模型,不再挂隐藏技术订单;`FIT + BOOKING_CODE` 不建 ACTIVE 唯一约束,匹配多条进人工复核;Basic Information 必须先确认;Account / Market / Source 当前通过数据库目录读取和派生;旧 V2/V3 任务详情和草稿确认接口后续可逐步废弃。 ## 5. Next Steps @@ -42,6 +43,7 @@ - 后续如继续做 M002 V4,可优先进入测试机 V4 目录管理与多卡 lookup 联调、真实 PMS / OPERA / OHIP 目录同步和 `workflow_reservation_catalog_sync_run` checkpoint。 - 后续新增重要功能时,优先在 `docs/project/requirements/` 或未来 `docs/specs/` 中形成 Spec,再实现代码。 - M010 后续如需预览、历史记录、OSS 下载、订单 / 任务预填或客户字段目录化,再单独开前后端 checkpoint。 +- M011 后续如需运营查询或长期追踪,可进入 CP4:设计 Excel 解析批次 / 行级持久化表;当前 CP3 只增强 SuperAgent 输入,不直接落订单、任务或长期解析历史。 ## 6. 文档同步提醒 diff --git a/client/src/i18n/locales/en-US.ts b/client/src/i18n/locales/en-US.ts index ae70ebc..a459cfe 100644 --- a/client/src/i18n/locales/en-US.ts +++ b/client/src/i18n/locales/en-US.ts @@ -766,6 +766,7 @@ export default { parsedJson: 'Parsed JSON', rawAnswer: 'Raw answer', warnings: 'Warnings', + bookingExcelExtractions: 'Booking Excel attachment extraction', debugPayload: 'Debug payload', statuses: { idle: 'Idle', diff --git a/client/src/i18n/locales/th-TH.ts b/client/src/i18n/locales/th-TH.ts index c5895ba..a763646 100644 --- a/client/src/i18n/locales/th-TH.ts +++ b/client/src/i18n/locales/th-TH.ts @@ -766,6 +766,7 @@ export default { parsedJson: 'JSON ที่แยกแล้ว', rawAnswer: 'คำตอบดิบ', warnings: 'คำเตือน', + bookingExcelExtractions: 'การแยกไฟล์แนบ Booking Excel', debugPayload: 'Debug payload', statuses: { idle: 'รออัปโหลด', diff --git a/client/src/i18n/locales/zh-CN.ts b/client/src/i18n/locales/zh-CN.ts index 0f3d31f..bc60f72 100644 --- a/client/src/i18n/locales/zh-CN.ts +++ b/client/src/i18n/locales/zh-CN.ts @@ -766,6 +766,7 @@ export default { parsedJson: '解析 JSON', rawAnswer: '原始回答', warnings: '警告', + bookingExcelExtractions: 'Booking Excel 附件预处理', debugPayload: '调试 Payload', statuses: { idle: '待上传', diff --git a/client/src/services/debugEmlService.ts b/client/src/services/debugEmlService.ts index a58d214..11a90ae 100644 --- a/client/src/services/debugEmlService.ts +++ b/client/src/services/debugEmlService.ts @@ -273,6 +273,9 @@ function normalizeDebugEmlResult(payload: unknown): DebugEmlSuperAgentRunResult typeof result.html_sanitize_required === 'boolean' ? result.html_sanitize_required : null, html_render_mode: nullableStringValue(result.html_render_mode), agentbus_like_payload: isRecord(result.agentbus_like_payload) ? result.agentbus_like_payload : null, + attachment_extractions: Array.isArray(result.attachment_extractions) + ? result.attachment_extractions.filter(isRecord) + : [], superagent_session_id: nullableStringValue(result.superagent_session_id), superagent_run_id: nullableStringValue(result.superagent_run_id), superagent_raw_answer: nullableStringValue(result.superagent_raw_answer), diff --git a/client/src/tests/debugEmlService.spec.ts b/client/src/tests/debugEmlService.spec.ts index 0d99946..a7f9d18 100644 --- a/client/src/tests/debugEmlService.spec.ts +++ b/client/src/tests/debugEmlService.spec.ts @@ -84,6 +84,14 @@ describe('debugEmlService', () => { html_sanitize_required: true, html_render_mode: 'SANITIZED_HTML', agentbus_like_payload: { schema_version: 'debug-eml-upload-v1' }, + attachment_extractions: [ + { + file_type: 'BOOKING_UPDATE', + month_filter: { + selected_months: ['2026-05'], + }, + }, + ], superagent_session_id: 'session-1', superagent_run_id: 'run-1', superagent_raw_answer: '{"ok":true}', @@ -102,6 +110,14 @@ describe('debugEmlService', () => { }) expect(fetchMock).toHaveBeenCalledTimes(1) + expect(result.attachment_extractions).toEqual([ + { + file_type: 'BOOKING_UPDATE', + month_filter: { + selected_months: ['2026-05'], + }, + }, + ]) const [url, init] = fetchMock.mock.calls[0]! expect(url).toBe('/api/system/debug/eml-superagent-runs') expect(init).toMatchObject({ diff --git a/client/src/tests/debugEmlView.spec.ts b/client/src/tests/debugEmlView.spec.ts index de91dd0..699e810 100644 --- a/client/src/tests/debugEmlView.spec.ts +++ b/client/src/tests/debugEmlView.spec.ts @@ -63,6 +63,14 @@ function createResult() { original_message_id: '', }, }, + attachment_extractions: [ + { + file_type: 'BOOKING_UPDATE', + month_filter: { + selected_months: ['2026-05'], + }, + }, + ], superagent_session_id: 'session-1', superagent_run_id: 'run-1', superagent_raw_answer: '{"ok":true}', @@ -176,6 +184,9 @@ describe('DebugEmlSuperAgentRunView', () => { expect(wrapper.find('.debug-eml-html-preview').html()).not.toContain('