@feedmepos/mf-order-setting 0.0.29 → 0.0.31

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 (35) hide show
  1. package/dist/{KioskDevicesView-Dvr4RUmt.js → KioskDevicesView-CWzmu0rZ.js} +1 -1
  2. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-CJ-xAR8i.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CldPl8BW.js} +2 -2
  3. package/dist/{KioskSettingView-DaJz8ZZi.js → KioskSettingView-BsxOiUdj.js} +1 -1
  4. package/dist/{KioskView-v8Yl4x4R.js → KioskView-DBnQe7Mp.js} +4 -4
  5. package/dist/{OrderSettingsView-CN1PFwX_.js → OrderSettingsView-BvDtRpI_.js} +2294 -2256
  6. package/dist/{app-d1Lptg6A.js → app-G3iTmEHp.js} +7 -4
  7. package/dist/app.js +1 -1
  8. package/dist/common/util/index.d.ts +7 -1
  9. package/dist/{dayjs.min-BLlPHZkl.js → dayjs.min-ChzYZzP1.js} +1 -1
  10. package/dist/frontend/mf-order/src/api/remoteOrder/index.d.ts +1 -1
  11. package/dist/frontend/mf-order/src/app.d.ts +3 -0
  12. package/dist/frontend/mf-order/src/main.d.ts +3 -0
  13. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue.d.ts +1 -0
  14. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  15. package/dist/{index-Cg9kSeyn.js → index-Bacw_1Kj.js} +2 -2
  16. package/dist/package/entity/index.d.ts +1 -0
  17. package/dist/package/entity/order-platform/base-integration.dto.d.ts +71 -0
  18. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +6 -6
  19. package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +14 -0
  20. package/dist/package/entity/order-platform/shopeefood/shopeefood-order.dto.d.ts +55 -0
  21. package/dist/package/entity/order-platform/shopeefood/shopeefood.enum.d.ts +2 -0
  22. package/dist/{queue.do-zk6sqriQ.js → queue.do-BtfSllT8.js} +5036 -4999
  23. package/package.json +1 -1
  24. package/src/api/remoteOrder/index.ts +1 -1
  25. package/src/locales/en-US.json +1 -0
  26. package/src/locales/th-TH.json +1 -0
  27. package/src/locales/zh-CN.json +1 -0
  28. package/src/views/order-settings/delivery/DeliverySetting.vue +2 -0
  29. package/src/views/order-settings/delivery/delivery.data.ts +2 -1
  30. package/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue +31 -2
  31. package/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue +2 -0
  32. package/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue +3 -2
  33. package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +16 -2
  34. package/src/views/order-settings/delivery/integrated-delivery/ShopeefoodSetting.vue +1 -0
  35. package/src/views/order-settings/discount-rule/DiscountRuleSetting.vue +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-order-setting",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "type": "module",
5
5
  "module": "./dist/app.js",
6
6
  "license": "UNLICENSED",
@@ -88,7 +88,7 @@ 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> {
91
+ async startSelfServeFlow(restaurantId: string): Promise<string|null> {
92
92
  return getData(await deliveryClientInstance('grabfood').get(`/setting/integration-url/${restaurantId}`));
93
93
  },
94
94
 
@@ -183,6 +183,7 @@
183
183
  "pickupPoint": "Pickup point",
184
184
  "pleaseCompleteProfile": "please complete your restaurant profile to enable FeedMe Express",
185
185
  "pleaseSelectRestaurant": "Please select a restaurant.",
186
+ "printReceiptAfterClose": "Print receipt after auto close bill",
186
187
  "prefix": "Prefix",
187
188
  "preOrder": "Pre-order",
188
189
  "preOrderHint": "Order on {today}, Customer can order between {start} and {end}. Max 7 days.",
@@ -184,6 +184,7 @@
184
184
  "preOrder": "สั่งซื้อล่วงหน้า",
185
185
  "preOrderHint": "สั่งซื้อในวันที่ {today} ลูกค้าสามารถสั่งซื้อได้ระหว่าง {start} และ {end} สูงสุด 7 วัน",
186
186
  "pricePerMessage": "ราคาต่อข้อความ",
187
+ "printReceiptAfterClose": "พิมพ์ใบเสร็จหลังจากปิดบิลอัตโนมัติ",
187
188
  "processing": "กำลังประมวลผล",
188
189
  "productSelected": "ผลิตภัณฑ์ที่เลือก",
189
190
  "promptAnonymousLoginDialog": "กล่องโต้ตอบพร้อมท์เข้าสู่ระบบสำหรับคำสั่งซื้อแบบไม่เปิดเผยตัวตน",
@@ -187,6 +187,7 @@
187
187
  "prefix": "前缀",
188
188
  "preOrder": "预订",
189
189
  "preOrderHint": "于今日 {today} 下单,客户可以在 {start} 和 {end} 之间预订。最多 7 天。",
190
+ "printReceiptAfterClose": "自动关闭账单后打印收据",
190
191
  "pricePerMessage": "每条短信的价格",
191
192
  "processing": "处理中",
192
193
  "productSelected": "已选择商品",
@@ -348,6 +348,8 @@ async function updateIntegratedDeliveryType({
348
348
  },
349
349
  canUseAuto: canUseAutoDeliveryIntegration as boolean | string
350
350
  }
351
+ localAuto.value = setting ?? localAuto.value
352
+ localManual.value = doc ?? localManual.value
351
353
  }
352
354
 
353
355
  async function updateFeedmeExpress({ key, setting }: IntegratedDeliveryRow) {
@@ -73,8 +73,9 @@ function initExternalDelivery(): FdoExternalSetting {
73
73
  enable: false,
74
74
  config: {
75
75
  autoAccept: true,
76
- autoSend: false,
76
+ autoSend: true,
77
77
  autoCloseBill: false,
78
+ printReceiptAfterClose: false,
78
79
  },
79
80
  platform: 'ZUS',
80
81
  }
@@ -7,11 +7,30 @@
7
7
  @update:model-value="updateEnable"
8
8
  :disabled="!canEdit"
9
9
  />
10
+ <div class="mt-6">
11
+ <div>
12
+ <FmCheckbox
13
+ :model-value="data.config.autoCloseBill"
14
+ :label="t('order.allowedAutoCloseBill')"
15
+ @update:model-value="updateAutoCloseBill"
16
+ :disabled="!canEdit"
17
+ value=""
18
+ />
19
+ </div>
20
+ <div>
21
+ <FmCheckbox
22
+ :model-value="data.config.printReceiptAfterClose ?? true"
23
+ :label="t('order.printReceiptAfterClose')"
24
+ @update:model-value="updatePrintReceiptAfterClose"
25
+ value=""
26
+ :disabled="!canEdit"
27
+ />
28
+ </div>
29
+ </div>
10
30
  <div v-if="data.enable">
11
- <FmCard variant="outlined" class="mt-10 p-5">
31
+ <FmCard variant="outlined" class="mt-6 p-5">
12
32
  <div class="mb-3">
13
33
  <div class="flex-grow fm-typo-en-title-sm-600 mb-5">{{ t('order.syncMenu') }}</div>
14
-
15
34
  <FmSelect
16
35
  :placeholder="t('order.selectPlatform')"
17
36
  :model-value="data.platform"
@@ -96,6 +115,16 @@ function emitUpdatedValue() {
96
115
  emits('update:model-value', { ...data })
97
116
  }
98
117
 
118
+ function updateAutoCloseBill(value: boolean) {
119
+ data.config.autoCloseBill = value
120
+ emitUpdatedValue()
121
+ }
122
+
123
+ function updatePrintReceiptAfterClose(value: boolean) {
124
+ data.config.printReceiptAfterClose = value
125
+ emitUpdatedValue()
126
+ }
127
+
99
128
  function updateEnable(value: boolean) {
100
129
  data.enable = value
101
130
  emitUpdatedValue()
@@ -50,6 +50,7 @@ const modelValue = computed<IntegratedDeliverySettingData>(() => {
50
50
  commissionRate: auto.reportConfig?.commissionRate ?? 0,
51
51
  lastSynchronize: auto.lastSynchronize ?? '',
52
52
  autoAccept: true,
53
+ printReceiptAfterClose: auto.printReceiptAfterClose ?? true,
53
54
  ignoreDiscount: auto.ignoreDiscount ?? false,
54
55
  status: auto.status,
55
56
  updatedAt: auto.updatedAt,
@@ -76,6 +77,7 @@ function updateData({ manual, auto }: IntegratedDeliverySettingData) {
76
77
  commissionRate: auto.commissionRate
77
78
  }
78
79
  }
80
+
79
81
  return { manual: data.manual, integrated: data.integrated }
80
82
  }
81
83
 
@@ -43,6 +43,7 @@ const modelValue = computed<IntegratedDeliverySettingData>(() => {
43
43
  autoCloseBill: auto.autoCloseBill || false,
44
44
  catalogId: auto?.catalogId || null,
45
45
  commissionRate: auto.commissionRate,
46
+ printReceiptAfterClose: auto.printReceiptAfterClose ?? true,
46
47
  lastSynchronize: auto.lastSynchronize,
47
48
  status: auto.status,
48
49
  updatedAt: auto.updatedAt,
@@ -118,9 +119,9 @@ async function startSelfServeFlow() {
118
119
 
119
120
  if (!url) {
120
121
  showError(`Failed to get integration url for ${currentRestaurant?.value?._id}`)
122
+ } else {
123
+ window.open(url, '_blank')
121
124
  }
122
-
123
- window.open(url, '_blank')
124
125
  }
125
126
  </script>
126
127
 
@@ -23,6 +23,7 @@ export interface AutoIntegrateData {
23
23
  updatedAt?: string | null
24
24
  menuSyncError?: string | null
25
25
  sstInclusive?: boolean | null
26
+ printReceiptAfterClose?: boolean | null
26
27
  }
27
28
 
28
29
  export interface IntegratedDeliverySettingData {
@@ -115,13 +116,21 @@ function updateMenuCatalog(catalogId: string | null) {
115
116
  }))
116
117
  }
117
118
 
118
- type OrderSettingKey = 'autoAcceptOrder' | 'autoCloseBill' | 'ignoreDiscount' | 'sstInclusive'
119
+ type OrderSettingKey =
120
+ | 'autoAcceptOrder'
121
+ | 'autoCloseBill'
122
+ | 'ignoreDiscount'
123
+ | 'sstInclusive'
124
+ | 'printReceiptAfterClose'
119
125
  const orderSettingValue = computed(() => {
120
- const { autoAccept, autoCloseBill, ignoreDiscount, sstInclusive } = props.modelValue.auto
126
+ const { autoAccept, autoCloseBill, ignoreDiscount, sstInclusive, printReceiptAfterClose } =
127
+ props.modelValue.auto
121
128
  const value: OrderSettingKey[] = []
122
129
  if (autoCloseBill) value.push('autoCloseBill')
123
130
  if (ignoreDiscount) value.push('ignoreDiscount')
124
131
  if (sstInclusive) value.push('sstInclusive')
132
+ if (printReceiptAfterClose) value.push('printReceiptAfterClose')
133
+
125
134
  return value
126
135
  })
127
136
  const orderSettingOptions = computed<
@@ -137,6 +146,10 @@ const orderSettingOptions = computed<
137
146
  {
138
147
  label: t('order.allowedAutoCloseBill'),
139
148
  value: 'autoCloseBill'
149
+ },
150
+ {
151
+ label: t('order.printReceiptAfterClose'),
152
+ value: 'printReceiptAfterClose'
140
153
  }
141
154
  ]
142
155
  if (props.modelValue.auto.autoAccept !== undefined) {
@@ -159,6 +172,7 @@ function updateOrderSettings(orderSettingKeys: OrderSettingKey[]) {
159
172
  ...oldV,
160
173
  autoAccept: orderSettingKeys.includes('autoAcceptOrder'),
161
174
  autoCloseBill: orderSettingKeys.includes('autoCloseBill'),
175
+ printReceiptAfterClose: orderSettingKeys.includes('printReceiptAfterClose'),
162
176
  ignoreDiscount: orderSettingKeys.includes('ignoreDiscount'),
163
177
  sstInclusive: orderSettingKeys.includes('sstInclusive')
164
178
  }))
@@ -43,6 +43,7 @@ const modelValue = computed<IntegratedDeliverySettingData>(() => {
43
43
  integrationId: auto.storeID,
44
44
  autoCloseBill: auto.autoCloseBill || false,
45
45
  catalogId: auto?.catalogId || null,
46
+ printReceiptAfterClose: auto.printReceiptAfterClose ?? true,
46
47
  commissionRate: auto.reportConfig?.commissionRate || 0,
47
48
  lastSynchronize: auto.lastSynchronize,
48
49
  status: auto.status,
@@ -44,12 +44,18 @@
44
44
  />
45
45
  </div>
46
46
  <FmTextField
47
- v-model="group.maxApplicableEffects"
47
+ :model-value="group.maxApplicableEffects"
48
48
  :label="t('order.discountRule.maxTotalUses')"
49
49
  type="number"
50
50
  :rules="maxApplicableEffectsRules"
51
51
  :min="1"
52
52
  :helper-text="t('order.discountRule.maxTotalUsesSublabel')"
53
+ @update:model-value="
54
+ (newValue) => {
55
+ const parsedValue = parseInt(newValue)
56
+ group.maxApplicableEffects = isNaN(parsedValue) ? 1 : parsedValue
57
+ }
58
+ "
53
59
  />
54
60
  </FmCard>
55
61
  <FmCard
@@ -408,7 +414,6 @@ async function _updateDiscountRule(effectGroups: FdoEffectGroup[]) {
408
414
  lastUpdatedAt: lastUpdatedAt.value || ''
409
415
  })
410
416
  applyDiscountRuleSettings(discountRule)
411
- await initSetting()
412
417
  })
413
418
  }
414
419