feat: 增加通用品牌咨询记录类型
This commit is contained in:
1 parent
0228112846
commit
8d93f34260
7 files changed
+27
-4
No files matched your search
@@ -152,6 +152,27 @@ test("customer booking DTO rejects incomplete package requests", async () => {
|
||||
assert.equal(JSON.parse(response.body).error.code, "HTTP_400");
|
||||
});
|
||||
|
||||
test("customer can create a generic inquiry without food-specific fields", async () => {
|
||||
const response = await request("/customer/bookings", {
|
||||
method: "POST",
|
||||
headers: { authorization: `Bearer ${customerToken}` },
|
||||
payload: {
|
||||
requestType: "inquiry",
|
||||
customerName: "个人品牌咨询客户",
|
||||
wechatId: "inquiry-wechat",
|
||||
contactPreference: "wechat",
|
||||
requestedTime: "下周三 14:00",
|
||||
note: "希望讨论品牌合作方案",
|
||||
},
|
||||
});
|
||||
assert.equal(response.statusCode, 201);
|
||||
const body = JSON.parse(response.body);
|
||||
const booking = await prisma.booking.findUnique({ where: { bookingNo: body.bookingNo } });
|
||||
assert.ok(booking);
|
||||
assert.equal(booking.requestType, "inquiry");
|
||||
createdBookingIds.push(booking.id);
|
||||
});
|
||||
|
||||
test("customer can create and cancel a package booking", async () => {
|
||||
const service = await prisma.service.findFirst({ where: { brandId, isEnabled: true, priceAmount: { not: null } } });
|
||||
assert.ok(service);
|
||||
|
||||
Reference in new issue
Block a user