修复变更、增加筛选条件

This commit is contained in:
andy committed 2026-09-11 21:22:14 +08:00
1 parent 712ec51d68
commit e06afc8c33
137 files changed
+35872 -275

No files matched your search

+41
View File
@@ -82,6 +82,29 @@ test('hotel clear and update replies stay business-readable when the booking tem
assert.equal(updateReply.text, '酒店安排成功\n团号:LW-260603Z-A\n退房日期:2026-06-05\n房数:9间');
});
test('hotel replacement reply describes the new hotel and count while retaining the original dates', () => {
const reply = buildCustomerSuccessReply(
{ success: true, group_number: 'LW-TEST-A' },
{},
{
action: 'arrangement_hotel',
data: {
arrangement: {
mode: 'update',
resource: { id: '100', name: '原酒店' },
start_date: '2026-09-15',
end_date: '2026-09-16',
room_count: 8,
changes: { resource: { id: '270', name: '测试新酒店' }, room_count: 9 }
}
}
}
);
assert.equal(reply?.text, '酒店安排成功\n团号:LW-TEST-A\n资源:测试新酒店\n入住日期:2026-09-15\n退房日期:2026-09-16\n房数:9间');
assert.equal(reply?.fields.resource, '测试新酒店');
assert.equal(reply?.fields.quantity, 9);
});
test('batch newbooking receipt preserves every group number', () => {
const reply = buildCustomerSuccessReply(
{ success: true, group_number: 'LW-260603A-A', group_numbers: ['LW-260603A-A', 'LW-260605A-A'] },
@@ -191,3 +214,21 @@ test('legacy ERP mojibake filenames are repaired when a stored receipt is read',
download_url: '/api/tasks/TASK-LEGACY/artifacts/ART-LEGACY'
}]);
});
test('arrangement replacement receipts report the new resource and quantity with original dates', () => {
for (const action of ['arrangement_guide', 'arrangement_vehicle', 'arrangement_transport', 'arrangement_other']) {
const guide = action === 'arrangement_guide';
const reply = buildCustomerSuccessReply({ success: true, group_number: 'LW-TEST-UPDATE' }, {}, {
action,
data: { arrangement: {
mode: 'update', [guide ? 'resource' : 'supplier']: { name: '原资源' }, quantity: 3,
date: '2026-09-15',
changes: { [guide ? 'resource' : 'supplier']: { name: '新资源' }, ...(!guide ? { quantity: 8, item: '新项目' } : {}) }
} }
});
assert.equal(reply?.fields.resource, '新资源');
assert.equal(reply?.fields.date, '2026-09-15');
if (!guide) { assert.equal(reply?.fields.quantity, 8); assert.equal(reply?.fields.item, '新项目'); }
assert.doesNotMatch(reply?.text || '', /原资源/);
}
});