feat(M08-A): 接入顾客端选店下单入口
This commit is contained in:
@@ -50,6 +50,37 @@ const app = await buildApp({
|
||||
async findStores(query) {
|
||||
assert.equal(query.city, '上海市');
|
||||
return stores;
|
||||
},
|
||||
async getStore(query) {
|
||||
assert.equal(query.tenantId, '7');
|
||||
assert.equal(query.storeId, '11');
|
||||
return stores[0];
|
||||
},
|
||||
async listRooms(query) {
|
||||
assert.deepEqual(query, { tenantId: '7', storeId: '11' });
|
||||
return [{
|
||||
id: '101',
|
||||
storeId: '11',
|
||||
categoryName: '棋牌包间',
|
||||
name: '青竹房',
|
||||
roomNo: 'A101',
|
||||
capacity: 6,
|
||||
basePriceCents: 3600,
|
||||
weekdayPriceCents: 3200,
|
||||
holidayPriceCents: 4200,
|
||||
overnightPriceCents: 12800,
|
||||
fullDayPriceCents: 22800,
|
||||
minimumSpendCents: 0,
|
||||
depositCents: 5000,
|
||||
minimumMinutes: 60,
|
||||
maxAdvanceStartMinutes: 30,
|
||||
maxAdvanceDays: 7,
|
||||
configurationStatus: 'ENABLED',
|
||||
operationalStatus: 'AVAILABLE',
|
||||
tags: ['自动麻将机'],
|
||||
images: [],
|
||||
sortOrder: 1
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,6 +98,22 @@ const invalid = await app.inject({
|
||||
headers: { 'x-wechat-appid': 'wx-test-app', 'tenant-id': '7' }
|
||||
});
|
||||
assert.equal(invalid.statusCode, 400);
|
||||
|
||||
const detail = await app.inject({
|
||||
method: 'GET',
|
||||
url: '/app-api/stores/11',
|
||||
headers: { 'x-wechat-appid': 'wx-test-app', 'tenant-id': '7' }
|
||||
});
|
||||
assert.equal(detail.statusCode, 200);
|
||||
assert.equal(detail.json().data.name, '近店');
|
||||
|
||||
const rooms = await app.inject({
|
||||
method: 'GET',
|
||||
url: '/app-api/stores/11/rooms',
|
||||
headers: { 'x-wechat-appid': 'wx-test-app', 'tenant-id': '7' }
|
||||
});
|
||||
assert.equal(rooms.statusCode, 200);
|
||||
assert.equal(rooms.json().data[0].id, '101');
|
||||
await app.close();
|
||||
|
||||
console.log('PASS: M03-C trusted distance sorting, city fallback and public store discovery are present.');
|
||||
console.log('PASS: M08-A public store detail and room discovery support customer miniapp browsing.');
|
||||
|
||||
Reference in New Issue
Block a user