接入前端P0页面真实接口

This commit is contained in:
andy committed 2026-07-08 16:20:06 +08:00
1 parent 5c5b8e33b0
commit 66a613d6cd
45 files changed
+8719

No files matched your search

+539
View File
@@ -0,0 +1,539 @@
import type {
ReservationOrderDetail,
ReservationTaskAuditListResult,
ReservationTaskDetailResult,
ReservationWorkbenchItem,
} from '@/types/reservation'
export const reservationWorkbenchItems: ReservationWorkbenchItem[] = [
{
order_id: '100083',
hotel_id: 'HOTEL-TEST',
display_name: '#ORD-083',
order_key_type: 'CONFIRMATION_NUMBER',
order_business_key: '#ORD-083',
active_business_key: '#ORD-083',
temporary_order_code: null,
order_status: 'ACTIVE',
business_key_source: 'AI_RESULT',
source_message_id: '900083',
guest_name: '王建国',
room_type: '豪华 Q1A',
arrival_date: '2026-07-09',
departure_date: '2026-07-10',
amount: 1246,
currency_code: 'CNY',
current_task_id: '700083',
current_task_card_type: 'NEW_BOOKING',
current_task_status: 'PENDING_CONFIRM',
updated_at: '2026-07-08T09:26:00+08:00',
},
{
order_id: '100084',
hotel_id: 'HOTEL-TEST',
display_name: 'GRP-SEA-0712',
order_key_type: 'GROUP_CODE',
order_business_key: 'GRP-SEA-0712',
active_business_key: 'GRP-SEA-0712',
temporary_order_code: null,
order_status: 'ACTIVE',
business_key_source: 'MANUAL_REVIEW',
source_message_id: '900084',
guest_name: 'Mark Lee',
room_type: '行政套房',
arrival_date: '2026-07-12',
departure_date: '2026-07-15',
amount: 3450,
currency_code: 'CNY',
current_task_id: '700084',
current_task_card_type: 'ROOMING_LIST',
current_task_status: 'READY',
updated_at: '2026-07-08T08:42:00+08:00',
},
{
order_id: '100085',
hotel_id: 'HOTEL-TEST',
display_name: 'TMP-20260708-001',
order_key_type: 'TEMPORARY_CODE',
order_business_key: null,
active_business_key: null,
temporary_order_code: 'TMP-20260708-001',
order_status: 'TEMPORARY',
business_key_source: 'PENDING_AI',
source_message_id: '900085',
guest_name: '李雪梅',
room_type: '豪华双床',
arrival_date: '2026-07-15',
departure_date: '2026-07-16',
amount: 665,
currency_code: 'CNY',
current_task_id: '700085',
current_task_card_type: 'MANUAL_REVIEW',
current_task_status: 'BLOCKED',
updated_at: '2026-07-08T08:15:00+08:00',
},
]
const firstWorkbenchItem = reservationWorkbenchItems[0] as ReservationWorkbenchItem
const secondWorkbenchItem = reservationWorkbenchItems[1] as ReservationWorkbenchItem
const thirdWorkbenchItem = reservationWorkbenchItems[2] as ReservationWorkbenchItem
export const reservationOrderDetails: ReservationOrderDetail[] = [
{
...firstWorkbenchItem,
source_message: {
source_message_id: '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',
summary: '客人请求 2026-07-09 入住 1 晚,豪华 Q1A,已提供手机号和预计到店时间。',
},
tasks: [
{
task_id: '700083',
order_id: '100083',
system_task_type: 'CREATE_RESERVATION',
task_card_type: 'NEW_BOOKING',
task_status: 'PENDING_CONFIRM',
queue_participation: true,
execution_order: 10,
blocked_by_task_id: null,
updated_at: '2026-07-08T09:26:00+08:00',
},
{
task_id: '700086',
order_id: '100083',
system_task_type: 'ADD_TRACE_NOTE',
task_card_type: 'TRACE_NOTE',
task_status: 'READY',
queue_participation: true,
execution_order: 20,
blocked_by_task_id: '700083',
updated_at: '2026-07-08T09:27:00+08:00',
},
],
},
{
...secondWorkbenchItem,
source_message: {
source_message_id: '900084',
channel: 'EMAIL',
sender_identifier: 'sales@example.test',
thread_subject: 'Rooming list update for GRP-SEA-0712',
payload_received_at: '2026-07-08T08:31:00+08:00',
summary: '销售团队补充团队房表,需要核对姓名、房型和入住离店日期。',
},
tasks: [
{
task_id: '700084',
order_id: '100084',
system_task_type: 'UPDATE_ROOMING_LIST',
task_card_type: 'ROOMING_LIST',
task_status: 'READY',
queue_participation: true,
execution_order: 10,
blocked_by_task_id: null,
updated_at: '2026-07-08T08:42:00+08:00',
},
],
},
{
...thirdWorkbenchItem,
source_message: {
source_message_id: '900085',
channel: 'EMAIL',
sender_identifier: 'guest@example.test',
thread_subject: 'Need to change my booking',
payload_received_at: '2026-07-08T08:02:00+08:00',
summary: '客人提到需要修改订单,但缺少可稳定匹配的业务号,需要人工复核。',
},
tasks: [
{
task_id: '700085',
order_id: '100085',
system_task_type: 'MANUAL_REVIEW',
task_card_type: 'MANUAL_REVIEW',
task_status: 'BLOCKED',
queue_participation: true,
execution_order: 10,
blocked_by_task_id: null,
updated_at: '2026-07-08T08:15:00+08:00',
},
],
},
]
export const reservationTaskDetails: ReservationTaskDetailResult[] = [
{
task_id: '700083',
order_id: '100083',
source_message_id: '900083',
system_task_type: 'CREATE_RESERVATION',
task_card_type: 'NEW_BOOKING',
task_status: 'PENDING_CONFIRM',
field_contract_version: 'reservation-task-card-v1',
draft_payload: null,
confirmed_payload: null,
availability: {
blocked: false,
read_only: false,
editable: true,
confirmable: true,
executable: false,
blocked_by_task_id: null,
blocked_reason: null,
},
fields: [
{
row_number: 1,
card_name: 'New Booking',
display_area: '客人信息',
field_path: 'guest.name',
display_name: '客人姓名',
visible: 'Y',
editable: 'Y',
input_editable: 'Y',
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: '不能为空',
write_path: 'reservation.guest.name',
opera_write_participation: 'Y',
opera_parameter_mapping: 'profile.name',
notes: '来自邮件正文,确认前可修正。',
value: '王建国',
},
{
row_number: 2,
card_name: 'New Booking',
display_area: '客人信息',
field_path: 'guest.phone',
display_name: '手机号',
visible: 'Y',
editable: 'Y',
input_editable: 'Y',
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: '手机号脱敏回显',
write_path: 'reservation.guest.phone',
opera_write_participation: 'Y',
opera_parameter_mapping: 'profile.phone',
notes: '前端只展示后端脱敏后的值。',
value: '186****1234',
},
{
row_number: 3,
card_name: 'New Booking',
display_area: '预订信息',
field_path: 'stay.arrival_date',
display_name: '入住日期',
visible: 'Y',
editable: 'Y',
input_editable: 'N',
select_editable: 'N',
date_picker: 'Y',
number_input: 'N',
file_display: 'N',
table_editable: 'N',
enum_options: null,
required_rule: 'Y',
display_condition: null,
validation_rule: 'YYYY-MM-DD',
write_path: 'reservation.stay.arrivalDate',
opera_write_participation: 'Y',
opera_parameter_mapping: 'arrivalDate',
notes: null,
value: '2026-07-09',
},
{
row_number: 4,
card_name: 'New Booking',
display_area: '预订信息',
field_path: 'stay.departure_date',
display_name: '离店日期',
visible: 'Y',
editable: 'Y',
input_editable: 'N',
select_editable: 'N',
date_picker: 'Y',
number_input: 'N',
file_display: 'N',
table_editable: 'N',
enum_options: null,
required_rule: 'Y',
display_condition: null,
validation_rule: 'YYYY-MM-DD',
write_path: 'reservation.stay.departureDate',
opera_write_participation: 'Y',
opera_parameter_mapping: 'departureDate',
notes: null,
value: '2026-07-10',
},
{
row_number: 5,
card_name: 'New Booking',
display_area: '预订信息',
field_path: 'room.type',
display_name: '房型',
visible: 'Y',
editable: 'Y',
input_editable: 'N',
select_editable: 'Y',
date_picker: 'N',
number_input: 'N',
file_display: 'N',
table_editable: 'N',
enum_options: '豪华 Q1A, 行政套房, 豪华双床',
required_rule: 'Y',
display_condition: null,
validation_rule: '必须来自房型枚举',
write_path: 'reservation.room.type',
opera_write_participation: 'Y',
opera_parameter_mapping: 'roomType',
notes: null,
value: '豪华 Q1A',
},
{
row_number: 6,
card_name: 'New Booking',
display_area: '预订信息',
field_path: 'room.count',
display_name: '房间数',
visible: 'Y',
editable: 'Y',
input_editable: 'N',
select_editable: 'N',
date_picker: 'N',
number_input: 'Y',
file_display: 'N',
table_editable: 'N',
enum_options: null,
required_rule: 'Y',
display_condition: null,
validation_rule: '正整数',
write_path: 'reservation.room.count',
opera_write_participation: 'Y',
opera_parameter_mapping: 'roomCount',
notes: null,
value: 1,
},
{
row_number: 7,
card_name: 'New Booking',
display_area: '付款信息',
field_path: 'payment.amount',
display_name: '订单金额',
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: 'N',
display_condition: null,
validation_rule: null,
write_path: null,
opera_write_participation: 'N',
opera_parameter_mapping: null,
notes: '金额由后端规则或外部系统确认,前端只读展示。',
value: 'CNY 1,246',
},
{
row_number: 8,
card_name: 'New Booking',
display_area: '附件与备注',
field_path: 'attachments.voucher',
display_name: '附件',
visible: 'Y',
editable: 'N',
input_editable: 'N',
select_editable: 'N',
date_picker: 'N',
number_input: 'N',
file_display: 'Y',
table_editable: 'N',
enum_options: null,
required_rule: 'N',
display_condition: null,
validation_rule: null,
write_path: null,
opera_write_participation: 'N',
opera_parameter_mapping: null,
notes: '只展示后端安全摘要,不展示原始附件 URL。',
value: ['booking-request.pdf'],
},
{
row_number: 9,
card_name: 'New Booking',
display_area: '附件与备注',
field_path: 'notes.guest_request',
display_name: '客房备注',
visible: 'Y',
editable: 'Y',
input_editable: 'Y',
select_editable: 'N',
date_picker: 'N',
number_input: 'N',
file_display: 'N',
table_editable: 'N',
enum_options: null,
required_rule: 'N',
display_condition: null,
validation_rule: null,
write_path: 'reservation.notes.guestRequest',
opera_write_participation: 'CONDITION',
opera_parameter_mapping: 'comments',
notes: '客人要求高楼层,预计 12:30 到店。',
value: '需要安静房间,支持高楼层。',
},
],
opera_operations: [],
},
{
task_id: '700084',
order_id: '100084',
source_message_id: '900084',
system_task_type: 'UPDATE_ROOMING_LIST',
task_card_type: 'ROOMING_LIST',
task_status: 'READY',
field_contract_version: 'reservation-task-card-v1',
draft_payload: {
'group.code': 'GRP-SEA-0712',
'rooming_list.rows': '3 rows',
},
confirmed_payload: {
'group.code': 'GRP-SEA-0712',
'rooming_list.rows': '3 rows',
},
availability: {
blocked: false,
read_only: true,
editable: false,
confirmable: false,
executable: true,
blocked_by_task_id: null,
blocked_reason: null,
},
fields: [
{
row_number: 1,
card_name: 'Rooming List',
display_area: '团队信息',
field_path: 'group.code',
display_name: '团队号',
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: 'group.code',
opera_write_participation: 'Y',
opera_parameter_mapping: 'groupCode',
notes: null,
value: 'GRP-SEA-0712',
},
{
row_number: 2,
card_name: 'Rooming List',
display_area: '房表',
field_path: 'rooming_list.rows',
display_name: '房表行',
visible: 'Y',
editable: 'N',
input_editable: 'N',
select_editable: 'N',
date_picker: 'N',
number_input: 'N',
file_display: 'N',
table_editable: 'Y',
enum_options: null,
required_rule: 'Y',
display_condition: null,
validation_rule: '至少一行',
write_path: 'group.roomingList',
opera_write_participation: 'Y',
opera_parameter_mapping: 'roomingList',
notes: '表格编辑第一版先只做摘要展示,详细编辑后续补独立组件。',
value: [
{ guest: 'Mark Lee', room_type: '行政套房', arrival_date: '2026-07-12' },
{ guest: 'Anna Kim', room_type: '行政套房', arrival_date: '2026-07-12' },
{ guest: '周为三', room_type: '豪华双床', arrival_date: '2026-07-13' },
],
},
],
opera_operations: [
{
operation_id: '810001',
task_id: '700084',
operation_sequence: 10,
operation_code: 'UPDATE_ROOMING_LIST',
operation_name: '更新团队房表',
operation_status: 'PENDING',
attempt_count: 0,
last_error_message: null,
attempts: [],
},
],
},
]
export const reservationTaskAudits: ReservationTaskAuditListResult[] = [
{
task_id: '700083',
items: [
{
audit_id: 'AUD-700083-1',
order_id: '100083',
task_id: '700083',
operation_id: null,
actor_type: 'SYSTEM',
actor_id: 'reservation-ai-intake',
action: 'TASK_CREATED',
reason: 'AI result projected to reservation task',
before_snapshot: null,
after_snapshot: { task_status: 'PENDING_CONFIRM' },
occurred_at: '2026-07-08T09:26:00+08:00',
},
],
},
{
task_id: '700084',
items: [
{
audit_id: 'AUD-700084-1',
order_id: '100084',
task_id: '700084',
operation_id: null,
actor_type: 'USER',
actor_id: 'andy',
action: 'TASK_CONFIRMED',
reason: '房表字段人工确认',
before_snapshot: { task_status: 'PENDING_CONFIRM' },
after_snapshot: { task_status: 'READY' },
occurred_at: '2026-07-08T08:42:00+08:00',
},
],
},
]