@feedmepos/mf-order-setting 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{KioskDevicesView-AKvyDF3w.js → KioskDevicesView-Dvr4RUmt.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-Cx8VMyNB.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CJ-xAR8i.js} +2 -2
- package/dist/{KioskSettingView-equ5EIvU.js → KioskSettingView-DaJz8ZZi.js} +1 -1
- package/dist/{KioskView-CsE7BGtA.js → KioskView-v8Yl4x4R.js} +4 -4
- package/dist/OrderSettingsView-CN1PFwX_.js +74545 -0
- package/dist/{app-D-zQN9_E.js → app-d1Lptg6A.js} +123 -30
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-CWQSmujV.js → dayjs.min-BLlPHZkl.js} +278 -267
- package/dist/frontend/mf-order/src/api/business/index.d.ts +5 -0
- package/dist/frontend/mf-order/src/api/effects/index.d.ts +3 -0
- package/dist/frontend/mf-order/src/api/index.d.ts +2 -0
- package/dist/frontend/mf-order/src/api/remoteOrder/index.d.ts +1 -0
- package/dist/frontend/mf-order/src/app.d.ts +93 -0
- package/dist/frontend/mf-order/src/main.d.ts +93 -0
- package/dist/frontend/mf-order/src/stores/business/index.d.ts +62 -0
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +139 -125
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +81 -78
- package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +54 -52
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +4 -0
- package/dist/frontend/mf-order/src/views/order-settings/discount-rule/DiscountRuleSetting.vue.d.ts +2 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-BwrMcIf2.js → index-Cg9kSeyn.js} +2 -2
- package/dist/package/entity/booking/booking.do.d.ts +596 -551
- package/dist/package/entity/delivery/delivery.dto.d.ts +118 -109
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +342 -652
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +13778 -478
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +731 -1227
- package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +1 -1
- package/dist/package/entity/index.d.ts +1 -0
- package/dist/package/entity/kiosk/kiosk.do.d.ts +32 -0
- package/dist/package/entity/kiosk/kiosk.dto.d.ts +14 -14
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +1469 -621
- package/dist/package/entity/member/member.dto.d.ts +14 -7
- package/dist/package/entity/order/effects/effect.dto.d.ts +154 -6
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +87 -34
- package/dist/package/entity/order/order.do.d.ts +177 -572
- package/dist/package/entity/order/order.dto.d.ts +902 -1412
- package/dist/package/entity/order/pickup/pickup.dto.d.ts +37 -0
- package/dist/package/entity/order-platform/external/menu/external-menu.dto.d.ts +8 -0
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +8 -0
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +22 -3
- package/dist/package/entity/order-platform/external/order/external-order.enum.d.ts +1 -1
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +5 -0
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +5 -0
- package/dist/package/entity/order-platform/external/zus/zus-menu.dto.d.ts +192 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +104 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +152 -109
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +3 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +3 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda.enum.d.ts +2 -0
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +139 -109
- package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +3 -0
- package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +152 -2
- package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +2 -0
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +6 -3
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +164 -109
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.dto.d.ts +22 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +3 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +3 -0
- package/dist/package/entity/queue/queue.dto.d.ts +11446 -93
- package/dist/package/entity/user/user.do.d.ts +129 -18
- package/dist/queue.do-zk6sqriQ.js +125612 -0
- package/package.json +4 -3
- package/src/api/business/index.ts +16 -0
- package/src/api/effects/index.ts +7 -0
- package/src/api/index.ts +9 -1
- package/src/api/remoteOrder/index.ts +3 -0
- package/src/locales/en-US.json +31 -1
- package/src/locales/th-TH.json +31 -1
- package/src/locales/zh-CN.json +34 -1
- package/src/stores/business/index.ts +45 -0
- package/src/stores/restaurant/index.ts +3 -1
- package/src/views/order-settings/OrderSettingsView.vue +17 -5
- package/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue +38 -1
- package/src/views/order-settings/discount-rule/DiscountRuleSetting.vue +452 -0
- package/dist/OrderSettingsView-BpLXyk_0.js +0 -49013
- package/dist/queue.do-F110q0_J.js +0 -100389
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-order-setting",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./dist/app.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"build:dev": "cross-env NODE_ENV=dev vite build --mode dev",
|
|
22
22
|
"build:prod": "vite build --mode prod",
|
|
23
23
|
"type-check": "set NODE_OPTIONS=--max-old-space-size=16384 && vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
|
24
|
+
"type-check:mac": "export NODE_OPTIONS=--max-old-space-size=16384 && vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
|
24
25
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
25
26
|
"format": "prettier --write src/"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@feedmepos/core": "^2.14.
|
|
29
|
-
"@feedmepos/menu": "^1.5.
|
|
29
|
+
"@feedmepos/core": "^2.14.19",
|
|
30
|
+
"@feedmepos/menu": "^1.5.21",
|
|
30
31
|
"@feedmepos/mf-common": "1.20.0-beta.2",
|
|
31
32
|
"@feedmepos/ordering": "^0.0.3",
|
|
32
33
|
"@feedmepos/ui-library": "1.5.2-beta.1",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getData, businessClientInstance } from '@/api'
|
|
2
|
+
import { FdtoDiscountRuleRes, FdoDiscountRule } from '@feedmepos/core/entity'
|
|
3
|
+
|
|
4
|
+
export const businessApi = {
|
|
5
|
+
async readDiscountRule(businessId: string): Promise<FdtoDiscountRuleRes> {
|
|
6
|
+
const result = await businessClientInstance(businessId).get('/discount-rule')
|
|
7
|
+
return getData(result)
|
|
8
|
+
},
|
|
9
|
+
async updateDiscountRule(
|
|
10
|
+
businessId: string,
|
|
11
|
+
discountRule: FdoDiscountRule
|
|
12
|
+
): Promise<FdtoDiscountRuleRes> {
|
|
13
|
+
const result = await businessClientInstance(businessId).put('/discount-rule', discountRule)
|
|
14
|
+
return getData(result)
|
|
15
|
+
}
|
|
16
|
+
}
|
package/src/api/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ interface ApiUrl {
|
|
|
12
12
|
menuBackendUrl: string
|
|
13
13
|
smsBackendUrl: string
|
|
14
14
|
accountBackendUrl: string
|
|
15
|
+
marketingBackendUrl: string
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
let apiUrl: ApiUrl | null = null
|
|
@@ -57,13 +58,15 @@ function generateBackendUrl(country: F_COUNTRY): ApiUrl {
|
|
|
57
58
|
const domain = `${isDev ? '-dev' : ''}${area}.feedmeapi.com`
|
|
58
59
|
const portalBackendUrl = `https://portal-v2${domain}`
|
|
59
60
|
const accountBackendUrl = `https://account${domain}`
|
|
61
|
+
const marketingBackendUrl = `https://portal-marketing${domain}`
|
|
60
62
|
return {
|
|
61
63
|
portalBackendUrl,
|
|
62
64
|
websocketBackendUrl: `wss://94ilf9iqc0.execute-api.ap-southeast-1.amazonaws.com/${isDev ? 'dev' : 'prod'}`,
|
|
63
65
|
linkedDeliveryBackend: `${portalBackendUrl}/linked-deliveries`,
|
|
64
66
|
menuBackendUrl: `${portalBackendUrl}/menu-v4`,
|
|
65
67
|
smsBackendUrl: `https://sms${domain}`,
|
|
66
|
-
accountBackendUrl
|
|
68
|
+
accountBackendUrl,
|
|
69
|
+
marketingBackendUrl
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
|
|
@@ -179,6 +182,11 @@ export const smsBackendClientInstance = (): AxiosInstance => {
|
|
|
179
182
|
return baseClientInstance('', 'portal', { url: smsBackendUrl })
|
|
180
183
|
}
|
|
181
184
|
|
|
185
|
+
export const marketingBackendClientInstance = (): AxiosInstance => {
|
|
186
|
+
const { marketingBackendUrl } = SvcConfig.getBackendUrl()
|
|
187
|
+
return baseClientInstance('', 'portal', { url: marketingBackendUrl })
|
|
188
|
+
}
|
|
189
|
+
|
|
182
190
|
export function getData<T>(response: AxiosResponse<T>): T {
|
|
183
191
|
return response.data
|
|
184
192
|
}
|
|
@@ -88,6 +88,9 @@ export const remoteOrderApi = {
|
|
|
88
88
|
async syncGrabfoodMenu(merchantId: string): Promise<FdoGrabfoodSettings> {
|
|
89
89
|
return getData(await deliveryClientInstance('grabfood').get(`/menu-sync/${merchantId}`));
|
|
90
90
|
},
|
|
91
|
+
async startSelfServeFlow(restaurantId: string): Promise<string> {
|
|
92
|
+
return getData(await deliveryClientInstance('grabfood').get(`/setting/integration-url/${restaurantId}`));
|
|
93
|
+
},
|
|
91
94
|
|
|
92
95
|
async readShopeefood(restaurantId: string): Promise<FdoShopeeFoodSettings | null> {
|
|
93
96
|
return getData(await deliveryClientInstance('shopeefood').get(`/setting/${restaurantId}`));
|
package/src/locales/en-US.json
CHANGED
|
@@ -207,6 +207,11 @@
|
|
|
207
207
|
"selectRestaurant": "Select Restaurant",
|
|
208
208
|
"selectServiceChargeType": "Select service charge type",
|
|
209
209
|
"selectTable": "Select table",
|
|
210
|
+
"selfServeActivation": {
|
|
211
|
+
"title": "Self Serve Activation",
|
|
212
|
+
"subTitle": "New to the flow? Click here to",
|
|
213
|
+
"learnMore": "learn more"
|
|
214
|
+
},
|
|
210
215
|
"serve": "serve",
|
|
211
216
|
"serviceCharge": "Service Charge",
|
|
212
217
|
"serviceChargeRule": "* Service Charge required POS version 4.0.0 or higher",
|
|
@@ -264,6 +269,31 @@
|
|
|
264
269
|
"pickupCatalog": "Pickup catalog",
|
|
265
270
|
"DeliverySettingUpdated": "Delivery setting updated.",
|
|
266
271
|
"selectPlatform": "Select Platform",
|
|
267
|
-
"platform": "Platform"
|
|
272
|
+
"platform": "Platform",
|
|
273
|
+
"discountRule": {
|
|
274
|
+
"add": "Add discount rule",
|
|
275
|
+
"description": "Define how the discount is applied to the bill. Require POS version {minPosVersion} or above.",
|
|
276
|
+
"effect": "Promotion/Vouchers",
|
|
277
|
+
"effectSelected": "{count} selected",
|
|
278
|
+
"effectUsedInOtherGroup": "Used in another rule",
|
|
279
|
+
"forceSync": "Force sync",
|
|
280
|
+
"latest": "Latest",
|
|
281
|
+
"loadingRestaurants": "Loading restaurants",
|
|
282
|
+
"maxTotalUses": "Max total uses",
|
|
283
|
+
"maxTotalUsesSublabel": "Maximum times promotions/vouchers can be used per bill",
|
|
284
|
+
"outdated": "Outdated",
|
|
285
|
+
"restaurantName": "Restaurant Name",
|
|
286
|
+
"restaurants": "Restaurants",
|
|
287
|
+
"restaurantsDescription": "Sync status of the discount rule across all restaurants",
|
|
288
|
+
"selectAllEffects": "Select all promotions/vouchers",
|
|
289
|
+
"selectEffects": "Select promotions/vouchers",
|
|
290
|
+
"status": "Status",
|
|
291
|
+
"syncSuccess": "Discount rule setting synced to all restaurants",
|
|
292
|
+
"title": "Discount Rule",
|
|
293
|
+
"updateSuccess": "Discount rule setting updated",
|
|
294
|
+
"version": "Version",
|
|
295
|
+
"promotion": "Promotion",
|
|
296
|
+
"voucher": "Voucher"
|
|
297
|
+
}
|
|
268
298
|
}
|
|
269
299
|
}
|
package/src/locales/th-TH.json
CHANGED
|
@@ -203,6 +203,11 @@
|
|
|
203
203
|
"selectRestaurant": "เลือกร้านอาหาร",
|
|
204
204
|
"selectServiceChargeType": "เลือกประเภทค่าบริการ",
|
|
205
205
|
"selectTable": "เลือกโต๊ะ",
|
|
206
|
+
"selfServeActivation": {
|
|
207
|
+
"title": "เปิดใช้งานการบริการตนเอง",
|
|
208
|
+
"subTitle": "เปิดใช้งานการบริการตนเองเพื่อให้ลูกค้าสามารถสั่งซื้อได้ด้วยตนเอง",
|
|
209
|
+
"learnMore": "เรียนรู้เพิ่มเติม"
|
|
210
|
+
},
|
|
206
211
|
"serve": "เสิร์ฟ",
|
|
207
212
|
"serviceCharge": "ค่าบริการ",
|
|
208
213
|
"serviceChargeRule": "* ค่าบริการจำเป็นต้องใช้ POS เวอร์ชัน 4.0.0 ขึ้นไป",
|
|
@@ -259,6 +264,31 @@
|
|
|
259
264
|
"pickupCatalog": "แคตตาล็อกการรับสินค้า",
|
|
260
265
|
"DeliverySettingUpdated": "อัปเดตการตั้งค่าการจัดส่งแล้ว",
|
|
261
266
|
"selectPlatform": "เลือกแพลตฟอร์ม",
|
|
262
|
-
"platform": "แพลตฟอร์ม"
|
|
267
|
+
"platform": "แพลตฟอร์ม",
|
|
268
|
+
"discountRule": {
|
|
269
|
+
"add": "เพิ่มกฎส่วนลด",
|
|
270
|
+
"description": "กำหนดวิธีการใช้ส่วนลดในบิล ใช้ได้กับ POS เวอร์ชัน {minPosVersion} หรือใหม่กว่าเท่านั้น",
|
|
271
|
+
"effect": "โปรโมชั่น/บัตรกำนัล",
|
|
272
|
+
"effectSelected": "เลือกแล้ว {count} รายการ",
|
|
273
|
+
"effectUsedInOtherGroup": "ถูกใช้ในกฎอื่น",
|
|
274
|
+
"forceSync": "ซิงค์ข้อมูลแบบบังคับ",
|
|
275
|
+
"latest": "เผยแพร่ล่าสุด",
|
|
276
|
+
"loadingRestaurants": "กำลังโหลดร้านอาหาร",
|
|
277
|
+
"maxTotalUses": "จำนวนการใช้งานสูงสุด",
|
|
278
|
+
"maxTotalUsesSublabel": "จำนวนครั้งสูงสุดที่สามารถใช้โปรโมชั่น/บัตรกำนัลต่อบิล",
|
|
279
|
+
"outdated": "ล้าสมัย",
|
|
280
|
+
"restaurantName": "ชื่อร้านอาหาร",
|
|
281
|
+
"restaurants": "ร้านอาหาร",
|
|
282
|
+
"restaurantsDescription": "สถานะการซิงค์กฎส่วนลดของทุกร้านอาหาร",
|
|
283
|
+
"selectAllEffects": "เลือกโปรโมชั่น/บัตรกำนัลทั้งหมด",
|
|
284
|
+
"selectEffects": "เลือกโปรโมชั่น/บัตรกำนัล",
|
|
285
|
+
"status": "สถานะ",
|
|
286
|
+
"syncSuccess": "ซิงค์กฎส่วนลดไปยังร้านอาหารทั้งหมดเรียบร้อยแล้ว",
|
|
287
|
+
"title": "กฎส่วนลด",
|
|
288
|
+
"updateSuccess": "อัปเดตกฎส่วนลดเรียบร้อยแล้ว",
|
|
289
|
+
"version": "เวอร์ชัน",
|
|
290
|
+
"promotion": "โปรโมชั่น",
|
|
291
|
+
"voucher": "บัตรกำนัล"
|
|
292
|
+
}
|
|
263
293
|
}
|
|
264
294
|
}
|
package/src/locales/zh-CN.json
CHANGED
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"edit": "编辑",
|
|
92
92
|
"editOfflinePayment": "编辑线下支付方式",
|
|
93
93
|
"editPickupPoint": "编辑取货地点",
|
|
94
|
+
"effectSelected": "已选择效果",
|
|
94
95
|
"enableServiceCharge": "启用服务费",
|
|
95
96
|
"end": "结束",
|
|
96
97
|
"enterAddress": "输入地址",
|
|
@@ -203,10 +204,17 @@
|
|
|
203
204
|
"search": "搜索",
|
|
204
205
|
"searchRestaurant": "搜索餐厅",
|
|
205
206
|
"selectAllItemsIncludeCustomItem": "全部 (包括自定义商品)",
|
|
207
|
+
"selectEffects": "选择效果",
|
|
208
|
+
"selectAllEffects": "选择所有效果",
|
|
206
209
|
"selectItem": "请选择",
|
|
207
210
|
"selectRestaurant": "选择餐厅",
|
|
208
211
|
"selectServiceChargeType": "选择服务费类型",
|
|
209
212
|
"selectTable": "选择餐桌",
|
|
213
|
+
"selfServeActivation": {
|
|
214
|
+
"title": "自助激活对接",
|
|
215
|
+
"subTitle": "第一次使用这个流程?点击此处",
|
|
216
|
+
"learnMore": "了解更多"
|
|
217
|
+
},
|
|
210
218
|
"serve": "服务",
|
|
211
219
|
"serviceCharge": "服务费",
|
|
212
220
|
"serviceChargeRule": "* 服务费功能仅适用于POS版本4.0.0或更高版本。",
|
|
@@ -264,6 +272,31 @@
|
|
|
264
272
|
"pickupCatalog": "自取目录",
|
|
265
273
|
"DeliverySettingUpdated": "配送设置已更新",
|
|
266
274
|
"selectPlatform": "选择平台",
|
|
267
|
-
"platform": "平台"
|
|
275
|
+
"platform": "平台",
|
|
276
|
+
"discountRule": {
|
|
277
|
+
"add": "添加折扣规则",
|
|
278
|
+
"description": "定义折扣在账单中如何应用。仅适用于POS版本{minPosVersion}或更高版本。",
|
|
279
|
+
"effect": "促销/代金券",
|
|
280
|
+
"effectSelected": "已选择{count}个",
|
|
281
|
+
"effectUsedInOtherGroup": "已在其他规则中使用",
|
|
282
|
+
"forceSync": "强制同步",
|
|
283
|
+
"latest": "已发布",
|
|
284
|
+
"loadingRestaurants": "正在加载餐厅",
|
|
285
|
+
"maxTotalUses": "最大使用次数",
|
|
286
|
+
"maxTotalUsesSublabel": "每张账单最多可使用促销/代金券次数",
|
|
287
|
+
"outdated": "过时",
|
|
288
|
+
"restaurantName": "餐厅名称",
|
|
289
|
+
"restaurants": "餐厅",
|
|
290
|
+
"restaurantsDescription": "所有餐厅的折扣规则同步状态",
|
|
291
|
+
"selectAllEffects": "选择所有促销/代金券",
|
|
292
|
+
"selectEffects": "选择促销/代金券",
|
|
293
|
+
"status": "状态",
|
|
294
|
+
"syncSuccess": "折扣规则设置已同步到所有餐厅",
|
|
295
|
+
"title": "折扣规则",
|
|
296
|
+
"updateSuccess": "折扣规则设置已更新",
|
|
297
|
+
"version": "版本",
|
|
298
|
+
"promotion": "促销",
|
|
299
|
+
"voucher": "代金券"
|
|
300
|
+
}
|
|
268
301
|
}
|
|
269
302
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
import { FdtoDiscountRuleRes, FdoDiscountRule } from '@feedmepos/core/entity'
|
|
3
|
+
import { useCoreStore } from '@feedmepos/mf-common'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import { businessApi } from '@/api/business'
|
|
6
|
+
|
|
7
|
+
interface BusinessState {
|
|
8
|
+
discountRule?: FdtoDiscountRuleRes
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function initBusinessState(): BusinessState {
|
|
12
|
+
return {
|
|
13
|
+
discountRule: undefined
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const useBusinessStore = defineStore('business', () => {
|
|
18
|
+
const coreStore = useCoreStore()
|
|
19
|
+
const state = ref(initBusinessState())
|
|
20
|
+
|
|
21
|
+
async function readDiscountRule(): Promise<FdtoDiscountRuleRes> {
|
|
22
|
+
if (!coreStore.currentBusiness.value?._id) {
|
|
23
|
+
throw new Error('No business selected.')
|
|
24
|
+
}
|
|
25
|
+
const discountRule = await businessApi.readDiscountRule(coreStore.currentBusiness.value._id)
|
|
26
|
+
state.value.discountRule = discountRule
|
|
27
|
+
return discountRule
|
|
28
|
+
}
|
|
29
|
+
async function updateDiscountRule(discountRule: FdoDiscountRule): Promise<FdtoDiscountRuleRes> {
|
|
30
|
+
if (!coreStore.currentBusiness.value?._id) {
|
|
31
|
+
throw new Error('No business selected.')
|
|
32
|
+
}
|
|
33
|
+
const updatedRule = await businessApi.updateDiscountRule(
|
|
34
|
+
coreStore.currentBusiness.value._id,
|
|
35
|
+
discountRule
|
|
36
|
+
)
|
|
37
|
+
state.value.discountRule = updatedRule
|
|
38
|
+
return updatedRule
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
state: state.value,
|
|
42
|
+
readDiscountRule,
|
|
43
|
+
updateDiscountRule
|
|
44
|
+
}
|
|
45
|
+
})
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
type FdoAddress,
|
|
14
14
|
type FdoProfile,
|
|
15
15
|
FdoRestaurant,
|
|
16
|
+
FdoRestaurantSetting,
|
|
17
|
+
type FdoEffectGroup
|
|
16
18
|
} from '@feedmepos/core/entity'
|
|
17
19
|
import { FdoExternalSetting, FdoGrabfoodSettings } from '@entity'
|
|
18
20
|
import { FeatureFlag, Pos } from '@feedmepos/core'
|
|
@@ -145,6 +147,6 @@ export const useRestaurantStore = defineStore('restaurant', () => {
|
|
|
145
147
|
updateIntegratedGrabfoodDelivery,
|
|
146
148
|
updateIntegratedShopeefoodDelivery,
|
|
147
149
|
updateExternalDelivery,
|
|
148
|
-
getRestaurantEPayment
|
|
150
|
+
getRestaurantEPayment,
|
|
149
151
|
}
|
|
150
152
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="py-[1.5rem]">
|
|
3
|
-
<FmPageHead :title="t('order.orderSetting')"/>
|
|
3
|
+
<FmPageHead :title="t('order.orderSetting')" />
|
|
4
4
|
<div class="flex px-[1.5rem]">
|
|
5
5
|
<div class="flex-[2_2_0%] overflow-auto">
|
|
6
|
-
<FmTabs v-model:model-value="selectedOrderSetting" :items="settingItem" />
|
|
6
|
+
<FmTabs v-model:model-value="selectedOrderSetting" :items="settingItem" :showMoreAt="99" />
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
@@ -18,11 +18,20 @@ import DineInSetting from './dine-in/DineInSetting.vue'
|
|
|
18
18
|
import PickUpSetting from './pickup/PickUpSetting.vue'
|
|
19
19
|
import SmsSetting from './sms/SmsSetting.vue'
|
|
20
20
|
import ServiceChargeSetting from './servicecharge/ServiceChargeSetting.vue'
|
|
21
|
+
import DiscountRuleSetting from './discount-rule/DiscountRuleSetting.vue'
|
|
22
|
+
|
|
21
23
|
import GeneralSetting from './general/GeneralSetting.vue'
|
|
22
24
|
import { useI18n } from '@feedmepos/mf-common'
|
|
23
25
|
|
|
24
26
|
const { t } = useI18n()
|
|
25
|
-
type OrderSettingMenuItemValue =
|
|
27
|
+
type OrderSettingMenuItemValue =
|
|
28
|
+
| 'delivery'
|
|
29
|
+
| 'pickup'
|
|
30
|
+
| 'dinein'
|
|
31
|
+
| 'servicecharge'
|
|
32
|
+
| 'sms'
|
|
33
|
+
| 'discountRule'
|
|
34
|
+
| 'general'
|
|
26
35
|
const selectedOrderSetting = ref<OrderSettingMenuItemValue>('delivery')
|
|
27
36
|
|
|
28
37
|
const settingItem = computed<FmTabProps[]>(() => [
|
|
@@ -30,8 +39,9 @@ const settingItem = computed<FmTabProps[]>(() => [
|
|
|
30
39
|
{ label: t('order.pickup'), value: 'pickup' },
|
|
31
40
|
{ label: t('order.dineIn'), value: 'dinein' },
|
|
32
41
|
{ label: t('order.serviceCharge'), value: 'servicecharge' },
|
|
42
|
+
{ label: t('order.discountRule.title'), value: 'discountRule' },
|
|
33
43
|
{ label: t('order.sms'), value: 'sms' },
|
|
34
|
-
{ label: t('order.general'), value: 'general'}
|
|
44
|
+
{ label: t('order.general'), value: 'general' }
|
|
35
45
|
])
|
|
36
46
|
|
|
37
47
|
const currentComponent = computed(() => {
|
|
@@ -46,7 +56,9 @@ const currentComponent = computed(() => {
|
|
|
46
56
|
return SmsSetting
|
|
47
57
|
case 'servicecharge':
|
|
48
58
|
return ServiceChargeSetting
|
|
49
|
-
case '
|
|
59
|
+
case 'discountRule':
|
|
60
|
+
return DiscountRuleSetting
|
|
61
|
+
case 'general':
|
|
50
62
|
return GeneralSetting
|
|
51
63
|
}
|
|
52
64
|
})
|
|
@@ -88,7 +88,7 @@ async function syncMenu() {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
import { useSnackbarFunctions } from '@/components/snackbar'
|
|
91
|
-
const { showSuccess } = useSnackbarFunctions()
|
|
91
|
+
const { showSuccess, showError } = useSnackbarFunctions()
|
|
92
92
|
|
|
93
93
|
async function flowTestOrder() {
|
|
94
94
|
await startAsyncCallWithErr(async () => {
|
|
@@ -108,6 +108,20 @@ async function cancelTestOrder() {
|
|
|
108
108
|
})
|
|
109
109
|
showSuccess('Completed. ')
|
|
110
110
|
}
|
|
111
|
+
|
|
112
|
+
async function startSelfServeFlow() {
|
|
113
|
+
const url = await startAsyncCallWithErr(async () => {
|
|
114
|
+
return await remoteOrderApi.integratedDelivery.startSelfServeFlow(
|
|
115
|
+
currentRestaurant.value?._id ?? ''
|
|
116
|
+
)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
if (!url) {
|
|
120
|
+
showError(`Failed to get integration url for ${currentRestaurant?.value?._id}`)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
window.open(url, '_blank')
|
|
124
|
+
}
|
|
111
125
|
</script>
|
|
112
126
|
|
|
113
127
|
<template>
|
|
@@ -120,4 +134,27 @@ async function cancelTestOrder() {
|
|
|
120
134
|
@flow-test-order="flowTestOrder"
|
|
121
135
|
@cancel-test-order="cancelTestOrder"
|
|
122
136
|
/>
|
|
137
|
+
<div v-if="canUseAutoDeliveryIntegration === true">
|
|
138
|
+
<div class="flex flex-row mt-5 items-center">
|
|
139
|
+
<div class="flex-grow fm-typo-en-title-sm-600 mb-3 mt-3">
|
|
140
|
+
{{ t('order.selfServeActivation.title') }}
|
|
141
|
+
</div>
|
|
142
|
+
<FmButton
|
|
143
|
+
variant="primary"
|
|
144
|
+
:label="t('order.start')"
|
|
145
|
+
@click="startSelfServeFlow"
|
|
146
|
+
class="m-1"
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
<div>
|
|
150
|
+
{{ t('order.selfServeActivation.subTitle') }}
|
|
151
|
+
<a
|
|
152
|
+
href="https://doc.clickup.com/25608366/d/h/rdg5e-52596/7d44e2bd89752e0"
|
|
153
|
+
target="_blank"
|
|
154
|
+
style="color: blue; text-decoration: underline"
|
|
155
|
+
>
|
|
156
|
+
{{ t('order.selfServeActivation.learnMore') }}</a
|
|
157
|
+
>.
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
123
160
|
</template>
|