适配 M002 V3 前端任务流与同卡复核

This commit is contained in:
andy committed 2026-07-12 00:33:15 +08:00
1 parent fd027f124c
commit 155db63028
17 files changed
+1593 -85

No files matched your search

+239 -3
View File
@@ -1,10 +1,52 @@
import type {
ReservationOrderDetail,
ReservationRecord,
ReservationTaskAuditListResult,
ReservationTaskDetailResult,
ReservationWorkbenchItem,
} from '@/types/reservation'
const v3SourceMessageFixture: ReservationRecord = {
source_message_id: '900083',
source_provider: 'DEBUG_EML',
external_message_id: 'debug-eml-900083',
external_conversation_id: 'thread-900083',
channel: 'EMAIL',
sender_identifier: 'guest@example.test',
thread_subject: 'New booking request #ORD-083',
payload_received_at: '2026-07-08T09:18:00+08:00',
}
const v3MessageEventFixture: ReservationRecord = {
event_role: 'current',
current_or_history: 'CURRENT',
source_event_index: 0,
case_keys: {
group_code: null,
confirmation_number: '#ORD-083',
reservation_number: null,
block_code: null,
},
relevant_message_excerpt: 'Please book one deluxe Q1A room for July 9.',
attachments: [],
file_references: [],
context_used: {
history_message_count: 1,
},
extracted_fields: {
pms_room_type_code: null,
room_items: [
{
pms_room_type_code: null,
},
],
},
manual_review: {
reason_code: 'missing_room_type_code',
missing_fields: ['/extracted_fields/pms_room_type_code'],
},
}
export const reservationWorkbenchItems: ReservationWorkbenchItem[] = [
{
order_id: '100083',
@@ -68,7 +110,7 @@ export const reservationWorkbenchItems: ReservationWorkbenchItem[] = [
amount: 665,
currency_code: 'CNY',
current_task_id: '700085',
current_task_card_type: 'MANUAL_REVIEW',
current_task_card_type: 'NEW_BOOKING',
current_task_status: 'BLOCKED',
updated_at: '2026-07-08T08:15:00+08:00',
},
@@ -152,8 +194,8 @@ export const reservationOrderDetails: ReservationOrderDetail[] = [
{
task_id: '700085',
order_id: '100085',
system_task_type: 'MANUAL_REVIEW',
task_card_type: 'MANUAL_REVIEW',
system_task_type: 'NEW_BOOKING',
task_card_type: 'NEW_BOOKING',
task_status: 'BLOCKED',
queue_participation: true,
execution_order: 10,
@@ -169,6 +211,16 @@ export const reservationTaskDetails: ReservationTaskDetailResult[] = [
task_id: '700083',
order_id: '100083',
source_message_id: '900083',
source_subject: 'New booking request #ORD-083',
source_sender_summary: 'guest@example.test',
source_received_at: '2026-07-08T09:18:00+08:00',
external_conversation_id: 'thread-900083',
conversation_message_count: 2,
result_type: 'normal_task',
ai_task_type: 'NEW_BOOKING',
task_subtype: 'NEW_BOOKING',
route_code: 'NEW_BOOKING_NORMAL',
system_process_category: 'BUSINESS_TASK',
system_task_type: 'CREATE_RESERVATION',
task_card_type: 'NEW_BOOKING',
task_status: 'PENDING_CONFIRM',
@@ -408,6 +460,16 @@ export const reservationTaskDetails: ReservationTaskDetailResult[] = [
task_id: '700084',
order_id: '100084',
source_message_id: '900084',
source_subject: 'Rooming list update for GRP-SEA-0712',
source_sender_summary: 'sales@example.test',
source_received_at: '2026-07-08T08:31:00+08:00',
external_conversation_id: 'thread-900084',
conversation_message_count: 3,
result_type: 'normal_task',
ai_task_type: 'ROOMING_LIST',
task_subtype: 'ROOMING_LIST',
route_code: 'ROOMING_LIST_NORMAL',
system_process_category: 'BUSINESS_TASK',
system_task_type: 'UPDATE_ROOMING_LIST',
task_card_type: 'ROOMING_LIST',
task_status: 'READY',
@@ -497,6 +559,158 @@ export const reservationTaskDetails: ReservationTaskDetailResult[] = [
},
],
},
{
task_id: '700085',
order_id: '100085',
source_message_id: '900085',
source_subject: 'Need to change my booking',
source_sender_summary: 'guest@example.test',
source_received_at: '2026-07-08T08:02:00+08:00',
external_conversation_id: 'thread-900085',
conversation_message_count: 2,
result_type: 'manual_review',
ai_task_type: 'NEW_BOOKING',
task_subtype: 'NEW_BOOKING',
route_code: 'NEW_BOOKING_MANUAL_REVIEW',
system_process_category: 'BUSINESS_TASK',
review_status: 'PENDING',
manual_review: {
reason_code: 'missing_room_type_code',
review_instruction: '请确认 PMS 房型代码后解阻原任务卡。',
missing_fields: ['/extracted_fields/pms_room_type_code'],
source_message: {
...v3SourceMessageFixture,
source_message_id: '900085',
thread_subject: 'Need to change my booking',
},
message_events: [
{
...v3MessageEventFixture,
relevant_message_excerpt: 'I need to change my booking but did not include the PMS room type code.',
case_keys: {
group_code: null,
confirmation_number: null,
reservation_number: null,
block_code: null,
},
},
],
},
system_task_type: 'NEW_BOOKING',
task_card_type: 'NEW_BOOKING',
task_status: 'BLOCKED',
field_contract_version: 'reservation-task-card-v3',
draft_payload: null,
confirmed_payload: null,
availability: {
blocked: true,
read_only: true,
editable: false,
confirmable: false,
executable: false,
blocked_by_task_id: null,
blocked_reason: 'MANUAL_REVIEW_REQUIRED',
},
fields: [
{
row_number: 1,
card_name: 'New Booking',
result_type: 'manual_review',
task_type: 'NEW_BOOKING',
task_subtype: 'NEW_BOOKING',
display_area: '预订信息',
field_path: 'extracted_fields.pms_room_type_code',
display_name: 'PMS 房型代码',
default_value_source: 'manual_review',
visible: 'Y',
editable: 'N',
input_editable: 'N',
select_editable: 'N',
date_picker: 'N',
number_input: 'N',
file_display: 'N',
table_editable: 'N',
enum_options: null,
required_rule: 'Y',
display_condition: null,
validation_rule: null,
write_path: 'extracted_fields.pms_room_type_code',
opera_write_participation: 'Y',
opera_parameter_mapping: 'roomTypeCode',
notes: 'V3 同卡人工复核缺失字段。',
value: null,
},
],
opera_operations: [],
},
{
task_id: '700090',
order_id: 'TECH-S10-900090',
source_message_id: '900090',
source_subject: 'FYI arrival time',
source_sender_summary: 'guest@example.test',
source_received_at: '2026-07-08T07:40:00+08:00',
external_conversation_id: 'thread-900090',
conversation_message_count: 1,
result_type: 'source_message_review_notification',
ai_task_type: 'Message Notification',
task_subtype: 'S10',
route_code: 'S10',
system_process_category: 'SOURCE_MESSAGE_NOTIFICATION',
system_task_type: 'MESSAGE_NOTIFICATION',
task_card_type: 'MESSAGE_NOTIFICATION',
task_status: 'COMPLETED',
field_contract_version: 'reservation-task-card-v3',
draft_payload: null,
confirmed_payload: null,
availability: {
blocked: false,
read_only: true,
editable: false,
confirmable: false,
executable: false,
blocked_by_task_id: null,
blocked_reason: null,
},
fields: [],
source_message_only_result: {
entry_result_code: 'S10',
entry_result_meaning: 'PURE_INFORMATION',
entry_result_description: '纯信息类邮件,仅展示来源消息通知。',
entry_result_source_message_id: '900090',
result_type: 'source_message_review_notification',
route_code: 'S10',
agent_assessment: {
source_message: {
...v3SourceMessageFixture,
source_message_id: '900090',
thread_subject: 'FYI arrival time',
},
message_events: [
{
...v3MessageEventFixture,
relevant_message_excerpt: 'FYI: I may arrive at 3 PM.',
manual_review: null,
extracted_fields: {},
case_keys: {
group_code: null,
confirmation_number: null,
reservation_number: null,
block_code: null,
},
},
],
},
notification: {
summary: '客人仅同步到店时间,不需要生成业务任务。',
},
manual_review: null,
raw_answer: 'S10,900090',
},
adapter_contract_errors: [],
unhandled_intents: [],
opera_operations: [],
},
]
export const reservationTaskAudits: ReservationTaskAuditListResult[] = [
@@ -536,4 +750,26 @@ export const reservationTaskAudits: ReservationTaskAuditListResult[] = [
},
],
},
{
task_id: '700085',
items: [
{
audit_id: 'AUD-700085-1',
order_id: '100085',
task_id: '700085',
operation_id: null,
actor_type: 'SYSTEM',
actor_id: 'reservation-ai-intake',
action: 'MANUAL_REVIEW_CREATED',
reason: 'V3 type-known manual_review missing PMS room type code',
before_snapshot: null,
after_snapshot: {
result_type: 'manual_review',
review_status: 'PENDING',
missing_fields: ['/extracted_fields/pms_room_type_code'],
},
occurred_at: '2026-07-08T08:15:00+08:00',
},
],
},
]