@feedmepos/mf-order-setting 0.0.46 → 0.0.48
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-Dd3xcM5X.js → KioskDevicesView-iZTQ--DO.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-D-epeOIx.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CPDemTBj.js} +19 -19
- package/dist/KioskSettingView-mN7UPNYu.js +552 -0
- package/dist/{KioskView-BGiHHSjd.js → KioskView-NEpc7Ivb.js} +12 -8
- package/dist/OrderSettingsView-B5Nq_u9Z.js +51275 -0
- package/dist/app-B3KtJhiw.js +2914 -0
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-D-vfvSns.js → dayjs.min-GjkM9dM2.js} +49 -49
- package/dist/frontend/mf-order/src/app.d.ts +1769 -0
- package/dist/frontend/mf-order/src/composables/useDeprecationNotice.d.ts +7 -0
- package/dist/frontend/mf-order/src/main.d.ts +1769 -0
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +60 -0
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +18 -12
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +18 -6
- package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +12 -4
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskPaymentTypeSection.vue.d.ts +12 -8
- package/dist/frontend/mf-order/src/views/order-settings/delivery/components/FeedmeExpressDeprecationNotice.vue.d.ts +2 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-DAruvcri.js → index-Dwzta1U-.js} +2 -2
- package/dist/menu.dto-DgPhiIVk.js +101330 -0
- package/dist/package/entity/booking/booking.do.d.ts +170 -40
- package/dist/package/entity/delivery/delivery.dto.d.ts +34 -8
- package/dist/package/entity/food-court/order.dto.d.ts +2890 -2890
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +226 -226
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +1027 -790
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +356 -356
- package/dist/package/entity/index.d.ts +1 -0
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +213 -91
- package/dist/package/entity/order/effects/effect.dto.d.ts +10 -10
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +110 -110
- package/dist/package/entity/order/order.do.d.ts +20 -20
- package/dist/package/entity/order/order.dto.d.ts +23748 -40781
- package/dist/package/entity/order/payment/payment.dto.d.ts +784 -10508
- package/dist/package/entity/order-platform/deliveroo/deliveroo-order.do.d.ts +26 -26
- package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +158 -158
- package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +196 -196
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +34 -8
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +34 -8
- package/dist/package/entity/order-platform/menu.dto.d.ts +75 -44
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +34 -8
- package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +57 -42
- package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +44 -32
- package/dist/package/entity/order-setting/order-setting.do.d.ts +31 -22
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +62 -44
- package/dist/package/entity/payment/payment.dto.d.ts +2 -2
- package/dist/package/entity/payment/transaction.d.ts +1937 -0
- package/dist/package/entity/queue/queue.dto.d.ts +2677 -7335
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +220 -144
- package/dist/package/entity/websocket/websocket.dto.d.ts +68 -48
- package/package.json +3 -3
- package/src/app.ts +2 -0
- package/src/composables/useDeprecationNotice.ts +52 -0
- package/src/locales/en-US.json +6 -0
- package/src/locales/ja-JP.json +1751 -0
- package/src/locales/th-TH.json +6 -0
- package/src/locales/zh-CN.json +6 -0
- package/src/main.ts +2 -0
- package/src/stores/order-setting/mapper.ts +35 -23
- package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +21 -0
- package/src/views/order-settings/delivery/DeliverySetting.vue +46 -2
- package/src/views/order-settings/delivery/components/FeedmeExpressDeprecationNotice.vue +16 -0
- package/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue +13 -0
- package/src/views/order-settings/delivery/integrated-delivery/FeedmeDelivery.vue +39 -39
- package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +25 -2
- package/dist/KioskSettingView-D50Gh7NR.js +0 -528
- package/dist/OrderSettingsView-DNuKMNFe.js +0 -74486
- package/dist/app-DGT9bC4M.js +0 -1145
- package/dist/menu.dto-B82ITnH5.js +0 -124296
package/src/locales/th-TH.json
CHANGED
|
@@ -122,6 +122,11 @@
|
|
|
122
122
|
"feedmeExpressPayoutAccIssue": "จำเป็นต้องมีบัญชีการจ่ายเงินเพื่อเปิดใช้งาน FeedMe Express",
|
|
123
123
|
"feedmeExpressPosVersionIssue": "จำเป็นต้องมีเวอร์ชัน POS ขั้นต่ำ {minVersion} สำหรับ FeedMe Express",
|
|
124
124
|
"feedmeExpressTitle": "อัปเดต FeedMe express",
|
|
125
|
+
"feedmeExpressDeprecationTitle": "FeedMe Express — ปิดรับสมัคร บริการสิ้นสุด 1 ก.พ. 2026",
|
|
126
|
+
"feedmeExpressDeprecationMessage": "การสมัคร FeedMe Express ปิดรับทันที บริการสำหรับร้านค้าที่มีอยู่จะสิ้นสุดในวันที่ 1 ก.พ. 2026 ติดต่อฝ่ายสนับสนุนเพื่อหาทางเลือกอื่น",
|
|
127
|
+
"feedmeExpressDeprecationThanks": "ขอบคุณสำหรับการสนับสนุนอย่างต่อเนื่อง",
|
|
128
|
+
"feedmeExpressDeprecationConfirm": "ฉันเข้าใจแล้ว",
|
|
129
|
+
"feedmeExpressAdminOnly": "การตั้งค่า FeedMe Express เป็นแบบอ่านอย่างเดียว ติดต่อผู้ดูแลระบบเพื่อทำการเปลี่ยนแปลง",
|
|
125
130
|
"fieldCannotBeEmpty": "ไม่สามารถเว้นช่องได้",
|
|
126
131
|
"followDineIn": "ทำตามการรับประทานอาหารที่ร้าน",
|
|
127
132
|
"fixedTime": "เวลาที่กำหนด",
|
|
@@ -222,6 +227,7 @@
|
|
|
222
227
|
"qrPay": "ชำระเงินด้วย QR",
|
|
223
228
|
"terminalScanPay": "ชำระเงินด้วยการสแกนเทอร์มินัล",
|
|
224
229
|
"terminalQrPay": "ชำระเงินด้วย QR เทอร์มินัล",
|
|
230
|
+
"terminalPaymentDescription": "ชำระเงินโดยใช้เครื่องเทอร์มินัลที่รวมอยู่ในระบบ",
|
|
225
231
|
"rate": "อัตรา",
|
|
226
232
|
"rateLimitWarning": "กรุณารอ 1 นาทีแล้วซิงค์อีกครั้ง",
|
|
227
233
|
"remoteId": "รหัสประจำตัวระยะไกล",
|
package/src/locales/zh-CN.json
CHANGED
|
@@ -126,6 +126,11 @@
|
|
|
126
126
|
"feedmeExpressPayoutAccIssue": "需要设置支付账户才能启用FeedMe外卖快递",
|
|
127
127
|
"feedmeExpressPosVersionIssue": "需要最低{minVersion}版本的POS系统才能使用FeedMe外卖快递",
|
|
128
128
|
"feedmeExpressTitle": "更新 Feedme 外卖快递",
|
|
129
|
+
"feedmeExpressDeprecationTitle": "FeedMe Express — 注册已关闭,服务将于 2026 年 2 月 1 日结束",
|
|
130
|
+
"feedmeExpressDeprecationMessage": "FeedMe Express 注册即日起关闭。现有商家的服务将于 2026 年 2 月 1 日结束。请联系客服了解其他选择。",
|
|
131
|
+
"feedmeExpressDeprecationThanks": "感谢您一直以来的支持。",
|
|
132
|
+
"feedmeExpressDeprecationConfirm": "我已了解",
|
|
133
|
+
"feedmeExpressAdminOnly": "FeedMe Express 设置为只读。如需更改请联系管理员。",
|
|
129
134
|
"fieldCannotBeEmpty": "字段不可为空",
|
|
130
135
|
"followDineIn": "跟随堂食",
|
|
131
136
|
"fixedTime": "固定时间",
|
|
@@ -226,6 +231,7 @@
|
|
|
226
231
|
"qrPay": "二维码支付",
|
|
227
232
|
"terminalScanPay": "终端扫描支付",
|
|
228
233
|
"terminalQrPay": "终端二维码支付",
|
|
234
|
+
"terminalPaymentDescription": "通过集成的终端设备进行支付。",
|
|
229
235
|
"rate": "费率",
|
|
230
236
|
"remoteId": "平台注册ID",
|
|
231
237
|
"restaurant": "餐厅",
|
package/src/main.ts
CHANGED
|
@@ -14,11 +14,13 @@ import { createFeedMeI18n, type I18n, detectLocale } from "@feedmepos/mf-common"
|
|
|
14
14
|
import enUS from "./locales/en-US.json"
|
|
15
15
|
import zhCN from "./locales/zh-CN.json"
|
|
16
16
|
import thTH from "./locales/th-TH.json"
|
|
17
|
+
import jaJP from "./locales/ja-JP.json"
|
|
17
18
|
|
|
18
19
|
export const i18nMessages = {
|
|
19
20
|
"en-US": enUS,
|
|
20
21
|
"zh-CN": zhCN,
|
|
21
22
|
"th-TH": thTH,
|
|
23
|
+
"ja-JP": jaJP,
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
function initI18n(): I18n {
|
|
@@ -55,13 +55,14 @@ export const defaultKioskOrderSetting: MfKioskOrderSettingForm = {
|
|
|
55
55
|
enabled: false,
|
|
56
56
|
pickUp: defaultPickUp,
|
|
57
57
|
sequenceNumber: FdoOrderKioskDineInSequence.parse({}),
|
|
58
|
-
displayStand: defaultDisplayStand
|
|
58
|
+
displayStand: defaultDisplayStand
|
|
59
59
|
},
|
|
60
60
|
takeaway: defaultTakeaway,
|
|
61
61
|
paymentSetting: {
|
|
62
62
|
paymentTypes: [],
|
|
63
63
|
offlinePaymentTypes: [],
|
|
64
64
|
ePaymentTypes: {
|
|
65
|
+
terminal: false,
|
|
65
66
|
card: {
|
|
66
67
|
terminal: false,
|
|
67
68
|
nfc: false
|
|
@@ -72,10 +73,10 @@ export const defaultKioskOrderSetting: MfKioskOrderSettingForm = {
|
|
|
72
73
|
qrPay: false,
|
|
73
74
|
scanPay: false
|
|
74
75
|
}
|
|
75
|
-
}
|
|
76
|
+
}
|
|
76
77
|
},
|
|
77
78
|
menuItem: {
|
|
78
|
-
showAllOnly: false
|
|
79
|
+
showAllOnly: false
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -90,35 +91,46 @@ const convertOrderSettingDto = (dto: OrderSettingsDto): MfOrderSetting => {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
const toKiosk = (
|
|
94
|
+
const toKiosk = (
|
|
95
|
+
kioskOrderSettings: OrderKioskSettings | null | undefined,
|
|
96
|
+
kioskDineInSeq?: OrderKioskDineInSequenceDto
|
|
97
|
+
): MfKioskOrderSetting => {
|
|
94
98
|
return {
|
|
95
|
-
dineIn: toKioskDineInSetting(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
dineIn: toKioskDineInSetting(
|
|
100
|
+
kioskDineInSeq ?? {
|
|
101
|
+
current: 0,
|
|
102
|
+
prefix: '#K'
|
|
103
|
+
},
|
|
104
|
+
kioskOrderSettings?.dineIn ?? undefined
|
|
105
|
+
),
|
|
99
106
|
takeaway: {
|
|
100
107
|
enabled: kioskOrderSettings?.canTakeaway ?? false,
|
|
101
|
-
submitOrderInstruction: kioskOrderSettings?.takeaway?.submitOrderInstruction
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
submitOrderInstruction: kioskOrderSettings?.takeaway?.submitOrderInstruction
|
|
109
|
+
? {
|
|
110
|
+
payAtCounter:
|
|
111
|
+
kioskOrderSettings?.takeaway?.submitOrderInstruction?.payAtCounter?.['en'] ?? null,
|
|
112
|
+
paid: kioskOrderSettings?.takeaway?.submitOrderInstruction?.paid?.['en'] ?? null
|
|
113
|
+
}
|
|
114
|
+
: defaultSubmitOrderInstruction
|
|
105
115
|
},
|
|
106
116
|
paymentSetting: {
|
|
107
117
|
paymentTypes: kioskOrderSettings?.paymentSetting?.paymentTypes ?? [],
|
|
108
118
|
offlinePaymentTypes: kioskOrderSettings?.paymentSetting?.offlinePaymentTypes ?? [],
|
|
109
|
-
ePaymentTypes:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
ePaymentTypes:
|
|
120
|
+
kioskOrderSettings?.paymentSetting?.ePaymentTypes ??
|
|
121
|
+
FdoEPaymentMethod.parse({
|
|
122
|
+
card: {
|
|
123
|
+
terminal: false,
|
|
124
|
+
nfc: false
|
|
125
|
+
},
|
|
126
|
+
eWallet: {
|
|
127
|
+
qrPay: false,
|
|
128
|
+
scanPay: false
|
|
129
|
+
}
|
|
130
|
+
})
|
|
119
131
|
},
|
|
120
132
|
menuItem: {
|
|
121
|
-
showAllOnly: kioskOrderSettings?.menuItem?.showAllOnly ?? false
|
|
133
|
+
showAllOnly: kioskOrderSettings?.menuItem?.showAllOnly ?? false
|
|
122
134
|
}
|
|
123
135
|
}
|
|
124
136
|
}
|
|
@@ -56,6 +56,7 @@ const paymentCheckboxVal = ref<string[]>([])
|
|
|
56
56
|
const cardPaymentRadioVal = ref<string>()
|
|
57
57
|
const eWalletPaymentCheckboxVal = ref<string[]>([])
|
|
58
58
|
const useCard = ref(false)
|
|
59
|
+
const useTerminal = ref(false)
|
|
59
60
|
const useEwallet = ref(false)
|
|
60
61
|
|
|
61
62
|
const checkboxChildren = [
|
|
@@ -70,6 +71,10 @@ const initializeCheckboxes = () => {
|
|
|
70
71
|
paymentCheckboxVal.value = initialValues
|
|
71
72
|
parentCheckbox.value = initialValues.length === checkboxChildren.length
|
|
72
73
|
if (!(Object.keys(props.ePaymentTypes).length === 0)) {
|
|
74
|
+
if (props.ePaymentTypes.terminal) {
|
|
75
|
+
useTerminal.value = true;
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
if (props.ePaymentTypes.card.terminal) {
|
|
74
79
|
cardPaymentRadioVal.value = F_ORDER_E_PAYMENT_TYPE.enum.TERMINAL
|
|
75
80
|
useCard.value = true
|
|
@@ -195,6 +200,7 @@ const handleEPaymentCardUpdate = (ev: string) => {
|
|
|
195
200
|
|
|
196
201
|
const handleEPaymentEWalletUpdate = () => {
|
|
197
202
|
const ePaymentObj = {
|
|
203
|
+
terminal: false,
|
|
198
204
|
card: {
|
|
199
205
|
terminal: false,
|
|
200
206
|
nfc: false
|
|
@@ -218,6 +224,10 @@ const handleEPaymentEWalletUpdate = () => {
|
|
|
218
224
|
}
|
|
219
225
|
}
|
|
220
226
|
|
|
227
|
+
if (useTerminal.value) {
|
|
228
|
+
ePaymentObj.terminal = true
|
|
229
|
+
}
|
|
230
|
+
|
|
221
231
|
if (eWalletPaymentCheckboxVal.value.includes(F_ORDER_E_PAYMENT_TYPE.enum.QRPAY)) {
|
|
222
232
|
ePaymentObj.eWallet.qrPay = true
|
|
223
233
|
}
|
|
@@ -346,6 +356,17 @@ onMounted(() => {
|
|
|
346
356
|
</div>
|
|
347
357
|
</FmCardSection>
|
|
348
358
|
</FmCard>
|
|
359
|
+
<FmCard variant="outlined" class="mt-2">
|
|
360
|
+
<FmCardSection>
|
|
361
|
+
<FmSwitch
|
|
362
|
+
:label="t('order.terminal')"
|
|
363
|
+
:sublabel="t('order.terminalPaymentDescription')"
|
|
364
|
+
label-placement="right"
|
|
365
|
+
v-model="useTerminal"
|
|
366
|
+
@update:modelValue="updateCardSwitch"
|
|
367
|
+
/>
|
|
368
|
+
</FmCardSection>
|
|
369
|
+
</FmCard>
|
|
349
370
|
<FmCard variant="outlined" class="mt-2">
|
|
350
371
|
<FmCardSection>
|
|
351
372
|
<FmSwitch
|
|
@@ -165,9 +165,9 @@
|
|
|
165
165
|
</template>
|
|
166
166
|
|
|
167
167
|
<script setup lang="ts">
|
|
168
|
-
import { computed, h, ref, watch } from 'vue'
|
|
168
|
+
import { computed, h, ref, watch, onMounted } from 'vue'
|
|
169
169
|
import RestaurantSelector from '../components/RestaurantSelector.vue'
|
|
170
|
-
import { type ColumnDef } from '@feedmepos/ui-library'
|
|
170
|
+
import { type ColumnDef, useDialog } from '@feedmepos/ui-library'
|
|
171
171
|
import type { FdoDeliverooSettings, FdoFoodpandaSettings, FdoExternalSetting } from '@entity'
|
|
172
172
|
import type {
|
|
173
173
|
FdoLinkedDelivery,
|
|
@@ -197,6 +197,8 @@ import { useSnackbarFunctions } from '@/components/snackbar'
|
|
|
197
197
|
import useSearch from '@/composables/search'
|
|
198
198
|
import DeliveryList from './DeliveryList.vue'
|
|
199
199
|
import DeliverooSetting from './integrated-delivery/DeliverooSetting.vue'
|
|
200
|
+
import FeedmeExpressDeprecationNotice from './components/FeedmeExpressDeprecationNotice.vue'
|
|
201
|
+
import { useDeprecationNotice } from '@/composables/useDeprecationNotice'
|
|
200
202
|
import { useI18n, useCoreStore } from '@feedmepos/mf-common'
|
|
201
203
|
|
|
202
204
|
const { t } = useI18n()
|
|
@@ -212,6 +214,40 @@ const {
|
|
|
212
214
|
currentCountry
|
|
213
215
|
} = useCoreStore()
|
|
214
216
|
const menuStore = useMenuStore()
|
|
217
|
+
const Dialog = useDialog()
|
|
218
|
+
const { shouldShowNotice, markNoticeAsShown } = useDeprecationNotice()
|
|
219
|
+
|
|
220
|
+
const FEEDME_EXPRESS_DEPRECATION_NOTICE_ID = 'feedme_express_feb_2025'
|
|
221
|
+
|
|
222
|
+
function showFeedmeExpressDeprecationDialog() {
|
|
223
|
+
const restaurantId = currentRestaurant.value?._id
|
|
224
|
+
if (!restaurantId) return
|
|
225
|
+
|
|
226
|
+
Dialog.open({
|
|
227
|
+
title: t('order.feedmeExpressDeprecationTitle'),
|
|
228
|
+
contentComponent: FeedmeExpressDeprecationNotice,
|
|
229
|
+
dismissAway: false,
|
|
230
|
+
primaryActions: {
|
|
231
|
+
text: t('order.feedmeExpressDeprecationConfirm'),
|
|
232
|
+
variant: 'primary',
|
|
233
|
+
close: true
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
markNoticeAsShown(FEEDME_EXPRESS_DEPRECATION_NOTICE_ID, restaurantId)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function checkAndShowDeprecationNotice() {
|
|
241
|
+
const restaurantId = currentRestaurant.value?._id
|
|
242
|
+
const isFeedmeExpressEnabled = currentRestaurant.value?.feedmeDelivery?.enable
|
|
243
|
+
|
|
244
|
+
if (restaurantId && isFeedmeExpressEnabled) {
|
|
245
|
+
if (shouldShowNotice(FEEDME_EXPRESS_DEPRECATION_NOTICE_ID, restaurantId)) {
|
|
246
|
+
showFeedmeExpressDeprecationDialog()
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
215
251
|
const linkedCompanies = ref<LinkedDeliveryDoc[]>([])
|
|
216
252
|
const deliveryCompanies = ref<DeliveryCompany[]>([])
|
|
217
253
|
export interface DeliveryRow {
|
|
@@ -977,7 +1013,13 @@ function handleModelValueUpdateExternal(v: any) {
|
|
|
977
1013
|
}
|
|
978
1014
|
|
|
979
1015
|
const feedmeValidate = ref<boolean | null>(null)
|
|
1016
|
+
const isAdmin = computed(() => sessionUser.value?.role?.isAdmin ?? false)
|
|
1017
|
+
|
|
980
1018
|
const canSave = computed(() => {
|
|
1019
|
+
// For FeedMe Express, only admin can save
|
|
1020
|
+
if (feedMeComponentProps.value?.key === F_ORDER_PLATFORM.enum.FEEDME) {
|
|
1021
|
+
return feedmeValidate.value !== false && isAdmin.value
|
|
1022
|
+
}
|
|
981
1023
|
return !feedMeComponentProps.value?.key || feedmeValidate.value !== false
|
|
982
1024
|
})
|
|
983
1025
|
|
|
@@ -1035,6 +1077,8 @@ watch(
|
|
|
1035
1077
|
async (newRestaurant) => {
|
|
1036
1078
|
if (newRestaurant) {
|
|
1037
1079
|
await readData()
|
|
1080
|
+
// Check if FeedMe Express deprecation notice should be shown
|
|
1081
|
+
checkAndShowDeprecationNotice()
|
|
1038
1082
|
}
|
|
1039
1083
|
},
|
|
1040
1084
|
{ immediate: true }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-4">
|
|
3
|
+
<p class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary">
|
|
4
|
+
{{ t('order.feedmeExpressDeprecationMessage') }}
|
|
5
|
+
</p>
|
|
6
|
+
<p class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary">
|
|
7
|
+
{{ t('order.feedmeExpressDeprecationThanks') }}
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
14
|
+
|
|
15
|
+
const { t } = useI18n()
|
|
16
|
+
</script>
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
@update:model-value="updateEnable"
|
|
8
8
|
/>
|
|
9
9
|
<div class="mt-6">
|
|
10
|
+
<div>
|
|
11
|
+
<FmCheckbox
|
|
12
|
+
:model-value="data.config.autoSend"
|
|
13
|
+
:label="t('order.autoSendKitchen')"
|
|
14
|
+
@update:model-value="updateAutoSend"
|
|
15
|
+
value=""
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
10
18
|
<div>
|
|
11
19
|
<FmCheckbox
|
|
12
20
|
:model-value="data.config.autoCloseBill"
|
|
@@ -101,6 +109,11 @@ function emitUpdatedValue() {
|
|
|
101
109
|
emits('update:model-value', { ...data })
|
|
102
110
|
}
|
|
103
111
|
|
|
112
|
+
function updateAutoSend(value: boolean) {
|
|
113
|
+
data.config.autoSend = value
|
|
114
|
+
emitUpdatedValue()
|
|
115
|
+
}
|
|
116
|
+
|
|
104
117
|
function updateAutoCloseBill(value: boolean) {
|
|
105
118
|
data.config.autoCloseBill = value
|
|
106
119
|
emitUpdatedValue()
|
|
@@ -45,7 +45,7 @@ const data = reactive<FdoRestaurantFeedme>(
|
|
|
45
45
|
props.initialValue ? clone(props.initialValue) : defaultValue
|
|
46
46
|
)
|
|
47
47
|
const { sessionUser } = useCoreStore()
|
|
48
|
-
const canActivateFeedmeExpress = computed(() => sessionUser.value?.
|
|
48
|
+
const canActivateFeedmeExpress = computed(() => sessionUser.value?.role?.isAdmin ?? false)
|
|
49
49
|
const { currentRestaurant } = useCoreStore()
|
|
50
50
|
const validatePosVersion = computed<ValidateFeedmeResult>(() => {
|
|
51
51
|
const posVersion = currentRestaurant?.value?.posVersion
|
|
@@ -64,21 +64,15 @@ const router = useRouter();
|
|
|
64
64
|
|
|
65
65
|
const validatePayoutAccount = computed<ValidateFeedmeResult>(() => {
|
|
66
66
|
const account = currentRestaurant.value?.payoutAccount
|
|
67
|
+
// Since FeedMe Express is ending, show deprecation message instead of asking to set up payout
|
|
67
68
|
if (!account?.enable) {
|
|
68
69
|
return {
|
|
69
|
-
message:
|
|
70
|
-
action: {
|
|
71
|
-
label: t('order.updatePayoutAccount'),
|
|
72
|
-
callback: () => {
|
|
73
|
-
router.push({ name: "mf-payment-payout-account"})
|
|
74
|
-
}
|
|
75
|
-
}
|
|
70
|
+
message: `${t('order.feedmeExpressDeprecationTitle')}\n\n${t('order.feedmeExpressDeprecationMessage')}`
|
|
76
71
|
}
|
|
77
72
|
}
|
|
78
73
|
if (account.status !== F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED) {
|
|
79
74
|
return {
|
|
80
|
-
message:
|
|
81
|
-
`${t('order.feedmeExpressNotApproved')}`
|
|
75
|
+
message: `${t('order.feedmeExpressDeprecationTitle')}\n\n${t('order.feedmeExpressDeprecationMessage')}`
|
|
82
76
|
}
|
|
83
77
|
}
|
|
84
78
|
return true
|
|
@@ -113,11 +107,6 @@ const validation = computed<ValidateFeedmeResult>(() => {
|
|
|
113
107
|
|
|
114
108
|
emits('validation-result', result === true)
|
|
115
109
|
|
|
116
|
-
if (!(props.initialValue?.enable || false) && !canActivateFeedmeExpress.value) {
|
|
117
|
-
return {
|
|
118
|
-
message: 'Contact our staff to enable FeedMe Express'
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
110
|
return (
|
|
122
111
|
[validatePosVersion.value, validatePayoutAccount.value, validateRestaurantProfile.value].find(
|
|
123
112
|
(result) => result !== true
|
|
@@ -125,6 +114,8 @@ const validation = computed<ValidateFeedmeResult>(() => {
|
|
|
125
114
|
)
|
|
126
115
|
})
|
|
127
116
|
|
|
117
|
+
const isReadOnly = computed(() => !canActivateFeedmeExpress.value)
|
|
118
|
+
|
|
128
119
|
const emits = defineEmits<{
|
|
129
120
|
(event: 'update:model-value', v: FdoRestaurantFeedme): void
|
|
130
121
|
(event: 'validation-result', result: boolean): void
|
|
@@ -166,27 +157,36 @@ import { formatAddress } from '@/helpers/profile'
|
|
|
166
157
|
|
|
167
158
|
<template>
|
|
168
159
|
<template v-if="validation === true">
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
160
|
+
<!-- Read-only banner for non-admin users -->
|
|
161
|
+
<div v-if="isReadOnly" class="mb-4 p-3 bg-fm-color-system-warning-100 rounded-lg">
|
|
162
|
+
<div class="text-fm-color-typo-warning fm-typo-en-body-md-600">
|
|
163
|
+
{{ t('order.feedmeExpressAdminOnly') }}
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div :class="{ 'opacity-60 pointer-events-none': isReadOnly }">
|
|
168
|
+
<FmSwitch :model-value="data.enable" :label="`${t('order.actiavteFeedmeExpress')}`" label-placement="right"
|
|
169
|
+
:sublabel="t('order.activateFeedmeExpressSublabel')" :disabled="isReadOnly" @update:model-value="updateEnable" />
|
|
170
|
+
<div v-if="data.enable">
|
|
171
|
+
<FmCard variant="outlined" class="p-5 mt-10">
|
|
172
|
+
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.generalInfo') }}</div>
|
|
173
|
+
|
|
174
|
+
<FmSwitch :model-value="data.ignoreStock || false" value="ignoreStock" :label="t('order.ignoreStock')"
|
|
175
|
+
:sublabel="t('order.ignoreStockSublabel')" label-placement="right"
|
|
176
|
+
:disabled="isReadOnly" @update:model-value="updateIgnoreStock" />
|
|
177
|
+
|
|
178
|
+
<div class="mt-5 mb-3">
|
|
179
|
+
<FmSelect :model-value="data.catalogId" :label="t('order.catalog')" :items="menuStore.catalogOptions"
|
|
180
|
+
:disabled="isReadOnly" @update:model-value="updateCatalogId" />
|
|
181
|
+
</div>
|
|
182
|
+
<FmTextarea :model-value="data.term ?? undefined" :label="t('order.term')" :disabled="isReadOnly" @update:model-value="updateTerm" />
|
|
183
|
+
|
|
184
|
+
<div class="mt-5 mb-3">
|
|
185
|
+
<FmTextarea :model-value="data.instruction ?? undefined" :label="t('order.deliveryInstruction')"
|
|
186
|
+
:disabled="isReadOnly" @update:model-value="updateInstruction" />
|
|
187
|
+
</div>
|
|
188
|
+
</FmCard>
|
|
189
|
+
</div>
|
|
190
190
|
</div>
|
|
191
191
|
</template>
|
|
192
192
|
<div v-else>
|
|
@@ -194,9 +194,9 @@ import { formatAddress } from '@/helpers/profile'
|
|
|
194
194
|
<img :src="svgPath" alt="" />
|
|
195
195
|
<div class="flex flex-col">
|
|
196
196
|
<div class="text-center mb-5">{{ validation.message }}</div>
|
|
197
|
-
<FmButton
|
|
198
|
-
v-if="validation.action"
|
|
199
|
-
variant="primary"
|
|
197
|
+
<FmButton
|
|
198
|
+
v-if="validation.action"
|
|
199
|
+
variant="primary"
|
|
200
200
|
:label="validation.action.label"
|
|
201
201
|
@click = "(validation as ValidateFeedmeErrorResult).action!.callback"
|
|
202
202
|
/>
|
|
@@ -188,6 +188,29 @@ function convertStatusI18n(status: string) {
|
|
|
188
188
|
return t('order.failed')
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
+
|
|
192
|
+
const formattedMenuSyncError = computed(() => {
|
|
193
|
+
const error = props.modelValue.auto.menuSyncError
|
|
194
|
+
if (!error) return null
|
|
195
|
+
|
|
196
|
+
let formatted = error
|
|
197
|
+
|
|
198
|
+
// Find all item_ or product_ IDs in the error message
|
|
199
|
+
const itemIdPattern = /(item_[^\s,]+|product_[^\s,]+)/g
|
|
200
|
+
const matches = error.match(itemIdPattern)
|
|
201
|
+
|
|
202
|
+
if (matches) {
|
|
203
|
+
for (const itemId of matches) {
|
|
204
|
+
const item = menuStore.items.find((i) => i._id === itemId)
|
|
205
|
+
if (item) {
|
|
206
|
+
const itemName = item.code ? `${item.code} - ${item.name}` : item.name
|
|
207
|
+
formatted = formatted.replace(itemId, `"${itemName}" (${itemId})`)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return formatted
|
|
213
|
+
})
|
|
191
214
|
</script>
|
|
192
215
|
|
|
193
216
|
<template>
|
|
@@ -259,8 +282,8 @@ function convertStatusI18n(status: string) {
|
|
|
259
282
|
{{ t('order.status') }}: {{ convertStatusI18n(modelValue.auto.status) }}
|
|
260
283
|
</div>
|
|
261
284
|
<FmTooltip
|
|
262
|
-
v-if="modelValue.auto.status === 'FAILED' &&
|
|
263
|
-
:content="
|
|
285
|
+
v-if="modelValue.auto.status === 'FAILED' && formattedMenuSyncError !== null"
|
|
286
|
+
:content="formattedMenuSyncError"
|
|
264
287
|
:zIndex="1000"
|
|
265
288
|
>
|
|
266
289
|
<FmIcon name="info" size="sm" />
|