@feedmepos/mf-order-setting 0.0.52-dev.0 → 0.0.52-dev.1

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.
@@ -3121,7 +3121,7 @@ const E = { class: "flex-1 overflow-auto" }, H = /* @__PURE__ */ b({
3121
3121
  {
3122
3122
  path: u.OrderSettingView,
3123
3123
  name: "Order Setting View",
3124
- component: () => import("./OrderSettingsView-C4aEpC1j.js")
3124
+ component: () => import("./OrderSettingsView-DzbdDgEN.js")
3125
3125
  }
3126
3126
  ], j = {
3127
3127
  "en-US": C,
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as a, i as e, r as o } from "./app-CwYXsqxX.js";
1
+ import { _ as a, i as e, r as o } from "./app-CpFcQuAa.js";
2
2
  export {
3
3
  a as FmApp,
4
4
  e as i18nMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-order-setting",
3
- "version": "0.0.52-dev.0",
3
+ "version": "0.0.52-dev.1",
4
4
  "type": "module",
5
5
  "module": "./dist/app.js",
6
6
  "license": "UNLICENSED",
@@ -29,6 +29,15 @@ const { currentRestaurant } = useCoreStore()
29
29
  const { isLoading, startAsyncCallWithErr } = useLoading()
30
30
  const dialog = useDialog()
31
31
 
32
+ // Helper function to generate unique IDs and names for reservation ranges
33
+ const generateRangeDefaults = (index = 0) => ({
34
+ _id: new Date().toISOString() + '-' + index, // Add index to ensure uniqueness
35
+ name: `Dining Area ${index + 1}`
36
+ })
37
+
38
+ // Helper function to generate unique capacity tier ID
39
+ const generateCapacityTierId = () => new Date().toISOString() + '-' + Math.random().toString(36).substr(2, 9)
40
+
32
41
  const DEFAULT_GUEST_MESSAGE = `Please take note of the following important details before making a reservation:
33
42
 
34
43
  1. Dining Time Limit
@@ -44,7 +53,7 @@ Free cancellation up to 24 hours before your reservation. Please contact the out
44
53
  const reservationSettings = ref<FdoOrderReservationSettingsV2>({
45
54
  ranges: [
46
55
  {
47
- _id: '',
56
+ ...generateRangeDefaults(0),
48
57
  enable: false,
49
58
  bookingDuration: 60,
50
59
  enablePreorder: true,
@@ -56,7 +65,6 @@ const reservationSettings = ref<FdoOrderReservationSettingsV2>({
56
65
  value: 30,
57
66
  unit: 'day'
58
67
  },
59
- name: '',
60
68
  operatingHours: {
61
69
  0: {
62
70
  enable: false,
@@ -103,7 +111,7 @@ const reservationSettings = ref<FdoOrderReservationSettingsV2>({
103
111
  })
104
112
 
105
113
  const rangeSetting = ref<FdoReservationRange>({
106
- _id: '',
114
+ ...generateRangeDefaults(0),
107
115
  enable: true,
108
116
  bookingDuration: 60,
109
117
  enablePreorder: true,
@@ -115,7 +123,6 @@ const rangeSetting = ref<FdoReservationRange>({
115
123
  value: 30,
116
124
  unit: 'day'
117
125
  },
118
- name: '',
119
126
  operatingHours: {
120
127
  0: {
121
128
  enable: true,
@@ -164,25 +171,25 @@ const rangeSetting = ref<FdoReservationRange>({
164
171
  preferences: [],
165
172
  capacityTiers: [
166
173
  {
167
- _id: '1',
174
+ _id: generateCapacityTierId(),
168
175
  minPax: 1,
169
176
  maxPax: 2,
170
177
  capacity: 10
171
178
  },
172
179
  {
173
- _id: '2',
180
+ _id: generateCapacityTierId(),
174
181
  minPax: 3,
175
182
  maxPax: 4,
176
183
  capacity: 8
177
184
  },
178
185
  {
179
- _id: '3',
186
+ _id: generateCapacityTierId(),
180
187
  minPax: 5,
181
188
  maxPax: 6,
182
189
  capacity: 5
183
190
  },
184
191
  {
185
- _id: '4',
192
+ _id: generateCapacityTierId(),
186
193
  minPax: 7,
187
194
  maxPax: null,
188
195
  capacity: 3
@@ -1078,7 +1085,7 @@ function handleCopySettings(copiedSettings: Partial<FdoOrderReservationSettingsV
1078
1085
  <div>
1079
1086
  <FmButton label="Add table type" icon="add" variant="plain" @click="
1080
1087
  rangeSetting.capacityTiers.push({
1081
- _id: new Date().toISOString(),
1088
+ _id: generateCapacityTierId(),
1082
1089
  minPax: ([...rangeSetting.capacityTiers].pop()?.maxPax ?? 0) + 1,
1083
1090
  maxPax: null,
1084
1091
  capacity: 0