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

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 (63) hide show
  1. package/.tsbuildinfo +1 -0
  2. package/dist/{KioskDevicesView-u14hzPbE.js → KioskDevicesView-Vy9FLX1n.js} +1 -1
  3. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-DBgRDIoS.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-DhZPOEEQ.js} +2 -2
  4. package/dist/{KioskSettingView-DmvtZcV1.js → KioskSettingView-cE-JdCBB.js} +206 -208
  5. package/dist/{KioskView-M8V91gD5.js → KioskView-BYs5bem0.js} +4 -4
  6. package/dist/OrderSettingsView-C4aEpC1j.js +56063 -0
  7. package/dist/{app-CLewMjcd.js → app-CwYXsqxX.js} +184 -20
  8. package/dist/app.js +1 -1
  9. package/dist/{dayjs.min-DCTYRWyD.js → dayjs.min-JEYIJz2D.js} +1 -1
  10. package/dist/frontend/mf-order/src/api/reservation/index.d.ts +8 -0
  11. package/dist/frontend/mf-order/src/app.d.ts +164 -0
  12. package/dist/frontend/mf-order/src/main.d.ts +164 -0
  13. package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +3 -3
  14. package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +2 -2
  15. package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +2 -2
  16. package/dist/frontend/mf-order/src/views/order-settings/reservation/CopySettingsSheet.vue.d.ts +186 -0
  17. package/dist/frontend/mf-order/src/views/order-settings/reservation/CustomSelect.vue.d.ts +15 -0
  18. package/dist/frontend/mf-order/src/views/order-settings/reservation/CustomTimePicker.vue.d.ts +10 -0
  19. package/dist/frontend/mf-order/src/views/order-settings/reservation/ReservationSetting.vue.d.ts +2 -0
  20. package/dist/{index-B7LtJeBJ.js → index-DZCjODMx.js} +2 -2
  21. package/dist/{menu.dto-Co7iXHNr.js → menu.dto-D9CDVLiP.js} +22865 -20028
  22. package/dist/package/entity/food-court/order.do.d.ts +47 -2
  23. package/dist/package/entity/food-court/order.dto.d.ts +0 -3
  24. package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +12356 -1
  25. package/dist/package/entity/incoming-order/incoming-order.do.d.ts +3 -22266
  26. package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +18 -0
  27. package/dist/package/entity/index.d.ts +5 -0
  28. package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +1 -19864
  29. package/dist/package/entity/order/order-item/order-item.dto.d.ts +24 -3714
  30. package/dist/package/entity/order/order.do.d.ts +8 -0
  31. package/dist/package/entity/order/order.dto.d.ts +118 -0
  32. package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +20 -0
  33. package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +23 -0
  34. package/dist/package/entity/order-platform/menu.dto.d.ts +34 -0
  35. package/dist/package/entity/order-setting/order-setting.do.d.ts +861 -0
  36. package/dist/package/entity/order-setting/reservationV2/reservation.do.d.ts +1269 -0
  37. package/dist/package/entity/queue/queue.do.d.ts +1 -11
  38. package/dist/package/entity/queue/queue.dto.d.ts +25 -0
  39. package/dist/package/entity/reservation/reservation.do.d.ts +101 -0
  40. package/dist/package/entity/reservation/reservation.dto.d.ts +325 -0
  41. package/dist/package/entity/reservation/reservation.enum.d.ts +3 -0
  42. package/dist/package/entity/reservation/reservation.utils.d.ts +152 -0
  43. package/dist/style.css +1 -0
  44. package/package.json +3 -3
  45. package/src/api/reservation/index.ts +28 -0
  46. package/src/assets/images/not-found.png +0 -0
  47. package/src/locales/en-US.json +56 -0
  48. package/src/locales/th-TH.json +54 -0
  49. package/src/locales/zh-CN.json +54 -0
  50. package/src/main.ts +7 -5
  51. package/src/stores/order-setting/mapper.ts +50 -50
  52. package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +1 -19
  53. package/src/views/order-settings/OrderSettingsView.vue +7 -2
  54. package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +3 -1
  55. package/src/views/order-settings/drive-thru/DriveThruSetting.vue +13 -28
  56. package/src/views/order-settings/reservation/CopySettingsSheet.vue +238 -0
  57. package/src/views/order-settings/reservation/CustomSelect.vue +99 -0
  58. package/src/views/order-settings/reservation/CustomTimePicker.vue +201 -0
  59. package/src/views/order-settings/reservation/ReservationSetting.vue +1246 -0
  60. package/src/views/order-settings/servicecharge/ServiceChargeRule.vue +5 -1
  61. package/tsconfig.app.json +8 -6
  62. package/dist/OrderSettingsView-Bl3LshG3.js +0 -51603
  63. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +0 -1
@@ -0,0 +1,325 @@
1
+ import { z } from 'zod';
2
+ export declare const RestaurantReservationDto: z.ZodObject<{
3
+ _id: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
4
+ restaurantId: z.ZodEffects<z.ZodString, string, string>;
5
+ /** The capacity tier ID - the actual inventory unit to deduct from */
6
+ capacityTierId: z.ZodString;
7
+ /** The range ID - the zone/area this booking belongs to (for reference) */
8
+ rangeId: z.ZodString;
9
+ /** The exact start/end time returned by the availability API */
10
+ startDate: z.ZodEffects<z.ZodString, string, string>;
11
+ endDate: z.ZodEffects<z.ZodString, string, string>;
12
+ pax: z.ZodNumber;
13
+ /** User _id that created the reservation, can be null if created by POS */
14
+ userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
15
+ userName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
16
+ userPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
17
+ userEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
18
+ customerRemarks: z.ZodNullable<z.ZodOptional<z.ZodString>>;
19
+ /** Guest preferences - customer's selections from range preferences */
20
+ guestPreferences: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
21
+ name: z.ZodString;
22
+ value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ name: string;
25
+ value: string | string[];
26
+ }, {
27
+ name: string;
28
+ value: string | string[];
29
+ }>, "many">>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ _id?: string | null | undefined;
32
+ userId?: string | null | undefined;
33
+ userName?: string | null | undefined;
34
+ userPhone?: string | null | undefined;
35
+ userEmail?: string | null | undefined;
36
+ customerRemarks?: string | null | undefined;
37
+ guestPreferences?: {
38
+ name: string;
39
+ value: string | string[];
40
+ }[] | null | undefined;
41
+ restaurantId: string;
42
+ pax: number;
43
+ startDate: string;
44
+ endDate: string;
45
+ capacityTierId: string;
46
+ rangeId: string;
47
+ }, {
48
+ _id?: string | null | undefined;
49
+ userId?: string | null | undefined;
50
+ userName?: string | null | undefined;
51
+ userPhone?: string | null | undefined;
52
+ userEmail?: string | null | undefined;
53
+ customerRemarks?: string | null | undefined;
54
+ guestPreferences?: {
55
+ name: string;
56
+ value: string | string[];
57
+ }[] | null | undefined;
58
+ restaurantId: string;
59
+ pax: number;
60
+ startDate: string;
61
+ endDate: string;
62
+ capacityTierId: string;
63
+ rangeId: string;
64
+ }>;
65
+ export declare const RestaurantReservationPOSDto: z.ZodObject<{
66
+ _id: z.ZodEffects<z.ZodString, string, string>;
67
+ /** Reservation status */
68
+ status: z.ZodEnum<["DRAFT", "CONFIRMED", "CANCELLED", "SEATED", "NO_SHOW"]>;
69
+ /** Restaurant _id */
70
+ restaurant: z.ZodEffects<z.ZodString, string, string>;
71
+ /** The capacity tier ID - the actual inventory unit */
72
+ capacityTierId: z.ZodString;
73
+ /** The range ID - the zone/area (for reference) */
74
+ rangeId: z.ZodString;
75
+ startDate: z.ZodEffects<z.ZodString, string, string>;
76
+ endDate: z.ZodEffects<z.ZodString, string, string>;
77
+ /** Pax */
78
+ pax: z.ZodNumber;
79
+ userName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
80
+ /** User phone and email can be null if created by POS */
81
+ userPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
82
+ userEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
83
+ /** User _id that created the reservation, can be null if created by POS */
84
+ userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
85
+ /** POS assigned slot number */
86
+ slotNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
87
+ /** Customer remarks */
88
+ customerRemarks: z.ZodNullable<z.ZodOptional<z.ZodString>>;
89
+ /** Guest preferences - customer's selections from range preferences */
90
+ guestPreferences: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
91
+ name: z.ZodString;
92
+ value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ name: string;
95
+ value: string | string[];
96
+ }, {
97
+ name: string;
98
+ value: string | string[];
99
+ }>, "many">>>;
100
+ /** Reserved until timestamp */
101
+ reservedUntil: z.ZodEffects<z.ZodString, string, string>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ userId?: string | null | undefined;
104
+ userName?: string | null | undefined;
105
+ userPhone?: string | null | undefined;
106
+ userEmail?: string | null | undefined;
107
+ slotNumber?: string | null | undefined;
108
+ customerRemarks?: string | null | undefined;
109
+ guestPreferences?: {
110
+ name: string;
111
+ value: string | string[];
112
+ }[] | null | undefined;
113
+ status: "CANCELLED" | "DRAFT" | "CONFIRMED" | "SEATED" | "NO_SHOW";
114
+ _id: string;
115
+ restaurant: string;
116
+ pax: number;
117
+ startDate: string;
118
+ endDate: string;
119
+ reservedUntil: string;
120
+ capacityTierId: string;
121
+ rangeId: string;
122
+ }, {
123
+ userId?: string | null | undefined;
124
+ userName?: string | null | undefined;
125
+ userPhone?: string | null | undefined;
126
+ userEmail?: string | null | undefined;
127
+ slotNumber?: string | null | undefined;
128
+ customerRemarks?: string | null | undefined;
129
+ guestPreferences?: {
130
+ name: string;
131
+ value: string | string[];
132
+ }[] | null | undefined;
133
+ status: "CANCELLED" | "DRAFT" | "CONFIRMED" | "SEATED" | "NO_SHOW";
134
+ _id: string;
135
+ restaurant: string;
136
+ pax: number;
137
+ startDate: string;
138
+ endDate: string;
139
+ reservedUntil: string;
140
+ capacityTierId: string;
141
+ rangeId: string;
142
+ }>;
143
+ export type RestaurantReservationDto = z.infer<typeof RestaurantReservationDto>;
144
+ export type RestaurantReservationPOSDto = z.infer<typeof RestaurantReservationPOSDto>;
145
+ /** DTO for updating a reservation from POS */
146
+ export declare const UpdateReservationPOSDto: z.ZodObject<{
147
+ status: z.ZodEnum<["DRAFT", "CONFIRMED", "CANCELLED", "SEATED", "NO_SHOW"]>;
148
+ pax: z.ZodNumber;
149
+ /** Optional: Update the capacity tier ID if changing time slot or pax */
150
+ capacityTierId: z.ZodString;
151
+ /** Optional: Update the range ID if changing time slot */
152
+ rangeId: z.ZodString;
153
+ /** Optional: Update the start time */
154
+ startDate: z.ZodEffects<z.ZodString, string, string>;
155
+ /** Optional: Update the end time */
156
+ endDate: z.ZodEffects<z.ZodString, string, string>;
157
+ /** Optional: Update pax count */
158
+ userName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
159
+ userPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
160
+ userEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
161
+ slotNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
162
+ customerRemarks: z.ZodNullable<z.ZodOptional<z.ZodString>>;
163
+ /** Guest preferences - customer's selections from range preferences */
164
+ guestPreferences: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
165
+ name: z.ZodString;
166
+ value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ name: string;
169
+ value: string | string[];
170
+ }, {
171
+ name: string;
172
+ value: string | string[];
173
+ }>, "many">>>;
174
+ }, "strip", z.ZodTypeAny, {
175
+ userName?: string | null | undefined;
176
+ userPhone?: string | null | undefined;
177
+ userEmail?: string | null | undefined;
178
+ slotNumber?: string | null | undefined;
179
+ customerRemarks?: string | null | undefined;
180
+ guestPreferences?: {
181
+ name: string;
182
+ value: string | string[];
183
+ }[] | null | undefined;
184
+ status: "CANCELLED" | "DRAFT" | "CONFIRMED" | "SEATED" | "NO_SHOW";
185
+ pax: number;
186
+ startDate: string;
187
+ endDate: string;
188
+ capacityTierId: string;
189
+ rangeId: string;
190
+ }, {
191
+ userName?: string | null | undefined;
192
+ userPhone?: string | null | undefined;
193
+ userEmail?: string | null | undefined;
194
+ slotNumber?: string | null | undefined;
195
+ customerRemarks?: string | null | undefined;
196
+ guestPreferences?: {
197
+ name: string;
198
+ value: string | string[];
199
+ }[] | null | undefined;
200
+ status: "CANCELLED" | "DRAFT" | "CONFIRMED" | "SEATED" | "NO_SHOW";
201
+ pax: number;
202
+ startDate: string;
203
+ endDate: string;
204
+ capacityTierId: string;
205
+ rangeId: string;
206
+ }>;
207
+ export type UpdateReservationPOSDto = z.infer<typeof UpdateReservationPOSDto>;
208
+ /** DTO for creating a reservation from POS */
209
+ export declare const CreateReservationPOSDto: z.ZodObject<{
210
+ capacityTierId: z.ZodString;
211
+ rangeId: z.ZodString;
212
+ startDate: z.ZodEffects<z.ZodString, string, string>;
213
+ endDate: z.ZodEffects<z.ZodString, string, string>;
214
+ pax: z.ZodNumber;
215
+ userName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
216
+ userPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
217
+ userEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
218
+ customerRemarks: z.ZodNullable<z.ZodOptional<z.ZodString>>;
219
+ slotNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
220
+ /** Guest preferences - customer's selections from range preferences */
221
+ guestPreferences: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
222
+ name: z.ZodString;
223
+ value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
224
+ }, "strip", z.ZodTypeAny, {
225
+ name: string;
226
+ value: string | string[];
227
+ }, {
228
+ name: string;
229
+ value: string | string[];
230
+ }>, "many">>>;
231
+ }, "strip", z.ZodTypeAny, {
232
+ userName?: string | null | undefined;
233
+ userPhone?: string | null | undefined;
234
+ userEmail?: string | null | undefined;
235
+ slotNumber?: string | null | undefined;
236
+ customerRemarks?: string | null | undefined;
237
+ guestPreferences?: {
238
+ name: string;
239
+ value: string | string[];
240
+ }[] | null | undefined;
241
+ pax: number;
242
+ startDate: string;
243
+ endDate: string;
244
+ capacityTierId: string;
245
+ rangeId: string;
246
+ }, {
247
+ userName?: string | null | undefined;
248
+ userPhone?: string | null | undefined;
249
+ userEmail?: string | null | undefined;
250
+ slotNumber?: string | null | undefined;
251
+ customerRemarks?: string | null | undefined;
252
+ guestPreferences?: {
253
+ name: string;
254
+ value: string | string[];
255
+ }[] | null | undefined;
256
+ pax: number;
257
+ startDate: string;
258
+ endDate: string;
259
+ capacityTierId: string;
260
+ rangeId: string;
261
+ }>;
262
+ export type CreateReservationPOSDto = z.infer<typeof CreateReservationPOSDto>;
263
+ export declare const ReservationAvailabilitySlotDto: z.ZodObject<{
264
+ status: z.ZodEnum<["AVAILABLE", "FULL"]>;
265
+ /** The capacity tier ID - the actual inventory unit to book */
266
+ capacityTierId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
267
+ /** The range ID - the zone/area this slot belongs to */
268
+ rangeId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
269
+ /** The exact ISO start time the frontend should send back to create the booking */
270
+ isoStart: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
271
+ /** The exact ISO end time (Calculated: start + duration) */
272
+ isoEnd: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
273
+ /** Helpful metadata for the UI (e.g., "120 mins") */
274
+ durationMinutes: z.ZodOptional<z.ZodNumber>;
275
+ /** The name of the range (e.g., "VIP Room") - useful for debugging or UI labels */
276
+ label: z.ZodOptional<z.ZodString>;
277
+ }, "strip", z.ZodTypeAny, {
278
+ label?: string | undefined;
279
+ capacityTierId?: string | undefined;
280
+ rangeId?: string | undefined;
281
+ isoStart?: string | undefined;
282
+ isoEnd?: string | undefined;
283
+ durationMinutes?: number | undefined;
284
+ status: "AVAILABLE" | "FULL";
285
+ }, {
286
+ label?: string | undefined;
287
+ capacityTierId?: string | undefined;
288
+ rangeId?: string | undefined;
289
+ isoStart?: string | undefined;
290
+ isoEnd?: string | undefined;
291
+ durationMinutes?: number | undefined;
292
+ status: "AVAILABLE" | "FULL";
293
+ }>;
294
+ export declare const ReservationAvailabilityResponseDto: z.ZodRecord<z.ZodString, z.ZodObject<{
295
+ status: z.ZodEnum<["AVAILABLE", "FULL"]>;
296
+ /** The capacity tier ID - the actual inventory unit to book */
297
+ capacityTierId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
298
+ /** The range ID - the zone/area this slot belongs to */
299
+ rangeId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
300
+ /** The exact ISO start time the frontend should send back to create the booking */
301
+ isoStart: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
302
+ /** The exact ISO end time (Calculated: start + duration) */
303
+ isoEnd: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
304
+ /** Helpful metadata for the UI (e.g., "120 mins") */
305
+ durationMinutes: z.ZodOptional<z.ZodNumber>;
306
+ /** The name of the range (e.g., "VIP Room") - useful for debugging or UI labels */
307
+ label: z.ZodOptional<z.ZodString>;
308
+ }, "strip", z.ZodTypeAny, {
309
+ label?: string | undefined;
310
+ capacityTierId?: string | undefined;
311
+ rangeId?: string | undefined;
312
+ isoStart?: string | undefined;
313
+ isoEnd?: string | undefined;
314
+ durationMinutes?: number | undefined;
315
+ status: "AVAILABLE" | "FULL";
316
+ }, {
317
+ label?: string | undefined;
318
+ capacityTierId?: string | undefined;
319
+ rangeId?: string | undefined;
320
+ isoStart?: string | undefined;
321
+ isoEnd?: string | undefined;
322
+ durationMinutes?: number | undefined;
323
+ status: "AVAILABLE" | "FULL";
324
+ }>>;
325
+ export type ReservationAvailabilityResponseDto = z.infer<typeof ReservationAvailabilityResponseDto>;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ export declare const F_RESERVATION_STATUS: z.ZodEnum<["DRAFT", "CONFIRMED", "CANCELLED", "SEATED", "NO_SHOW"]>;
3
+ export type F_RESERVATION_STATUS = z.infer<typeof F_RESERVATION_STATUS>;
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Duration unit type for lead time and booking duration
3
+ */
4
+ export type DurationUnit = 'minute' | 'hour' | 'day';
5
+ /**
6
+ * Duration object with value and unit
7
+ */
8
+ export interface Duration {
9
+ value: number;
10
+ unit: DurationUnit;
11
+ }
12
+ /**
13
+ * Time range with start and end in HH:mm format
14
+ */
15
+ export interface TimeRange {
16
+ start: string;
17
+ end: string;
18
+ }
19
+ /**
20
+ * Operating hours for a day
21
+ */
22
+ export interface DayOperatingHours {
23
+ enable: boolean;
24
+ hours: TimeRange[];
25
+ }
26
+ /**
27
+ * Time slot with availability status
28
+ */
29
+ export interface TimeSlot {
30
+ time: string;
31
+ available: boolean;
32
+ }
33
+ /**
34
+ * Converts a duration to minutes for comparison
35
+ * @param duration - Duration object with value and unit
36
+ * @returns Total minutes
37
+ */
38
+ export declare function convertDurationToMinutes(duration: Duration): number;
39
+ /**
40
+ * Validates that maxLeadDuration > minLeadDuration
41
+ * @param minLead - Minimum lead time duration
42
+ * @param maxLead - Maximum lead time duration
43
+ * @returns True if valid, false otherwise
44
+ */
45
+ export declare function validateLeadDuration(minLead: Duration, maxLead: Duration): boolean;
46
+ /**
47
+ * Checks if two time ranges overlap
48
+ * @param range1 - First time range
49
+ * @param range2 - Second time range
50
+ * @returns True if ranges overlap, false otherwise
51
+ */
52
+ export declare function validateTimeRangeOverlap(range1: TimeRange, range2: TimeRange): boolean;
53
+ /**
54
+ * Validates that end time is after start time for the same day
55
+ * @param timeRange - Time range to validate
56
+ * @returns True if valid (end > start), false otherwise
57
+ */
58
+ export declare function validateSameDayTimeRange(timeRange: TimeRange): boolean;
59
+ /**
60
+ * Generates time slots for a given time window based on slot interval and booking duration
61
+ *
62
+ * IMPORTANT: This function ensures that bookings fit within operating hours.
63
+ * A slot is only generated if: slotStart + bookingDuration <= windowEnd
64
+ *
65
+ * Example: If window is 17:00-22:00, slotInterval=30min, bookingDuration=90min:
66
+ * - 17:00 ✓ (ends at 18:30)
67
+ * - 17:30 ✓ (ends at 19:00)
68
+ * - ...
69
+ * - 20:30 ✓ (ends at 22:00)
70
+ * - 21:00 ✗ (would end at 22:30, exceeds window)
71
+ *
72
+ * @param windowStart - Start time of the window in HH:mm format
73
+ * @param windowEnd - End time of the window in HH:mm format
74
+ * @param slotInterval - Interval between slots in minutes (e.g., 30)
75
+ * @param bookingDuration - Duration of each booking in minutes (e.g., 60)
76
+ * @returns Array of time slots in HH:mm format
77
+ */
78
+ export declare function generateTimeSlots(windowStart: string, windowEnd: string, slotInterval: number, bookingDuration: number): string[];
79
+ /**
80
+ * Generates all time slots for a day based on operating hours configuration
81
+ * @param operatingHours - Operating hours configuration for the day
82
+ * @param slotInterval - Interval between slots in minutes
83
+ * @param bookingDuration - Duration of each booking in minutes
84
+ * @returns Array of all available time slots in HH:mm format
85
+ */
86
+ export declare function generateDayTimeSlots(operatingHours: DayOperatingHours, slotInterval: number, bookingDuration: number): string[];
87
+ /**
88
+ * Categorizes time slots into morning, afternoon, and evening
89
+ * @param slots - Array of time slots in HH:mm format
90
+ * @returns Object with categorized slots
91
+ */
92
+ export declare function categorizeTimeSlots(slots: string[]): {
93
+ morning: string[];
94
+ afternoon: string[];
95
+ evening: string[];
96
+ };
97
+ /**
98
+ * Categorizes time slots with status into morning, afternoon, and evening
99
+ * @param slots - Array of time slots with availability status
100
+ * @returns Object with categorized slots
101
+ */
102
+ export declare function categorizeTimeSlotsWithStatus(slots: TimeSlot[]): {
103
+ morning: TimeSlot[];
104
+ afternoon: TimeSlot[];
105
+ evening: TimeSlot[];
106
+ };
107
+ /**
108
+ * Checks if a time slot falls within any of the operating hour windows
109
+ * @param slotTime - Time in HH:mm format
110
+ * @param operatingHours - Operating hours configuration
111
+ * @returns True if slot is within operating hours, false otherwise
112
+ */
113
+ export declare function isSlotWithinOperatingHours(slotTime: string, operatingHours: TimeRange[]): boolean;
114
+ /**
115
+ * Generates all time slots for the entire day (00:00 - 23:59) with availability status
116
+ *
117
+ * This function generates slots for the full 24-hour period, marking each slot as:
118
+ * - available: true = within operating hours AND booking fits
119
+ * - available: false = outside operating hours OR booking doesn't fit
120
+ *
121
+ * Example: Operating hours 09:00-12:00, 15:00-21:00, slotInterval=30min, bookingDuration=60min
122
+ * - 08:30 ✗ (unavailable - before operating hours)
123
+ * - 09:00 ✓ (available)
124
+ * - 09:30 ✓ (available)
125
+ * - ...
126
+ * - 11:00 ✓ (available - ends at 12:00)
127
+ * - 11:30 ✗ (unavailable - booking would extend to 12:30, beyond window)
128
+ * - 12:00 ✗ (unavailable - outside operating hours)
129
+ * - ...
130
+ * - 14:30 ✗ (unavailable - outside operating hours)
131
+ * - 15:00 ✓ (available)
132
+ *
133
+ * @param operatingHours - Operating hours configuration for the day
134
+ * @param slotInterval - Interval between slots in minutes
135
+ * @param bookingDuration - Duration of each booking in minutes
136
+ * @param startTime - Start time for slot generation (default: '00:00')
137
+ * @param endTime - End time for slot generation (default: '23:59')
138
+ * @returns Array of all time slots with availability status
139
+ */
140
+ export declare function generateFullDayTimeSlots(operatingHours: DayOperatingHours, slotInterval: number, bookingDuration: number, startTime?: string, endTime?: string): TimeSlot[];
141
+ /**
142
+ * Generates day time slots with availability status (only for operating hours range)
143
+ *
144
+ * This generates slots only within the min/max operating hours range, not full 24h.
145
+ * Useful for compact displays that don't need to show very early/late unavailable slots.
146
+ *
147
+ * @param operatingHours - Operating hours configuration for the day
148
+ * @param slotInterval - Interval between slots in minutes
149
+ * @param bookingDuration - Duration of each booking in minutes
150
+ * @returns Array of time slots with availability status
151
+ */
152
+ export declare function generateDayTimeSlotsWithStatus(operatingHours: DayOperatingHours, slotInterval: number, bookingDuration: number): TimeSlot[];
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .scrollbar-thin[data-v-fc459980]::-webkit-scrollbar{width:6px}.scrollbar-thin[data-v-fc459980]::-webkit-scrollbar-track{background:transparent;border-radius:3px;margin:4px 0}.scrollbar-thin[data-v-fc459980]::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.scrollbar-thin[data-v-fc459980]::-webkit-scrollbar-thumb:hover{background:#9ca3af}.time-picker-field[data-v-fc459980] .fm-text-field-input{border-width:2px;border-radius:.75rem;padding:12px 16px;font-size:1.125rem;transition:all .2s}.time-picker-field[data-v-fc459980] .fm-text-field-input:not(:focus):not(:focus-within){border-color:#d1d5db;background-color:#fff}.time-picker-field[data-v-fc459980] .fm-text-field-input:not(:focus):not(:focus-within):hover{border-color:#9ca3af}.time-picker-field.focused[data-v-fc459980] .fm-text-field-input,.time-picker-field[data-v-fc459980] .fm-text-field-input:focus,.time-picker-field[data-v-fc459980] .fm-text-field-input:focus-within{border-color:#f97316!important;background-color:#fff7ed!important}.fm-text-field-input[data-v-6a4bdab2]{font-size:1.125rem;line-height:1.75rem}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-order-setting",
3
- "version": "0.0.50",
3
+ "version": "0.0.52-dev.0",
4
4
  "type": "module",
5
5
  "module": "./dist/app.js",
6
6
  "license": "UNLICENSED",
@@ -30,7 +30,7 @@
30
30
  "@feedmepos/menu": "^1.7.32",
31
31
  "@feedmepos/mf-common": "1.20.0-beta.2",
32
32
  "@feedmepos/ordering": "^0.0.3",
33
- "@feedmepos/ui-library": "1.5.2-beta.1",
33
+ "@feedmepos/ui-library": "^1.8.8",
34
34
  "@types/googlemaps": "^3.43.3",
35
35
  "axios": "^1.7.2",
36
36
  "change-case": "^5.4.4",
@@ -70,4 +70,4 @@
70
70
  "vite": "^5.1.4",
71
71
  "vue-tsc": "^2.2.0"
72
72
  }
73
- }
73
+ }
@@ -0,0 +1,28 @@
1
+ import { baseClientInstance, getData } from '@/api'
2
+ import { FdoOrderReservationSettingsV2 } from '@entity'
3
+
4
+ // const baseClientInstance = () =>
5
+ // _baseClientInstance(undefined, 'portal', {
6
+ // url: 'http://localhost:3000/portal'
7
+ // })
8
+
9
+ async function getReservationSetting(restaurantId: string): Promise<FdoOrderReservationSettingsV2> {
10
+ const result = await baseClientInstance().get(`/reservation/restaurant/${restaurantId}/setting`)
11
+ return getData<FdoOrderReservationSettingsV2>(result)
12
+ }
13
+
14
+ async function updateReservationSetting(
15
+ restaurantId: string,
16
+ payload: FdoOrderReservationSettingsV2
17
+ ): Promise<FdoOrderReservationSettingsV2> {
18
+ const result = await baseClientInstance().put(
19
+ `/reservation/restaurant/${restaurantId}/setting`,
20
+ payload
21
+ )
22
+ return getData<FdoOrderReservationSettingsV2>(result)
23
+ }
24
+
25
+ export const ReservationApi = {
26
+ getReservationSetting,
27
+ updateReservationSetting
28
+ }
Binary file
@@ -231,6 +231,62 @@
231
231
  "current": "Current",
232
232
  "paxMin": "Pax Min",
233
233
  "paxMax": "Pax Max",
234
+ "reservation": "Reservation",
235
+ "reservationStatus": "Reservation Status",
236
+ "reservationSettings": "Reservation Settings",
237
+ "reservationRanges": "Reservation Ranges",
238
+ "reservationAvailability": "Reservation Availability",
239
+ "addRange": "Add Range",
240
+ "range": "Range",
241
+ "rangeName": "Range Name",
242
+ "priority": "Priority",
243
+ "priorityDescription": "Higher number = higher priority when matching slots",
244
+ "capacity": "Capacity",
245
+ "capacityDescription": "Maximum concurrent reservations for this range",
246
+ "minPax": "Min Pax",
247
+ "maxPax": "Max Pax",
248
+ "slotInterval": "Slot Interval",
249
+ "slotIntervalDescription": "Time between each available booking slot (e.g., 30 mins)",
250
+ "bookingDuration": "Booking Duration",
251
+ "bookingDurationDescription": "Duration of each reservation (e.g., 60 mins)",
252
+ "minLeadDays": "Min Lead Days",
253
+ "minLeadDaysDescription": "Minimum days in advance customers must book (0 = same day)",
254
+ "maxLeadDays": "Max Lead Days",
255
+ "maxLeadDaysDescription": "Maximum days in advance customers can book",
256
+ "operatingWindows": "Operating Windows",
257
+ "addWindow": "Add Window",
258
+ "startTime": "Start Time",
259
+ "endTime": "End Time",
260
+ "customPresetRemarks": "Custom Preset Remarks",
261
+ "addRemark": "Add Remark",
262
+ "noRangesConfigured": "No reservation ranges configured. Click 'Add Range' to get started.",
263
+ "addFirstRange": "Add your first reservation range to get started",
264
+ "globalSettings": "Global Settings",
265
+ "paxRange": "Pax Range",
266
+ "noOperatingHours": "No operating hours",
267
+ "saveAllChanges": "Save All Changes",
268
+ "confirmDeleteRange": "Are you sure you want to delete {name}?",
269
+ "settingUpdated": "Settings updated successfully",
270
+ "newReservationRange": "New Reservation Range",
271
+ "basicInformation": "Basic Information",
272
+ "guestRequirements": "Guest Requirements",
273
+ "bookingConfiguration": "Booking Configuration",
274
+ "rangeNamePlaceholder": "e.g., VIP Room, Main Hall",
275
+ "presetRemarkPlaceholder": "e.g., Window seat, Quiet area",
276
+ "saveRange": "Save Range",
277
+ "draftHoldTimeMinutes": "Draft Hold Time (Minutes)",
278
+ "draftHoldTimeDescription": "How long to hold a draft reservation before it expires",
279
+ "posCanOverbook": "POS Can Overbook",
280
+ "posCanOverbookDescription": "Allow POS to create reservations even when capacity is full",
281
+ "notificationSettings": "Notification Settings",
282
+ "smsEnabled": "Enable SMS Notifications",
283
+ "smsEnabledDescription": "Send SMS notifications to customers for reservation updates",
284
+ "emailEnabled": "Enable Email Notifications",
285
+ "emailEnabledDescription": "Send email notifications to customers for reservation updates",
286
+ "notifyOnConfirm": "Notify on Confirmation",
287
+ "notifyOnConfirmDescription": "Send notifications when a reservation is confirmed",
288
+ "notifyOnCancel": "Notify on Cancellation",
289
+ "notifyOnCancelDescription": "Send notifications when a reservation is cancelled",
234
290
  "qrPay": "QR Pay",
235
291
  "terminalScanPay": "Terminal Scan Pay",
236
292
  "terminalQrPay": "Terminal QR Pay",
@@ -228,6 +228,60 @@
228
228
  "current": "ปัจจุบัน",
229
229
  "paxMin": "จำนวนผู้โดยสารขั้นต่ำ",
230
230
  "paxMax": "จำนวนผู้โดยสารสูงสุด",
231
+ "reservation": "การจอง",
232
+ "reservationSettings": "การตั้งค่าการจอง",
233
+ "reservationRanges": "ช่วงการจอง",
234
+ "addRange": "เพิ่มช่วง",
235
+ "range": "ช่วง",
236
+ "rangeName": "ชื่อช่วง",
237
+ "priority": "ลำดับความสำคัญ",
238
+ "priorityDescription": "ตัวเลขที่สูงกว่า = ลำดับความสำคัญสูงกว่าเมื่อจับคู่ช่วงเวลา",
239
+ "capacity": "ความจุ",
240
+ "capacityDescription": "จำนวนการจองพร้อมกันสูงสุดสำหรับช่วงนี้",
241
+ "minPax": "จำนวนผู้โดยสารขั้นต่ำ",
242
+ "maxPax": "จำนวนผู้โดยสารสูงสุด",
243
+ "slotInterval": "ช่วงเวลา",
244
+ "slotIntervalDescription": "เวลาระหว่างช่วงการจองที่ว่าง (เช่น 30 นาที)",
245
+ "bookingDuration": "ระยะเวลาการจอง",
246
+ "bookingDurationDescription": "ระยะเวลาของการจองแต่ละครั้ง (เช่น 60 นาที)",
247
+ "minLeadDays": "จำนวนวันล่วงหน้าขั้นต่ำ",
248
+ "minLeadDaysDescription": "จำนวนวันขั้นต่ำที่ลูกค้าต้องจองล่วงหน้า (0 = วันเดียวกัน)",
249
+ "maxLeadDays": "จำนวนวันล่วงหน้าสูงสุด",
250
+ "maxLeadDaysDescription": "จำนวนวันสูงสุดที่ลูกค้าสามารถจองล่วงหน้าได้",
251
+ "operatingWindows": "ช่วงเวลาทำการ",
252
+ "addWindow": "เพิ่มช่วงเวลา",
253
+ "startTime": "เวลาเริ่มต้น",
254
+ "endTime": "เวลาสิ้นสุด",
255
+ "customPresetRemarks": "หมายเหตุที่กำหนดไว้ล่วงหน้า",
256
+ "addRemark": "เพิ่มหมายเหตุ",
257
+ "noRangesConfigured": "ยังไม่มีการกำหนดช่วงการจอง คลิก 'เพิ่มช่วง' เพื่อเริ่มต้น",
258
+ "addFirstRange": "เพิ่มช่วงการจองแรกของคุณเพื่อเริ่มต้น",
259
+ "globalSettings": "การตั้งค่าทั่วไป",
260
+ "paxRange": "ช่วงจำนวนผู้โดยสาร",
261
+ "noOperatingHours": "ไม่มีเวลาทำการ",
262
+ "saveAllChanges": "บันทึกการเปลี่ยนแปลงทั้งหมด",
263
+ "confirmDeleteRange": "คุณแน่ใจหรือไม่ว่าต้องการลบ {name}?",
264
+ "settingUpdated": "อัปเดตการตั้งค่าสำเร็จ",
265
+ "newReservationRange": "ช่วงการจองใหม่",
266
+ "basicInformation": "ข้อมูลพื้นฐาน",
267
+ "guestRequirements": "ความต้องการของแขก",
268
+ "bookingConfiguration": "การกำหนดค่าการจอง",
269
+ "rangeNamePlaceholder": "เช่น ห้อง VIP, ห้องโถง",
270
+ "presetRemarkPlaceholder": "เช่น ที่นั่งริมหน้าต่าง, พื้นที่เงียบ",
271
+ "saveRange": "บันทึกช่วง",
272
+ "draftHoldTimeMinutes": "เวลาเก็บร่าง (นาที)",
273
+ "draftHoldTimeDescription": "ระยะเวลาในการเก็บการจองแบบร่างก่อนที่จะหมดอายุ",
274
+ "posCanOverbook": "POS สามารถจองเกินได้",
275
+ "posCanOverbookDescription": "อนุญาตให้ POS สร้างการจองแม้ว่าความจุเต็มแล้ว",
276
+ "notificationSettings": "การตั้งค่าการแจ้งเตือน",
277
+ "smsEnabled": "เปิดใช้งานการแจ้งเตือนผ่าน SMS",
278
+ "smsEnabledDescription": "ส่งการแจ้งเตือนผ่าน SMS ให้กับลูกค้าสำหรับการอัพเดทการจอง",
279
+ "emailEnabled": "เปิดใช้งานการแจ้งเตือนผ่านอีเมล",
280
+ "emailEnabledDescription": "ส่งการแจ้งเตือนผ่านอีเมลให้กับลูกค้าสำหรับการอัพเดทการจอง",
281
+ "notifyOnConfirm": "แจ้งเตือนเมื่อยืนยัน",
282
+ "notifyOnConfirmDescription": "ส่งการแจ้งเตือนเมื่อการจองได้รับการยืนยัน",
283
+ "notifyOnCancel": "แจ้งเตือนเมื่อยกเลิก",
284
+ "notifyOnCancelDescription": "ส่งการแจ้งเตือนเมื่อการจองถูกยกเลิก",
231
285
  "qrPay": "ชำระเงินด้วย QR",
232
286
  "terminalScanPay": "ชำระเงินด้วยการสแกนเทอร์มินัล",
233
287
  "terminalQrPay": "ชำระเงินด้วย QR เทอร์มินัล",