@feedmepos/mf-inventory-portal 1.6.0-dev.7 → 1.6.1-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.
- package/dist/{App-CfPro_9C.js → App-CL5dPCEj.js} +4 -4
- package/dist/{ApprovalView-DSN8Po9S.js → ApprovalView-DKJibNlK.js} +7 -7
- package/dist/{BindingsDialog-Bnuqm3nG.js → BindingsDialog-DLJXu8Dw.js} +2 -2
- package/dist/{BindingsPicker-Dd4REc66.js → BindingsPicker-CW6Tk9JI.js} +2 -2
- package/dist/{BindingsTable-C-HtmMpH.js → BindingsTable-3JJEAQz3.js} +3 -3
- package/dist/{ClosingDraftView-CTtxiXwh.js → ClosingDraftView-DVoWnPTQ.js} +27 -28
- package/dist/{ClosingHistoryView-cvmoaHAt.js → ClosingHistoryView-qWjIbBsX.js} +5 -5
- package/dist/{ClosingTemplateView-BBxNHF64.js → ClosingTemplateView-C3Hf510z.js} +14 -14
- package/dist/{DefaultView-CsqggsmN.js → DefaultView-wBhT3ag9.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DKEmN4tO.js → DeliveryOrderPrintPreview-VnG9wrNu.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CLMHR5Fy.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C4pvSYN-.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-24Qj9QM3.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bkh9LvJQ.js} +2 -2
- package/dist/{FmMultiselectDialog-DXBkITTj.js → FmMultiselectDialog-C7P1UET0.js} +2 -2
- package/dist/{FmMultiselectDialog-C70WEGrm.js → FmMultiselectDialog-Dru64kWF.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B8QH4-MU.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BklBxBGT.js} +5 -5
- package/dist/{ImportView-BNS7vOnx.js → ImportView-C9w-sF5E.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CGoVzY_5.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BuphGYe2.js} +1 -1
- package/dist/{IngredientGroupView-Db80oGZN.js → IngredientGroupView-BZqXPr_n.js} +21 -21
- package/dist/{IngredientsView-q6E2tmIN.js → IngredientsView-DgTPgkN9.js} +17 -17
- package/dist/{IntegrationExplorerView-4pyt5Z5K.js → IntegrationExplorerView-B8U3LTtj.js} +5 -5
- package/dist/IntegrationView-QyHxizvF.js +5791 -0
- package/dist/{InventoryBindingForm-D-j7xlaq.js → InventoryBindingForm-NRwFwJt5.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BPMTYItR.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-C-If3KBe.js} +5 -5
- package/dist/{InventoryBindingSummary-BS9rFFE5.js → InventoryBindingSummary-DqI3M6jQ.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DvtFGe3C.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Xt_1oU-z.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-54yXqcN9.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DFYTlv_K.js} +1 -1
- package/dist/{PublishView-xnFv__ui.js → PublishView-2ytn8EUo.js} +61 -56
- package/dist/{PurchaseOrderPrintPreview-CMMBoIGC.js → PurchaseOrderPrintPreview-Bqim_q38.js} +2 -2
- package/dist/{ReceiveRequestView-BR2e1bFZ.js → ReceiveRequestView-DIPZCXxV.js} +738 -738
- package/dist/{RecipeView-CHnyBJ0f.js → RecipeView-Bs326Ew3.js} +17 -17
- package/dist/{SettingsView-Cf6T5YmG.js → SettingsView-frX_dI_K.js} +4 -4
- package/dist/{StockView-Cv5M6SI4.js → StockView-Us8Wx8y_.js} +19 -19
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BdJfkEW-.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Du8BI_cZ.js} +1 -1
- package/dist/{SupplierView-Bm3pUwbz.js → SupplierView-8dnHAbK3.js} +12 -12
- package/dist/{SurchargeView-CvxmTW8L.js → SurchargeView-CfqjYiBs.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Dohtj-Y_.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-_03vSZ4W.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DBWoc7Cq.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CAb7UWFP.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BvQoNFyl.js → TransferDetails.vue_vue_type_script_setup_true_lang-B58A7dWI.js} +179 -179
- package/dist/{TransferTemplateView-DwslyLh7.js → TransferTemplateView-CI84cmV5.js} +20 -20
- package/dist/{UnitCostHistoryView-DyYMqFXw.js → UnitCostHistoryView-DXolsbDT.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BiVS-xuv.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Bpoawj7B.js} +10 -11
- package/dist/{UnitView-DWS3MozP.js → UnitView-DT3fcagF.js} +7 -7
- package/dist/{WarehouseView-BWO6YSsg.js → WarehouseView-C1BHChSJ.js} +5 -5
- package/dist/{WastageTemplateView-BtCHJ60X.js → WastageTemplateView-Bc5CZJ58.js} +14 -14
- package/dist/{app-BS8Y8XB1.js → app-DpMCzQql.js} +228 -23
- package/dist/app.d.ts +205 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-Dnukh28P.js → closing-template-CaFX19g1.js} +1 -1
- package/dist/{date2-DOWGtN_k.js → date2-DBsUy1HH.js} +1 -1
- package/dist/{dayjs.min-D3dSrhTX.js → dayjs.min-BVKjPmJE.js} +1 -1
- package/dist/{decimal-Bk_LcBc8.js → decimal-DKl2dUd0.js} +2 -2
- package/dist/{defineDeepModel-s_J1LoEM.js → defineDeepModel-YeHxg9wN.js} +1 -1
- package/dist/{duplicate-template-BTf1Xhvo.js → duplicate-template-Dyx4X380.js} +1 -1
- package/dist/{feature-DDV6dfk3.js → feature-ltFu24H8.js} +2 -2
- package/dist/{format-time-from-id-Q4wzJvY5.js → format-time-from-id-D3lPFiqA.js} +1 -1
- package/dist/{format-unit-display-B8tTISaS.js → format-unit-display-CD8C9YZc.js} +12 -12
- package/dist/{import-export.helper-BK3vn2Ss.js → import-export.helper-BJ5Lz4Gg.js} +6 -6
- package/dist/{index-CY7iF8Ji.js → index-B8xTUvTH.js} +1 -1
- package/dist/{index-C74Cmjq-.js → index-JOemzj27.js} +1 -1
- package/dist/{index-fQ54arbf.js → index-TQKBiFuU.js} +3 -3
- package/dist/{inventory-core-dart.default-Dl166D_R.js → inventory-core-dart.default-Xz0fuxVn.js} +355 -328
- package/dist/{lz-string-wIxbEJut.js → lz-string-DAdPi3YY.js} +1 -1
- package/dist/{netsuite-BeD5zM7r.js → netsuite-qr2wHoV5.js} +1570 -1509
- package/dist/{number-B5DVgaWM.js → number-xgIylzEb.js} +3 -3
- package/dist/{predefined-templates-DZNPHq12.js → predefined-templates-j5MqD37J.js} +1 -1
- package/dist/{purchase-order-template-aR89SUGU.js → purchase-order-template-CglLUVxv.js} +1 -1
- package/dist/{recalculationUtils-DjE7iLEk.js → recalculationUtils-O8dnzyPD.js} +1 -1
- package/dist/{rules-C_1llraF.js → rules-BPu-CBAX.js} +2 -2
- package/dist/{stock-DzPtGhtF.js → stock-VM7b7_Km.js} +1 -1
- package/dist/{supplier-Bln8QZF9.js → supplier-W00UQBDk.js} +2 -2
- package/dist/{surcharge-Czr01eFJ.js → surcharge-CUUDBYUf.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-DGZ_Y5qW.js → uom-rules-D6eW0fAO.js} +1 -1
- package/dist/{use-ingredient-select-dialog-Bo31tZwb.js → use-ingredient-select-dialog-Cd700UkI.js} +2 -2
- package/dist/{use-inventory-binding-dialog-Cs0ag6eH.js → use-inventory-binding-dialog-Cf8wC8AI.js} +2 -2
- package/dist/{use-template-enabled-locations-Dz7i898A.js → use-template-enabled-locations-D1AVostH.js} +2 -2
- package/dist/{use-transfer-locations-DGKaXjGH.js → use-transfer-locations-uOi6cGul.js} +2 -2
- package/dist/{useHrmPermission-YMieTr4z.js → useHrmPermission-DEu2Lyei.js} +1 -1
- package/dist/{useNavigationMenu-CR9b-9EU.js → useNavigationMenu-DuIGSnMd.js} +2 -2
- package/dist/{useSseClient-D5xvMgqf.js → useSseClient-D1uc8ZIc.js} +3 -3
- package/dist/views/integration/components/binding-import/BindingImportPreview.vue.d.ts +22 -0
- package/dist/views/integration/components/binding-import/ImportBindings.vue.d.ts +444 -0
- package/dist/views/integration/helper/binding-import/configs/codemax.d.ts +3 -0
- package/dist/views/integration/helper/binding-import/configs/codemax.spec.d.ts +1 -0
- package/dist/views/integration/helper/binding-import/configs/food-market-hub.d.ts +3 -0
- package/dist/views/integration/helper/binding-import/configs/food-market-hub.spec.d.ts +1 -0
- package/dist/views/integration/helper/binding-import/core.d.ts +43 -0
- package/dist/views/integration/helper/binding-import/types.d.ts +100 -0
- package/dist/{vue-i18n-CPBfs8-Q.js → vue-i18n-DElpxFA8.js} +321 -321
- package/dist/{xlsx-9rrE89GF.js → xlsx.util-Cm8s0ZJD.js} +2511 -2414
- package/package.json +3 -3
- package/dist/IntegrationView-BnZlrLP_.js +0 -5100
- package/dist/xlsx.util-Dt_h5XF4.js +0 -101
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic menu-binding importer core. See `types.ts` for the design notes.
|
|
3
|
+
*
|
|
4
|
+
* All functions are pure (except `exportTemplate`, which downloads a file) and operate over any
|
|
5
|
+
* binding type via a `BindingImportConfig`. Codemax and Food Market Hub each supply a config in
|
|
6
|
+
* `./configs/*` and mount the same parser/classifier/preview.
|
|
7
|
+
*/
|
|
8
|
+
import type { FdoMenuV4Item, FdoMenuV4VariantGroup } from '@feedmepos/menu/entity';
|
|
9
|
+
import type { WorkSheet } from 'xlsx';
|
|
10
|
+
import type { BindingBase, BindingImportConfig, ImportResult, ImportRow, ImportSummary, MenuIndex, TemplateResult } from './types';
|
|
11
|
+
/** stable key for a binding — null/undefined/empty combinationKey all collapse to "" */
|
|
12
|
+
export declare function bindingKey(productId: string, combinationKey?: string | null): string;
|
|
13
|
+
export declare function worksheetToImportRows<TBinding extends BindingBase>(sheet: WorkSheet, config: BindingImportConfig<TBinding>): ImportRow[];
|
|
14
|
+
/**
|
|
15
|
+
* Build the resolution indexes from the live menu: `byProductId` (authoritative, every item),
|
|
16
|
+
* `byCode` (product `code` only), `byName` (normalized product name). Every match is product-level
|
|
17
|
+
* and carries the set of valid `combinationKeys`; a specific variant is selected later by Variant
|
|
18
|
+
* Key, never by a variant's own code. Integration-agnostic.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildMenuCodeIndex(menus: FdoMenuV4Item[], variantGroups?: FdoMenuV4VariantGroup[]): MenuIndex;
|
|
21
|
+
export declare function classifyImport<TBinding extends BindingBase>(rows: ImportRow[], menuIndex: MenuIndex, existingBindings: TBinding[], config: BindingImportConfig<TBinding>): ImportResult<TBinding>;
|
|
22
|
+
/** Parse + classify in one call, converting parse errors into an `invalidExcel` result. */
|
|
23
|
+
export declare function parseAndClassify<TBinding extends BindingBase>(sheet: WorkSheet, menus: FdoMenuV4Item[], existingBindings: TBinding[], variantGroups: FdoMenuV4VariantGroup[], config: BindingImportConfig<TBinding>): ImportResult<TBinding>;
|
|
24
|
+
/** Bindings to actually apply — NEW/OVERRIDE rows that resolved cleanly (no errors). */
|
|
25
|
+
export declare function resolvedBindings<TBinding extends BindingBase>(result: ImportResult<TBinding>): TBinding[];
|
|
26
|
+
export declare function summarize<TBinding extends BindingBase>(result: ImportResult<TBinding>): ImportSummary;
|
|
27
|
+
/**
|
|
28
|
+
* Merge imported bindings into the existing set (keyed by productId + combinationKey):
|
|
29
|
+
* existing bindings not present in the import are kept untouched; imported items override
|
|
30
|
+
* matching existing ones and new bindings are appended.
|
|
31
|
+
*/
|
|
32
|
+
export declare function mergeBindings<TBinding extends BindingBase>(existing: TBinding[], imported: TBinding[]): TBinding[];
|
|
33
|
+
type TemplateCategory = {
|
|
34
|
+
_id?: string | null;
|
|
35
|
+
name?: string | null;
|
|
36
|
+
};
|
|
37
|
+
export declare function buildTemplateRows<TBinding extends BindingBase>(menus: FdoMenuV4Item[], categories: TemplateCategory[], bindings: TBinding[], variantGroups: FdoMenuV4VariantGroup[], config: BindingImportConfig<TBinding>): TemplateResult;
|
|
38
|
+
/** Build and download the binding template as an .xlsx file. Returns the row count + filename. */
|
|
39
|
+
export declare function exportTemplate<TBinding extends BindingBase>(menus: FdoMenuV4Item[], categories: TemplateCategory[], bindings: TBinding[], variantGroups: FdoMenuV4VariantGroup[], config: BindingImportConfig<TBinding>, businessName?: string): {
|
|
40
|
+
filename: string;
|
|
41
|
+
itemCount: number;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic, integration-agnostic types for the menu-binding importer.
|
|
3
|
+
*
|
|
4
|
+
* A binding always has the identity `productId` + `combinationKey?` (a menu item, optionally a
|
|
5
|
+
* specific variant combination). What differs per integration is the set of *value* fields carried
|
|
6
|
+
* on the binding (Codemax: `itemCode` + `unit`; Food Market Hub: `code`). Each integration supplies a
|
|
7
|
+
* `BindingImportConfig` describing those value columns and how to build/read a binding; everything
|
|
8
|
+
* else (menu indexing, duplicate detection, variant resolution, classification, merge, template) is
|
|
9
|
+
* shared in `core.ts`.
|
|
10
|
+
*/
|
|
11
|
+
/** A binding shape the generic importer can operate on. */
|
|
12
|
+
export interface BindingBase {
|
|
13
|
+
productId: string;
|
|
14
|
+
combinationKey?: string | null;
|
|
15
|
+
}
|
|
16
|
+
/** One integration-specific value column appended after the fixed menu columns. */
|
|
17
|
+
export interface BindingValueColumn {
|
|
18
|
+
/** stable field key on the binding object, e.g. 'itemCode' | 'unit' | 'code' */
|
|
19
|
+
field: string;
|
|
20
|
+
/** header text written to the template and shown in the preview, e.g. 'CodeMax Code' | 'FMH Code' */
|
|
21
|
+
header: string;
|
|
22
|
+
/** tolerant header aliases (already normalized: lowercase, alphanumeric-only) accepted on import */
|
|
23
|
+
aliases: string[];
|
|
24
|
+
/** when true, a blank cell on an otherwise-resolved row contributes to SKIPPED / partial-error logic */
|
|
25
|
+
required: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface BindingImportConfig<TBinding extends BindingBase> {
|
|
28
|
+
/** integration key — used for the template filename, e.g. 'codemax' | 'foodMarketHub' */
|
|
29
|
+
key: string;
|
|
30
|
+
/** value columns, in display/template order, appended after the fixed menu columns */
|
|
31
|
+
valueColumns: BindingValueColumn[];
|
|
32
|
+
/** assemble a binding from a resolved menu match + the row's value cells (field → cell value) */
|
|
33
|
+
buildBinding(args: {
|
|
34
|
+
productId: string;
|
|
35
|
+
combinationKey?: string;
|
|
36
|
+
values: Record<string, string>;
|
|
37
|
+
}): TBinding;
|
|
38
|
+
/** read the value cells back off an existing binding (for template prefilling + preview display) */
|
|
39
|
+
readValues(binding: TBinding): Record<string, string>;
|
|
40
|
+
}
|
|
41
|
+
export type ImportStatus = 'NEW' | 'OVERRIDE' | 'SKIPPED' | 'DUPLICATE' | 'NOT_FOUND' | 'AMBIGUOUS';
|
|
42
|
+
/**
|
|
43
|
+
* A parsed spreadsheet row. Identity is `productId` (authoritative) → `menuItemCode` → `menuItemName`
|
|
44
|
+
* (normalized fallback); the variant dimension is `variantKey` (combinationKey). `category` /
|
|
45
|
+
* `variantName` are display-only. Mirrors the menu export's column conventions (reference only — the
|
|
46
|
+
* raw menu export is not parsed).
|
|
47
|
+
*/
|
|
48
|
+
export interface ImportRow {
|
|
49
|
+
productId: string;
|
|
50
|
+
menuItemCode: string;
|
|
51
|
+
menuItemName: string;
|
|
52
|
+
category: string;
|
|
53
|
+
variantName: string;
|
|
54
|
+
variantKey: string;
|
|
55
|
+
/** value-column field → trimmed cell value */
|
|
56
|
+
values: Record<string, string>;
|
|
57
|
+
}
|
|
58
|
+
export interface MenuMatch {
|
|
59
|
+
productId: string;
|
|
60
|
+
name: string;
|
|
61
|
+
isAddon: boolean;
|
|
62
|
+
/** the valid combinationKeys the product owns (empty for a product without variants) */
|
|
63
|
+
combinationKeys?: Set<string>;
|
|
64
|
+
combinationNames?: Map<string, string>;
|
|
65
|
+
}
|
|
66
|
+
/** Resolution indexes built from the live menu: productId (authoritative), code, normalized name. */
|
|
67
|
+
export interface MenuIndex {
|
|
68
|
+
byProductId: Map<string, MenuMatch>;
|
|
69
|
+
byCode: Map<string, MenuMatch[]>;
|
|
70
|
+
byName: Map<string, MenuMatch[]>;
|
|
71
|
+
}
|
|
72
|
+
export interface ImportResultRow<TBinding extends BindingBase> {
|
|
73
|
+
excelRowNumber: number;
|
|
74
|
+
status: ImportStatus;
|
|
75
|
+
row: ImportRow;
|
|
76
|
+
binding?: TBinding;
|
|
77
|
+
resolvedName?: string;
|
|
78
|
+
variantName?: string;
|
|
79
|
+
isAddon?: boolean;
|
|
80
|
+
warnings: string[];
|
|
81
|
+
errors: string[];
|
|
82
|
+
}
|
|
83
|
+
export interface ImportResult<TBinding extends BindingBase> {
|
|
84
|
+
invalidExcel: boolean;
|
|
85
|
+
invalidExcelMessage?: string;
|
|
86
|
+
rows: ImportResultRow<TBinding>[];
|
|
87
|
+
}
|
|
88
|
+
export interface ImportSummary {
|
|
89
|
+
new: number;
|
|
90
|
+
override: number;
|
|
91
|
+
skipped: number;
|
|
92
|
+
duplicate: number;
|
|
93
|
+
notFound: number;
|
|
94
|
+
ambiguous: number;
|
|
95
|
+
withErrors: number;
|
|
96
|
+
}
|
|
97
|
+
export interface TemplateResult {
|
|
98
|
+
/** header + data rows, ready for `toSheet` */
|
|
99
|
+
rows: string[][];
|
|
100
|
+
}
|