@feedmepos/mf-menu 0.32.76 → 0.32.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.
Files changed (82) hide show
  1. package/dist/{App-D2pK798q.js → App-DPCHWImL.js} +8 -8
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CHoFzx9k.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C4iacJky.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-DKmzpuS7.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-BWoRN4s5.js} +3 -3
  4. package/dist/{Catalog-Da2qmeW2.js → Catalog-CBYCvZ4i.js} +6 -6
  5. package/dist/{Category-BXYjH0dH.js → Category-CbNtnuBB.js} +4 -4
  6. package/dist/{Category-QRUzSOLZ.js → Category-Dpc6jnS1.js} +14 -14
  7. package/dist/{CookingGuide-CPI7qV9Z.js → CookingGuide-B848njOa.js} +5 -5
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-D-lfN4Xw.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CkNSC4k9.js} +1 -1
  9. package/dist/{Group-C4_-7vPz.js → Group-WQdbziVl.js} +1 -1
  10. package/dist/{Group-C3bKVuCF.js → Group-yhtx74q4.js} +8 -8
  11. package/dist/Group.vue_vue_type_script_setup_true_lang-Q0Z5rAEg.js +627 -0
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DmZV1yCe.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-R2zzBkf0.js} +5 -5
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CmbxGud_.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-_R7RQdJk.js} +2672 -2665
  14. package/dist/{Ingredient-q8zKgNTY.js → Ingredient-C5i01EIS.js} +4 -4
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CKaRVmyj.js → InventoryBinding.vue_vue_type_script_setup_true_lang-OpRB3dyV.js} +2 -2
  16. package/dist/{LinkProductSideSheet-h94g93ZW.js → LinkProductSideSheet-Dt78f3fG.js} +4 -4
  17. package/dist/{MenuSetting-Juhf48gV.js → MenuSetting-LhwHiH3C.js} +7 -7
  18. package/dist/{OrderPacing-_4_iXa6e.js → OrderPacing-DXj4J7Sp.js} +5 -5
  19. package/dist/{PrintRoute-BujMv7Zl.js → PrintRoute-DZQYeMsQ.js} +5 -5
  20. package/dist/{Product-DnByb90X.js → Product--7aX0fcK.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-BDL64d7Q.js → Product.vue_vue_type_script_setup_true_lang-BSsS2dqJ.js} +14 -14
  22. package/dist/{ProductInternalTools-LMHxDc6R.js → ProductInternalTools-C4_r1tAz.js} +7 -7
  23. package/dist/{Products-qkRrsj1W.js → Products-CmtzWP4r.js} +40 -40
  24. package/dist/{Publish-aa8PbFqn.js → Publish-Bquodjpf.js} +4 -4
  25. package/dist/{Recipe-C5mMNuY_.js → Recipe-DanBt83W.js} +5 -5
  26. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DfcX0gDQ.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-Ck5gHsEQ.js} +1 -1
  27. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DJBV2o8C.js → RuleView.vue_vue_type_script_setup_true_lang-xuzVQmfE.js} +791 -791
  28. package/dist/{Scheduler-Bp05_Qv6.js → Scheduler-CNQbEpCH.js} +3 -3
  29. package/dist/{ServingSequence-Cs-ST8Oc.js → ServingSequence-BpLukp5s.js} +3 -3
  30. package/dist/{Setting-BnIq46pa.js → Setting-CqtVbgEX.js} +5 -5
  31. package/dist/{Subcategory-BAgZ5vsm.js → Subcategory-D05nSckm.js} +6 -6
  32. package/dist/{Takeaway-DUd0KVAX.js → Takeaway-BojkiMWZ.js} +1 -1
  33. package/dist/{Takeaway-BIMtyXGB.js → Takeaway-o938dKSs.js} +4 -4
  34. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-Ch-0hq7k.js → Takeaway.vue_vue_type_script_setup_true_lang-CyItVmUO.js} +5 -5
  35. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-BfqnNbPl.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-BrLUgeet.js} +1 -1
  36. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-CbYBwX8e.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-BlgJ9HSX.js} +2 -2
  37. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dl7sYg0Q.js +5971 -0
  38. package/dist/{Unit-CLG2PrgL.js → Unit-BO34czMi.js} +2 -2
  39. package/dist/{Variant-Cy0JvleU.js → Variant-9hYjzP27.js} +3 -3
  40. package/dist/{_id_-jplkA1eL.js → _id_-C9EPUJMN.js} +10 -10
  41. package/dist/{app-J9vFNODI.js → app-BJeTqtv9.js} +331 -331
  42. package/dist/{app-30Z6mZbq.js → app-Br1rwkSn.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/apps/mf-menu/src/app.d.ts +50 -0
  45. package/dist/apps/mf-menu/src/components/feature/GroupManager/BaseForm.vue.d.ts +5 -0
  46. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/BaseForm.vue.d.ts +5 -0
  47. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/index.d.ts +9 -0
  48. package/dist/apps/mf-menu/src/composable/groupHidden.d.ts +26 -0
  49. package/dist/apps/mf-menu/src/helper/itemCategories.d.ts +47 -13
  50. package/dist/apps/mf-menu/src/manager/menu/group.d.ts +12 -3
  51. package/dist/apps/mf-menu/src/manager/menu/groupExtraction.d.ts +17 -1
  52. package/dist/apps/mf-menu/src/manager/menu/groupImmutableFields.d.ts +2 -0
  53. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/assets/{linked-status-BffktJ2X.js → linked-status-DeOWgUtC.js} +4 -4
  55. package/dist/assets/{menu-export-cv_rQBxw.js → menu-export-C4lP1SAy.js} +3 -3
  56. package/dist/assets/{override-menu-BxfuFlXS.js → override-menu-D_fBjnbT.js} +4 -4
  57. package/dist/assets/{validate-menu-CBVSVrx9.js → validate-menu-Cyw7mq4e.js} +3 -3
  58. package/dist/catalog-xBfYjm-n.js +235 -0
  59. package/dist/{catalogSetting-DR6N1dMx.js → catalogSetting-CuHh62ii.js} +1 -1
  60. package/dist/{currency-TzQJueZa.js → currency-CSYrHGCM.js} +1 -1
  61. package/dist/{dayjs.min-CqRhbatW.js → dayjs.min-DMxeixDE.js} +2 -2
  62. package/dist/{discardConfirm-JZF5xM6V.js → discardConfirm-DEE_kXqK.js} +1 -1
  63. package/dist/{index-BlsVC9Ep.js → index-CFAe9jDS.js} +71 -57
  64. package/dist/{index-CUViEtmn.js → index-CgR6vyM1.js} +5 -5
  65. package/dist/{index-DAkwVhKq.js → index-nDpqIsxv.js} +6 -6
  66. package/dist/{index.vue_vue_type_script_setup_true_lang-CEZndQrA.js → index.vue_vue_type_script_setup_true_lang-CDnlHcKS.js} +7 -7
  67. package/dist/{item-CqPMNjVQ.js → item-Cg4hkIm0.js} +4670 -4549
  68. package/dist/{jszip.min-BAB8KFbL.js → jszip.min-BGGp26Zm.js} +167 -167
  69. package/dist/{linkProducts-CMKCTrne.js → linkProducts-rOzmlZmQ.js} +4 -4
  70. package/dist/{memberPricing-Bv62STuu.js → memberPricing-BVC55wej.js} +1 -1
  71. package/dist/{menu-wjZ0VHbh.js → menu-sD696lXn.js} +1 -1
  72. package/dist/{menuV2-CwtrrHxb.js → menuV2-Cf41MUAw.js} +28 -28
  73. package/dist/{order_pacing-3Un89bxb.js → order_pacing-D-VDq_AN.js} +5 -5
  74. package/dist/{priceTier-CRHLKied.js → priceTier-Dajfy9ll.js} +1 -1
  75. package/dist/{rules-B_ftcBV6.js → rules-BTp32qER.js} +3 -3
  76. package/dist/{scheduler-DYeWfbj0.js → scheduler-Ct06dHRB.js} +5 -5
  77. package/dist/{toExcel-JddNv1bE.js → toExcel-BOsLuO7C.js} +2 -2
  78. package/dist/{unit-Y0iUG9B2.js → unit-D-Sppjh0.js} +3 -3
  79. package/package.json +2 -2
  80. package/dist/Group.vue_vue_type_script_setup_true_lang-CltccIA5.js +0 -622
  81. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DzeQ5yJ6.js +0 -5865
  82. package/dist/catalog-Q6KsvtTp.js +0 -199
@@ -1,5 +1,5 @@
1
1
  import { defineStore as r } from "pinia";
2
- import { K as a, L as s, M as l } from "./index.vue_vue_type_script_setup_true_lang-CEZndQrA.js";
2
+ import { K as a, L as s, M as l } from "./index.vue_vue_type_script_setup_true_lang-CDnlHcKS.js";
3
3
  const u = {
4
4
  async read() {
5
5
  return a(await s().get("/public-setting"));
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { F as e, i as r, j as o, o as t, r as i, u as p } from "./app-J9vFNODI.js";
1
+ import { F as e, i as r, j as o, o as t, r as i, u as p } from "./app-BJeTqtv9.js";
2
2
  export {
3
3
  e as FmApp,
4
4
  r as i18nMessages,
@@ -82,6 +82,13 @@ export declare const i18nMessages: {
82
82
  products_count: string;
83
83
  search: string;
84
84
  status: string;
85
+ hide_group: string;
86
+ hide_group_sublabel_variant: string;
87
+ hide_group_sublabel_product: string;
88
+ hide_group_sublabel_catalog: string;
89
+ hide_group_notice: string;
90
+ min_locked_while_hidden: string;
91
+ hide_group_notice_reset: string;
85
92
  };
86
93
  translation: {
87
94
  title_suffix: string;
@@ -442,6 +449,9 @@ export declare const i18nMessages: {
442
449
  code: string;
443
450
  is_default: string;
444
451
  should_link_at_least_one_variant: string;
452
+ show_in_variants: string;
453
+ hidden_in_variants: string;
454
+ shown_in_all_variants: string;
445
455
  };
446
456
  types: {
447
457
  normal: string;
@@ -2149,6 +2159,13 @@ export declare const i18nMessages: {
2149
2159
  products_count: string;
2150
2160
  search: string;
2151
2161
  status: string;
2162
+ hide_group: string;
2163
+ hide_group_sublabel_variant: string;
2164
+ hide_group_sublabel_product: string;
2165
+ hide_group_sublabel_catalog: string;
2166
+ hide_group_notice: string;
2167
+ min_locked_while_hidden: string;
2168
+ hide_group_notice_reset: string;
2152
2169
  };
2153
2170
  translation: {
2154
2171
  title_suffix: string;
@@ -2509,6 +2526,9 @@ export declare const i18nMessages: {
2509
2526
  code: string;
2510
2527
  is_default: string;
2511
2528
  should_link_at_least_one_variant: string;
2529
+ show_in_variants: string;
2530
+ hidden_in_variants: string;
2531
+ shown_in_all_variants: string;
2512
2532
  };
2513
2533
  types: {
2514
2534
  normal: string;
@@ -4214,6 +4234,13 @@ export declare const i18nMessages: {
4214
4234
  products_count: string;
4215
4235
  search: string;
4216
4236
  status: string;
4237
+ hide_group: string;
4238
+ hide_group_sublabel_variant: string;
4239
+ hide_group_sublabel_product: string;
4240
+ hide_group_sublabel_catalog: string;
4241
+ hide_group_notice: string;
4242
+ min_locked_while_hidden: string;
4243
+ hide_group_notice_reset: string;
4217
4244
  };
4218
4245
  translation: {
4219
4246
  title_suffix: string;
@@ -4574,6 +4601,9 @@ export declare const i18nMessages: {
4574
4601
  code: string;
4575
4602
  is_default: string;
4576
4603
  should_link_at_least_one_variant: string;
4604
+ show_in_variants: string;
4605
+ hidden_in_variants: string;
4606
+ shown_in_all_variants: string;
4577
4607
  };
4578
4608
  types: {
4579
4609
  normal: string;
@@ -6280,6 +6310,13 @@ export declare const i18nMessages: {
6280
6310
  products_count: string;
6281
6311
  search: string;
6282
6312
  status: string;
6313
+ hide_group: string;
6314
+ hide_group_sublabel_variant: string;
6315
+ hide_group_sublabel_product: string;
6316
+ hide_group_sublabel_catalog: string;
6317
+ hide_group_notice: string;
6318
+ min_locked_while_hidden: string;
6319
+ hide_group_notice_reset: string;
6283
6320
  };
6284
6321
  translation: {
6285
6322
  title_suffix: string;
@@ -6640,6 +6677,9 @@ export declare const i18nMessages: {
6640
6677
  code: string;
6641
6678
  is_default: string;
6642
6679
  should_link_at_least_one_variant: string;
6680
+ show_in_variants: string;
6681
+ hidden_in_variants: string;
6682
+ shown_in_all_variants: string;
6643
6683
  };
6644
6684
  types: {
6645
6685
  normal: string;
@@ -8345,6 +8385,13 @@ export declare const i18nMessages: {
8345
8385
  products_count: string;
8346
8386
  search: string;
8347
8387
  status: string;
8388
+ hide_group: string;
8389
+ hide_group_sublabel_variant: string;
8390
+ hide_group_sublabel_product: string;
8391
+ hide_group_sublabel_catalog: string;
8392
+ hide_group_notice: string;
8393
+ min_locked_while_hidden: string;
8394
+ hide_group_notice_reset: string;
8348
8395
  };
8349
8396
  translation: {
8350
8397
  title_suffix: string;
@@ -8705,6 +8752,9 @@ export declare const i18nMessages: {
8705
8752
  code: string;
8706
8753
  is_default: string;
8707
8754
  should_link_at_least_one_variant: string;
8755
+ show_in_variants: string;
8756
+ hidden_in_variants: string;
8757
+ shown_in_all_variants: string;
8708
8758
  };
8709
8759
  types: {
8710
8760
  normal: string;
@@ -7,6 +7,11 @@ interface Props {
7
7
  config: (group: MenuGroup) => GroupConfig;
8
8
  categorizedItems: CategorizedItem[];
9
9
  allowRefundInventory?: boolean;
10
+ /**
11
+ * Label of the scope the "hide this group" toggle applies to, e.g. the selected variant. Left
12
+ * unset when the form edits a single scope that needs no naming (a product, a catalog).
13
+ */
14
+ hideGroupScope?: string | null;
10
15
  }
11
16
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
12
17
  trigger: (event?: any) => void;
@@ -7,6 +7,11 @@ interface Props {
7
7
  config: (group: MenuGroup) => GroupConfig;
8
8
  categorizedItems: CategorizedItem[];
9
9
  allowRefundInventory?: boolean;
10
+ /**
11
+ * Label of the scope the "hide this group" toggle applies to, e.g. the selected variant. Left
12
+ * unset when the form edits a single scope that needs no naming (a product, a catalog).
13
+ */
14
+ hideGroupScope?: string | null;
10
15
  }
11
16
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
12
17
  trigger: (event?: any) => void;
@@ -23,6 +23,9 @@ export declare const GroupManagerForm: {
23
23
  allowRefundInventory: {
24
24
  type: import("vue").PropType<boolean>;
25
25
  };
26
+ hideGroupScope: {
27
+ type: import("vue").PropType<string | null>;
28
+ };
26
29
  }>> & Readonly<{
27
30
  "onUpdate:group"?: ((group: import("../../../../../manager/menu/group").MenuGroup) => any) | undefined;
28
31
  "onSubmit:group"?: ((group: import("../../../../../manager/menu/group").MenuGroup) => any) | undefined;
@@ -65,6 +68,9 @@ export declare const GroupManagerForm: {
65
68
  allowRefundInventory: {
66
69
  type: import("vue").PropType<boolean>;
67
70
  };
71
+ hideGroupScope: {
72
+ type: import("vue").PropType<string | null>;
73
+ };
68
74
  }>> & Readonly<{
69
75
  "onUpdate:group"?: ((group: import("../../../../../manager/menu/group").MenuGroup) => any) | undefined;
70
76
  "onSubmit:group"?: ((group: import("../../../../../manager/menu/group").MenuGroup) => any) | undefined;
@@ -100,6 +106,9 @@ export declare const GroupManagerForm: {
100
106
  allowRefundInventory: {
101
107
  type: import("vue").PropType<boolean>;
102
108
  };
109
+ hideGroupScope: {
110
+ type: import("vue").PropType<string | null>;
111
+ };
103
112
  }>> & Readonly<{
104
113
  "onUpdate:group"?: ((group: import("../../../../../manager/menu/group").MenuGroup) => any) | undefined;
105
114
  "onSubmit:group"?: ((group: import("../../../../../manager/menu/group").MenuGroup) => any) | undefined;
@@ -0,0 +1,26 @@
1
+ import { type FdoGroupOverriderV4, type FdoMenuV4Group } from "@feedmepos/entity";
2
+ import type { MenuGroup } from "@/manager/menu/group";
3
+ /**
4
+ * A group is "hidden" when it cannot contribute a single selectable option: min is overridden to
5
+ * 0 and every product under it (base rows and variant rows alike) is set to NONE. POS, QR and
6
+ * Kiosk drop a group with no available products, so this combination is what actually hides it.
7
+ *
8
+ * There is no `hidden` field on the overrider — this is derived, so a merchant who configures the
9
+ * same combination by hand still sees the toggle switched on.
10
+ */
11
+ export declare function isGroupHidden(group: MenuGroup | null | undefined): boolean;
12
+ /**
13
+ * Same question as {@link isGroupHidden}, answered straight from an overrider and its base group.
14
+ * Building the merged view deep-clones the whole menu, which is far too heavy to do once per
15
+ * variant, so callers that only need the answer for several scopes at once use this instead.
16
+ */
17
+ export declare function isGroupHiddenInOverride(override: FdoGroupOverriderV4 | null | undefined, baseGroup: FdoMenuV4Group | null | undefined): boolean;
18
+ /** Overrides min to 0 and every product under the group to NONE. */
19
+ export declare function hideGroup(group: MenuGroup): MenuGroup;
20
+ /**
21
+ * Clears what {@link hideGroup} wrote: min goes back to the base group's value and every product
22
+ * falls back to inheriting its availability. Any per-product availability the merchant had set
23
+ * before hiding is not restored — the option table is locked while the group is hidden, so there
24
+ * is nothing to preserve from that period.
25
+ */
26
+ export declare function showGroup(group: MenuGroup, baseMin: number): MenuGroup;
@@ -20,23 +20,57 @@ export declare function getItemCategoryNames(categories: CategorizedItem[], item
20
20
  */
21
21
  export declare function getItemPositionFnByCurrentCategory(currentCategoryId: string | null): (item: FdoMenuV4Item) => number | null;
22
22
  /**
23
- * Position for a newly created item: strictly below every existing one, so the item sorts
24
- * to the TOP of whichever category it lands in.
23
+ * Position for a newly created item: its slot within the category it lands in, one past the
24
+ * highest already taken there, so items keep the order they were keyed in.
25
25
  *
26
- * Landing it last is unreachable. Every sort in the stack — `sortPosition` here, Dart
27
- * `sortByPositionCodeName` inside `overrideMenu`, and its Go port — appends the items whose
28
- * position is null AFTER all positioned ones, so no number can outrank a null, and most
29
- * items in a real menu carry no position at all. Sorting first IS reachable, so that is the
30
- * guarantee we make instead.
26
+ * The incremental counterpart of `withSheetOrderPosition`, which applies the same rule to a whole
27
+ * imported sheet. Both mean "the item's slot in this category", and a drag normalising a category
28
+ * to 1..n means the same thing, so all three paths write the same kind of number.
31
29
  *
32
- * Distinct descending values rather than a shared constant: the Dart sort behind the POS is
33
- * not stable, so items sharing a position have no defined order there.
30
+ * `max + 1`, not `items.length + 1`. Length breaks as soon as anything is deleted — positions
31
+ * 1,2,3 minus the middle one leaves 1,3 with a length of 2, and the next item would be handed 3
32
+ * and tie with the survivor. Tied positions have no defined order (the Dart sort behind the POS
33
+ * is not stable), so the new item could appear either side of it. Taking the max cannot collide.
34
34
  *
35
- * Negative values are safe end to end — `position` is an `optional double` in the entity
36
- * proto, the zod schema has no lower bound, and every sort compares it as a signed number.
37
- * A drag re-normalizes the affected category to 1..n, so the negatives are transient.
35
+ * Scoped to one category, because an item holds a separate position per category it belongs to —
36
+ * `item.position` for its main one, an `additionalCategories` entry for each of the rest. A max
37
+ * taken across the whole menu would still sort correctly but would drift away from the 1..n a
38
+ * drag writes.
39
+ *
40
+ * A null position means "never placed", so it does not contribute to the max. Those items sort
41
+ * AFTER every positioned one — `sortPosition` here, Dart `sortByPositionCodeName` inside
42
+ * `overrideMenu`, and its Go port all agree — so no number can rank a new item below them. New
43
+ * items therefore group above the never-placed ones, in the order they were entered. Landing
44
+ * them at the true end of a legacy category would mean renumbering it first; that is what a drag
45
+ * is for, and doing it on every add was rejected on ITS-000651 because a single addition to a
46
+ * long menu would then vanish off the bottom of the screen.
47
+ */
48
+ export declare function getNewItemPosition(items: FdoMenuV4Item[], categoryId: string | null): number;
49
+ /**
50
+ * Positions for an imported row: one slot in every category the item belongs to.
51
+ *
52
+ * The batch counterpart of `getNewItemPosition` — same rule, applied to a whole sheet at once
53
+ * instead of one item at a time, so the two agree on what a position means and manual additions
54
+ * carry straight on from where an import left off.
55
+ *
56
+ * Import is a full replace of the item module, not a merge: `MenuImport.deleteItem` drops every
57
+ * existing item whose `_id` is absent from the sheet. So the sheet row order is the intended
58
+ * order for rows that update an existing item just as much as for rows that create one, and a
59
+ * dense 1..n per category is safe — there is no unlisted item left behind to collide with.
60
+ *
61
+ * Every membership draws its own number, main and secondary alike. Stamping the main category's
62
+ * number onto each `additionalCategories` entry would tie with whichever item actually holds that
63
+ * number in the secondary category, and tied positions have no defined order (the Dart sort
64
+ * behind the POS is not stable). The sheet carries no column saying where an item should sit in a
65
+ * secondary category, so those memberships fall in the row order of the items that hold them.
66
+ *
67
+ * `takeNextPosition` hands out the next free slot in a category and is expected to have side
68
+ * effects — it is called once per membership, and the call order fixes the numbering.
69
+ *
70
+ * A useful side effect of all this: after any import every item in the sheet carries a position,
71
+ * so `getNewItemPosition` has a real max to build on rather than a category full of nulls.
38
72
  */
39
- export declare function getNewItemPosition(items: FdoMenuV4Item[]): number;
73
+ export declare function withSheetOrderPositions<T extends Pick<FdoMenuV4Item, "category" | "position" | "additionalCategories">>(item: T, takeNextPosition: (categoryId: string | null) => number): T;
40
74
  export declare function getUpdatedItemsWithNewPositions(items: FdoMenuV4Item[], currentCategoryId: string | null): ({
41
75
  position: number;
42
76
  _id: string;
@@ -3,8 +3,8 @@ import { F_ADDON_GROUP_TYPE, F_ORDER_FROM } from "@feedmepos/entity";
3
3
  import { type FdoGroupOverriderV4, type FdoItemOverriderV4, FdoMenuV4Group, type FdoMenuV4Item } from "@feedmepos/entity";
4
4
  import { type DialogProvider } from "@feedmepos/ui-library";
5
5
  import { useMenuLoader } from "@/helper/menu";
6
- export { extractGroup } from "@/manager/menu/groupExtraction";
7
- export { mapGroupConfigToImmutableItemsFields } from "@/manager/menu/groupImmutableFields";
6
+ export { dropRedundantMinMax, extractGroup } from "@/manager/menu/groupExtraction";
7
+ export { mapGroupConfigToImmutableFields, mapGroupConfigToImmutableItemsFields } from "@/manager/menu/groupImmutableFields";
8
8
  export interface GroupConfig {
9
9
  type: boolean;
10
10
  price: boolean;
@@ -18,6 +18,16 @@ export interface GroupConfig {
18
18
  name: (combinationKey?: string | null | undefined) => boolean;
19
19
  isDefault: (combinationKey?: string | null | undefined) => boolean;
20
20
  orderFrom: (combinationKey?: string | null | undefined) => boolean;
21
+ /**
22
+ * Whether min/max may be edited and persisted in this context. Overriders store them per
23
+ * scope (`FdoGroupOverriderV4.min/max`), so this is true wherever that overrider is written.
24
+ */
25
+ minMax: boolean;
26
+ /**
27
+ * Whether to offer the "hide this group" shortcut, which overrides min to 0 and sets every
28
+ * product under the group to NONE. Only meaningful where `minMax` and `orderFrom` are editable.
29
+ */
30
+ hideGroup: boolean;
21
31
  isOverride: boolean;
22
32
  isItemGroup: boolean;
23
33
  isV4: boolean;
@@ -62,7 +72,6 @@ export declare class MenuGroupManager {
62
72
  applyItems(group: MenuGroup, overrideIds: string[]): Promise<void>;
63
73
  private isOverride;
64
74
  }
65
- export declare function mapGroupConfigToImmutableFields(groupConfig: GroupConfig | null | undefined): Array<keyof MenuGroup>;
66
75
  /**
67
76
  * Currently, there are many fields under group that are immutable. Such as name, type, min, max, etc.
68
77
  * If we don't remove these fields, the group will be saved with these fields. Which will cause these
@@ -1,4 +1,4 @@
1
- import type { FdoItemOverriderV4, FdoMenuV4Group } from "@feedmepos/entity";
1
+ import type { FdoGroupOverriderV4, FdoItemOverriderV4, FdoMenuV4Group } from "@feedmepos/entity";
2
2
  /**
3
3
  * The shape `extractGroup` needs from a `MenuGroup`: items keyed by id, each carrying its variant
4
4
  * overriders under `items`. Declared structurally so this module stays free of the store and
@@ -17,4 +17,20 @@ type ExtractableGroup = Omit<FdoMenuV4Group, "items"> & {
17
17
  * item overrider list the menu module stores.
18
18
  */
19
19
  export declare function extractGroup(group: ExtractableGroup): FdoMenuV4Group;
20
+ /**
21
+ * Picks the group-level fields an overrider may carry beyond its items. Callers hand in a group
22
+ * that has already been through `removeImmutableFieldsByGroup`, so a field is absent exactly when
23
+ * the current context is not allowed to override it — and an absent field must stay absent rather
24
+ * than be written as `undefined`.
25
+ */
26
+ export declare function pickGroupOverrideMinMax(group: FdoMenuV4Group): Pick<FdoGroupOverriderV4, "min" | "max">;
27
+ /**
28
+ * Drops min/max from an overrider when they already match the base group. Without this every
29
+ * save of an override form would freeze min/max at today's value, so a later edit to the base
30
+ * group would silently stop reaching that catalog/variant.
31
+ */
32
+ export declare function dropRedundantMinMax<T extends {
33
+ min?: number | null;
34
+ max?: number | null;
35
+ }>(override: T, baseGroup: FdoMenuV4Group | undefined | null): T;
20
36
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { FdoItemOverriderV4 } from "@feedmepos/entity";
2
+ import type { GroupConfig, MenuGroup } from "@/manager/menu/group";
2
3
  interface ImmutableGroupConfig {
3
4
  priceEdit: boolean;
4
5
  priceTier: boolean;
@@ -6,4 +7,5 @@ interface ImmutableGroupConfig {
6
7
  isDefault: (combinationKey?: string | null | undefined) => boolean;
7
8
  }
8
9
  export declare function mapGroupConfigToImmutableItemsFields(groupConfig: ImmutableGroupConfig | null | undefined, combinationKey?: string | null | undefined): (keyof FdoItemOverriderV4)[];
10
+ export declare function mapGroupConfigToImmutableFields(groupConfig: GroupConfig | null | undefined): Array<keyof MenuGroup>;
9
11
  export {};