@feedmepos/mf-order-setting 0.0.12 → 0.0.14-alpha

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.
Files changed (91) hide show
  1. package/dist/KioskSettingView-DNN7VBM4.js +4 -0
  2. package/dist/{app-DnR4r5jW.js → app-CbKAPxxI.js} +42471 -41975
  3. package/dist/app.js +1 -1
  4. package/dist/frontend/mf-order/src/main.d.ts +472 -0
  5. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +12 -0
  6. package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +1 -0
  7. package/dist/frontend/mf-order/src/views/order-settings/delivery/DeliverySetting.vue.d.ts +1 -1
  8. package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +0 -8
  9. package/dist/frontend/mf-order/src/views/order-settings/general/GeneralSetting.vue.d.ts +2 -0
  10. package/dist/frontend/mf-order/src/views/order-settings/pickup/PaymentSidesheet.vue.d.ts +2 -16
  11. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  12. package/dist/package/entity/booking/booking.do.d.ts +60 -1025
  13. package/dist/package/entity/delivery/delivery.dto.d.ts +39 -208
  14. package/dist/package/entity/delivery/gateway/pandago.dto.d.ts +6 -6
  15. package/dist/package/entity/food-court/order.dto.d.ts +1607 -13450
  16. package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +1413 -291
  17. package/dist/package/entity/incoming-order/incoming-order.do.d.ts +602 -99
  18. package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +1182 -154
  19. package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +66 -875
  20. package/dist/package/entity/order/delivery/delivery.do.d.ts +12 -0
  21. package/dist/package/entity/order/menu/menu.dto.d.ts +6 -1
  22. package/dist/package/entity/order/order-item/order-item.dto.d.ts +847 -40
  23. package/dist/package/entity/order/order.do.d.ts +9 -3
  24. package/dist/package/entity/order/order.dto.d.ts +2639 -8399
  25. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +12 -205
  26. package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +12 -205
  27. package/dist/package/entity/order-platform/menu.dto.d.ts +48 -48
  28. package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +12 -205
  29. package/dist/package/entity/order-setting/order-setting.do.d.ts +8 -0
  30. package/dist/package/entity/order-setting/order-setting.dto.d.ts +16 -0
  31. package/dist/package/entity/order-setting/v3/v3.do.d.ts +3 -0
  32. package/dist/package/entity/order-setting/v3/v3.dto.d.ts +3 -0
  33. package/dist/package/entity/queue/queue.do.d.ts +50 -50
  34. package/dist/package/entity/restaurant/restaurant.dto.d.ts +10 -0
  35. package/package.json +3 -2
  36. package/src/i18n.d.ts +11 -0
  37. package/src/locales/en-US.json +235 -0
  38. package/src/locales/zh-CN.json +235 -0
  39. package/src/main.ts +23 -1
  40. package/src/stores/restaurant/index.ts +31 -3
  41. package/src/stores/table-settings.ts +0 -5
  42. package/src/views/kiosk/KioskSummary.vue +16 -13
  43. package/src/views/kiosk/KioskView.vue +16 -11
  44. package/src/views/kiosk/devices/KioskDeviceCard.vue +10 -7
  45. package/src/views/kiosk/devices/KioskDevicesView.vue +6 -4
  46. package/src/views/kiosk/devices/KioskOtpDialog.vue +4 -1
  47. package/src/views/kiosk/devices/KioskUnbindConfirm.vue +3 -1
  48. package/src/views/kiosk/settings/KioskDineInSection.vue +4 -1
  49. package/src/views/kiosk/settings/KioskDisplayStandSection.vue +14 -11
  50. package/src/views/kiosk/settings/KioskPickAtCounterSection.vue +4 -1
  51. package/src/views/kiosk/settings/KioskSettingView.vue +8 -5
  52. package/src/views/kiosk/settings/KioskTakeawaySection.vue +4 -1
  53. package/src/views/order-settings/OrderSettingsView.vue +13 -7
  54. package/src/views/order-settings/components/RestaurantSelector.vue +5 -2
  55. package/src/views/order-settings/delivery/DeliverySetting.vue +113 -60
  56. package/src/views/order-settings/delivery/components/ManualIntegratedDeliverySetting.vue +11 -8
  57. package/src/views/order-settings/delivery/components/TaxInput.vue +1 -1
  58. package/src/views/order-settings/delivery/inhouse/CurrencyInput.vue +2 -2
  59. package/src/views/order-settings/delivery/inhouse/DeliveryCustomTime.vue +31 -0
  60. package/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue +12 -9
  61. package/src/views/order-settings/delivery/inhouse/DeliveryTime.vue +9 -6
  62. package/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue +63 -68
  63. package/src/views/order-settings/delivery/inhouse/TimePicker.vue +4 -1
  64. package/src/views/order-settings/delivery/inhouse/ZoneDialog.vue +7 -4
  65. package/src/views/order-settings/delivery/integrated-delivery/FeedmeDelivery.vue +38 -15
  66. package/src/views/order-settings/delivery/integrated-delivery/FoodpandaCampaignDialog.vue +7 -4
  67. package/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue +7 -4
  68. package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +99 -41
  69. package/src/views/order-settings/dinein/DineInSetting.vue +15 -12
  70. package/src/views/order-settings/dinein/OfflinePaymentTypeDialog.vue +9 -6
  71. package/src/views/order-settings/dinein/OfflinePaymentTypeDialogContent.vue +6 -3
  72. package/src/views/order-settings/dinein/PaymentType.vue +9 -6
  73. package/src/views/order-settings/general/GeneralSetting.vue +103 -0
  74. package/src/views/order-settings/pickup/AddressInput.vue +5 -2
  75. package/src/views/order-settings/pickup/CustomPayment.vue +10 -8
  76. package/src/views/order-settings/pickup/PaymentSidesheet.vue +114 -63
  77. package/src/views/order-settings/pickup/PickUpPointDialog.vue +7 -4
  78. package/src/views/order-settings/pickup/PickUpPointDialogContent.vue +7 -4
  79. package/src/views/order-settings/pickup/PickUpSetting.vue +13 -10
  80. package/src/views/order-settings/pickup/PickUpSettingDialog.vue +13 -8
  81. package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +37 -37
  82. package/src/views/order-settings/pickup/Preorder.vue +10 -8
  83. package/src/views/order-settings/servicecharge/RateInput.vue +12 -5
  84. package/src/views/order-settings/servicecharge/ServiceChargeRule.vue +44 -24
  85. package/src/views/order-settings/servicecharge/ServiceChargeSetting.vue +82 -29
  86. package/src/views/order-settings/sms/SmsSetting.vue +105 -29
  87. package/tsconfig.app.json +3 -1
  88. package/tsconfig.json +2 -1
  89. package/tsconfig.node.json +3 -1
  90. package/vite.config.ts +2 -1
  91. package/dist/KioskSettingView-YfMgLMyn.js +0 -4
@@ -44,7 +44,7 @@ const selectedTax = computed(() => {
44
44
  label-mark="required"
45
45
  :label="title"
46
46
  :items="taxOptions"
47
- :disable="disable"
47
+ :disabled="disable"
48
48
  @update:model-value="
49
49
  (ev) => {
50
50
  if (ev) {
@@ -19,8 +19,8 @@ const emits = defineEmits<{
19
19
  }>()
20
20
 
21
21
 
22
- const value = computed<number>(() => {
23
- if (!props.modelValue) return 0
22
+ const value = computed<number | null>(() => {
23
+ if (!props.modelValue) return null
24
24
  const formattedValue = Dinero.fromFdoDinero(props.modelValue).toFormat().replace(/ /g, '')
25
25
  return parseFloat(formattedValue)
26
26
  })
@@ -3,6 +3,9 @@ import { clone } from '@/helpers/object'
3
3
  import type { FdoOperatingHour, FdoOperatingHours } from '@feedmepos/core/entity'
4
4
  import Day from 'dayjs'
5
5
  import { computed, type PropType } from 'vue'
6
+ import { useI18n } from '@feedmepos/mf-common'
7
+
8
+ const { t } = useI18n()
6
9
 
7
10
  const props = defineProps({
8
11
  modelValue: {
@@ -145,12 +148,40 @@ function emitValue(fn: (v: FdoOperatingHour[]) => FdoOperatingHour[]) {
145
148
  emits('update:model-value', v)
146
149
  }
147
150
 
151
+ function convertDayToI18n(day:string) {
152
+ switch(day) {
153
+ case "Monday":
154
+ return t('order.monday');
155
+ case "Tuesday":
156
+ return t('order.tuesday');
157
+ case "Wednesday":
158
+ return t('order.wednesday');
159
+ case "Thursday":
160
+ return t('order.thursday');
161
+ case "Friday":
162
+ return t('order.friday');
163
+ case "Saturday":
164
+ return t('order.saturday');
165
+ case "Sunday":
166
+ return t('order.sunday');
167
+ default:
168
+ return
169
+ }
170
+ }
171
+
148
172
  const sortedDayOptions = computed(() => {
149
173
  return dayOptions.value.slice().sort((a, b) => {
150
174
  // Sort so that 1 (Monday) comes first and 0 (Sunday) comes last
151
175
  if (a.value === 0) return 1
152
176
  if (b.value === 0) return -1
153
177
  return a.value - b.value
178
+ }).
179
+ map(option => {
180
+ const label = convertDayToI18n(option.label)
181
+ return {
182
+ ...option,
183
+ label
184
+ }
154
185
  })
155
186
  })
156
187
  </script>
@@ -9,6 +9,9 @@ import GoogleMap from '@/components/GoogleMap.vue'
9
9
  import ZoneDialog from './ZoneDialog.vue'
10
10
  import { type PropType, computed, onMounted, ref } from 'vue'
11
11
  import { useSnackbar, SnackbarPosition } from '@feedmepos/ui-library'
12
+ import { useI18n } from '@feedmepos/mf-common'
13
+
14
+ const { t } = useI18n()
12
15
 
13
16
  export interface Address extends FdoAddress {
14
17
  formatted: string
@@ -54,15 +57,15 @@ const areas = computed(() =>
54
57
  const { deliveryFee, minPurchase, freeAfterTotal } = area
55
58
  return [
56
59
  {
57
- label: 'Delivery Fee',
60
+ label: t('order.deliveryFee'),
58
61
  value: formatCurrency(deliveryFee)
59
62
  },
60
63
  {
61
- label: 'Min Purchase',
64
+ label: t('order.minPurchase'),
62
65
  value: minPurchase ? formatCurrency(minPurchase) : 'Not Set'
63
66
  },
64
67
  {
65
- label: 'Min spend for free Delivery',
68
+ label: t('order.minSpendForFreeDelivery'),
66
69
  value: freeAfterTotal ? formatCurrency(freeAfterTotal) : 'Not Set'
67
70
  }
68
71
  ]
@@ -179,10 +182,10 @@ onMounted(getCenter)
179
182
  <GoogleMap ref="gmRef" class="full-width" style="height: 500px" :center="center" :polygons="polygons" :zoom="10" />
180
183
 
181
184
  <div class=" mt-5 mb-5">
182
- <FmButton class="mt-3" @click="openSideSheet" icon="add" label="Add Delivery Zone" variant="plain" />
185
+ <FmButton class="mt-3" @click="openSideSheet" icon="add" :label="t('order.addDeliveryZone')" variant="plain" />
183
186
  </div>
184
187
 
185
- <FmSideSheet header="Add delivery zone" dismiss-away :maxWidth="600" v-model="sideSheet">
188
+ <FmSideSheet :header="t('order.addDeliveryZone')" dismiss-away :maxWidth="600" v-model="sideSheet">
186
189
  <div v-if="currentIndex !== null">
187
190
  <ZoneDialog :center="getPolygonCenter(deliveryArea?.polygon ?? [])" :initial-value="deliveryArea"
188
191
  @update:model-value="handleZoneUpdate" />
@@ -194,12 +197,12 @@ onMounted(getCenter)
194
197
  <template #side-sheet-footer>
195
198
  <div class="flex gap-8 items-center justify-start">
196
199
  <div v-if="currentIndex !== null">
197
- <FmButton variant="primary" label="Save" size="lg" @click="updateZone(currentIndex)" close: true />
200
+ <FmButton variant="primary" :label="t('order.save')" size="lg" @click="updateZone(currentIndex)" close: true />
198
201
  </div>
199
202
  <div v-else>
200
- <FmButton variant="primary" label="Save" size="lg" @click="addZone" close: true />
203
+ <FmButton variant="primary" :label="t('order.save')" size="lg" @click="addZone" close: true />
201
204
  </div>
202
- <FmButton variant="secondary" label="Cancel" size="lg" @click="closeSideSheet" />
205
+ <FmButton variant="secondary" :label="t('order.cancel')" size="lg" @click="closeSideSheet" />
203
206
  </div>
204
207
  </template>
205
208
  </FmSideSheet>
@@ -209,7 +212,7 @@ onMounted(getCenter)
209
212
  <div class="flex flex-row">
210
213
  <div class="fm-typo-en-body-lg-600 mb-3 mr-5" :style="{
211
214
  color: colors[index]
212
- }">Delivery Zone {{ index + 1 }}</div>
215
+ }">{{ t('order.deliveryZone') }} {{ index + 1 }}</div>
213
216
 
214
217
  <div class="mr-auto"></div>
215
218
  <FmButton append-icon="edit" variant="tertiary" @click="editZone(index)" />
@@ -3,6 +3,9 @@ import type { FdoDeliveryTime, FdoOperatingHour, FdoOperatingHours } from '@feed
3
3
  import { computed, ref, type PropType } from 'vue'
4
4
  import TimePicker from './TimePicker.vue'
5
5
  import DeliveryCustomTime from './DeliveryCustomTime.vue'
6
+ import { useI18n } from '@feedmepos/mf-common'
7
+
8
+ const { t } = useI18n()
6
9
 
7
10
  type DeliveryTimeType = 'operatingHour' | 'fixed' | 'custom'
8
11
 
@@ -28,15 +31,15 @@ const deliveryTimeOptions: {
28
31
  value: DeliveryTimeType
29
32
  }[] = [
30
33
  {
31
- label: 'Operating hour',
34
+ label: t('order.operatingHour'),
32
35
  value: 'operatingHour'
33
36
  },
34
37
  {
35
- label: 'Fixed time',
38
+ label: t('order.fixedTime'),
36
39
  value: 'fixed'
37
40
  },
38
41
  {
39
- label: 'Custom time',
42
+ label: t('order.customTime'),
40
43
  value: 'custom'
41
44
  }
42
45
  ]
@@ -110,8 +113,8 @@ function canToggle(value: DeliveryTimeType) {
110
113
  <div v-if="modelValue.custom && option.value === 'custom'">
111
114
  <FmCard variant="outlined">
112
115
  <FmCardSection>
113
- <div class="flex-grow fm-typo-en-body-lg-600 mb-2">Time Slots</div>
114
- <DeliveryCustomTime title="Time slots" :model-value="modelValue.custom"
116
+ <div class="flex-grow fm-typo-en-body-lg-600 mb-2">{{ t('order.timeSlot') }}</div>
117
+ <DeliveryCustomTime :title="t('order.timeSlot')" :model-value="modelValue.custom"
115
118
  @update:model-value="updateCustomTime" />
116
119
  </FmCardSection>
117
120
  </FmCard>
@@ -120,7 +123,7 @@ function canToggle(value: DeliveryTimeType) {
120
123
  <div v-if="modelValue.time && option.value === 'fixed'">
121
124
  <FmCard variant="outlined">
122
125
  <FmCardSection>
123
- <div class="flex-grow fm-typo-en-body-lg-600 mb-2">Time Slots</div>
126
+ <div class="flex-grow fm-typo-en-body-lg-600 mb-2">{{ t('order.timeSlot') }}</div>
124
127
  <TimePicker :modelValue="props.modelValue" @update:model-value="(v) => emits('update:model-value', v)" />
125
128
  </FmCardSection>
126
129
  </FmCard>
@@ -21,6 +21,10 @@ import { Pos } from '@feedmepos/core'
21
21
  import TaxInput from '../components/TaxInput.vue'
22
22
  import { useCoreStore } from '@feedmepos/mf-common'
23
23
  import { useSnackbar } from '@feedmepos/ui-library'
24
+ import { useI18n } from '@feedmepos/mf-common'
25
+ import { useRestaurantStore } from '@/stores/restaurant'
26
+
27
+ const { t } = useI18n()
24
28
 
25
29
  export interface InhouseDialogData {
26
30
  enable: boolean
@@ -34,6 +38,8 @@ export interface InhouseDialogData {
34
38
  taxes: { [key: string]: FdoDeliveryTaxSetting }
35
39
  }
36
40
 
41
+ const restaurantStore = useRestaurantStore()
42
+
37
43
  enum TaxOption {
38
44
  inclusive,
39
45
  exclusive
@@ -41,11 +47,11 @@ enum TaxOption {
41
47
 
42
48
  const taxInclusiveOptions = [
43
49
  {
44
- label: 'Inclusive',
50
+ label: `${t('order.taxInclusive')}`,
45
51
  value: TaxOption.inclusive
46
52
  },
47
53
  {
48
- label: 'Exclusive',
54
+ label: `${t('order.taxExclusive')}`,
49
55
  value: TaxOption.exclusive
50
56
  }
51
57
  ]
@@ -53,15 +59,10 @@ const taxInclusiveOptions = [
53
59
  const snackBar = useSnackbar()
54
60
  const { currentRestaurant } = useCoreStore()
55
61
  const minVersionForTax = Pos.minVersionToUse(F_FEATURE.Enum.calculatorV4)
56
- const validatePosVersion = computed<string>(() => {
62
+ const validPosVersion = computed<boolean>(() => {
57
63
  const posVersion = currentRestaurant.value?.posVersion ?? ''
58
64
  const feature = F_FEATURE.Enum.calculatorV4
59
- const res = Pos.canUse({ feature, posVersion })
60
- if (!res) {
61
- const minVersion = Pos.minVersionToUse(feature)
62
- return `*POS version ${minVersion} or above`
63
- }
64
- return ''
65
+ return Pos.canUse({ feature, posVersion })
65
66
  })
66
67
 
67
68
  const props = defineProps({
@@ -69,10 +70,6 @@ const props = defineProps({
69
70
  type: Object as PropType<InhouseDialogData>,
70
71
  default: undefined
71
72
  },
72
- allowEPayment: {
73
- type: [Boolean, String] as PropType<boolean | string>,
74
- required: true
75
- },
76
73
  address: {
77
74
  type: Object as PropType<Address | undefined>,
78
75
  required: true
@@ -83,16 +80,16 @@ const inhouse = reactive<InhouseDialogData>(
83
80
  props.initialValue
84
81
  ? clone(props.initialValue)
85
82
  : {
86
- enable: false,
87
- catalogId: null,
88
- term: '',
89
- areas: [],
90
- ignoreStock: false,
91
- paymentTypes: [],
92
- offlinePaymentTypes: [],
93
- deliveryTime: null,
94
- taxes: {}
95
- }
83
+ enable: false,
84
+ catalogId: null,
85
+ term: '',
86
+ areas: [],
87
+ ignoreStock: false,
88
+ paymentTypes: [],
89
+ offlinePaymentTypes: [],
90
+ deliveryTime: null,
91
+ taxes: {}
92
+ }
96
93
  )
97
94
 
98
95
  const tax = computed(() => ItemTax.taxSetting())
@@ -190,8 +187,13 @@ function updateTerm(value: string) {
190
187
  emitUpdatedValue()
191
188
  }
192
189
 
193
- function updatePaymentTypes(v: F_ORDER_PAYMENT_TYPE[]) {
194
- inhouse.paymentTypes = v
190
+ function updatePayment(value: {
191
+ paymentTypes: F_ORDER_PAYMENT_TYPE[]
192
+ offlinePaymentTypes: FdoOfflinePaymentMethod[] | undefined | null
193
+ }) {
194
+ inhouse.offlinePaymentTypes = value.offlinePaymentTypes
195
+ inhouse.paymentTypes = value.paymentTypes
196
+ emitUpdatedValue()
195
197
  }
196
198
 
197
199
  watch(
@@ -228,23 +230,22 @@ const actualDeliveryTime = computed({
228
230
  </script>
229
231
 
230
232
  <template>
231
- <FmSwitch
232
- :model-value="inhouse.enable"
233
- label="Activate In house Delivery"
233
+ <FmSwitch
234
+ :model-value="inhouse.enable"
235
+ :label="t('order.activateDeliveryCompany', {company:'In house'})"
234
236
  label-placement="right"
235
- sublabel="Accept In house Delivery with POS"
236
- @update:model-value="updateEnable"
237
- />
237
+ :sublabel="t('order.inhouseSwitchSublabel')"
238
+ @update:model-value="updateEnable" />
238
239
  <div v-if="inhouse.enable">
239
240
  <FmCard variant="outlined" class="p-5 mt-10">
240
- <div class="flex-grow fm-typo-en-title-sm-600 mb-3">General setting</div>
241
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.generalSetting') }}</div>
241
242
 
242
243
  <div class="mb-5">
243
244
  <FmSwitch
244
245
  :model-value="inhouse.ignoreStock || false"
245
246
  value="ignoreStock"
246
- label="Ignore stock"
247
- sublabel="Customer can order even product out of stocks"
247
+ :label="t('order.ignoreStock')"
248
+ :sublabel="t('order.ignoreStockSublabel')"
248
249
  label-placement="right"
249
250
  @update:model-value="updateIgnoreStock"
250
251
  />
@@ -253,7 +254,7 @@ const actualDeliveryTime = computed({
253
254
  <div class="mb-5">
254
255
  <FmSelect
255
256
  :model-value="inhouse.catalogId"
256
- label="Catalog"
257
+ :label="t('order.catalog')"
257
258
  :items="menuStore.catalogOptions"
258
259
  @update:model-value="updateCatalogId"
259
260
  />
@@ -262,7 +263,7 @@ const actualDeliveryTime = computed({
262
263
  <div class="mb-5">
263
264
  <FmTextarea
264
265
  :model-value="inhouse.term"
265
- label="Delivery term"
266
+ :label="t('order.deliveryTerm')"
266
267
  @update:model-value="updateTerm"
267
268
  />
268
269
  </div>
@@ -270,41 +271,41 @@ const actualDeliveryTime = computed({
270
271
 
271
272
  <FmCard variant="outlined" class="p-5 mt-10">
272
273
  <div class="flex-grow fm-typo-en-title-sm-600 mb-3">
273
- Tax settings
274
+ {{ t('order.taxSetting') }}
274
275
  <span
275
276
  class="text-fm-color-secondary-salmon fm-typo-en-body-sm-600"
276
- v-if="validatePosVersion"
277
+ v-if="!validPosVersion"
277
278
  >
278
- (Tax setting only applicable for POS after {{ minVersionForTax }})</span
279
+ {{ t('order.taxSettingTerm', {validatePosVersion: minVersionForTax}) }}</span
279
280
  >
280
281
  </div>
281
282
  <div class="mb-5">
282
- <FmSwitch
283
- :model-value="hasInhouseDeliveryTax"
284
- :disabled="!!validatePosVersion.length"
285
- label="Delivery fee charge tax"
286
- label-placement="right"
287
- sublabel="Accept In house Delivery with POS"
288
- @update:model-value="toggleTax"
289
- />
283
+ <FmSwitch
284
+ :model-value="hasInhouseDeliveryTax && validPosVersion"
285
+ :disabled="!validPosVersion"
286
+ :label="t('order.inhouseDeliveryTaxLabel')"
287
+ label-placement="right"
288
+ :sublabel="t('order.inhouseDeliveryTaxSublabel')"
289
+ @update:model-value="toggleTax" />
290
290
  </div>
291
- <div v-if="hasInhouseDeliveryTax">
291
+ <div v-if="hasInhouseDeliveryTax && validPosVersion">
292
292
  <div class="mb-5">
293
- <TaxInput
294
- :model-value="taxSettings"
293
+ <TaxInput
294
+ :disable="!validPosVersion"
295
+ :model-value="taxSettings"
295
296
  :tax-options="taxOptions"
296
- :title="`${tax.systemCode} (applicable if restaurant profile SST is set)`"
297
- @update:model-value="(ev) => updateTax(ev)"
297
+ :title="`${tax.systemCode} ${t('order.inhouseDeliveryInputLabel')}`"
298
+ @update:model-value="(ev) => updateTax(ev)"
298
299
  />
299
300
  </div>
300
301
  <div class="mb-5">
301
- <FmRadioGroup
302
- :model-value="taxInclusive"
303
- label-mark="required"
302
+ <FmRadioGroup
303
+ :disabled="!validPosVersion"
304
+ :model-value="taxInclusive"
305
+ label-mark="required"
304
306
  inline
305
- label="Tax calculation"
306
- @update:model-value="(ev) => updateTaxInclusive(ev as unknown as number)"
307
- >
307
+ :label="t('order.inhouseDeliveryTaxCalculation')"
308
+ @update:model-value="(ev) => updateTaxInclusive(ev as unknown as number)">
308
309
  <div v-for="option in taxInclusiveOptions" :key="option.value">
309
310
  <FmRadio :value="option.value" :label="option.label" />
310
311
  </div>
@@ -314,14 +315,8 @@ const actualDeliveryTime = computed({
314
315
  </FmCard>
315
316
 
316
317
  <FmCard variant="outlined" class="p-5 mt-10">
317
- <PaymentSidesheet
318
- :paymentTypes="inhouse.paymentTypes"
319
- :offlinePaymentTypes="inhouse.offlinePaymentTypes"
320
- @update:payment-types="(v: F_ORDER_PAYMENT_TYPE[]) => updatePaymentTypes(v)"
321
- @update:offline-payment-types="
322
- (v: FdoOfflinePaymentMethod[] | undefined | null) => (inhouse.offlinePaymentTypes = v)
323
- "
324
- />
318
+ <PaymentSidesheet :paymentTypes="inhouse.paymentTypes" :offlinePaymentTypes="inhouse.offlinePaymentTypes"
319
+ :allow-e-payment="restaurantStore.getRestaurantEPayment(currentRestaurant)" @update:payments="updatePayment" />
325
320
  </FmCard>
326
321
 
327
322
  <FmCard variant="outlined" class="p-5 mt-10">
@@ -330,12 +325,12 @@ const actualDeliveryTime = computed({
330
325
 
331
326
  <div v-if="preorderDeliveryTime">
332
327
  <FmCard variant="outlined" class="p-5 mt-10">
333
- <div class="flex-grow fm-typo-en-title-sm-600">Delivery Time</div>
328
+ <div class="flex-grow fm-typo-en-title-sm-600">{{ t('order.deliveryTime') }}</div>
334
329
  <DeliveryTime v-model="actualDeliveryTime as FdoDeliveryTime" />
335
330
  </FmCard>
336
331
  </div>
337
332
  <FmCard variant="outlined" class="p-5 mt-10">
338
- <div class="flex-grow fm-typo-en-title-sm-600 mb-3">Delivery order</div>
333
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.deliveryOrder') }}</div>
339
334
  <DeliveryOrder v-model="inhouse.areas" :address="address as Address" />
340
335
  </FmCard>
341
336
  </div>
@@ -15,13 +15,16 @@
15
15
  <FmButton class="mt-2 ml-4" append-icon="close" variant="tertiary" @click="removeTimeslot(index)" />
16
16
  </div>
17
17
  </div>
18
- <FmButton class="mt-3" @click.stop="addTimeslot" icon="add" label="Add Time Slot" variant="plain"/>
18
+ <FmButton class="mt-3" @click.stop="addTimeslot" icon="add" :label="t('order.addTimeSlot')" variant="plain"/>
19
19
  </template>
20
20
 
21
21
  <script setup lang="ts">
22
22
  import { computed } from 'vue'
23
23
  import Day from 'dayjs'
24
24
  import type { FdoDeliveryTime } from '@feedmepos/core/entity'
25
+ import { useI18n } from '@feedmepos/mf-common'
26
+
27
+ const { t } = useI18n()
25
28
 
26
29
  const props = defineProps<{
27
30
  modelValue: FdoDeliveryTime
@@ -7,6 +7,9 @@ import { Dinero } from '@feedmepos/core'
7
7
  import type { FdoDeliveryArea, FdoDinero } from '@feedmepos/core/entity'
8
8
  import { ref, reactive, type PropType, computed, onMounted, watch } from 'vue'
9
9
  import CurrencyInput from './CurrencyInput.vue'
10
+ import { useI18n } from '@feedmepos/mf-common'
11
+
12
+ const { t } = useI18n()
10
13
 
11
14
  const emits = defineEmits<{
12
15
  (e: 'update:model-value', value: FdoDeliveryArea): void
@@ -101,28 +104,28 @@ watch(
101
104
  <CurrencyInput
102
105
  :model-value="data.deliveryFee"
103
106
  @update:model-value="updateDeliveryFee"
104
- label="Delivery Fee"
107
+ :label="t('order.deliveryFee')"
105
108
  />
106
109
  <div class="flex flex-row">
107
110
  <div class="mr-1">
108
111
  <CurrencyInput
109
112
  :model-value="data.minPurchase"
110
113
  @update:model-value="updateMinPurchase"
111
- label="Min Purchase"
114
+ :label="t('order.minPurchase')"
112
115
  />
113
116
  </div>
114
117
  <div class="ml-1">
115
118
  <CurrencyInput
116
119
  :model-value="data.freeAfterTotal"
117
120
  @update:model-value="updateFreeAfterTotal"
118
- label="Min spend for free Delivery"
121
+ :label="t('order.minSpendForFreeDelivery')"
119
122
  />
120
123
  </div>
121
124
  </div>
122
125
  <FmStepperField
123
126
  class="mb-5"
124
127
  :model-value="distanceInKM"
125
- label="Delivery zone (km)"
128
+ :label="`${t('order.deliveryZone')} (km)`"
126
129
  placeholder="0"
127
130
  :show-steppers="false"
128
131
  @update:model-value="updateDistance"
@@ -10,6 +10,10 @@ import {
10
10
  import { useCoreStore } from '@feedmepos/mf-common'
11
11
  import { type PropType, computed, reactive } from 'vue'
12
12
  import parsePhoneNumberFromString from 'libphonenumber-js'
13
+ import { useI18n } from '@feedmepos/mf-common'
14
+
15
+ import { useRouter } from 'vue-router'
16
+ const { t } = useI18n()
13
17
 
14
18
  interface ValidateFeedmeErrorResult {
15
19
  message: string
@@ -51,23 +55,30 @@ const validatePosVersion = computed<ValidateFeedmeResult>(() => {
51
55
  })
52
56
  if (!res) {
53
57
  const minVersion = Pos.minVersionToUse(F_FEATURE.enum.feedmeDelivery)
54
- return { message: `Min POS version ${minVersion} required for FeedMe Express` }
58
+ return { message: `${t('order.feedmeExpressPosVersionIssue', {minVersion})}` }
55
59
  }
56
60
  return true
57
61
  })
58
62
 
63
+ const router = useRouter();
64
+
59
65
  const validatePayoutAccount = computed<ValidateFeedmeResult>(() => {
60
66
  const account = currentRestaurant.value?.payoutAccount
61
67
  if (!account?.enable) {
62
68
  return {
63
- message: 'Payout account is required to enable FeedMe Express',
64
-
69
+ message: `${t('order.feedmeExpressPayoutAccIssue')}`,
70
+ action: {
71
+ label: t('order.updatePayoutAccount'),
72
+ callback: () => {
73
+ router.push({ name: "mf-payment-payout-account"})
74
+ }
75
+ }
65
76
  }
66
77
  }
67
78
  if (account.status !== F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED) {
68
79
  return {
69
80
  message:
70
- 'Your payout account is under review. Please contact our staff for further assistant.'
81
+ `${t('order.feedmeExpressNotApproved')}`
71
82
  }
72
83
  }
73
84
  return true
@@ -77,12 +88,18 @@ const validateRestaurantProfile = computed<ValidateFeedmeResult>(() => {
77
88
  const restaurant = currentRestaurant
78
89
  const profile = currentRestaurant.value?.profile
79
90
  const formattedAddress = formatAddress(profile?.address)
80
- if (!restaurant || !profile) return { message: 'Invalid restaurant' }
91
+ if (!restaurant || !profile) return { message: t('order.invalidRestaurant') }
81
92
  const phoneNo = parsePhoneNumberFromString(profile.phoneNo)
82
93
  if (!phoneNo || !formattedAddress.isValid || !formattedAddress.isValidCoordinate) {
83
- const requiredField = !phoneNo ? 'contact' : 'address'
94
+ const requiredField = !phoneNo ? t('order.contact') : t('order.address')
84
95
  return {
85
- message: `Invalid restaurant ${requiredField}, please complete your restaurant profile to enable FeedMe Express`,
96
+ message:`${t('order.invalidRestaurant')} ${requiredField}, ${t('order.pleaseCompleteProfile')}`,
97
+ action: {
98
+ label: t('order.updateNow'),
99
+ callback: () => {
100
+ router.push({ name: "$settings-my-business"})
101
+ }
102
+ }
86
103
  }
87
104
  }
88
105
 
@@ -149,24 +166,24 @@ import { formatAddress } from '@/helpers/profile'
149
166
 
150
167
  <template>
151
168
  <template v-if="validation === true">
152
- <FmSwitch :model-value="data.enable" label="Active FeedMe Express" label-placement="right"
153
- sublabel="Customer can select FeedMe express to delivery their meal" @update:model-value="updateEnable" />
169
+ <FmSwitch :model-value="data.enable" :label="`${t('order.actiavteFeedmeExpress')}`" label-placement="right"
170
+ :sublabel="t('order.activateFeedmeExpressSublabel')" @update:model-value="updateEnable" />
154
171
  <div v-if="data.enable">
155
172
  <FmCard variant="outlined" class="p-5 mt-10">
156
- <div class="flex-grow fm-typo-en-title-sm-600 mb-3">General Info</div>
173
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.generalInfo') }}</div>
157
174
 
158
- <FmSwitch :model-value="data.ignoreStock || false" value="ignoreStock" label="Ignore stock"
159
- sublabel="Customer can order even product out of stocks" label-placement="right"
175
+ <FmSwitch :model-value="data.ignoreStock || false" value="ignoreStock" :label="t('order.ignoreStock')"
176
+ :sublabel="t('order.ignoreStockSublabel')" label-placement="right"
160
177
  @update:model-value="updateIgnoreStock" />
161
178
 
162
179
  <div class="mt-5 mb-3">
163
- <FmSelect :model-value="data.catalogId" label="Catalog" :items="menuStore.catalogOptions"
180
+ <FmSelect :model-value="data.catalogId" :label="t('order.catalog')" :items="menuStore.catalogOptions"
164
181
  @update:model-value="updateCatalogId" />
165
182
  </div>
166
- <FmTextarea :model-value="data.term ?? undefined" label="Term" @update:model-value="updateTerm" />
183
+ <FmTextarea :model-value="data.term ?? undefined" :label="t('order.term')" @update:model-value="updateTerm" />
167
184
 
168
185
  <div class="mt-5 mb-3">
169
- <FmTextarea :model-value="data.instruction ?? undefined" label="Delivery instruction"
186
+ <FmTextarea :model-value="data.instruction ?? undefined" :label="t('order.deliveryInstruction')"
170
187
  @update:model-value="updateInstruction" />
171
188
  </div>
172
189
  </FmCard>
@@ -177,6 +194,12 @@ import { formatAddress } from '@/helpers/profile'
177
194
  <img :src="svgPath" alt="" />
178
195
  <div class="flex flex-col">
179
196
  <div class="text-center mb-5">{{ validation.message }}</div>
197
+ <FmButton
198
+ v-if="validation.action"
199
+ variant="primary"
200
+ :label="validation.action.label"
201
+ @click = "(validation as ValidateFeedmeErrorResult).action!.callback"
202
+ />
180
203
  </div>
181
204
  </div>
182
205
  </div>
@@ -2,6 +2,9 @@
2
2
  import { clone } from '@/helpers/object';
3
3
  import Day from 'dayjs';
4
4
  import { reactive, type PropType, watch } from 'vue';
5
+ import { useI18n } from '@feedmepos/mf-common'
6
+
7
+ const { t } = useI18n()
5
8
 
6
9
  export interface IFPDiscountCampaign {
7
10
  name: string;
@@ -87,16 +90,16 @@ function convertToDateRange(newDateRange: { start: string, end: string }): { sta
87
90
  <template>
88
91
  <FmTextField
89
92
  v-model="data.name"
90
- label="Name"
91
- placeholder="Enter name"
93
+ :label="t('order.name')"
94
+ :placeholder="t('order.enterName')"
92
95
  />
93
96
 
94
97
  <FmStepperField
95
98
  class="mt-5"
96
99
  append-text="%"
97
100
  v-model="data.vendorBearPercentage"
98
- label="Vendor bear percentage"
99
- placeholder="Enter a number"
101
+ :label="t('order.vendorBearPercentage')"
102
+ :placeholder="t('order.enterANumber')"
100
103
  :show-steppers="false"
101
104
  />
102
105