@fayz-ai/plugin-inventory 0.9.3 → 0.10.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/components/RecipeGapsPanel.d.ts +14 -0
- package/dist/components/RecipeGapsPanel.d.ts.map +1 -0
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/supabase.d.ts.map +1 -1
- package/dist/data/tables.d.ts +6 -0
- package/dist/data/tables.d.ts.map +1 -1
- package/dist/data/types.d.ts +23 -1
- package/dist/data/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2459 -237
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-tools.d.ts +4 -0
- package/dist/lib/agent-tools.d.ts.map +1 -0
- package/dist/lib/movement-vocabulary.d.ts +30 -0
- package/dist/lib/movement-vocabulary.d.ts.map +1 -0
- package/dist/lib/recipe-cost.d.ts +22 -0
- package/dist/lib/recipe-cost.d.ts.map +1 -0
- package/dist/lib/stock-count.d.ts +19 -0
- package/dist/lib/stock-count.d.ts.map +1 -0
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/migrations/index.d.ts +7 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/types.d.ts +114 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/views/InventoryPage.d.ts.map +1 -1
- package/dist/views/MovementHistoryView.d.ts +4 -1
- package/dist/views/MovementHistoryView.d.ts.map +1 -1
- package/dist/views/ProductCrudForm.d.ts.map +1 -1
- package/dist/views/ProductDetailView.d.ts +9 -0
- package/dist/views/ProductDetailView.d.ts.map +1 -0
- package/dist/views/ProductListView.d.ts +3 -2
- package/dist/views/ProductListView.d.ts.map +1 -1
- package/dist/views/ProductStockTab.d.ts +11 -0
- package/dist/views/ProductStockTab.d.ts.map +1 -0
- package/dist/views/RecipeDetailView.d.ts.map +1 -1
- package/dist/views/RecipeFormView.d.ts +3 -1
- package/dist/views/RecipeFormView.d.ts.map +1 -1
- package/dist/views/RecipesView.d.ts +3 -1
- package/dist/views/RecipesView.d.ts.map +1 -1
- package/dist/views/StockCountFormView.d.ts +7 -0
- package/dist/views/StockCountFormView.d.ts.map +1 -0
- package/dist/views/StockCountSessionView.d.ts +15 -0
- package/dist/views/StockCountSessionView.d.ts.map +1 -0
- package/dist/views/StockCountsView.d.ts +7 -0
- package/dist/views/StockCountsView.d.ts.map +1 -0
- package/dist/views/StockMovementView.d.ts.map +1 -1
- package/dist/views/productEntity.d.ts +4 -1
- package/dist/views/productEntity.d.ts.map +1 -1
- package/package.json +8 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Recipe, RecipeGaps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* What the assistant proposed and could not match to the catalogue, offered
|
|
5
|
+
* back for the user to pick or create. Without this the AI path dead-ends on
|
|
6
|
+
* "she mentioned bacon and it is not in the recipe" — the recovery loop is what
|
|
7
|
+
* made the legacy feature usable.
|
|
8
|
+
*/
|
|
9
|
+
export declare function RecipeGapsPanel({ recipe, gaps, onResolved }: {
|
|
10
|
+
recipe: Recipe;
|
|
11
|
+
gaps: RecipeGaps;
|
|
12
|
+
onResolved: () => void | Promise<void>;
|
|
13
|
+
}): React.JSX.Element | null;
|
|
14
|
+
//# sourceMappingURL=RecipeGapsPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecipeGapsPanel.d.ts","sourceRoot":"","sources":["../../src/components/RecipeGapsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAKvC,OAAO,KAAK,EAAW,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE3D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;IAC5D,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvC,4BAiHA"}
|
package/dist/data/mock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAwDpD,wBAAgB,2BAA2B,IAAI,qBAAqB,CA2hBnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAiPpD,wBAAgB,+BAA+B,IAAI,qBAAqB,CAqiBvE"}
|
package/dist/data/tables.d.ts
CHANGED
|
@@ -6,5 +6,11 @@ export declare const T: {
|
|
|
6
6
|
readonly recipeIngredients: "plg_inventory_recipe_ingredients";
|
|
7
7
|
readonly measurementUnits: "plg_inventory_measurement_units";
|
|
8
8
|
readonly productCategories: "plg_inventory_product_categories";
|
|
9
|
+
readonly productDetails: "plg_inventory_product_details";
|
|
10
|
+
readonly recipeGroups: "plg_inventory_recipe_groups";
|
|
11
|
+
readonly countSessions: "plg_inventory_count_sessions";
|
|
12
|
+
readonly countItems: "plg_inventory_count_items";
|
|
9
13
|
};
|
|
14
|
+
/** Slot key of plg_inventory_stock_positions — matches uq_..._slot (006). */
|
|
15
|
+
export declare const STOCK_POSITION_SLOT = "tenant_id,product_id,stock_location_id,batch_number,expiration_date";
|
|
10
16
|
//# sourceMappingURL=tables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/data/tables.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/data/tables.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,CAAC;;;;;;;;;;;;CAYJ,CAAA;AAEV,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,wEAAwE,CAAA"}
|
package/dist/data/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Product, StockMovement, StockPosition, StockLocation, Recipe, RecipeIngredient, CreateProductInput, CreateStockMovementInput, CreateRecipeInput, ProductQuery, MovementQuery, PaginatedResult, InventorySummary } from '../types';
|
|
1
|
+
import type { Product, StockMovement, StockPosition, StockLocation, Supplier, Recipe, RecipeIngredient, RecipeGroup, StockCountSession, StockCountItem, ProductCategory, CreateProductInput, CreateStockMovementInput, CreateRecipeInput, CreateRecipeIngredientInput, OpenStockCountInput, CloseStockCountResult, ProductQuery, MovementQuery, PaginatedResult, InventorySummary } from '../types';
|
|
2
2
|
export interface InventoryDataProvider {
|
|
3
3
|
getProducts(query: ProductQuery): Promise<PaginatedResult<Product>>;
|
|
4
4
|
getProductById(id: string): Promise<Product | null>;
|
|
@@ -6,6 +6,9 @@ export interface InventoryDataProvider {
|
|
|
6
6
|
updateProduct(id: string, data: Partial<Product>): Promise<Product>;
|
|
7
7
|
getMovements(query: MovementQuery): Promise<PaginatedResult<StockMovement>>;
|
|
8
8
|
createMovement(input: CreateStockMovementInput): Promise<StockMovement>;
|
|
9
|
+
/** Drops a movement and unwinds what it did to the position and to on-hand. */
|
|
10
|
+
reverseMovement(movementId: string): Promise<void>;
|
|
11
|
+
/** Positions of one product, with the location name resolved. */
|
|
9
12
|
getPositions(productId: string): Promise<StockPosition[]>;
|
|
10
13
|
getLocations(): Promise<StockLocation[]>;
|
|
11
14
|
createLocation(data: {
|
|
@@ -13,10 +16,29 @@ export interface InventoryDataProvider {
|
|
|
13
16
|
description?: string;
|
|
14
17
|
unitId?: string;
|
|
15
18
|
}): Promise<StockLocation>;
|
|
19
|
+
getSuppliers(): Promise<Supplier[]>;
|
|
20
|
+
getCategories(): Promise<ProductCategory[]>;
|
|
21
|
+
getCountSessions(): Promise<StockCountSession[]>;
|
|
22
|
+
getCountSession(id: string): Promise<StockCountSession | null>;
|
|
23
|
+
getCountItems(sessionId: string): Promise<StockCountItem[]>;
|
|
24
|
+
/** Creates the session AND snapshots what the system believes right now. */
|
|
25
|
+
openCountSession(input: OpenStockCountInput): Promise<StockCountSession>;
|
|
26
|
+
/** `quantity` null clears the entry back to uncounted — which is not zero. */
|
|
27
|
+
saveCountEntry(itemId: string, quantity: number | null, notes?: string): Promise<StockCountItem>;
|
|
28
|
+
/** Atomic and idempotent: re-closing emits no second round of adjustments. */
|
|
29
|
+
closeCountSession(sessionId: string, reason?: string): Promise<CloseStockCountResult>;
|
|
30
|
+
cancelCountSession(sessionId: string): Promise<StockCountSession>;
|
|
16
31
|
getRecipes(): Promise<Recipe[]>;
|
|
17
32
|
getRecipeById(id: string): Promise<Recipe | null>;
|
|
18
33
|
getRecipeIngredients(recipeId: string): Promise<RecipeIngredient[]>;
|
|
34
|
+
/** Every recipe's lines in one round trip — the list costs rows without an
|
|
35
|
+
* N+1. Each line carries the ingredient's cost basis. */
|
|
36
|
+
getAllRecipeIngredients(): Promise<RecipeIngredient[]>;
|
|
37
|
+
getRecipeGroups(recipeId: string): Promise<RecipeGroup[]>;
|
|
19
38
|
createRecipe(input: CreateRecipeInput): Promise<Recipe>;
|
|
39
|
+
/** Partial update — how the screen closes the gaps the assistant left. */
|
|
40
|
+
updateRecipe(id: string, patch: Partial<Recipe>): Promise<Recipe>;
|
|
41
|
+
addRecipeIngredient(recipeId: string, input: CreateRecipeIngredientInput): Promise<RecipeIngredient>;
|
|
20
42
|
getSummary(): Promise<InventorySummary>;
|
|
21
43
|
}
|
|
22
44
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/data/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAC9D,MAAM,EAAE,gBAAgB,EAAE,WAAW,EACrC,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAClD,kBAAkB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,2BAA2B,EAC5F,mBAAmB,EAAE,qBAAqB,EAC1C,YAAY,EAAE,aAAa,EAC3B,eAAe,EAAE,gBAAgB,EAClC,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,qBAAqB;IAEpC,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA;IACnE,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACnD,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC1D,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAGnE,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,C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AAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAGjE,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/B,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACjD,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAA;IACnE;8DAC0D;IAC1D,uBAAuB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAA;IACtD,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;IACzD,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACvD,0EAA0E;IAC1E,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACjE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAGpG,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAA;CACxC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -53,4 +53,6 @@ export interface InventoryPluginOptions {
|
|
|
53
53
|
export declare function createInventoryPlugin(options?: InventoryPluginOptions): PluginManifest;
|
|
54
54
|
export type { InventoryDataProvider } from './data/types';
|
|
55
55
|
export type { ResolvedInventoryConfig } from './context';
|
|
56
|
+
export { MOVEMENT_TYPES, MOVEMENT_TYPE_VALUES, LEGACY_PT_MOVEMENT_TYPE, movementTypeSpec, normalizeMovementType, } from './lib/movement-vocabulary';
|
|
57
|
+
export type { MovementTypeSpec } from './lib/movement-vocabulary';
|
|
56
58
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAezD,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,cAAc,CAAC,EAAE,OAAO,CAAA;QACxB,aAAa,CAAC,EAAE,OAAO,CAAA;QACvB;;;;;;WAMG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;IACD,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,C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