@feedmepos/mf-order-setting 0.0.77 → 0.0.78
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-Dgs5_UoK.js → KioskDevicesView-Db2DyKc2.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-B4DXPgAV.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-Do-EH0Hn.js} +3 -3
- package/dist/{KioskSettingView-BUcPNVTc.js → KioskSettingView-D1JaAjmx.js} +3 -3
- package/dist/KioskView-B0jhv4Zp.js +464 -0
- package/dist/OrderSettingsView-BPNN4jOB.js +35883 -0
- package/dist/{app-BIvt4NBq.js → app-DpdLDlVr.js} +1993 -1954
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-B58_jBg3.js → dayjs.min-Cs3D4xiZ.js} +1 -1
- package/dist/frontend/mf-order/src/app.d.ts +16 -0
- package/dist/frontend/mf-order/src/helpers/map.d.ts +12 -1
- package/dist/frontend/mf-order/src/main.d.ts +16 -0
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +28 -0
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +9 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/delivery.d.ts +5 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +6 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-CLS-FSH-.js → index-BZL2Hpkn.js} +2 -2
- package/dist/{index-CahsmFL1.js → index-DXkcRRAu.js} +1 -1
- package/dist/lineman-settings.dto-CtRqCjzQ.js +74920 -0
- package/dist/package/entity/booking/booking.do.d.ts +125 -0
- package/dist/package/entity/delivery/delivery.dto.d.ts +25 -0
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +87 -0
- package/dist/package/entity/member/member.dto.d.ts +38 -0
- package/dist/package/entity/order/order.do.d.ts +90 -0
- package/dist/package/entity/order/order.dto.d.ts +198 -0
- package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +316 -48
- package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +1131 -209
- package/dist/package/entity/order-platform/external/menu/external-menu.dto.d.ts +3 -3
- package/dist/package/entity/order-platform/external/menu/external-menu.enum.d.ts +10 -1
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +80 -36
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +190 -83
- package/dist/package/entity/order-platform/external/order/external-order.enum.d.ts +2 -2
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +18 -0
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +13 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +25 -0
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +25 -0
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +2 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +25 -0
- package/dist/style.css +1 -1
- package/package.json +7 -9
- package/src/helpers/map.ts +24 -0
- package/src/locales/en-US.json +4 -0
- package/src/locales/ja-JP.json +4 -0
- package/src/locales/th-TH.json +4 -0
- package/src/locales/zh-CN.json +4 -0
- package/src/views/kiosk/KioskView.vue +51 -7
- package/src/views/order-settings/OrderSettingsView.vue +2 -2
- package/src/views/order-settings/delivery/DeliverySetting.vue +18 -1
- package/src/views/order-settings/delivery/delivery.ts +37 -0
- package/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue +24 -8
- package/src/views/order-settings/delivery/inhouse/ZoneDialog.vue +14 -2
- package/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue +136 -27
- package/dist/KioskView-DelVMMj4.js +0 -430
- package/dist/OrderSettingsView-DE2U7vqW.js +0 -60930
- package/dist/lineman-settings.dto-DBDThIb0.js +0 -62793
|
@@ -65,6 +65,13 @@ export declare const FdtoExternalSettingCreateOrUpdate: z.ZodObject<Omit<{
|
|
|
65
65
|
}, {
|
|
66
66
|
catalogId?: string | null | undefined;
|
|
67
67
|
}>>>;
|
|
68
|
+
dineIn: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
69
|
+
catalogId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
catalogId?: string | null | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
catalogId?: string | null | undefined;
|
|
74
|
+
}>>>;
|
|
68
75
|
updatedAt: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
69
76
|
lastSynchronize: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
70
77
|
}, "_id">, "strip", z.ZodTypeAny, {
|
|
@@ -79,6 +86,9 @@ export declare const FdtoExternalSettingCreateOrUpdate: z.ZodObject<Omit<{
|
|
|
79
86
|
systemCode: string;
|
|
80
87
|
} | null | undefined;
|
|
81
88
|
} | null | undefined;
|
|
89
|
+
dineIn?: {
|
|
90
|
+
catalogId?: string | null | undefined;
|
|
91
|
+
} | null | undefined;
|
|
82
92
|
updatedAt?: string | null | undefined;
|
|
83
93
|
lastSynchronize?: string | null | undefined;
|
|
84
94
|
enable: boolean;
|
|
@@ -104,6 +114,9 @@ export declare const FdtoExternalSettingCreateOrUpdate: z.ZodObject<Omit<{
|
|
|
104
114
|
systemCode: string;
|
|
105
115
|
} | null | undefined;
|
|
106
116
|
} | null | undefined;
|
|
117
|
+
dineIn?: {
|
|
118
|
+
catalogId?: string | null | undefined;
|
|
119
|
+
} | null | undefined;
|
|
107
120
|
updatedAt?: string | null | undefined;
|
|
108
121
|
lastSynchronize?: string | null | undefined;
|
|
109
122
|
enable: boolean;
|
|
@@ -1130,6 +1130,13 @@ export declare const FdoFoodpandaOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
1130
1130
|
url: string;
|
|
1131
1131
|
restaurantIds: string[];
|
|
1132
1132
|
}>, "many">>>;
|
|
1133
|
+
menuConfig: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
1134
|
+
mode: z.ZodEnum<["businessLevel", "restaurantLevel"]>;
|
|
1135
|
+
}, "strip", z.ZodTypeAny, {
|
|
1136
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
1137
|
+
}, {
|
|
1138
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
1139
|
+
}>>>;
|
|
1133
1140
|
}, "strip", z.ZodTypeAny, {
|
|
1134
1141
|
internal?: boolean | null | undefined;
|
|
1135
1142
|
url?: string | null | undefined;
|
|
@@ -1200,6 +1207,9 @@ export declare const FdoFoodpandaOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
1200
1207
|
url: string;
|
|
1201
1208
|
restaurantIds: string[];
|
|
1202
1209
|
}[] | null | undefined;
|
|
1210
|
+
menuConfig?: {
|
|
1211
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
1212
|
+
} | null | undefined;
|
|
1203
1213
|
name: string;
|
|
1204
1214
|
_id: string;
|
|
1205
1215
|
ownerId: string;
|
|
@@ -1276,6 +1286,9 @@ export declare const FdoFoodpandaOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
1276
1286
|
url: string;
|
|
1277
1287
|
restaurantIds: string[];
|
|
1278
1288
|
}[] | null | undefined;
|
|
1289
|
+
menuConfig?: {
|
|
1290
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
1291
|
+
} | null | undefined;
|
|
1279
1292
|
name: string;
|
|
1280
1293
|
_id: string;
|
|
1281
1294
|
ownerId: string;
|
|
@@ -2941,6 +2954,9 @@ export declare const FdoFoodpandaOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
2941
2954
|
url: string;
|
|
2942
2955
|
restaurantIds: string[];
|
|
2943
2956
|
}[] | null | undefined;
|
|
2957
|
+
menuConfig?: {
|
|
2958
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2959
|
+
} | null | undefined;
|
|
2944
2960
|
name: string;
|
|
2945
2961
|
_id: string;
|
|
2946
2962
|
ownerId: string;
|
|
@@ -3282,6 +3298,9 @@ export declare const FdoFoodpandaOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
3282
3298
|
url: string;
|
|
3283
3299
|
restaurantIds: string[];
|
|
3284
3300
|
}[] | null | undefined;
|
|
3301
|
+
menuConfig?: {
|
|
3302
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
3303
|
+
} | null | undefined;
|
|
3285
3304
|
name: string;
|
|
3286
3305
|
_id: string;
|
|
3287
3306
|
ownerId: string;
|
|
@@ -3625,6 +3644,9 @@ export declare const FdoFoodpandaOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
3625
3644
|
url: string;
|
|
3626
3645
|
restaurantIds: string[];
|
|
3627
3646
|
}[] | null | undefined;
|
|
3647
|
+
menuConfig?: {
|
|
3648
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
3649
|
+
} | null | undefined;
|
|
3628
3650
|
name: string;
|
|
3629
3651
|
_id: string;
|
|
3630
3652
|
ownerId: string;
|
|
@@ -4125,6 +4147,9 @@ export declare const FdoFoodpandaOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
4125
4147
|
url: string;
|
|
4126
4148
|
restaurantIds: string[];
|
|
4127
4149
|
}[] | null | undefined;
|
|
4150
|
+
menuConfig?: {
|
|
4151
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
4152
|
+
} | null | undefined;
|
|
4128
4153
|
name: string;
|
|
4129
4154
|
_id: string;
|
|
4130
4155
|
ownerId: string;
|
|
@@ -2696,6 +2696,13 @@ export declare const FdoGrabfoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
2696
2696
|
url: string;
|
|
2697
2697
|
restaurantIds: string[];
|
|
2698
2698
|
}>, "many">>>;
|
|
2699
|
+
menuConfig: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
2700
|
+
mode: z.ZodEnum<["businessLevel", "restaurantLevel"]>;
|
|
2701
|
+
}, "strip", z.ZodTypeAny, {
|
|
2702
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2703
|
+
}, {
|
|
2704
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2705
|
+
}>>>;
|
|
2699
2706
|
}, "strip", z.ZodTypeAny, {
|
|
2700
2707
|
internal?: boolean | null | undefined;
|
|
2701
2708
|
url?: string | null | undefined;
|
|
@@ -2766,6 +2773,9 @@ export declare const FdoGrabfoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
2766
2773
|
url: string;
|
|
2767
2774
|
restaurantIds: string[];
|
|
2768
2775
|
}[] | null | undefined;
|
|
2776
|
+
menuConfig?: {
|
|
2777
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2778
|
+
} | null | undefined;
|
|
2769
2779
|
name: string;
|
|
2770
2780
|
_id: string;
|
|
2771
2781
|
ownerId: string;
|
|
@@ -2842,6 +2852,9 @@ export declare const FdoGrabfoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
2842
2852
|
url: string;
|
|
2843
2853
|
restaurantIds: string[];
|
|
2844
2854
|
}[] | null | undefined;
|
|
2855
|
+
menuConfig?: {
|
|
2856
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2857
|
+
} | null | undefined;
|
|
2845
2858
|
name: string;
|
|
2846
2859
|
_id: string;
|
|
2847
2860
|
ownerId: string;
|
|
@@ -4507,6 +4520,9 @@ export declare const FdoGrabfoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
4507
4520
|
url: string;
|
|
4508
4521
|
restaurantIds: string[];
|
|
4509
4522
|
}[] | null | undefined;
|
|
4523
|
+
menuConfig?: {
|
|
4524
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
4525
|
+
} | null | undefined;
|
|
4510
4526
|
name: string;
|
|
4511
4527
|
_id: string;
|
|
4512
4528
|
ownerId: string;
|
|
@@ -4848,6 +4864,9 @@ export declare const FdoGrabfoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
4848
4864
|
url: string;
|
|
4849
4865
|
restaurantIds: string[];
|
|
4850
4866
|
}[] | null | undefined;
|
|
4867
|
+
menuConfig?: {
|
|
4868
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
4869
|
+
} | null | undefined;
|
|
4851
4870
|
name: string;
|
|
4852
4871
|
_id: string;
|
|
4853
4872
|
ownerId: string;
|
|
@@ -5191,6 +5210,9 @@ export declare const FdoGrabfoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
5191
5210
|
url: string;
|
|
5192
5211
|
restaurantIds: string[];
|
|
5193
5212
|
}[] | null | undefined;
|
|
5213
|
+
menuConfig?: {
|
|
5214
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
5215
|
+
} | null | undefined;
|
|
5194
5216
|
name: string;
|
|
5195
5217
|
_id: string;
|
|
5196
5218
|
ownerId: string;
|
|
@@ -5644,6 +5666,9 @@ export declare const FdoGrabfoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
5644
5666
|
url: string;
|
|
5645
5667
|
restaurantIds: string[];
|
|
5646
5668
|
}[] | null | undefined;
|
|
5669
|
+
menuConfig?: {
|
|
5670
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
5671
|
+
} | null | undefined;
|
|
5647
5672
|
name: string;
|
|
5648
5673
|
_id: string;
|
|
5649
5674
|
ownerId: string;
|
|
@@ -295,6 +295,7 @@ export declare const FdtoIntegrationUpdateOrderRequest: z.ZodObject<z.extendShap
|
|
|
295
295
|
level?: number | null | undefined;
|
|
296
296
|
phoneNumber?: string | null | undefined;
|
|
297
297
|
birthday?: string | null | undefined;
|
|
298
|
+
point?: number | null | undefined;
|
|
298
299
|
tier?: {
|
|
299
300
|
imageUrl?: string | null | undefined;
|
|
300
301
|
id: string;
|
|
@@ -1493,6 +1494,7 @@ export declare const FdtoIntegrationUpdateOrderRequest: z.ZodObject<z.extendShap
|
|
|
1493
1494
|
level?: number | null | undefined;
|
|
1494
1495
|
phoneNumber?: string | null | undefined;
|
|
1495
1496
|
birthday?: string | null | undefined;
|
|
1497
|
+
point?: number | null | undefined;
|
|
1496
1498
|
tier?: {
|
|
1497
1499
|
imageUrl?: string | null | undefined;
|
|
1498
1500
|
id: string;
|
|
@@ -2360,6 +2360,13 @@ export declare const FdoShopeeFoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
2360
2360
|
url: string;
|
|
2361
2361
|
restaurantIds: string[];
|
|
2362
2362
|
}>, "many">>>;
|
|
2363
|
+
menuConfig: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
2364
|
+
mode: z.ZodEnum<["businessLevel", "restaurantLevel"]>;
|
|
2365
|
+
}, "strip", z.ZodTypeAny, {
|
|
2366
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2367
|
+
}, {
|
|
2368
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2369
|
+
}>>>;
|
|
2363
2370
|
}, "strip", z.ZodTypeAny, {
|
|
2364
2371
|
internal?: boolean | null | undefined;
|
|
2365
2372
|
url?: string | null | undefined;
|
|
@@ -2430,6 +2437,9 @@ export declare const FdoShopeeFoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
2430
2437
|
url: string;
|
|
2431
2438
|
restaurantIds: string[];
|
|
2432
2439
|
}[] | null | undefined;
|
|
2440
|
+
menuConfig?: {
|
|
2441
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2442
|
+
} | null | undefined;
|
|
2433
2443
|
name: string;
|
|
2434
2444
|
_id: string;
|
|
2435
2445
|
ownerId: string;
|
|
@@ -2506,6 +2516,9 @@ export declare const FdoShopeeFoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
2506
2516
|
url: string;
|
|
2507
2517
|
restaurantIds: string[];
|
|
2508
2518
|
}[] | null | undefined;
|
|
2519
|
+
menuConfig?: {
|
|
2520
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
2521
|
+
} | null | undefined;
|
|
2509
2522
|
name: string;
|
|
2510
2523
|
_id: string;
|
|
2511
2524
|
ownerId: string;
|
|
@@ -4171,6 +4184,9 @@ export declare const FdoShopeeFoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
4171
4184
|
url: string;
|
|
4172
4185
|
restaurantIds: string[];
|
|
4173
4186
|
}[] | null | undefined;
|
|
4187
|
+
menuConfig?: {
|
|
4188
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
4189
|
+
} | null | undefined;
|
|
4174
4190
|
name: string;
|
|
4175
4191
|
_id: string;
|
|
4176
4192
|
ownerId: string;
|
|
@@ -4512,6 +4528,9 @@ export declare const FdoShopeeFoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
4512
4528
|
url: string;
|
|
4513
4529
|
restaurantIds: string[];
|
|
4514
4530
|
}[] | null | undefined;
|
|
4531
|
+
menuConfig?: {
|
|
4532
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
4533
|
+
} | null | undefined;
|
|
4515
4534
|
name: string;
|
|
4516
4535
|
_id: string;
|
|
4517
4536
|
ownerId: string;
|
|
@@ -4855,6 +4874,9 @@ export declare const FdoShopeeFoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
4855
4874
|
url: string;
|
|
4856
4875
|
restaurantIds: string[];
|
|
4857
4876
|
}[] | null | undefined;
|
|
4877
|
+
menuConfig?: {
|
|
4878
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
4879
|
+
} | null | undefined;
|
|
4858
4880
|
name: string;
|
|
4859
4881
|
_id: string;
|
|
4860
4882
|
ownerId: string;
|
|
@@ -5280,6 +5302,9 @@ export declare const FdoShopeeFoodOrderOutput: z.ZodObject<z.extendShape<{
|
|
|
5280
5302
|
url: string;
|
|
5281
5303
|
restaurantIds: string[];
|
|
5282
5304
|
}[] | null | undefined;
|
|
5305
|
+
menuConfig?: {
|
|
5306
|
+
mode: "businessLevel" | "restaurantLevel";
|
|
5307
|
+
} | null | undefined;
|
|
5283
5308
|
name: string;
|
|
5284
5309
|
_id: string;
|
|
5285
5310
|
ownerId: string;
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.integration-details[data-v-b07038c5]{display:flex;flex-direction:column;gap:.625rem;padding:1rem;margin-top:1rem;border:1px solid #e5e7eb;border-radius:.5rem}.integration-details--owned[data-v-b07038c5]{border-color:var(--fm-color-primary-oats);box-shadow:inset .25rem 0 0 var(--fm-color-primary)}.integration-details__header[data-v-b07038c5]{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem}.integration-details__title[data-v-b07038c5]{display:flex;align-items:center;gap:.375rem}.integration-details__store-label[data-v-b07038c5]{padding:.25rem .625rem;color:var(--fm-color-primary);background:var(--fm-color-primary-oats);border-radius:999px}.integration-details__row[data-v-b07038c5]{display:grid;grid-template-columns:10rem minmax(0,1fr);align-items:center;gap:1rem}.integration-details__value[data-v-b07038c5]{display:flex;min-width:0;align-items:center;gap:.5rem}code[data-v-b07038c5]{min-width:0;overflow-wrap:anywhere}@media (max-width: 460px){.integration-details__row[data-v-b07038c5]{grid-template-columns:1fr;gap:.25rem}.integration-details__header[data-v-b07038c5]{align-items:flex-start}}.store-section[data-v-fede2e83]{border-top:1px solid #e5e7eb;padding-top:1.5rem}.store-card[data-v-fede2e83]{padding:1.25rem;margin-bottom:1rem}.store-card__top[data-v-fede2e83]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.store-card__title[data-v-fede2e83]{min-width:0;word-break:break-all}.store-card__actions[data-v-fede2e83]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;flex-shrink:0}.store-card__fields[data-v-fede2e83]{display:flex;flex-direction:column;gap:.625rem}.store-field[data-v-fede2e83]{display:grid;grid-template-columns:9rem minmax(0,1fr);gap:1rem}.store-field>span[data-v-fede2e83]:first-child{color:var(--fm-color-neutral-gray-400)}.store-field>span[data-v-fede2e83]:last-child{word-break:break-word}.store-sheet-body[data-v-fede2e83]{display:flex;flex-direction:column;gap:1rem;padding-top:.5rem}@media (max-width: 460px){.store-field[data-v-fede2e83]{grid-template-columns:1fr}}.store-section[data-v-eb981b1a]{border-top:1px solid #e5e7eb;padding-top:1.5rem}.store-card[data-v-eb981b1a]{padding:1.25rem;margin-bottom:1rem}.store-card__top[data-v-eb981b1a]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}.store-card__title[data-v-eb981b1a]{min-width:0;word-break:break-all}.store-card__actions[data-v-eb981b1a]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;flex-shrink:0}.store-card__fields[data-v-eb981b1a]{display:flex;flex-direction:column;gap:.625rem}.store-field[data-v-eb981b1a]{display:grid;grid-template-columns:9rem minmax(0,1fr);align-items:start;-moz-column-gap:1rem;column-gap:1rem;row-gap:.125rem}.store-field>span[data-v-eb981b1a]:last-child{word-break:break-word}.store-sheet-body[data-v-eb981b1a]{display:flex;flex-direction:column;gap:1rem;padding-top:.5rem}.store-sheet-activate[data-v-eb981b1a]{padding-top:1.25rem;border-top:1px solid #e5e7eb}.store-sheet-activate__hint[data-v-eb981b1a]{margin-top:.5rem}@media (max-width: 460px){.store-field[data-v-eb981b1a]{grid-template-columns:1fr}}.store-section[data-v-748c1a37]{border-top:1px solid #e5e7eb;padding-top:1.5rem}.store-card[data-v-748c1a37]{padding:1.25rem;margin-bottom:1rem}.store-card__top[data-v-748c1a37]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.store-card__title[data-v-748c1a37]{min-width:0;word-break:break-all}.store-card__actions[data-v-748c1a37]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;flex-shrink:0}.store-card__fields[data-v-748c1a37]{display:flex;flex-direction:column;gap:.625rem}.store-field[data-v-748c1a37]{display:grid;grid-template-columns:9rem minmax(0,1fr);gap:1rem}.store-field>span[data-v-748c1a37]:first-child{color:var(--fm-color-neutral-gray-400)}.store-field>span[data-v-748c1a37]:last-child{word-break:break-word}.store-sheet-body[data-v-748c1a37]{display:flex;flex-direction:column;gap:1rem;padding-top:.5rem}@media (max-width: 460px){.store-field[data-v-748c1a37]{grid-template-columns:1fr}}.tng-setting-sheet[data-v-9b3f97fa] .text-fm-color-neutral-gray-400.fm-typo-cn-body-md-400.mb-5.mt-5{margin-top:0;margin-bottom:0}.delivery-company-filter-toolbar[data-v-
|
|
1
|
+
.integration-details[data-v-b07038c5]{display:flex;flex-direction:column;gap:.625rem;padding:1rem;margin-top:1rem;border:1px solid #e5e7eb;border-radius:.5rem}.integration-details--owned[data-v-b07038c5]{border-color:var(--fm-color-primary-oats);box-shadow:inset .25rem 0 0 var(--fm-color-primary)}.integration-details__header[data-v-b07038c5]{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem}.integration-details__title[data-v-b07038c5]{display:flex;align-items:center;gap:.375rem}.integration-details__store-label[data-v-b07038c5]{padding:.25rem .625rem;color:var(--fm-color-primary);background:var(--fm-color-primary-oats);border-radius:999px}.integration-details__row[data-v-b07038c5]{display:grid;grid-template-columns:10rem minmax(0,1fr);align-items:center;gap:1rem}.integration-details__value[data-v-b07038c5]{display:flex;min-width:0;align-items:center;gap:.5rem}code[data-v-b07038c5]{min-width:0;overflow-wrap:anywhere}@media (max-width: 460px){.integration-details__row[data-v-b07038c5]{grid-template-columns:1fr;gap:.25rem}.integration-details__header[data-v-b07038c5]{align-items:flex-start}}.store-section[data-v-fede2e83]{border-top:1px solid #e5e7eb;padding-top:1.5rem}.store-card[data-v-fede2e83]{padding:1.25rem;margin-bottom:1rem}.store-card__top[data-v-fede2e83]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.store-card__title[data-v-fede2e83]{min-width:0;word-break:break-all}.store-card__actions[data-v-fede2e83]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;flex-shrink:0}.store-card__fields[data-v-fede2e83]{display:flex;flex-direction:column;gap:.625rem}.store-field[data-v-fede2e83]{display:grid;grid-template-columns:9rem minmax(0,1fr);gap:1rem}.store-field>span[data-v-fede2e83]:first-child{color:var(--fm-color-neutral-gray-400)}.store-field>span[data-v-fede2e83]:last-child{word-break:break-word}.store-sheet-body[data-v-fede2e83]{display:flex;flex-direction:column;gap:1rem;padding-top:.5rem}@media (max-width: 460px){.store-field[data-v-fede2e83]{grid-template-columns:1fr}}.store-section[data-v-eb981b1a]{border-top:1px solid #e5e7eb;padding-top:1.5rem}.store-card[data-v-eb981b1a]{padding:1.25rem;margin-bottom:1rem}.store-card__top[data-v-eb981b1a]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}.store-card__title[data-v-eb981b1a]{min-width:0;word-break:break-all}.store-card__actions[data-v-eb981b1a]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;flex-shrink:0}.store-card__fields[data-v-eb981b1a]{display:flex;flex-direction:column;gap:.625rem}.store-field[data-v-eb981b1a]{display:grid;grid-template-columns:9rem minmax(0,1fr);align-items:start;-moz-column-gap:1rem;column-gap:1rem;row-gap:.125rem}.store-field>span[data-v-eb981b1a]:last-child{word-break:break-word}.store-sheet-body[data-v-eb981b1a]{display:flex;flex-direction:column;gap:1rem;padding-top:.5rem}.store-sheet-activate[data-v-eb981b1a]{padding-top:1.25rem;border-top:1px solid #e5e7eb}.store-sheet-activate__hint[data-v-eb981b1a]{margin-top:.5rem}@media (max-width: 460px){.store-field[data-v-eb981b1a]{grid-template-columns:1fr}}.store-section[data-v-748c1a37]{border-top:1px solid #e5e7eb;padding-top:1.5rem}.store-card[data-v-748c1a37]{padding:1.25rem;margin-bottom:1rem}.store-card__top[data-v-748c1a37]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.store-card__title[data-v-748c1a37]{min-width:0;word-break:break-all}.store-card__actions[data-v-748c1a37]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;flex-shrink:0}.store-card__fields[data-v-748c1a37]{display:flex;flex-direction:column;gap:.625rem}.store-field[data-v-748c1a37]{display:grid;grid-template-columns:9rem minmax(0,1fr);gap:1rem}.store-field>span[data-v-748c1a37]:first-child{color:var(--fm-color-neutral-gray-400)}.store-field>span[data-v-748c1a37]:last-child{word-break:break-word}.store-sheet-body[data-v-748c1a37]{display:flex;flex-direction:column;gap:1rem;padding-top:.5rem}@media (max-width: 460px){.store-field[data-v-748c1a37]{grid-template-columns:1fr}}.tng-setting-sheet[data-v-9b3f97fa] .text-fm-color-neutral-gray-400.fm-typo-cn-body-md-400.mb-5.mt-5{margin-top:0;margin-bottom:0}.delivery-company-filter-toolbar[data-v-db546c63]{display:flex;flex-direction:row;justify-content:space-between}@media (max-width: 647px){.delivery-company-filter-toolbar[data-v-db546c63]{flex-direction:column;flex-wrap:wrap}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-order-setting",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./dist/app.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@feedmepos/core": "^2.15.
|
|
14
|
-
"@feedmepos/entity": "
|
|
13
|
+
"@feedmepos/core": "^2.15.35",
|
|
14
|
+
"@feedmepos/entity": "0.0.19",
|
|
15
15
|
"@feedmepos/feature-flag": "^0.0.15",
|
|
16
16
|
"@feedmepos/hrm-permission": "^1.0.13",
|
|
17
|
-
"@feedmepos/menu": "^2.0.
|
|
17
|
+
"@feedmepos/menu": "^2.0.4",
|
|
18
18
|
"@feedmepos/mf-common": "^1.28.6",
|
|
19
19
|
"@feedmepos/ordering": "^0.0.3",
|
|
20
|
-
"@feedmepos/ui-library": "1.
|
|
20
|
+
"@feedmepos/ui-library": "1.10.13",
|
|
21
21
|
"@types/googlemaps": "^3.43.3",
|
|
22
22
|
"axios": "^1.7.2",
|
|
23
23
|
"change-case": "^5.4.4",
|
|
@@ -74,10 +74,8 @@
|
|
|
74
74
|
"build-only:prod": "dotenv -e .env.prod -- yarn build:mf && yarn build:dts",
|
|
75
75
|
"build:dev": "cross-env NODE_ENV=dev vite build --mode dev",
|
|
76
76
|
"build:prod": "vite build --mode prod",
|
|
77
|
-
"type-check": "
|
|
78
|
-
"
|
|
79
|
-
"golar:typecheck": "golar typecheck",
|
|
80
|
-
"golar:tsc": "golar tsc --noEmit",
|
|
77
|
+
"type-check": "golar tsc --noEmit -p tsconfig.app.json --composite false",
|
|
78
|
+
"golar:typecheck": "yarn type-check",
|
|
81
79
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
82
80
|
"format": "prettier --write src/"
|
|
83
81
|
}
|
package/src/helpers/map.ts
CHANGED
|
@@ -109,6 +109,29 @@ function getPolygonCenter(polygon: number[][]): MapCoordinate | undefined {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Inverse of `generateAreaPaths` — recovers the "Delivery Zone (km)" of a stored polygon so an
|
|
114
|
+
* existing zone can be reopened with the distance it was created with.
|
|
115
|
+
*
|
|
116
|
+
* `generateAreaPaths` spreads its vertices over `radiusLat = (radius / 6371) * (180 / PI)` and is
|
|
117
|
+
* called with `radius = distanceInKM / 2`, so `distanceInKM` is the polygon's latitude span
|
|
118
|
+
* converted back to km. For a hand-edited (non-circular) polygon there is no single distance —
|
|
119
|
+
* the latitude span is still the closest description of the drawn shape, and the caller must not
|
|
120
|
+
* regenerate the polygon from it. Returns `undefined` when the polygon can't describe a distance.
|
|
121
|
+
*/
|
|
122
|
+
function getPolygonDistanceInKM(polygon: number[][]): number | undefined {
|
|
123
|
+
const lats = polygon
|
|
124
|
+
.map((vertex) => vertex?.[1])
|
|
125
|
+
.filter((lat): lat is number => typeof lat === 'number' && Number.isFinite(lat));
|
|
126
|
+
if (lats.length < 3) return undefined;
|
|
127
|
+
|
|
128
|
+
const distance = (Math.max(...lats) - Math.min(...lats)) * 6371 * (Math.PI / 180);
|
|
129
|
+
if (!Number.isFinite(distance) || distance <= 0) return undefined;
|
|
130
|
+
|
|
131
|
+
// FmStepperField renders at most 2 decimals — round so the field shows what it stores.
|
|
132
|
+
return Math.round(distance * 100) / 100;
|
|
133
|
+
}
|
|
134
|
+
|
|
112
135
|
export {
|
|
113
136
|
googleMap,
|
|
114
137
|
coordinates,
|
|
@@ -119,4 +142,5 @@ export {
|
|
|
119
142
|
pathToPolygon,
|
|
120
143
|
polygonToPath,
|
|
121
144
|
getPolygonCenter,
|
|
145
|
+
getPolygonDistanceInKM,
|
|
122
146
|
};
|
package/src/locales/en-US.json
CHANGED
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"apply": "Apply",
|
|
82
82
|
"applyFor": "Apply for",
|
|
83
83
|
"asap": "ASAP",
|
|
84
|
+
"externalCatalogRequired": "Select a catalog for {orderTypes} on {platform}.",
|
|
84
85
|
"auto": "Auto",
|
|
85
86
|
"autoCalledLimit": "Auto Called Limit",
|
|
86
87
|
"autoCloseBill": "Auto close bill",
|
|
@@ -169,7 +170,9 @@
|
|
|
169
170
|
"deviceType": "Type",
|
|
170
171
|
"dineIn": "Dine In",
|
|
171
172
|
"dineInCanTakeaway": "Allow Takeaway",
|
|
173
|
+
"dineInCatalog": "Dine-in catalog",
|
|
172
174
|
"dineInModeAutoCorrected": "Pick At Counter was enabled automatically because Dine In is active and no mode was selected",
|
|
175
|
+
"dineInNotSupported": "No separate dine-in menu",
|
|
173
176
|
"dineInRemarkEnabled": "Customer order remark",
|
|
174
177
|
"dineInRemarkEnabledRequiresPosVersion": "Requires POS version {version} or above.",
|
|
175
178
|
"dineInRemarkEnabledSublabel": "Allow customers to attach a remark when ordering dine-in.",
|
|
@@ -321,6 +324,7 @@
|
|
|
321
324
|
"noPin": "No PIN",
|
|
322
325
|
"noPresetRemarks": "No preset remarks configured",
|
|
323
326
|
"noPresetRemarksAdded": "No remarks added yet",
|
|
327
|
+
"noRestaurantFound": "No restaurant found",
|
|
324
328
|
"noRestaurantSelected": "No Restaurant Selected",
|
|
325
329
|
"notAllowed": "Not allowed",
|
|
326
330
|
"notSet": "Not set",
|
package/src/locales/ja-JP.json
CHANGED
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"apply": "適用",
|
|
77
77
|
"applyFor": "適用対象",
|
|
78
78
|
"asap": "至急",
|
|
79
|
+
"externalCatalogRequired": "{platform} の{orderTypes}用カタログを選択してください",
|
|
79
80
|
"auto": "自動",
|
|
80
81
|
"autoIntegration": "自動連携",
|
|
81
82
|
"autoResetOrderNumber": "注文番号を自動リセット",
|
|
@@ -242,6 +243,7 @@
|
|
|
242
243
|
"noAvailableItem": "利用可能な商品がありません",
|
|
243
244
|
"noAvailableTable": "利用可能なテーブルがありません",
|
|
244
245
|
"nonNegativeRule": "値は正の数である必要があります",
|
|
246
|
+
"noRestaurantFound": "レストランが見つかりません",
|
|
245
247
|
"noRestaurantSelected": "レストランが選択されていません",
|
|
246
248
|
"notAllowed": "許可されていません",
|
|
247
249
|
"offlinePayment": "オフライン支払い",
|
|
@@ -424,6 +426,8 @@
|
|
|
424
426
|
"manageExternalDelivery": "外部配達を管理",
|
|
425
427
|
"deliveryCatalog": "配達カタログ",
|
|
426
428
|
"pickupCatalog": "テイクアウトカタログ",
|
|
429
|
+
"dineInCatalog": "イートインカタログ",
|
|
430
|
+
"dineInNotSupported": "イートイン専用メニューなし",
|
|
427
431
|
"DeliverySettingUpdated": "配達設定が更新されました。",
|
|
428
432
|
"selectPlatform": "プラットフォームを選択",
|
|
429
433
|
"platform": "プラットフォーム",
|
package/src/locales/th-TH.json
CHANGED
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"apply": "สมัคร",
|
|
77
77
|
"applyFor": "สมัครด่วน",
|
|
78
78
|
"asap": "ทันที",
|
|
79
|
+
"externalCatalogRequired": "เลือกแคตตาล็อกสำหรับ {orderTypes} บน {platform}",
|
|
79
80
|
"auto": "อัตโนมัติ",
|
|
80
81
|
"autoIntegration": "รวมอัตโนมัติ",
|
|
81
82
|
"autoResetOrderNumber": "รีเซ็ตหมายเลขคำสั่งซื้ออัตโนมัติ",
|
|
@@ -247,6 +248,7 @@
|
|
|
247
248
|
"noAvailableItem": "ไม่มีรายการที่ใช้ได้",
|
|
248
249
|
"noAvailableTable": "ไม่มีตารางที่ใช้ได้",
|
|
249
250
|
"nonNegativeRule": "ค่าควรเป็นค่าบวก",
|
|
251
|
+
"noRestaurantFound": "ไม่พบร้านอาหาร",
|
|
250
252
|
"noRestaurantSelected": "ไม่มีร้านอาหารที่เลือก",
|
|
251
253
|
"notAllowed": "ไม่อนุญาต",
|
|
252
254
|
"offlinePayment": "การชำระเงินแบบออฟไลน์",
|
|
@@ -426,6 +428,8 @@
|
|
|
426
428
|
"manageExternalDelivery": "จัดการช่องทาง External",
|
|
427
429
|
"deliveryCatalog": "แคตตาล็อกการจัดส่ง",
|
|
428
430
|
"pickupCatalog": "แคตตาล็อกการรับสินค้า",
|
|
431
|
+
"dineInCatalog": "แคตตาล็อกทานที่ร้าน",
|
|
432
|
+
"dineInNotSupported": "ไม่มีเมนูทานที่ร้านแยก",
|
|
429
433
|
"DeliverySettingUpdated": "อัปเดตการตั้งค่าการจัดส่งแล้ว",
|
|
430
434
|
"selectPlatform": "เลือกแพลตฟอร์ม",
|
|
431
435
|
"platform": "แพลตฟอร์ม",
|
package/src/locales/zh-CN.json
CHANGED
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"apply": "应用",
|
|
77
77
|
"applyFor": "应用于",
|
|
78
78
|
"asap": "尽快配送",
|
|
79
|
+
"externalCatalogRequired": "请为 {platform} 的{orderTypes}选择目录",
|
|
79
80
|
"auto": "自动",
|
|
80
81
|
"autoIntegration": "自动对接",
|
|
81
82
|
"autoResetOrderNumber": "自动重置订单号",
|
|
@@ -249,6 +250,7 @@
|
|
|
249
250
|
"noAvailableItem": "无可用商品",
|
|
250
251
|
"noAvailableTable": "无可用餐桌",
|
|
251
252
|
"nonNegativeRule": "该值必须为正数",
|
|
253
|
+
"noRestaurantFound": "未找到餐厅",
|
|
252
254
|
"noRestaurantSelected": "未选择餐厅",
|
|
253
255
|
"notAllowed": "没有权限",
|
|
254
256
|
"offlinePayment": "线下支付",
|
|
@@ -431,6 +433,8 @@
|
|
|
431
433
|
"manageExternalDelivery": "管理外部配送",
|
|
432
434
|
"deliveryCatalog": "配送目录",
|
|
433
435
|
"pickupCatalog": "自取目录",
|
|
436
|
+
"dineInCatalog": "堂食目录",
|
|
437
|
+
"dineInNotSupported": "无独立堂食菜单",
|
|
434
438
|
"DeliverySettingUpdated": "配送设置已更新",
|
|
435
439
|
"selectPlatform": "选择平台",
|
|
436
440
|
"platform": "平台",
|
|
@@ -5,16 +5,28 @@
|
|
|
5
5
|
<FmTabs v-model:model-value="selectedMenuItem" :items="menuItems"></FmTabs>
|
|
6
6
|
<div class="pt-[1.5rem]">
|
|
7
7
|
<div class="flex flex-col gap-10">
|
|
8
|
-
<div class="flex flex-col gap-2">
|
|
8
|
+
<div class="flex flex-col gap-2" ref="restaurantPicker">
|
|
9
9
|
<span class="fm-typo-en-title-sm-600"> {{ t('order.activateLocation') }} </span>
|
|
10
10
|
<span class="fm-typo-en-title-sm-400"> {{ t('order.selectRestaurant') }}: </span>
|
|
11
11
|
<FmSelect
|
|
12
12
|
class="w-1/2"
|
|
13
13
|
v-model="currentSelect"
|
|
14
14
|
:items="restaurantItems"
|
|
15
|
-
:placeholder="t('order.
|
|
15
|
+
:placeholder="t('order.searchRestaurant')"
|
|
16
|
+
searchable
|
|
17
|
+
:search-debounce="150"
|
|
18
|
+
:on-search="searchRestaurant"
|
|
16
19
|
@update:model-value="selectRestaurant"
|
|
17
|
-
|
|
20
|
+
@dropdown-changed="onDropdownChanged"
|
|
21
|
+
>
|
|
22
|
+
<template #append-menu>
|
|
23
|
+
<FmMenuItem
|
|
24
|
+
v-if="!restaurantItems.length"
|
|
25
|
+
disabled
|
|
26
|
+
:label="t('order.noRestaurantFound')"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
29
|
+
</FmSelect>
|
|
18
30
|
</div>
|
|
19
31
|
<KioskDevicesView
|
|
20
32
|
v-if="selectedMenuItem == 'device'"
|
|
@@ -77,13 +89,45 @@ const currentSelect = ref<string | undefined>(currentRestaurant.value?._id ?? un
|
|
|
77
89
|
/** Drives the denied/error panel inside the device tab. 'forbidden' === HTTP 403. */
|
|
78
90
|
const devicesLoadError = ref<'forbidden' | 'error' | null>(null)
|
|
79
91
|
|
|
92
|
+
/** Typed query, kept here because FmSelect's own filter matches a single field only. */
|
|
93
|
+
const restaurantSearch = ref('')
|
|
94
|
+
const restaurantPicker = ref<HTMLElement | null>(null)
|
|
95
|
+
|
|
80
96
|
const restaurantItems = computed<ISelectItem[]>(() => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
97
|
+
const search = restaurantSearch.value.trim().toLowerCase()
|
|
98
|
+
return restaurants.value
|
|
99
|
+
.filter(
|
|
100
|
+
(r) =>
|
|
101
|
+
!search ||
|
|
102
|
+
r.profile.name.toLowerCase().includes(search) ||
|
|
103
|
+
r._id.toLowerCase().includes(search)
|
|
104
|
+
)
|
|
105
|
+
.map((r) => ({
|
|
106
|
+
label: r.profile.name,
|
|
107
|
+
value: r._id
|
|
108
|
+
}))
|
|
85
109
|
})
|
|
86
110
|
|
|
111
|
+
// FmSelect's built-in `searchable` filter only looks at one field (searchTarget is
|
|
112
|
+
// either the label or the value). Outlets are picked by name AND by id — support
|
|
113
|
+
// pasting an _id — so take over the filtering via onSearch and narrow `items` here.
|
|
114
|
+
async function searchRestaurant(search: string) {
|
|
115
|
+
restaurantSearch.value = search
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function onDropdownChanged(open: boolean) {
|
|
119
|
+
if (!open) {
|
|
120
|
+
// Drop the query on close, otherwise reopening still shows the previous
|
|
121
|
+
// search's (possibly empty) result instead of every restaurant.
|
|
122
|
+
restaurantSearch.value = ''
|
|
123
|
+
return
|
|
124
|
+
}
|
|
125
|
+
// FmSelect seeds its search box with the selected restaurant's name and gives us no
|
|
126
|
+
// way to reset it, so a keystroke would append to that name and match nothing.
|
|
127
|
+
// Highlight the text instead — the first keystroke then replaces it.
|
|
128
|
+
restaurantPicker.value?.querySelector('input')?.select()
|
|
129
|
+
}
|
|
130
|
+
|
|
87
131
|
const currentRestaurantId = ref<string>(currentRestaurant.value?._id ?? '')
|
|
88
132
|
|
|
89
133
|
async function selectRestaurant(v: string) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="py-[1.5rem]">
|
|
3
|
-
<FmPageHead :title="t('order.orderSetting')" />
|
|
3
|
+
<FmPageHead :title="t('order.orderSetting')" :line-height="1.7" />
|
|
4
4
|
<div class="flex px-[1.5rem] items-center">
|
|
5
5
|
<div class="flex-[2_2_0%] overflow-auto">
|
|
6
6
|
<FmTabs v-model:model-value="selectedOrderSetting" :items="settingItem" :showMoreAt="99" />
|
|
@@ -114,7 +114,7 @@ watch(
|
|
|
114
114
|
if (newRestaurant?._id) {
|
|
115
115
|
await menuStore.loadCatalogOptions(newRestaurant._id)
|
|
116
116
|
}
|
|
117
|
-
}
|
|
117
|
+
}
|
|
118
118
|
)
|
|
119
119
|
|
|
120
120
|
watch(
|
|
@@ -212,7 +212,12 @@ import { FdoGoFoodSettings, FdoGrabfoodSettings, FdoShopeeFoodSettings } from '@
|
|
|
212
212
|
import type { OrderInhouseDeliverySettingsDto, OrderSettingsDto } from '@entity'
|
|
213
213
|
import { OrderSettingApi } from '@/api/order-setting'
|
|
214
214
|
import deliveryData from './delivery.data'
|
|
215
|
-
import {
|
|
215
|
+
import {
|
|
216
|
+
getInvalidExternalMenuCatalogOrderTypes,
|
|
217
|
+
useDelivery,
|
|
218
|
+
type DeliveryCompany,
|
|
219
|
+
type LinkedDeliveryDoc
|
|
220
|
+
} from './delivery'
|
|
216
221
|
import { useLoading } from '@/composables/loading'
|
|
217
222
|
import { remoteOrderApi } from '@/api/remoteOrder'
|
|
218
223
|
import { AUTO_INTEGRATION_CLIENT } from '../delivery/delivery'
|
|
@@ -1126,6 +1131,18 @@ async function updateInHouseSetting() {
|
|
|
1126
1131
|
}
|
|
1127
1132
|
|
|
1128
1133
|
async function updateExternalDeliverySetting() {
|
|
1134
|
+
const setting = externalDoc.value
|
|
1135
|
+
const invalidCatalogOrderTypes = getInvalidExternalMenuCatalogOrderTypes(setting)
|
|
1136
|
+
if (invalidCatalogOrderTypes.length > 0) {
|
|
1137
|
+
showError(
|
|
1138
|
+
t('order.externalCatalogRequired', {
|
|
1139
|
+
orderTypes: invalidCatalogOrderTypes.map((orderType) => t(`order.${orderType}`)).join(', '),
|
|
1140
|
+
platform: setting.platform === 'HAKSHAN' ? 'HakShan' : setting.platform
|
|
1141
|
+
})
|
|
1142
|
+
)
|
|
1143
|
+
return
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1129
1146
|
sideSheetIntegrated.value = false
|
|
1130
1147
|
await startAsyncCallWithErr(async () => {
|
|
1131
1148
|
await restaurantStore.updateExternalDelivery(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { F_PAYMENT_NAME, FdoLinkedDelivery, F_COUNTRY } from '@feedmepos/core/entity'
|
|
2
2
|
import { useCoreStore } from '@feedmepos/mf-common'
|
|
3
|
+
import { F_ORDER_PLATFORM, type FdoExternalSetting } from '@entity'
|
|
3
4
|
|
|
4
5
|
export type LinkedDeliveryDoc = FdoLinkedDelivery & { _rev: string }
|
|
5
6
|
|
|
@@ -22,6 +23,42 @@ export interface DeliveryCompany {
|
|
|
22
23
|
key: string
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
export type ExternalMenuOrderType = 'delivery' | 'pickup' | 'dineIn'
|
|
27
|
+
export type ExternalMenuOrderTypeWithRequiredCatalog = Extract<
|
|
28
|
+
ExternalMenuOrderType,
|
|
29
|
+
'delivery' | 'pickup'
|
|
30
|
+
>
|
|
31
|
+
|
|
32
|
+
export function externalMenuOrderTypeRequiresCatalog(
|
|
33
|
+
platform: FdoExternalSetting['platform'],
|
|
34
|
+
orderType: ExternalMenuOrderType
|
|
35
|
+
): orderType is ExternalMenuOrderTypeWithRequiredCatalog {
|
|
36
|
+
return (
|
|
37
|
+
(platform === F_ORDER_PLATFORM.enum.ZUS || platform === F_ORDER_PLATFORM.enum.HAKSHAN) &&
|
|
38
|
+
(orderType === 'delivery' || orderType === 'pickup')
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function getInvalidExternalMenuCatalogOrderTypes(
|
|
43
|
+
setting: Pick<FdoExternalSetting, 'platform' | 'delivery' | 'pickup'>
|
|
44
|
+
): ExternalMenuOrderTypeWithRequiredCatalog[] {
|
|
45
|
+
const orderTypes: ExternalMenuOrderTypeWithRequiredCatalog[] = ['delivery', 'pickup']
|
|
46
|
+
|
|
47
|
+
return orderTypes.filter((orderType) => {
|
|
48
|
+
const orderTypeSetting = setting[orderType]
|
|
49
|
+
if (
|
|
50
|
+
orderTypeSetting == null ||
|
|
51
|
+
!externalMenuOrderTypeRequiresCatalog(setting.platform, orderType)
|
|
52
|
+
) {
|
|
53
|
+
return false
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
typeof orderTypeSetting.catalogId !== 'string' || orderTypeSetting.catalogId.trim() === ''
|
|
58
|
+
)
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
25
62
|
function formatDeliveryCompanyKey(key: string) {
|
|
26
63
|
return key.toLowerCase().replace('_', '').toLowerCase()
|
|
27
64
|
}
|