接入订单列表V4继续处理入口

This commit is contained in:
andy
2026-07-20 11:15:19 +07:00
parent dfafd2c095
commit d7b24cbef7
8 changed files with 245 additions and 13 deletions

View File

@@ -0,0 +1,96 @@
# M002 V4 CP14 Order List Entrypoint Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 接入 `GET /api/reservation/orders` 的 CP14 V4 下一步字段,让订单列表“继续处理”优先进入 V4 订单任务详情,并保留旧 V2/V3 任务详情回退。
**Architecture:** 类型层扩展订单列表返回字段,页面层新增一个纯展示/路由解析函数,按 `next_v4_order_task_id``next_processable_task_id``next_v4_action_type` 的优先级输出继续处理链接和标签。服务层继续透传后端 JSON不引入前端伪造逻辑S10/S99 仍不进入订单列表。
**Tech Stack:** Vue 3, TypeScript, Vue Router, Vue I18n, Vitest, Vue Test Utils.
## Global Constraints
- 不改后端接口。
- 不改 V4 卡片确认 / 复核提交逻辑。
- 不做 S10/S99 订单列表展示。
- 不废弃旧 V2/V3 任务详情页面。
- 不做真实 OPERA / OHIP。
- 提交时不带入 `.idea``client/dist.zip` 或其他无关工作区改动。
---
### Task 1: Failing Tests For Entrypoint Priority
**Files:**
- Modify: `client/src/tests/reservationViews.spec.ts`
**Interfaces:**
- Consumes: `ReservationOrderListItem.next_v4_order_task_id`, `next_processable_task_id`, `next_v4_action_type`, `next_v4_action_status`
- Produces: 测试覆盖 V4 优先、旧任务回退、无待处理、查看详情不变
- [x] **Step 1: Add test cases**
Add order list fixtures with:
- V4 `next_v4_order_task_id='9001'` and legacy `next_processable_task_id='10002'`
- legacy-only `next_processable_task_id='10002'`
- no next task and `next_v4_action_type='NONE'`
- [x] **Step 2: Verify red**
Run `CI=true pnpm --dir client test -- reservationViews.spec.ts`.
Expected: V4 priority assertion fails because the current component still links “继续处理” to `/reservation/tasks/10002`.
### Task 2: Types And UI Logic
**Files:**
- Modify: `client/src/types/reservation.ts`
- Modify: `client/src/views/reservation/ReservationOrderListView.vue`
**Interfaces:**
- Produces: `ReservationV4OrderListActionType`, `ReservationV4OrderListActionStatus` unions and `resolveContinueTarget(order)` page helper
- [x] **Step 1: Extend types**
Add optional nullable CP14 fields to `ReservationOrderListItem`.
- [x] **Step 2: Implement route priority**
`resolveContinueTarget(order)` returns `/reservation/order-tasks/{id}` when V4 ID exists, otherwise `/reservation/tasks/{id}` when legacy ID exists, otherwise `null`.
- [x] **Step 3: Add label**
Show a compact V4 action tag for `CONFIRM` / `REVIEW`, reusing status text for `PENDING_CONFIRM` / `REVIEW_REQUIRED`.
- [x] **Step 4: Verify green**
Run `CI=true pnpm --dir client test -- reservationViews.spec.ts`.
### Task 3: Documentation And Final Verification
**Files:**
- Modify: `docs/project/frontend-backend/backend-to-frontend-notes.md`
- Modify: `docs/project/frontend-backend/frontend-to-backend-api-requests.md`
- Modify: `PROJECT_STATE.md`
**Interfaces:**
- Produces: 前端已接入 CP14 的说明
- [x] **Step 1: Update docs**
Record that the frontend order list now consumes CP14 V4 entry fields and keeps legacy fallback.
- [x] **Step 2: Run verification**
Run:
- `CI=true pnpm --dir client lint`
- `CI=true pnpm --dir client typecheck`
- `CI=true pnpm --dir client test`
- `CI=true pnpm --dir client build`
- [x] **Step 3: Code review**
Review routing, types, docs, tests, and unrelated workspace files.
- [x] **Step 4: Commit**
Stage only related files and commit with a Chinese message.