@feedmepos/mf-order-setting 0.0.72-prod → 0.0.73-dev
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/.env +1 -1
- package/README.md +7 -23
- package/dist/{KioskDevicesView-DIiEVc0i.js → KioskDevicesView-Dztw-Q35.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-BD0Olm4_.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-Ol419NZh.js} +3 -3
- package/dist/{KioskSettingView-Csm9he9M.js → KioskSettingView-BUHmoxyO.js} +183 -202
- package/dist/{KioskView-Ho2ts0j6.js → KioskView-B8j77zMA.js} +4 -4
- package/dist/OrderSettingsView-C5PK8CKZ.js +60009 -0
- package/dist/{app-xl2InG-H.js → app-C2_s0fkK.js} +5066 -4942
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BVqlMLNE.js → dayjs.min-B3nOmXcs.js} +1 -1
- package/dist/frontend/mf-order/src/api/menu/index.d.ts +1 -1
- package/dist/frontend/mf-order/src/api/remoteOrder/index.d.ts +10 -3
- package/dist/frontend/mf-order/src/app.d.ts +44 -8
- package/dist/frontend/mf-order/src/components/GoogleMap.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/composables/useQrOrderingEnabled.d.ts +2 -0
- package/dist/frontend/mf-order/src/helpers/menu.d.ts +1 -1
- package/dist/frontend/mf-order/src/main.d.ts +44 -8
- package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +21 -21
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +906 -1044
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +36 -3
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +5 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/DeliverySetting.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/components/TaxInput.vue.d.ts +3 -8
- package/dist/frontend/mf-order/src/views/order-settings/delivery/delivery.d.ts +3 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/delivery.data.d.ts +5 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +21 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue.d.ts +28 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/LinemanSetting.vue.d.ts +46 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/TngSetting.vue.d.ts +57 -0
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialogContent.vue.d.ts +23 -1
- package/dist/frontend/mf-order/src/views/order-settings/pickup/Preorder.vue.d.ts +27 -0
- package/dist/frontend/mf-order/src/views/order-settings/servicecharge/RateInput.vue.d.ts +8 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/index-6PQJ07gD.js +665 -0
- package/dist/{index-B4qdL9W3.js → index-B4XxBqiV.js} +1 -1
- package/dist/lineman-settings.dto-DcYJFu0U.js +60394 -0
- package/dist/package/entity/_type-assert.d.ts +7 -0
- package/dist/package/entity/booking/booking.dto.d.ts +24 -24
- package/dist/package/entity/delivery/delivery.dto.d.ts +8 -8
- package/dist/package/entity/delivery/delivery.enum.d.ts +12 -0
- package/dist/package/entity/delivery/gateway/grab.dto.d.ts +2 -2
- package/dist/package/entity/delivery/gateway/kosmo.dto.d.ts +16 -16
- package/dist/package/entity/delivery/gateway/pandago.dto.d.ts +4 -4
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +282 -4591
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +32 -24
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +23 -11719
- package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +2 -2
- package/dist/package/entity/index.d.ts +12 -0
- package/dist/package/entity/kiosk/kiosk.do.d.ts +140 -140
- package/dist/package/entity/kiosk/kiosk.dto.d.ts +168 -168
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +63 -7
- package/dist/package/entity/marketing/marketing.dto.d.ts +4 -4
- package/dist/package/entity/member/member.dto.d.ts +6 -0
- package/dist/package/entity/order/dine-in/dine-in.do.d.ts +8 -8
- package/dist/package/entity/order/effects/effect.dto.d.ts +68 -16
- package/dist/package/entity/order/menu/menu.dto.d.ts +45 -8
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +358 -3853
- package/dist/package/entity/order/order.do.d.ts +239 -42
- package/dist/package/entity/order/order.dto.d.ts +6497 -2236
- package/dist/package/entity/order/payment/payment.dto.d.ts +52 -12
- package/dist/package/entity/order-platform/base-integration.do.d.ts +8 -0
- package/dist/package/entity/order-platform/deliveroo/deliveroo-dto.d.ts +2 -2
- package/dist/package/entity/order-platform/deliveroo/deliveroo-order.do.d.ts +524 -524
- package/dist/package/entity/order-platform/deliveroo/deliveroo-setting.do.d.ts +2 -2
- package/dist/package/entity/order-platform/deliveroo/deliveroo.menu.dto.d.ts +58 -58
- package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +212 -284
- package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +331 -589
- package/dist/package/entity/order-platform/external/menu/external-menu.dto.d.ts +1 -1
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +12 -12
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +275 -275
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +3 -3
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +3 -3
- package/dist/package/entity/order-platform/foodpanda/foodpanda-menu.dto.d.ts +284 -284
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +40 -40
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +16 -16
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +2 -2
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +2 -2
- package/dist/package/entity/order-platform/gofood/gofood-order.do.d.ts +18 -18
- package/dist/package/entity/order-platform/gofood/gofood-settings.do.d.ts +2 -2
- package/dist/package/entity/order-platform/gofood/gofood-settings.dto.d.ts +2 -2
- package/dist/package/entity/order-platform/gofood/gofood.dto.d.ts +32 -32
- package/dist/package/entity/order-platform/grabfood/grabfood-edit-order.do.d.ts +12 -12
- package/dist/package/entity/order-platform/grabfood/grabfood-omni.do.d.ts +134 -115
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +187 -165
- package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +8 -2
- package/dist/package/entity/order-platform/grabfood/grabfood-webhook.dto.d.ts +49 -42
- package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +67 -54
- package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +1 -1
- package/dist/package/entity/order-platform/lineman/lineman-settings.do.d.ts +37 -0
- package/dist/package/entity/order-platform/lineman/lineman-settings.dto.d.ts +40 -0
- package/dist/package/entity/order-platform/menu.dto.d.ts +716 -13887
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +136 -2
- package/dist/package/entity/order-platform/order-platform.enum.d.ts +1 -1
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +176 -176
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.dto.d.ts +62 -62
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +8 -2
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +8 -2
- package/dist/package/entity/order-platform/tng/tng-menu.do.d.ts +1061 -0
- package/dist/package/entity/order-platform/tng/tng-order.do.d.ts +1915 -0
- package/dist/package/entity/order-platform/tng/tng-settings.do.d.ts +379 -0
- package/dist/package/entity/order-platform/tng/tng-settings.dto.d.ts +301 -0
- package/dist/package/entity/order-platform/tng/tng.dto.d.ts +1162 -0
- package/dist/package/entity/order-platform/tng/tng.enum.d.ts +29 -0
- package/dist/package/entity/order-setting/delivery/inhouse-delivery.do.d.ts +12 -0
- package/dist/package/entity/order-setting/delivery/inhouse-delivery.dto.d.ts +12 -0
- package/dist/package/entity/order-setting/dine-in/dine-in.do.d.ts +11 -0
- package/dist/package/entity/order-setting/dine-in/dine-in.dto.d.ts +9 -0
- package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +2 -2
- package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +2 -2
- package/dist/package/entity/order-setting/order-setting.do.d.ts +55 -4
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +110 -8
- package/dist/package/entity/order-setting/pickup/pickup.do.d.ts +12 -0
- package/dist/package/entity/order-setting/pickup/pickup.dto.d.ts +12 -0
- package/dist/package/entity/payment/transaction.d.ts +80 -8
- package/dist/package/entity/printer/printer.do.d.ts +14 -14
- package/dist/package/entity/pubsub/ably/ably.enum.d.ts +1 -1
- package/dist/package/entity/queue/queue.do.d.ts +236 -1901
- package/dist/package/entity/queue/queue.dto.d.ts +743 -445
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +27 -4
- package/dist/package/entity/websocket/websocket.dto.d.ts +10 -10
- package/dist/style.css +1 -0
- package/golar.config.ts +20 -0
- package/package.json +28 -22
- package/src/Entry.vue +2 -10
- package/src/api/menu/index.ts +1 -1
- package/src/api/remoteOrder/index.ts +176 -110
- package/src/composables/useQrOrderingEnabled.ts +66 -0
- package/src/helpers/menu.ts +1 -1
- package/src/locales/en-US.json +421 -412
- package/src/locales/ja-JP.json +1769 -1760
- package/src/locales/th-TH.json +409 -400
- package/src/locales/zh-CN.json +417 -408
- package/src/main.ts +4 -44
- package/src/router/index.ts +2 -2
- package/src/stores/menu/menu.ts +48 -27
- package/src/stores/restaurant/index.ts +24 -9
- package/src/utils/firebase-storage.ts +3 -13
- package/src/views/kiosk/settings/KioskSettingView.vue +3 -2
- package/src/views/order-settings/OrderSettingsView.vue +31 -11
- package/src/views/order-settings/delivery/DeliverySetting.vue +223 -11
- package/src/views/order-settings/delivery/components/TaxInput.vue +1 -1
- package/src/views/order-settings/delivery/delivery.data.ts +31 -10
- package/src/views/order-settings/delivery/delivery.ts +60 -28
- package/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue +40 -1
- package/src/views/order-settings/delivery/integrated-delivery/DeliverooSetting.vue +1 -1
- package/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue +15 -7
- package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +83 -27
- package/src/views/order-settings/delivery/integrated-delivery/LinemanSetting.vue +79 -0
- package/src/views/order-settings/delivery/integrated-delivery/ShopeefoodSetting.vue +2 -0
- package/src/views/order-settings/delivery/integrated-delivery/TngSetting.vue +749 -0
- package/src/views/order-settings/dine-in/DineInSetting.vue +54 -23
- package/src/views/order-settings/general/GeneralSetting.vue +15 -6
- package/src/views/order-settings/pickup/PickUpSettingDialog.vue +31 -3
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +34 -0
- package/src/views/order-settings/pickup/Preorder.vue +13 -12
- package/src/views/order-settings/queue/QueueSetting.vue +30 -1
- package/src/views/order-settings/servicecharge/RateInput.vue +9 -7
- package/vite.config.ts +16 -16
- package/dist/OrderSettingsView-C0G8kP3v.js +0 -32222
- package/dist/frontend/mf-order/src/api/auth/index.d.ts +0 -7
- package/dist/frontend/mf-order/src/stores/iframe/index.d.ts +0 -14
- package/dist/index-kCI8JdNP.js +0 -628
- package/dist/queue-transfer.dto-BLyCakS5.js +0 -45618
- package/src/api/auth/index.ts +0 -20
- package/src/stores/iframe/index.ts +0 -23
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import type { AxiosInstance } from 'axios'
|
|
2
|
-
import { baseClientInstance, getData, SvcConfig } from '..'
|
|
3
|
-
import type {
|
|
4
|
-
|
|
1
|
+
import type { AxiosInstance } from 'axios'
|
|
2
|
+
import { baseClientInstance, getData, SvcConfig } from '..'
|
|
3
|
+
import type {
|
|
4
|
+
DeliveryCompany,
|
|
5
|
+
LinkedDeliveryDoc
|
|
6
|
+
} from '../../views/order-settings/delivery/delivery'
|
|
7
|
+
import {
|
|
8
|
+
FdoLinkedDelivery,
|
|
9
|
+
FdoRestaurant,
|
|
10
|
+
FdoRestaurantFeedmeDelivery,
|
|
11
|
+
FdoRestaurantInHouseDelivery
|
|
12
|
+
} from '@feedmepos/core/entity'
|
|
5
13
|
import type {
|
|
6
14
|
FdoDeliverooSettings,
|
|
7
15
|
FdoExternalSetting,
|
|
@@ -10,189 +18,247 @@ import type {
|
|
|
10
18
|
FdoGoFoodSettings,
|
|
11
19
|
FdoGrabfoodOrderOutput,
|
|
12
20
|
FdoGrabfoodSettings,
|
|
21
|
+
FdoLinemanSettings,
|
|
13
22
|
FdoShopeeFoodOrder,
|
|
14
23
|
FdoShopeeFoodOrderOutput,
|
|
15
24
|
FdoShopeeFoodSettings,
|
|
16
|
-
FdtoGetOrderReq
|
|
17
|
-
|
|
25
|
+
FdtoGetOrderReq,
|
|
26
|
+
FdoTngSettings
|
|
27
|
+
} from '@entity'
|
|
18
28
|
|
|
19
|
-
type DeliveryCompanyUrl =
|
|
29
|
+
type DeliveryCompanyUrl =
|
|
30
|
+
| 'foodpanda'
|
|
31
|
+
| 'grabfood'
|
|
32
|
+
| 'shopeefood'
|
|
33
|
+
| 'deliveroo'
|
|
34
|
+
| 'gofood'
|
|
35
|
+
| 'tng'
|
|
36
|
+
| 'external'
|
|
37
|
+
| 'lineman'
|
|
20
38
|
|
|
21
|
-
const deliveryClientInstance = (
|
|
22
|
-
deliveryCompany: DeliveryCompanyUrl
|
|
23
|
-
): AxiosInstance => {
|
|
39
|
+
const deliveryClientInstance = (deliveryCompany: DeliveryCompanyUrl): AxiosInstance => {
|
|
24
40
|
//https://portal-v2-dev.feedmeapi.com/deliveroo/setting/:restaurantId
|
|
25
|
-
const path = `/${deliveryCompany}
|
|
26
|
-
return baseClientInstance(path, 'portal')
|
|
27
|
-
}
|
|
41
|
+
const path = `/${deliveryCompany}`
|
|
42
|
+
return baseClientInstance(path, 'portal')
|
|
43
|
+
}
|
|
28
44
|
|
|
29
45
|
const linkedDeliveryClientInstance = () => {
|
|
30
|
-
const restaurantId = SvcConfig.getRestaurantId()
|
|
31
|
-
if (!restaurantId) throw new Error('Invalid restaurant ID')
|
|
32
|
-
const { linkedDeliveryBackend } = SvcConfig.getBackendUrl()
|
|
33
|
-
const url = `${linkedDeliveryBackend}/restaurants/${restaurantId}/linked-deliveries
|
|
34
|
-
return baseClientInstance('', 'portal', { url })
|
|
35
|
-
}
|
|
36
|
-
|
|
46
|
+
const restaurantId = SvcConfig.getRestaurantId()
|
|
47
|
+
if (!restaurantId) throw new Error('Invalid restaurant ID')
|
|
48
|
+
const { linkedDeliveryBackend } = SvcConfig.getBackendUrl()
|
|
49
|
+
const url = `${linkedDeliveryBackend}/restaurants/${restaurantId}/linked-deliveries`
|
|
50
|
+
return baseClientInstance('', 'portal', { url })
|
|
51
|
+
}
|
|
37
52
|
|
|
38
53
|
export const remoteOrderApi = {
|
|
39
54
|
async readLinkedDeliveryCompanies(): Promise<LinkedDeliveryDoc[]> {
|
|
40
|
-
return getData(await linkedDeliveryClientInstance().get(''))
|
|
55
|
+
return getData(await linkedDeliveryClientInstance().get(''))
|
|
41
56
|
},
|
|
42
57
|
async readLocalDeliveryCompanies(): Promise<DeliveryCompany[]> {
|
|
43
|
-
return getData(await baseClientInstance().get('/deliveries'))
|
|
58
|
+
return getData(await baseClientInstance().get('/deliveries'))
|
|
44
59
|
},
|
|
45
60
|
async createDeliveryCompany(delivery: FdoLinkedDelivery): Promise<LinkedDeliveryDoc> {
|
|
46
|
-
return getData(await linkedDeliveryClientInstance().post('', delivery))
|
|
61
|
+
return getData(await linkedDeliveryClientInstance().post('', delivery))
|
|
47
62
|
},
|
|
48
63
|
async updateDeliveryCompany(delivery: LinkedDeliveryDoc): Promise<LinkedDeliveryDoc> {
|
|
49
|
-
return getData(await linkedDeliveryClientInstance().put(`/${delivery._id}`, delivery))
|
|
64
|
+
return getData(await linkedDeliveryClientInstance().put(`/${delivery._id}`, delivery))
|
|
50
65
|
},
|
|
51
66
|
async deleteDeliveryCompany(delivery: LinkedDeliveryDoc): Promise<LinkedDeliveryDoc> {
|
|
52
|
-
return getData(await linkedDeliveryClientInstance().delete(`/${delivery._id}`))
|
|
67
|
+
return getData(await linkedDeliveryClientInstance().delete(`/${delivery._id}`))
|
|
53
68
|
},
|
|
54
69
|
integratedDelivery: {
|
|
55
|
-
async updateInhouse(
|
|
56
|
-
|
|
70
|
+
async updateInhouse(
|
|
71
|
+
restaurantId: string,
|
|
72
|
+
dto: FdoRestaurantInHouseDelivery
|
|
73
|
+
): Promise<FdoRestaurant> {
|
|
74
|
+
return getData(
|
|
75
|
+
await baseClientInstance().put(`/restaurants/${restaurantId}/in-house-delivery`, dto)
|
|
76
|
+
)
|
|
57
77
|
},
|
|
58
|
-
async updateFeedme(
|
|
59
|
-
|
|
78
|
+
async updateFeedme(
|
|
79
|
+
restaurantId: string,
|
|
80
|
+
dto: FdoRestaurantFeedmeDelivery
|
|
81
|
+
): Promise<FdoRestaurant> {
|
|
82
|
+
return getData(
|
|
83
|
+
await baseClientInstance().put(`/restaurants/${restaurantId}/feedme-delivery`, dto)
|
|
84
|
+
)
|
|
60
85
|
},
|
|
61
86
|
async readFoodpanda(restaurantId: string): Promise<FdoFoodpandaSettings | null> {
|
|
62
|
-
return getData(await deliveryClientInstance('foodpanda').get(`/setting/${restaurantId}`))
|
|
87
|
+
return getData(await deliveryClientInstance('foodpanda').get(`/setting/${restaurantId}`))
|
|
63
88
|
},
|
|
64
89
|
async readFoodpandaOrders(req: FdtoGetOrderReq): Promise<FdoFoodpandaOrderOutput[]> {
|
|
65
|
-
return getData(await deliveryClientInstance('foodpanda').get('/order', { params: req }))
|
|
90
|
+
return getData(await deliveryClientInstance('foodpanda').get('/order', { params: req }))
|
|
66
91
|
},
|
|
67
92
|
async reflowFoodpandaOrders(orderId: string): Promise<FdoFoodpandaOrderOutput> {
|
|
68
|
-
return getData(await deliveryClientInstance('foodpanda').put(`/order/reflow/${orderId}`))
|
|
93
|
+
return getData(await deliveryClientInstance('foodpanda').put(`/order/reflow/${orderId}`))
|
|
69
94
|
},
|
|
70
95
|
async rejectFoodpandaOrders(orderId: string): Promise<FdoFoodpandaOrderOutput> {
|
|
71
|
-
return getData(await deliveryClientInstance('foodpanda').put(`/order/void/${orderId}`))
|
|
96
|
+
return getData(await deliveryClientInstance('foodpanda').put(`/order/void/${orderId}`))
|
|
72
97
|
},
|
|
73
|
-
async updateFoodpanda(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
async updateFoodpanda(
|
|
99
|
+
restaurantId: string,
|
|
100
|
+
dto: FdoFoodpandaSettings
|
|
101
|
+
): Promise<FdoFoodpandaSettings> {
|
|
102
|
+
return getData(
|
|
103
|
+
await deliveryClientInstance('foodpanda').put(`/setting/${restaurantId}`, {
|
|
104
|
+
_id: restaurantId,
|
|
105
|
+
...dto
|
|
106
|
+
})
|
|
107
|
+
)
|
|
78
108
|
},
|
|
79
109
|
async syncFoodpandaMenu(restaurantId: string): Promise<FdoFoodpandaSettings> {
|
|
80
|
-
return getData(await deliveryClientInstance('foodpanda').put(`/menu-sync/${restaurantId}`))
|
|
110
|
+
return getData(await deliveryClientInstance('foodpanda').put(`/menu-sync/${restaurantId}`))
|
|
81
111
|
},
|
|
82
112
|
async readGrabfood(restaurantId: string): Promise<FdoGrabfoodSettings | null> {
|
|
83
|
-
return getData(await deliveryClientInstance('grabfood').get(`/setting/${restaurantId}`))
|
|
113
|
+
return getData(await deliveryClientInstance('grabfood').get(`/setting/${restaurantId}`))
|
|
84
114
|
},
|
|
85
115
|
async readGrabfoodOrders(req: FdtoGetOrderReq): Promise<FdoGrabfoodOrderOutput[]> {
|
|
86
|
-
return getData(await deliveryClientInstance('grabfood').get('/order', { params: req }))
|
|
116
|
+
return getData(await deliveryClientInstance('grabfood').get('/order', { params: req }))
|
|
87
117
|
},
|
|
88
118
|
async reflowGrabfoodOrders(orderId: string): Promise<FdoGrabfoodOrderOutput> {
|
|
89
|
-
return getData(await deliveryClientInstance('grabfood').put(`/order/reflow/${orderId}`))
|
|
119
|
+
return getData(await deliveryClientInstance('grabfood').put(`/order/reflow/${orderId}`))
|
|
90
120
|
},
|
|
91
121
|
async rejectGrabfoodOrders(orderId: string): Promise<FdoGrabfoodOrderOutput> {
|
|
92
|
-
return getData(await deliveryClientInstance('grabfood').put(`/order/void/${orderId}`))
|
|
122
|
+
return getData(await deliveryClientInstance('grabfood').put(`/order/void/${orderId}`))
|
|
93
123
|
},
|
|
94
124
|
|
|
95
125
|
async updateGrabfood(restaurantId: string, dto: FdoGrabfoodSettings): Promise<FdoRestaurant> {
|
|
96
|
-
return getData(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
126
|
+
return getData(
|
|
127
|
+
await deliveryClientInstance('grabfood').put(`/setting/${restaurantId}`, {
|
|
128
|
+
_id: restaurantId,
|
|
129
|
+
...dto
|
|
130
|
+
})
|
|
131
|
+
)
|
|
100
132
|
},
|
|
101
133
|
async syncGrabfoodMenu(merchantId: string): Promise<FdoGrabfoodSettings> {
|
|
102
|
-
return getData(await deliveryClientInstance('grabfood').get(`/menu-sync/${merchantId}`))
|
|
134
|
+
return getData(await deliveryClientInstance('grabfood').get(`/menu-sync/${merchantId}`))
|
|
103
135
|
},
|
|
104
|
-
async startSelfServeFlow(restaurantId: string): Promise<string|null> {
|
|
105
|
-
return getData(
|
|
136
|
+
async startSelfServeFlow(restaurantId: string): Promise<string | null> {
|
|
137
|
+
return getData(
|
|
138
|
+
await deliveryClientInstance('grabfood').get(`/setting/integration-url/${restaurantId}`)
|
|
139
|
+
)
|
|
106
140
|
},
|
|
107
141
|
|
|
108
142
|
async readShopeefood(restaurantId: string): Promise<FdoShopeeFoodSettings | null> {
|
|
109
|
-
return getData(await deliveryClientInstance('shopeefood').get(`/setting/${restaurantId}`))
|
|
143
|
+
return getData(await deliveryClientInstance('shopeefood').get(`/setting/${restaurantId}`))
|
|
110
144
|
},
|
|
111
|
-
async readShopeefoodOrders(
|
|
112
|
-
|
|
145
|
+
async readShopeefoodOrders(
|
|
146
|
+
req: FdtoGetOrderReq
|
|
147
|
+
): Promise<(FdoShopeeFoodOrderOutput & FdoShopeeFoodOrder)[]> {
|
|
148
|
+
return getData(await deliveryClientInstance('shopeefood').get('/order', { params: req }))
|
|
113
149
|
},
|
|
114
150
|
async reflowShopeefoodOrders(orderId: string): Promise<FdoShopeeFoodOrderOutput> {
|
|
115
|
-
return getData(await deliveryClientInstance('shopeefood').put(`/order/reflow/${orderId}`))
|
|
151
|
+
return getData(await deliveryClientInstance('shopeefood').put(`/order/reflow/${orderId}`))
|
|
116
152
|
},
|
|
117
153
|
async rejectShopeefoodOrders(orderId: string): Promise<FdoShopeeFoodOrderOutput> {
|
|
118
|
-
return getData(await deliveryClientInstance('shopeefood').put(`/order/void/${orderId}`))
|
|
154
|
+
return getData(await deliveryClientInstance('shopeefood').put(`/order/void/${orderId}`))
|
|
119
155
|
},
|
|
120
|
-
async updateShopeefood(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
156
|
+
async updateShopeefood(
|
|
157
|
+
restaurantId: string,
|
|
158
|
+
dto: FdoShopeeFoodSettings
|
|
159
|
+
): Promise<FdoRestaurant> {
|
|
160
|
+
return getData(
|
|
161
|
+
await deliveryClientInstance('shopeefood').put(`/setting/${restaurantId}`, {
|
|
162
|
+
_id: restaurantId,
|
|
163
|
+
...dto
|
|
164
|
+
})
|
|
165
|
+
)
|
|
125
166
|
},
|
|
126
167
|
async syncShopeefoodMenu(storeId: string): Promise<FdoShopeeFoodSettings> {
|
|
127
|
-
return getData(await deliveryClientInstance('shopeefood').get(`/menu-sync/${storeId}`))
|
|
168
|
+
return getData(await deliveryClientInstance('shopeefood').get(`/menu-sync/${storeId}`))
|
|
128
169
|
},
|
|
129
170
|
async readGofood(restaurantId: string): Promise<FdoGoFoodSettings | null> {
|
|
130
|
-
return getData(await deliveryClientInstance('gofood').get(`/setting/${restaurantId}`))
|
|
171
|
+
return getData(await deliveryClientInstance('gofood').get(`/setting/${restaurantId}`))
|
|
131
172
|
},
|
|
132
|
-
async updateGofood(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
173
|
+
async updateGofood(
|
|
174
|
+
restaurantId: string,
|
|
175
|
+
dto: FdoGoFoodSettings
|
|
176
|
+
): Promise<FdoGoFoodSettings | null> {
|
|
177
|
+
return getData(
|
|
178
|
+
await deliveryClientInstance('gofood').put(`/setting/${restaurantId}`, {
|
|
179
|
+
...dto,
|
|
180
|
+
_id: restaurantId
|
|
181
|
+
})
|
|
182
|
+
)
|
|
137
183
|
},
|
|
138
184
|
async syncGofoodMenu(restaurantId: string): Promise<FdoGoFoodSettings> {
|
|
139
|
-
return getData(await deliveryClientInstance('gofood').get(`/menu-sync/${restaurantId}`))
|
|
185
|
+
return getData(await deliveryClientInstance('gofood').get(`/menu-sync/${restaurantId}`))
|
|
186
|
+
},
|
|
187
|
+
async readLineman(restaurantId: string): Promise<FdoLinemanSettings | null> {
|
|
188
|
+
return getData(await deliveryClientInstance('lineman').get(`/setting/${restaurantId}`))
|
|
189
|
+
},
|
|
190
|
+
async updateLineman(
|
|
191
|
+
restaurantId: string,
|
|
192
|
+
dto: FdoLinemanSettings
|
|
193
|
+
): Promise<FdoLinemanSettings> {
|
|
194
|
+
return getData(
|
|
195
|
+
await deliveryClientInstance('lineman').put(`/setting/${restaurantId}`, {
|
|
196
|
+
...dto,
|
|
197
|
+
_id: restaurantId
|
|
198
|
+
})
|
|
199
|
+
)
|
|
140
200
|
},
|
|
141
201
|
async updateDeliveroo(restaurantId: string, dto: FdoDeliverooSettings): Promise<FdoRestaurant> {
|
|
142
|
-
return getData(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
202
|
+
return getData(
|
|
203
|
+
await deliveryClientInstance('deliveroo').put(`/setting/${restaurantId}`, {
|
|
204
|
+
_id: restaurantId,
|
|
205
|
+
...dto
|
|
206
|
+
})
|
|
207
|
+
)
|
|
146
208
|
},
|
|
147
209
|
async readDeliveroo(restaurantId: string): Promise<FdoDeliverooSettings | null> {
|
|
148
|
-
return getData(await deliveryClientInstance('deliveroo').get(`/setting/${restaurantId}`))
|
|
210
|
+
return getData(await deliveryClientInstance('deliveroo').get(`/setting/${restaurantId}`))
|
|
211
|
+
},
|
|
212
|
+
async syncDeliverooMenu(merchantID: string): Promise<FdoDeliverooSettings> {
|
|
213
|
+
return getData(await deliveryClientInstance('deliveroo').get(`/menu-sync/${merchantID}`))
|
|
149
214
|
},
|
|
150
|
-
async
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
215
|
+
async readTng(restaurantId: string): Promise<FdoTngSettings | null> {
|
|
216
|
+
return getData(await deliveryClientInstance('tng').get(`/setting/${restaurantId}`))
|
|
217
|
+
},
|
|
218
|
+
async updateTng(restaurantId: string, dto: FdoTngSettings): Promise<FdoTngSettings> {
|
|
219
|
+
return getData(
|
|
220
|
+
await deliveryClientInstance('tng').put(`/setting/${restaurantId}`, {
|
|
221
|
+
_id: restaurantId,
|
|
222
|
+
...dto
|
|
223
|
+
})
|
|
224
|
+
)
|
|
225
|
+
},
|
|
226
|
+
async syncTngMenu(restaurantId: string): Promise<{ taskId?: string | null }> {
|
|
227
|
+
return getData(await deliveryClientInstance('tng').put(`/menu-sync/${restaurantId}`))
|
|
157
228
|
},
|
|
158
229
|
async readExternal(restaurantId: string): Promise<FdoExternalSetting | null> {
|
|
159
230
|
return getData(await deliveryClientInstance('external').get(`/setting/${restaurantId}`))
|
|
160
231
|
},
|
|
161
|
-
async updateExternal(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
232
|
+
async updateExternal(
|
|
233
|
+
restaurantId: string,
|
|
234
|
+
dto: FdoExternalSetting
|
|
235
|
+
): Promise<FdoExternalSetting> {
|
|
236
|
+
return getData(
|
|
237
|
+
await deliveryClientInstance('external').put(`setting/${restaurantId}`, {
|
|
238
|
+
...dto
|
|
239
|
+
})
|
|
240
|
+
)
|
|
165
241
|
},
|
|
166
242
|
async syncExternalMenu(restaurantId: string): Promise<FdoExternalSetting> {
|
|
167
|
-
return getData(await deliveryClientInstance('external').get(`/menu-sync/${restaurantId}`))
|
|
243
|
+
return getData(await deliveryClientInstance('external').get(`/menu-sync/${restaurantId}`))
|
|
168
244
|
},
|
|
169
|
-
async flowTestOrder(
|
|
170
|
-
restaurantId
|
|
171
|
-
platform: DeliveryCompanyUrl
|
|
172
|
-
): Promise<void> {
|
|
173
|
-
return getData(
|
|
174
|
-
await deliveryClientInstance(platform).put(`/test-order/${restaurantId}`)
|
|
175
|
-
);
|
|
245
|
+
async flowTestOrder(restaurantId: string, platform: DeliveryCompanyUrl): Promise<void> {
|
|
246
|
+
return getData(await deliveryClientInstance(platform).put(`/test-order/${restaurantId}`))
|
|
176
247
|
},
|
|
177
|
-
async cancelTestOrder(
|
|
178
|
-
restaurantId: string,
|
|
179
|
-
platform: DeliveryCompanyUrl
|
|
180
|
-
): Promise<void> {
|
|
248
|
+
async cancelTestOrder(restaurantId: string, platform: DeliveryCompanyUrl): Promise<void> {
|
|
181
249
|
return getData(
|
|
182
|
-
await deliveryClientInstance(platform).put(
|
|
183
|
-
|
|
184
|
-
)
|
|
185
|
-
);
|
|
250
|
+
await deliveryClientInstance(platform).put(`/test-order/cancel/${restaurantId}`)
|
|
251
|
+
)
|
|
186
252
|
},
|
|
187
253
|
async reflowFpOrderNotInDb(payload: { restaurantId: string; slot: string }): Promise<void> {
|
|
188
|
-
return getData(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
)
|
|
254
|
+
return getData(await deliveryClientInstance('foodpanda').put('/order/reconcile', payload))
|
|
255
|
+
},
|
|
256
|
+
async reflowGfOrderNotInDb(payload: {
|
|
257
|
+
restaurantId: string
|
|
258
|
+
slot: string
|
|
259
|
+
date: string
|
|
260
|
+
}): Promise<void> {
|
|
261
|
+
return getData(await deliveryClientInstance('grabfood').put('/order/reconcile', payload))
|
|
196
262
|
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { computed, watch, type ComputedRef } from 'vue'
|
|
2
|
+
import { useFeatureFlag } from '@feedmepos/feature-flag'
|
|
3
|
+
import { useCoreStore } from '@feedmepos/mf-common'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Whether QR / online ordering is enabled for the currently-selected restaurant,
|
|
7
|
+
* read from Flagsmith (the same source the backend enforces). Gates the Order
|
|
8
|
+
* Setting UI (tabs + integrated delivery section) in mf-order.
|
|
9
|
+
*
|
|
10
|
+
* - Reads `ordering_enable_qr` per-restaurant via Flagsmith identity (`setUser`).
|
|
11
|
+
* - Fails OPEN: until flags load, if the flag is missing, or if Flagsmith/init is
|
|
12
|
+
* unavailable (e.g. key not configured) => treated as ENABLED, so the UI is never
|
|
13
|
+
* hidden by a flag-infra blip.
|
|
14
|
+
*
|
|
15
|
+
* The portal host does not initialize `@feedmepos/feature-flag`, so we init it
|
|
16
|
+
* lazily here against the shared FeedMe Flagsmith environment (same public client
|
|
17
|
+
* keys admin-space + inventory use), picking dev/prod from the core-store namespace
|
|
18
|
+
* (the host-driven dev/prod signal mf-order already uses elsewhere).
|
|
19
|
+
*/
|
|
20
|
+
const QR_ORDERING_FLAG_KEY = 'ordering_enable_qr'
|
|
21
|
+
|
|
22
|
+
const FLAGSMITH_URL = 'https://flag.feedme.farm/api/v1/'
|
|
23
|
+
const FLAGSMITH_KEY_BY_NAMESPACE = {
|
|
24
|
+
dev: 'MaGoXrEWuEJNpWgKTqseee',
|
|
25
|
+
prod: '6GhcttsJ9Rj9cTevcdrpin'
|
|
26
|
+
} as const
|
|
27
|
+
|
|
28
|
+
let initPromise: Promise<void> | null = null
|
|
29
|
+
|
|
30
|
+
function ensureInit(
|
|
31
|
+
ff: ReturnType<typeof useFeatureFlag>,
|
|
32
|
+
namespace: keyof typeof FLAGSMITH_KEY_BY_NAMESPACE
|
|
33
|
+
): Promise<void> {
|
|
34
|
+
if (ff.isInitialized.value) return Promise.resolve()
|
|
35
|
+
if (!initPromise) {
|
|
36
|
+
initPromise = ff
|
|
37
|
+
.init({ apiKey: FLAGSMITH_KEY_BY_NAMESPACE[namespace], url: FLAGSMITH_URL })
|
|
38
|
+
.catch(() => undefined) // init failure => fail open
|
|
39
|
+
}
|
|
40
|
+
return initPromise
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function useQrOrderingEnabled(): ComputedRef<boolean> {
|
|
44
|
+
const ff = useFeatureFlag()
|
|
45
|
+
const { currentRestaurant, namespace } = useCoreStore()
|
|
46
|
+
|
|
47
|
+
watch(
|
|
48
|
+
() => currentRestaurant.value?._id,
|
|
49
|
+
async (restaurantId) => {
|
|
50
|
+
if (!restaurantId) return
|
|
51
|
+
await ensureInit(ff, namespace.value === 'dev' ? 'dev' : 'prod')
|
|
52
|
+
try {
|
|
53
|
+
await ff.setUser(restaurantId)
|
|
54
|
+
} catch {
|
|
55
|
+
// fail open — leave flags as-is
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{ immediate: true }
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
return computed(() => {
|
|
62
|
+
// Re-evaluate when the flag set updates (after init / setUser).
|
|
63
|
+
void ff.flags.value
|
|
64
|
+
return ff.getFlag(QR_ORDERING_FLAG_KEY)?.enabled ?? true
|
|
65
|
+
})
|
|
66
|
+
}
|
package/src/helpers/menu.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fullVariantCombination } from '@feedmepos/menu';
|
|
2
|
-
import { FdoItemOverriderV4, FdoMenuV4Item, FdoItemVariant, FdoMenuV4VariantGroup, FdoProductTaxSetting, FdtoV4Tax } from '@feedmepos/
|
|
2
|
+
import { FdoItemOverriderV4, FdoMenuV4Item, FdoItemVariant, FdoMenuV4VariantGroup, FdoProductTaxSetting, FdtoV4Tax } from '@feedmepos/entity';
|
|
3
3
|
import { Country, Dinero } from '@feedmepos/core';
|
|
4
4
|
import { F_COUNTRY } from '@feedmepos/core/entity';
|
|
5
5
|
import { useCoreStore } from '@feedmepos/mf-common';
|