@fayz-ai/plugin-inventory 0.11.1 → 0.12.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/data/mock.d.ts.map +1 -1
- package/dist/data/supabase.d.ts.map +1 -1
- package/dist/data/tables.d.ts +2 -0
- package/dist/data/tables.d.ts.map +1 -1
- package/dist/data/types.d.ts +30 -1
- package/dist/data/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5024 -3706
- package/dist/index.js.map +1 -1
- package/dist/lib/movement-vocabulary.d.ts.map +1 -1
- package/dist/lib/onboarding.d.ts +11 -0
- package/dist/lib/onboarding.d.ts.map +1 -0
- package/dist/lib/setup-guides.d.ts +3 -0
- package/dist/lib/setup-guides.d.ts.map +1 -0
- package/dist/lib/stock-count.d.ts +4 -1
- package/dist/lib/stock-count.d.ts.map +1 -1
- 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 +3 -25
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/store.d.ts +16 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/types.d.ts +87 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/views/InventoryPage.d.ts.map +1 -1
- package/dist/views/MovementHistoryView.d.ts.map +1 -1
- package/dist/views/ProductCrudForm.d.ts.map +1 -1
- package/dist/views/ProductListView.d.ts.map +1 -1
- package/dist/views/ProductStockTab.d.ts.map +1 -1
- package/dist/views/RecipeDetailView.d.ts.map +1 -1
- package/dist/views/RecipesView.d.ts.map +1 -1
- package/dist/views/StockCountsView.d.ts.map +1 -1
- package/dist/views/StockMovementView.d.ts.map +1 -1
- package/dist/views/UsageAuditView.d.ts +3 -0
- package/dist/views/UsageAuditView.d.ts.map +1 -0
- package/package.json +4 -4
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;AA8DpD,wBAAgB,2BAA2B,IAAI,qBAAqB,CAkrBnE"}
|
|
@@ -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;AA8YpD,wBAAgB,+BAA+B,IAAI,qBAAqB,CAq9BvE"}
|
package/dist/data/tables.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export declare const T: {
|
|
|
10
10
|
readonly recipeGroups: "plg_inventory_recipe_groups";
|
|
11
11
|
readonly countSessions: "plg_inventory_count_sessions";
|
|
12
12
|
readonly countItems: "plg_inventory_count_items";
|
|
13
|
+
readonly productSettings: "plg_inventory_product_settings";
|
|
14
|
+
readonly reservations: "plg_inventory_reservations";
|
|
13
15
|
};
|
|
14
16
|
/** Slot key of plg_inventory_stock_positions — matches uq_..._slot (006). */
|
|
15
17
|
export declare const STOCK_POSITION_SLOT = "tenant_id,product_id,stock_location_id,batch_number,expiration_date";
|
|
@@ -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;;;;;;;;;;;;;;CAcJ,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, Supplier, Recipe, RecipeIngredient, RecipeGroup, StockCountSession, StockCountItem, ProductCategory, CreateProductInput, CreateStockMovementInput, CreateRecipeInput, CreateRecipeIngredientInput, OpenStockCountInput, CloseStockCountResult, 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, UsageAuditQuery, UsageAuditEntry, UsageAuditCorrection, UsageAuditBatchResult, PaginatedResult, InventorySummary, ConsumeRecipeForSourceInput, ReverseRecipeConsumptionInput, InventoryConsumptionResult } from '../types';
|
|
2
2
|
export interface InventoryDataProvider {
|
|
3
3
|
/**
|
|
4
4
|
* Ensure the tenant has the reference rows the inventory UI depends on.
|
|
@@ -16,6 +16,27 @@ export interface InventoryDataProvider {
|
|
|
16
16
|
createMovement(input: CreateStockMovementInput): Promise<StockMovement>;
|
|
17
17
|
/** Drops a movement and unwinds what it did to the position and to on-hand. */
|
|
18
18
|
reverseMovement(movementId: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* What the sales consumed, product by product, against the recipe standard.
|
|
21
|
+
* A read of the ledger — there is no approval queue holding stock back.
|
|
22
|
+
*/
|
|
23
|
+
getUsageAudit(query: UsageAuditQuery): Promise<PaginatedResult<UsageAuditEntry>>;
|
|
24
|
+
/** Posts the difference as an adjustment; the reason is mandatory. */
|
|
25
|
+
correctUsage(input: {
|
|
26
|
+
itemId: string;
|
|
27
|
+
productId: string;
|
|
28
|
+
quantity: number;
|
|
29
|
+
reason: string;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Closes a whole conference at once: N lines under ONE reason and ONE
|
|
33
|
+
* operation, each difference posted as its own adjustment. The batch — not
|
|
34
|
+
* the line — is the event, which is what lets the reason be asked for once.
|
|
35
|
+
*/
|
|
36
|
+
correctUsageBatch(input: {
|
|
37
|
+
reason: string;
|
|
38
|
+
lines: UsageAuditCorrection[];
|
|
39
|
+
}): Promise<UsageAuditBatchResult>;
|
|
19
40
|
/** Positions of one product, with the location name resolved. */
|
|
20
41
|
getPositions(productId: string): Promise<StockPosition[]>;
|
|
21
42
|
getLocations(): Promise<StockLocation[]>;
|
|
@@ -47,6 +68,14 @@ export interface InventoryDataProvider {
|
|
|
47
68
|
/** Partial update — how the screen closes the gaps the assistant left. */
|
|
48
69
|
updateRecipe(id: string, patch: Partial<Recipe>): Promise<Recipe>;
|
|
49
70
|
addRecipeIngredient(recipeId: string, input: CreateRecipeIngredientInput): Promise<RecipeIngredient>;
|
|
71
|
+
/**
|
|
72
|
+
* Explodes the active recipe of a sold product and consumes its ingredients.
|
|
73
|
+
* The source item is the idempotency boundary: replaying the same source does
|
|
74
|
+
* not create a second stock exit.
|
|
75
|
+
*/
|
|
76
|
+
consumeRecipeForSource(input: ConsumeRecipeForSourceInput): Promise<InventoryConsumptionResult>;
|
|
77
|
+
/** Restores the stock consumed by the same source item, also idempotently. */
|
|
78
|
+
reverseRecipeConsumption(input: ReverseRecipeConsumptionInput): Promise<InventoryConsumptionResult>;
|
|
50
79
|
getSummary(): Promise<InventorySummary>;
|
|
51
80
|
}
|
|
52
81
|
//# 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,EAC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AO,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;;;;OAIG;IACH,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;IAC/F,8EAA8E;IAC9E,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;IAGnG,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAA;CACxC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -50,10 +50,13 @@ export interface InventoryPluginOptions {
|
|
|
50
50
|
isHQ?: boolean;
|
|
51
51
|
}>;
|
|
52
52
|
}
|
|
53
|
+
/** The same lazy provider selection used by the plugin, reusable by app composition. */
|
|
54
|
+
export declare function createInventoryDataProvider(): InventoryDataProvider;
|
|
53
55
|
export declare function createInventoryPlugin(options?: InventoryPluginOptions): PluginManifest;
|
|
54
56
|
export type { InventoryDataProvider } from './data/types';
|
|
55
57
|
export type { ResolvedInventoryConfig } from './context';
|
|
56
58
|
export { MOVEMENT_TYPES, MOVEMENT_TYPE_VALUES, LEGACY_PT_MOVEMENT_TYPE, movementTypeSpec, normalizeMovementType, } from './lib/movement-vocabulary';
|
|
57
59
|
export type { MovementTypeSpec } from './lib/movement-vocabulary';
|
|
58
60
|
export type { MovementType } from './types';
|
|
61
|
+
export type { ConsumeRecipeForSourceInput, ReverseRecipeConsumptionInput, InventoryConsumptionResult, InventoryConsumptionStatus, InventoryConsumptionSkipReason, } from './types';
|
|
59
62
|
//# 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,EAA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