Files
alibb-server/backend/tests/fixtures.ts
T

46 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-08-27 16:11:49 +08:00
export function makePayload(o: any = {}) {
return {
inquiry: {
inquiryId: '13776617920',
manager: 'cara Hu',
createTime: '2026-03-13T10:11:50Z',
updateTime: '2026-07-13T10:11:50Z',
status: '洽谈中',
msgPreview: 'hi',
isFlagged: false,
...o.inquiry,
},
customer: {
customerId: 'cid-1',
name: 'Carlos',
country: 'PE',
email: null,
company: 'World Shop',
registerTime: '2025-06-23T00:00:00Z',
avatarUrl: '',
buyerTags: 'TM沟通',
buyerFeatures: '',
behavior: { productViews: null, validInquiries: null, validRfq: 39 },
...o.customer,
},
messages: o.messages ?? [
{
messageId: 'm1',
sendTime: '2026-07-13T02:11:50Z',
sender: 'cara Hu',
direction: 'outgoing',
content: 'hello',
translation: '',
},
{
messageId: 'm2',
sendTime: '2026-07-13T02:12:00Z',
sender: 'Carlos',
direction: 'incoming',
content: 'hi',
translation: '',
},
],
};
}