From 0358b34159f6a3f838a6e7ba169efc26485e8e1d Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 12 Jul 2026 10:20:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20M002=20V3=20=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=88=97=E8=A1=A8=E7=AD=9B=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/i18n/locales/en-US.ts | 1 - client/src/i18n/locales/th-TH.ts | 1 - client/src/i18n/locales/zh-CN.ts | 1 - client/src/tests/reservationViews.spec.ts | 60 ++++++++++++++++--- client/src/types/reservation.ts | 27 ++++++++- .../reservation/ReservationTaskListView.vue | 3 - .../frontend-to-backend-api-requests.md | 4 +- 7 files changed, 79 insertions(+), 18 deletions(-) diff --git a/client/src/i18n/locales/en-US.ts b/client/src/i18n/locales/en-US.ts index 3cad4c1..31acb2f 100644 --- a/client/src/i18n/locales/en-US.ts +++ b/client/src/i18n/locales/en-US.ts @@ -268,7 +268,6 @@ export default { viewTask: 'View task', viewOrder: 'View order', viewConversation: 'View email conversation', - legacyMessageNotification: 'Message notification (legacy)', sourceOnlyOrderLabel: 'Source message only', hiddenTechnicalOrder: 'No visible order', columns: { diff --git a/client/src/i18n/locales/th-TH.ts b/client/src/i18n/locales/th-TH.ts index 737e96c..4591173 100644 --- a/client/src/i18n/locales/th-TH.ts +++ b/client/src/i18n/locales/th-TH.ts @@ -268,7 +268,6 @@ export default { viewTask: 'ดูงาน', viewOrder: 'ดูออเดอร์', viewConversation: 'ดูเธรดอีเมล', - legacyMessageNotification: 'การแจ้งเตือนข้อความ (เดิม)', sourceOnlyOrderLabel: 'ข้อความต้นทางแบบอ่านอย่างเดียว', hiddenTechnicalOrder: 'ไม่มีออเดอร์ที่แสดงได้', columns: { diff --git a/client/src/i18n/locales/zh-CN.ts b/client/src/i18n/locales/zh-CN.ts index fe9f959..22e4581 100644 --- a/client/src/i18n/locales/zh-CN.ts +++ b/client/src/i18n/locales/zh-CN.ts @@ -268,7 +268,6 @@ export default { viewTask: '查看任务', viewOrder: '查看订单', viewConversation: '查看邮件会话', - legacyMessageNotification: '消息通知(历史 Message Notification)', sourceOnlyOrderLabel: '来源消息只读', hiddenTechnicalOrder: '不关联可见订单', columns: { diff --git a/client/src/tests/reservationViews.spec.ts b/client/src/tests/reservationViews.spec.ts index 461ea9d..49d2e1d 100644 --- a/client/src/tests/reservationViews.spec.ts +++ b/client/src/tests/reservationViews.spec.ts @@ -93,12 +93,12 @@ function createTaskListResult( } } -function createSourceMessageOnlyTaskListResult(taskSubtype: 'S10' | 'S99' | 'S000' | 'S999' = 'S10') { +function createSourceMessageOnlyTaskListResult(taskSubtype: 'S10' | 'S99' = 'S10') { return { items: [ { - task_id: taskSubtype === 'S10' || taskSubtype === 'S000' ? '19990' : '19999', - order_id: taskSubtype === 'S10' || taskSubtype === 'S000' ? '29990' : '29999', + task_id: taskSubtype === 'S10' ? '19990' : '19999', + order_id: taskSubtype === 'S10' ? '29990' : '29999', hotel_id: 'HOTEL-TEST', display_order_key: null, temporary_order_no: null, @@ -114,8 +114,8 @@ function createSourceMessageOnlyTaskListResult(taskSubtype: 'S10' | 'S99' | 'S00 queue_participation: false, can_process: false, readonly_reason_code: 'QUEUE_EXCLUDED', - source_message_id: taskSubtype === 'S10' || taskSubtype === 'S000' ? '39990' : '39999', - source_subject: taskSubtype === 'S10' || taskSubtype === 'S000' ? 'FYI only' : 'Unclear email', + source_message_id: taskSubtype === 'S10' ? '39990' : '39999', + source_subject: taskSubtype === 'S10' ? 'FYI only' : 'Unclear email', source_sender_summary: 'guest@example.test', source_received_at: '2026-07-08T03:00:00Z', external_conversation_id: 'thread-source-only', @@ -485,12 +485,40 @@ describe('reservation P0 views', () => { const wrapper = await mountWithPlugins(ReservationTaskListView) await vi.dynamicImportSettled() + const taskTypeOptions = wrapper.find('select[name="task_type"]').findAll('option') + .map((option) => option.attributes('value')) + const taskSubtypeOptions = wrapper.find('select[name="task_subtype"]').findAll('option') + .map((option) => option.attributes('value')) + + expect(taskTypeOptions).toEqual([ + '', + 'NEW_BOOKING', + 'UPDATE_BOOKING', + 'CANCEL_BOOKING', + 'MANUAL_REVIEW', + 'SOURCE_MESSAGE_ONLY', + ]) + expect(taskTypeOptions).not.toContain('INFORMATIONAL_MESSAGE') + expect(taskSubtypeOptions).toEqual([ + '', + 'NEW_BOOKING', + 'UPDATE_BOOKING', + 'CANCEL_BOOKING', + 'RATE_CHANGE', + 'UPDATE_STAY_DATES', + 'UPDATE_ROOM_TYPE', + 'UPDATE_FIX_CHARGE', + 'NEW_GROUP_BLOCK', + 'NEW_FIT_RESERVATION', + 'MANUAL_REVIEW', + 'S10', + 'S99', + ]) + expect(taskSubtypeOptions).not.toContain('S000') + expect(taskSubtypeOptions).not.toContain('S999') expect(wrapper.find('select[name="task_type"]').text()).toContain('来源消息只读') - expect(wrapper.find('select[name="task_type"]').text()).toContain('历史 Message Notification') expect(wrapper.find('select[name="task_subtype"]').text()).toContain('纯信息类邮件(S10)') expect(wrapper.find('select[name="task_subtype"]').text()).toContain('无法形成业务素材包(S99)') - expect(wrapper.find('select[name="task_subtype"]').text()).toContain('纯信息类邮件') - expect(wrapper.find('select[name="task_subtype"]').text()).toContain('无法形成业务素材包') await wrapper.find('select[name="task_type"]').setValue('SOURCE_MESSAGE_ONLY') await vi.dynamicImportSettled() @@ -504,6 +532,22 @@ describe('reservation P0 views', () => { page_num: 1, }), ) + const lastTaskRequest = vi.mocked(service.fetchReservationTaskList).mock.calls[ + vi.mocked(service.fetchReservationTaskList).mock.calls.length - 1 + ]?.[0] ?? {} + expect(Object.keys(lastTaskRequest).sort()).toEqual([ + 'keyword', + 'order_status', + 'page_num', + 'page_size', + 'queue_participation', + 'task_status', + 'task_subtype', + 'task_type', + ]) + expect(lastTaskRequest).not.toHaveProperty('result_type') + expect(lastTaskRequest).not.toHaveProperty('route_code') + expect(lastTaskRequest).not.toHaveProperty('system_process_category') }) it('renders source-message-only task rows without a visible order action', async () => { diff --git a/client/src/types/reservation.ts b/client/src/types/reservation.ts index a5fa9c4..f681487 100644 --- a/client/src/types/reservation.ts +++ b/client/src/types/reservation.ts @@ -77,11 +77,34 @@ export interface ReservationOrderListResult { page: ReservationPageResult } +export type ReservationTaskListTaskTypeFilter = + | '' + | 'NEW_BOOKING' + | 'UPDATE_BOOKING' + | 'CANCEL_BOOKING' + | 'MANUAL_REVIEW' + | 'SOURCE_MESSAGE_ONLY' + +export type ReservationTaskListTaskSubtypeFilter = + | '' + | 'NEW_BOOKING' + | 'UPDATE_BOOKING' + | 'CANCEL_BOOKING' + | 'RATE_CHANGE' + | 'UPDATE_STAY_DATES' + | 'UPDATE_ROOM_TYPE' + | 'UPDATE_FIX_CHARGE' + | 'NEW_GROUP_BLOCK' + | 'NEW_FIT_RESERVATION' + | 'MANUAL_REVIEW' + | 'S10' + | 'S99' + export interface ReservationTaskListFilters { hotel_id?: string order_id?: string - task_type?: string - task_subtype?: string + task_type?: ReservationTaskListTaskTypeFilter + task_subtype?: ReservationTaskListTaskSubtypeFilter task_status?: string order_status?: string queue_participation?: boolean diff --git a/client/src/views/reservation/ReservationTaskListView.vue b/client/src/views/reservation/ReservationTaskListView.vue index cafca31..a7aac98 100644 --- a/client/src/views/reservation/ReservationTaskListView.vue +++ b/client/src/views/reservation/ReservationTaskListView.vue @@ -44,7 +44,6 @@ -