@feedmepos/mf-order-setting 0.0.73-dev → 0.0.74-dev

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 (42) hide show
  1. package/dist/{KioskDevicesView-Dztw-Q35.js → KioskDevicesView-CW7nDXi2.js} +1 -1
  2. package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-CPDkls2i.js +762 -0
  3. package/dist/{KioskSettingView-BUHmoxyO.js → KioskSettingView-DErXeFIt.js} +3 -3
  4. package/dist/KioskView-d1YjttbD.js +362 -0
  5. package/dist/{OrderSettingsView-C5PK8CKZ.js → OrderSettingsView-asfw4cYT.js} +13 -10
  6. package/dist/app-DrWO2wkv.js +20750 -0
  7. package/dist/app.js +3 -3
  8. package/dist/{dayjs.min-B3nOmXcs.js → dayjs.min-Fu6ejRAr.js} +1 -1
  9. package/dist/frontend/mf-order/src/api/index.d.ts +3 -1
  10. package/dist/frontend/mf-order/src/app.d.ts +160 -152
  11. package/dist/frontend/mf-order/src/composables/useKioskPermission.d.ts +11 -0
  12. package/dist/frontend/mf-order/src/composables/useOrderSettingPermission.d.ts +13 -0
  13. package/dist/frontend/mf-order/src/main.d.ts +160 -152
  14. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +3 -3
  15. package/dist/frontend/mf-order/src/views/kiosk/KioskStatePanel.vue.d.ts +19 -0
  16. package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +7 -1
  17. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  18. package/dist/{index-B4XxBqiV.js → index-DEKeP24S.js} +7 -7
  19. package/dist/{index-6PQJ07gD.js → index-DJLCZHNZ.js} +2 -2
  20. package/dist/{lineman-settings.dto-DcYJFu0U.js → lineman-settings.dto-DS4tgxBJ.js} +18974 -18109
  21. package/dist/package/entity/delivery/gateway/pandago.dto.d.ts +6 -6
  22. package/dist/package/entity/order-setting/order-setting.do.d.ts +4 -4
  23. package/dist/package/entity/order-setting/order-setting.dto.d.ts +8 -8
  24. package/dist/package/entity/order-setting/sms/sms.do.d.ts +2 -2
  25. package/dist/package/entity/order-setting/sms/sms.dto.d.ts +2 -2
  26. package/package.json +3 -2
  27. package/src/api/index.ts +5 -2
  28. package/src/composables/useKioskPermission.ts +41 -0
  29. package/src/composables/useOrderSettingPermission.ts +34 -0
  30. package/src/locales/en-US.json +429 -421
  31. package/src/main.ts +9 -6
  32. package/src/router/routes.ts +34 -5
  33. package/src/views/kiosk/KioskStatePanel.vue +31 -0
  34. package/src/views/kiosk/KioskView.vue +100 -62
  35. package/src/views/kiosk/devices/KioskDeviceCard.vue +4 -0
  36. package/src/views/kiosk/devices/KioskDevicesView.vue +42 -9
  37. package/src/views/order-settings/OrderSettingsView.vue +8 -5
  38. package/src/views/order-settings/delivery/delivery.ts +1 -1
  39. package/vite.config.ts +5 -2
  40. package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-Ol419NZh.js +0 -707
  41. package/dist/KioskView-B8j77zMA.js +0 -343
  42. package/dist/app-C2_s0fkK.js +0 -18792
@@ -717,7 +717,6 @@ declare const PandaGoCreateOrUpdateOutlet: z.ZodObject<{
717
717
  rider_instructions?: string | null | undefined;
718
718
  halal?: boolean | null | undefined;
719
719
  name: string;
720
- locale: string;
721
720
  address: string;
722
721
  description: string;
723
722
  latitude: number;
@@ -725,6 +724,7 @@ declare const PandaGoCreateOrUpdateOutlet: z.ZodObject<{
725
724
  currency: "MYR";
726
725
  phone_number: string;
727
726
  city: string;
727
+ locale: string;
728
728
  }, {
729
729
  street?: string | null | undefined;
730
730
  street_number?: string | null | undefined;
@@ -734,7 +734,6 @@ declare const PandaGoCreateOrUpdateOutlet: z.ZodObject<{
734
734
  rider_instructions?: string | null | undefined;
735
735
  halal?: boolean | null | undefined;
736
736
  name: string;
737
- locale: string;
738
737
  address: string;
739
738
  description: string;
740
739
  latitude: number;
@@ -742,6 +741,7 @@ declare const PandaGoCreateOrUpdateOutlet: z.ZodObject<{
742
741
  currency: "MYR";
743
742
  phone_number: string;
744
743
  city: string;
744
+ locale: string;
745
745
  }>;
746
746
  declare const PandaGoGetOutletRes: z.ZodObject<{
747
747
  client_vendor_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -771,7 +771,6 @@ declare const PandaGoGetOutletRes: z.ZodObject<{
771
771
  rider_instructions?: string | null | undefined;
772
772
  halal?: boolean | null | undefined;
773
773
  name: string;
774
- locale: "en-MY";
775
774
  address: string;
776
775
  description: string;
777
776
  latitude: number;
@@ -779,6 +778,7 @@ declare const PandaGoGetOutletRes: z.ZodObject<{
779
778
  currency: "MYR";
780
779
  phone_number: string;
781
780
  city: string;
781
+ locale: "en-MY";
782
782
  }, {
783
783
  client_vendor_id?: string | null | undefined;
784
784
  street?: string | null | undefined;
@@ -789,7 +789,6 @@ declare const PandaGoGetOutletRes: z.ZodObject<{
789
789
  rider_instructions?: string | null | undefined;
790
790
  halal?: boolean | null | undefined;
791
791
  name: string;
792
- locale: "en-MY";
793
792
  address: string;
794
793
  description: string;
795
794
  latitude: number;
@@ -797,6 +796,7 @@ declare const PandaGoGetOutletRes: z.ZodObject<{
797
796
  currency: "MYR";
798
797
  phone_number: string;
799
798
  city: string;
799
+ locale: "en-MY";
800
800
  }>;
801
801
  declare const PandaGoCreateOutletRes: z.ZodObject<{
802
802
  name: z.ZodString;
@@ -824,7 +824,6 @@ declare const PandaGoCreateOutletRes: z.ZodObject<{
824
824
  rider_instructions?: string | null | undefined;
825
825
  halal?: boolean | null | undefined;
826
826
  name: string;
827
- locale: "en-MY";
828
827
  address: string;
829
828
  description: string;
830
829
  latitude: number;
@@ -832,6 +831,7 @@ declare const PandaGoCreateOutletRes: z.ZodObject<{
832
831
  currency: "MYR";
833
832
  phone_number: string;
834
833
  city: string;
834
+ locale: "en-MY";
835
835
  }, {
836
836
  street?: string | null | undefined;
837
837
  street_number?: string | null | undefined;
@@ -841,7 +841,6 @@ declare const PandaGoCreateOutletRes: z.ZodObject<{
841
841
  rider_instructions?: string | null | undefined;
842
842
  halal?: boolean | null | undefined;
843
843
  name: string;
844
- locale: "en-MY";
845
844
  address: string;
846
845
  description: string;
847
846
  latitude: number;
@@ -849,6 +848,7 @@ declare const PandaGoCreateOutletRes: z.ZodObject<{
849
848
  currency: "MYR";
850
849
  phone_number: string;
851
850
  city: string;
851
+ locale: "en-MY";
852
852
  }>;
853
853
  export declare const PandaGoWebhook: z.ZodObject<{
854
854
  order_id: z.ZodString;
@@ -989,19 +989,19 @@ export declare const FdoOrderSettings: z.ZodObject<{
989
989
  raw: string;
990
990
  }>;
991
991
  }, "strip", z.ZodTypeAny, {
992
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
992
993
  message: {
993
994
  keys: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number">;
994
995
  raw: string;
995
996
  };
996
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
997
997
  enable: boolean;
998
998
  action: "ACCEPT" | "SERVE";
999
999
  }, {
1000
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1000
1001
  message: {
1001
1002
  keys?: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number"> | undefined;
1002
1003
  raw: string;
1003
1004
  };
1004
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1005
1005
  enable: boolean;
1006
1006
  action: "ACCEPT" | "SERVE";
1007
1007
  }>, "many">>>;
@@ -1325,11 +1325,11 @@ export declare const FdoOrderSettings: z.ZodObject<{
1325
1325
  } | undefined;
1326
1326
  } | null | undefined;
1327
1327
  smsSettings?: {
1328
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1328
1329
  message: {
1329
1330
  keys: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number">;
1330
1331
  raw: string;
1331
1332
  };
1332
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1333
1333
  enable: boolean;
1334
1334
  action: "ACCEPT" | "SERVE";
1335
1335
  }[] | null | undefined;
@@ -1536,11 +1536,11 @@ export declare const FdoOrderSettings: z.ZodObject<{
1536
1536
  } | undefined;
1537
1537
  } | null | undefined;
1538
1538
  smsSettings?: {
1539
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1539
1540
  message: {
1540
1541
  keys?: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number"> | undefined;
1541
1542
  raw: string;
1542
1543
  };
1543
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1544
1544
  enable: boolean;
1545
1545
  action: "ACCEPT" | "SERVE";
1546
1546
  }[] | null | undefined;
@@ -954,19 +954,19 @@ export declare const OrderSettingsDto: z.ZodObject<{
954
954
  raw: string;
955
955
  }>;
956
956
  }, "strip", z.ZodTypeAny, {
957
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
957
958
  message: {
958
959
  keys: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number">;
959
960
  raw: string;
960
961
  };
961
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
962
962
  enable: boolean;
963
963
  action: "ACCEPT" | "SERVE";
964
964
  }, {
965
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
965
966
  message: {
966
967
  keys?: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number"> | undefined;
967
968
  raw: string;
968
969
  };
969
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
970
970
  enable: boolean;
971
971
  action: "ACCEPT" | "SERVE";
972
972
  }>, "many">>>;
@@ -1285,11 +1285,11 @@ export declare const OrderSettingsDto: z.ZodObject<{
1285
1285
  } | undefined;
1286
1286
  } | null | undefined;
1287
1287
  smsSettings?: {
1288
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1288
1289
  message: {
1289
1290
  keys: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number">;
1290
1291
  raw: string;
1291
1292
  };
1292
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1293
1293
  enable: boolean;
1294
1294
  action: "ACCEPT" | "SERVE";
1295
1295
  }[] | null | undefined;
@@ -1502,11 +1502,11 @@ export declare const OrderSettingsDto: z.ZodObject<{
1502
1502
  } | undefined;
1503
1503
  } | null | undefined;
1504
1504
  smsSettings?: {
1505
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1505
1506
  message: {
1506
1507
  keys?: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number"> | undefined;
1507
1508
  raw: string;
1508
1509
  };
1509
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
1510
1510
  enable: boolean;
1511
1511
  action: "ACCEPT" | "SERVE";
1512
1512
  }[] | null | undefined;
@@ -2470,19 +2470,19 @@ export declare const OrderSettingUpdateDto: z.ZodObject<Omit<{
2470
2470
  raw: string;
2471
2471
  }>;
2472
2472
  }, "strip", z.ZodTypeAny, {
2473
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
2473
2474
  message: {
2474
2475
  keys: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number">;
2475
2476
  raw: string;
2476
2477
  };
2477
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
2478
2478
  enable: boolean;
2479
2479
  action: "ACCEPT" | "SERVE";
2480
2480
  }, {
2481
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
2481
2482
  message: {
2482
2483
  keys?: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number"> | undefined;
2483
2484
  raw: string;
2484
2485
  };
2485
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
2486
2486
  enable: boolean;
2487
2487
  action: "ACCEPT" | "SERVE";
2488
2488
  }>, "many">>>;
@@ -2801,11 +2801,11 @@ export declare const OrderSettingUpdateDto: z.ZodObject<Omit<{
2801
2801
  } | undefined;
2802
2802
  } | null | undefined;
2803
2803
  smsSettings?: {
2804
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
2804
2805
  message: {
2805
2806
  keys: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number">;
2806
2807
  raw: string;
2807
2808
  };
2808
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
2809
2809
  enable: boolean;
2810
2810
  action: "ACCEPT" | "SERVE";
2811
2811
  }[] | null | undefined;
@@ -3017,11 +3017,11 @@ export declare const OrderSettingUpdateDto: z.ZodObject<Omit<{
3017
3017
  } | undefined;
3018
3018
  } | null | undefined;
3019
3019
  smsSettings?: {
3020
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
3020
3021
  message: {
3021
3022
  keys?: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number"> | undefined;
3022
3023
  raw: string;
3023
3024
  };
3024
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
3025
3025
  enable: boolean;
3026
3026
  action: "ACCEPT" | "SERVE";
3027
3027
  }[] | null | undefined;
@@ -14,19 +14,19 @@ export declare const FdoOrderSmsSettings: z.ZodObject<{
14
14
  raw: string;
15
15
  }>;
16
16
  }, "strip", z.ZodTypeAny, {
17
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
17
18
  message: {
18
19
  keys: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number">;
19
20
  raw: string;
20
21
  };
21
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
22
22
  enable: boolean;
23
23
  action: "ACCEPT" | "SERVE";
24
24
  }, {
25
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
25
26
  message: {
26
27
  keys?: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number"> | undefined;
27
28
  raw: string;
28
29
  };
29
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
30
30
  enable: boolean;
31
31
  action: "ACCEPT" | "SERVE";
32
32
  }>;
@@ -24,19 +24,19 @@ export declare const OrderSmsSettingDto: z.ZodObject<{
24
24
  raw: string;
25
25
  }>;
26
26
  }, "strip", z.ZodTypeAny, {
27
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
27
28
  message: {
28
29
  keys: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number">;
29
30
  raw: string;
30
31
  };
31
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
32
32
  enable: boolean;
33
33
  action: "ACCEPT" | "SERVE";
34
34
  }, {
35
+ type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
35
36
  message: {
36
37
  keys?: Record<string, "Bill Receipt Number" | "Bill Receipt Total Amount (Net)" | "Order Type" | "Order Slot" | "Order Datetime" | "Order Delivery Type" | "Restaurant Name" | "Restaurant Email" | "Restaurant Address" | "Restaurant Contact Number"> | undefined;
37
38
  raw: string;
38
39
  };
39
- type: "QUEUE" | "RESERVATION" | "QR" | "TAKEAWAY" | "KIOSK" | "COUNTER" | "DINE_IN" | "PICKUP" | "DELIVERY";
40
40
  enable: boolean;
41
41
  action: "ACCEPT" | "SERVE";
42
42
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-order-setting",
3
- "version": "0.0.73-dev",
3
+ "version": "0.0.74-dev",
4
4
  "type": "module",
5
5
  "module": "./dist/app.js",
6
6
  "license": "UNLICENSED",
@@ -13,8 +13,9 @@
13
13
  "@feedmepos/core": "^2.15.31",
14
14
  "@feedmepos/entity": "^0.0.11",
15
15
  "@feedmepos/feature-flag": "^0.0.15",
16
+ "@feedmepos/hrm-permission": "^1.0.13",
16
17
  "@feedmepos/menu": "^2.0.3",
17
- "@feedmepos/mf-common": "1.20.0-beta.2",
18
+ "@feedmepos/mf-common": "^1.28.6",
18
19
  "@feedmepos/ordering": "^0.0.3",
19
20
  "@feedmepos/ui-library": "1.5.2-beta.1",
20
21
  "@types/googlemaps": "^3.43.3",
package/src/api/index.ts CHANGED
@@ -92,10 +92,13 @@ class ApiError extends Error {
92
92
  }
93
93
 
94
94
  export class SvcCompanyApiError extends ApiError {
95
- constructor(message: string) {
95
+ /** HTTP status from the failed response, when available (e.g. 403 for permission denied). */
96
+ readonly status?: number
97
+ constructor(message: string, status?: number) {
96
98
  super(message)
97
99
  this.name = 'SvcCompanyApiError'
98
100
  this.message = message
101
+ this.status = status
99
102
  }
100
103
  }
101
104
 
@@ -131,7 +134,7 @@ export const baseClientInstance = (
131
134
  if (error instanceof AxiosError) {
132
135
  const data = error.response?.data
133
136
  const errMsg = data?.message || data?.error || `${error.message}` || `${error}`
134
- return Promise.reject(new SvcCompanyApiError(errMsg))
137
+ return Promise.reject(new SvcCompanyApiError(errMsg, error.response?.status))
135
138
  }
136
139
  return Promise.reject(error)
137
140
  }
@@ -0,0 +1,41 @@
1
+ import { computed } from 'vue'
2
+ import { useCoreStore } from '@feedmepos/mf-common'
3
+ import { Permission, checkAccess, type CaslPermission } from '@feedmepos/hrm-permission'
4
+
5
+ type PermissionRules = Parameters<typeof checkAccess>[1]
6
+
7
+ export type KioskPermissionKey = 'deviceManagement' | 'deviceBinding'
8
+
9
+ const kioskSubjects = {
10
+ deviceManagement: Permission.Subject.Business.kiosk_deviceManagement,
11
+ deviceBinding: Permission.Subject.Business.kiosk_deviceBinding
12
+ } as const
13
+
14
+ /** Build a CaslPermission for a kiosk subject key (centralizes the subject mapping). */
15
+ export const kioskPermission = (
16
+ action: (typeof Permission.Action)[keyof typeof Permission.Action],
17
+ key: KioskPermissionKey
18
+ ): CaslPermission => ({
19
+ action,
20
+ subject: kioskSubjects[key]
21
+ })
22
+
23
+ /** True if the current user satisfies ANY of the given kiosk permissions (OR). */
24
+ export function checkKioskAccess(permissions: CaslPermission[]) {
25
+ const Core = useCoreStore()
26
+ const rules = (Core.sessionUser.value?.permissions ?? []) as PermissionRules
27
+
28
+ return permissions.some((permission) => checkAccess([permission], rules).granted)
29
+ }
30
+
31
+ /** Reactive in-component flags for gating kiosk controls. */
32
+ export function useKioskPermission() {
33
+ const canManageDevices = computed(() =>
34
+ checkKioskAccess([kioskPermission(Permission.Action.manage, 'deviceManagement')])
35
+ )
36
+ const canBindDevice = computed(() =>
37
+ checkKioskAccess([kioskPermission(Permission.Action.manage, 'deviceBinding')])
38
+ )
39
+
40
+ return { canManageDevices, canBindDevice }
41
+ }
@@ -0,0 +1,34 @@
1
+ import { computed } from 'vue'
2
+ import { useCoreStore } from '@feedmepos/mf-common'
3
+ import { Permission, checkAccess, type CaslPermission } from '@feedmepos/hrm-permission'
4
+
5
+ type PermissionRules = Parameters<typeof checkAccess>[1]
6
+
7
+ /**
8
+ * Build the CaslPermission for managing order settings. A single subject
9
+ * (business::operation::orderSetting) covers both the Operations "Order
10
+ * Settings" view and the Kiosk "Settings" tab.
11
+ */
12
+ export const orderSettingPermission = (
13
+ action: (typeof Permission.Action)[keyof typeof Permission.Action]
14
+ ): CaslPermission => ({
15
+ action,
16
+ subject: Permission.Subject.Business.operation_orderSetting
17
+ })
18
+
19
+ /** True if the current user satisfies ANY of the given order-setting permissions (OR). */
20
+ export function checkOrderSettingAccess(permissions: CaslPermission[]) {
21
+ const Core = useCoreStore()
22
+ const rules = (Core.sessionUser.value?.permissions ?? []) as PermissionRules
23
+
24
+ return permissions.some((permission) => checkAccess([permission], rules).granted)
25
+ }
26
+
27
+ /** Reactive in-component flag for gating order-setting surfaces. */
28
+ export function useOrderSettingPermission() {
29
+ const canManageOrderSetting = computed(() =>
30
+ checkOrderSettingAccess([orderSettingPermission(Permission.Action.manage)])
31
+ )
32
+
33
+ return { canManageOrderSetting }
34
+ }