@fayz-ai/plugin-inventory 0.1.1
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/InventoryContext.d.ts +37 -0
- package/dist/InventoryContext.d.ts.map +1 -0
- package/dist/InventoryPage.d.ts +13 -0
- package/dist/InventoryPage.d.ts.map +1 -0
- package/dist/components/InventoryGeneralSettings.d.ts +3 -0
- package/dist/components/InventoryGeneralSettings.d.ts.map +1 -0
- package/dist/components/InventoryOnboarding.d.ts +5 -0
- package/dist/components/InventoryOnboarding.d.ts.map +1 -0
- package/dist/components/InventorySettings.d.ts +8 -0
- package/dist/components/InventorySettings.d.ts.map +1 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/mock.d.ts +3 -0
- package/dist/data/mock.d.ts.map +1 -0
- package/dist/data/supabase.d.ts +3 -0
- package/dist/data/supabase.d.ts.map +1 -0
- package/dist/data/types.d.ts +22 -0
- package/dist/data/types.d.ts.map +1 -0
- package/dist/index.cjs +2936 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2930 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/tenant.d.ts +3 -0
- package/dist/lib/tenant.d.ts.map +1 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/index.d.ts +2 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/pt-BR.d.ts +2 -0
- package/dist/locales/pt-BR.d.ts.map +1 -0
- package/dist/registries.d.ts +3 -0
- package/dist/registries.d.ts.map +1 -0
- package/dist/store.d.ts +28 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/types.d.ts +213 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/views/DashboardView.d.ts +8 -0
- package/dist/views/DashboardView.d.ts.map +1 -0
- package/dist/views/MovementHistoryView.d.ts +5 -0
- package/dist/views/MovementHistoryView.d.ts.map +1 -0
- package/dist/views/ProductCrudForm.d.ts +6 -0
- package/dist/views/ProductCrudForm.d.ts.map +1 -0
- package/dist/views/ProductFormView.d.ts +6 -0
- package/dist/views/ProductFormView.d.ts.map +1 -0
- package/dist/views/ProductListView.d.ts +6 -0
- package/dist/views/ProductListView.d.ts.map +1 -0
- package/dist/views/RecipeDetailView.d.ts +6 -0
- package/dist/views/RecipeDetailView.d.ts.map +1 -0
- package/dist/views/RecipeFormView.d.ts +5 -0
- package/dist/views/RecipeFormView.d.ts.map +1 -0
- package/dist/views/RecipesView.d.ts +6 -0
- package/dist/views/RecipesView.d.ts.map +1 -0
- package/dist/views/StockMovementView.d.ts +8 -0
- package/dist/views/StockMovementView.d.ts.map +1 -0
- package/dist/views/dashboardWidgets.d.ts +11 -0
- package/dist/views/dashboardWidgets.d.ts.map +1 -0
- package/dist/views/productEntity.d.ts +6 -0
- package/dist/views/productEntity.d.ts.map +1 -0
- package/package.json +55 -0
- package/src/InventoryContext.tsx +40 -0
- package/src/InventoryPage.tsx +170 -0
- package/src/README.md +177 -0
- package/src/components/InventoryGeneralSettings.tsx +26 -0
- package/src/components/InventoryOnboarding.tsx +60 -0
- package/src/components/InventorySettings.tsx +27 -0
- package/src/data/index.ts +2 -0
- package/src/data/mock.ts +266 -0
- package/src/data/supabase.ts +358 -0
- package/src/data/types.ts +35 -0
- package/src/index.ts +191 -0
- package/src/lib/tenant.ts +4 -0
- package/src/locales/en.ts +242 -0
- package/src/locales/index.ts +7 -0
- package/src/locales/pt-BR.ts +242 -0
- package/src/migrations/001_inventory_base.sql +69 -0
- package/src/migrations/002_recipes.sql +34 -0
- package/src/migrations/003_measurement_units.sql +13 -0
- package/src/registries.ts +111 -0
- package/src/store.ts +127 -0
- package/src/types.ts +256 -0
- package/src/views/DashboardView.tsx +11 -0
- package/src/views/MovementHistoryView.tsx +104 -0
- package/src/views/ProductCrudForm.tsx +99 -0
- package/src/views/ProductFormView.tsx +283 -0
- package/src/views/ProductListView.tsx +107 -0
- package/src/views/RecipeDetailView.tsx +192 -0
- package/src/views/RecipeFormView.tsx +235 -0
- package/src/views/RecipesView.tsx +103 -0
- package/src/views/StockMovementView.tsx +516 -0
- package/src/views/dashboardWidgets.tsx +101 -0
- package/src/views/productEntity.tsx +124 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../../src/lib/tenant.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,QAAW;AACtE,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,SAAS,CAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgPrC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locales/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGnE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pt-BR.d.ts","sourceRoot":"","sources":["../../src/locales/pt-BR.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgPvC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../src/registries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAsEtD,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAwClD,CAAA"}
|
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type StoreApi } from 'zustand/vanilla';
|
|
2
|
+
import type { InventoryDataProvider } from './data/types';
|
|
3
|
+
import type { Product, StockMovement, StockLocation, Recipe, InventorySummary, ProductQuery, MovementQuery, CreateProductInput, CreateStockMovementInput, CreateRecipeInput } from './types';
|
|
4
|
+
export interface InventoryUIState {
|
|
5
|
+
products: Product[];
|
|
6
|
+
productsTotal: number;
|
|
7
|
+
productsLoading: boolean;
|
|
8
|
+
productQuery: ProductQuery;
|
|
9
|
+
movements: StockMovement[];
|
|
10
|
+
movementsTotal: number;
|
|
11
|
+
movementsLoading: boolean;
|
|
12
|
+
locations: StockLocation[];
|
|
13
|
+
locationsLoading: boolean;
|
|
14
|
+
recipes: Recipe[];
|
|
15
|
+
recipesLoading: boolean;
|
|
16
|
+
summary: InventorySummary | null;
|
|
17
|
+
summaryLoading: boolean;
|
|
18
|
+
fetchSummary(): Promise<void>;
|
|
19
|
+
fetchProducts(query: ProductQuery): Promise<void>;
|
|
20
|
+
fetchMovements(query: MovementQuery): Promise<void>;
|
|
21
|
+
fetchLocations(): Promise<void>;
|
|
22
|
+
fetchRecipes(): Promise<void>;
|
|
23
|
+
createProduct(input: CreateProductInput): Promise<Product>;
|
|
24
|
+
createMovement(input: CreateStockMovementInput): Promise<StockMovement>;
|
|
25
|
+
createRecipe(input: CreateRecipeInput): Promise<Recipe>;
|
|
26
|
+
}
|
|
27
|
+
export declare function createInventoryStore(provider: InventoryDataProvider): StoreApi<InventoryUIState>;
|
|
28
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAG5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,KAAK,EACV,OAAO,EAAE,aAA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/types.d.ts
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/** Product classification — a product can have multiple types */
|
|
2
|
+
export type ProductType = 'ingredient' | 'sale' | 'intermediate' | 'asset';
|
|
3
|
+
/** Stock movement direction/reason */
|
|
4
|
+
export type MovementType = 'entry' | 'exit' | 'adjustment' | 'transfer' | 'loss';
|
|
5
|
+
/** Product purpose for filtering */
|
|
6
|
+
export type ProductPurpose = 'purchase' | 'sale' | 'both' | 'internal';
|
|
7
|
+
export interface Product {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
sku?: string;
|
|
12
|
+
barcode?: string;
|
|
13
|
+
brand?: string;
|
|
14
|
+
categoryId?: string;
|
|
15
|
+
categoryName?: string;
|
|
16
|
+
productType: ProductType;
|
|
17
|
+
purpose?: ProductPurpose;
|
|
18
|
+
currentQuantity: number;
|
|
19
|
+
minQuantity: number;
|
|
20
|
+
maxQuantity?: number;
|
|
21
|
+
costPrice: number;
|
|
22
|
+
salePrice?: number;
|
|
23
|
+
measurementUnitId?: string;
|
|
24
|
+
measurementUnitName?: string;
|
|
25
|
+
isActive: boolean;
|
|
26
|
+
supplierId?: string;
|
|
27
|
+
supplierName?: string;
|
|
28
|
+
defaultLocationId?: string;
|
|
29
|
+
imageUrl?: string;
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
tenantId: string;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
}
|
|
35
|
+
export interface StockMovement {
|
|
36
|
+
id: string;
|
|
37
|
+
productId: string;
|
|
38
|
+
productName?: string;
|
|
39
|
+
quantity: number;
|
|
40
|
+
movementType: MovementType;
|
|
41
|
+
unitCost: number;
|
|
42
|
+
totalCost: number;
|
|
43
|
+
stockLocationId?: string;
|
|
44
|
+
stockLocationName?: string;
|
|
45
|
+
destinationLocationId?: string;
|
|
46
|
+
destinationLocationName?: string;
|
|
47
|
+
supplierId?: string;
|
|
48
|
+
supplierName?: string;
|
|
49
|
+
documentNumber?: string;
|
|
50
|
+
reason?: string;
|
|
51
|
+
notes?: string;
|
|
52
|
+
movementDate: string;
|
|
53
|
+
userId?: string;
|
|
54
|
+
userName?: string;
|
|
55
|
+
metadata?: Record<string, unknown>;
|
|
56
|
+
tenantId: string;
|
|
57
|
+
createdAt: string;
|
|
58
|
+
}
|
|
59
|
+
export interface StockPosition {
|
|
60
|
+
id: string;
|
|
61
|
+
productId: string;
|
|
62
|
+
productName?: string;
|
|
63
|
+
quantity: number;
|
|
64
|
+
unitCost: number;
|
|
65
|
+
stockLocationId?: string;
|
|
66
|
+
stockLocationName?: string;
|
|
67
|
+
batchNumber?: string;
|
|
68
|
+
expirationDate?: string;
|
|
69
|
+
tenantId: string;
|
|
70
|
+
createdAt: string;
|
|
71
|
+
}
|
|
72
|
+
export interface StockLocation {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
isActive: boolean;
|
|
77
|
+
unitId?: string;
|
|
78
|
+
tenantId: string;
|
|
79
|
+
createdAt: string;
|
|
80
|
+
updatedAt: string;
|
|
81
|
+
}
|
|
82
|
+
export interface Recipe {
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
productId: string;
|
|
87
|
+
productName?: string;
|
|
88
|
+
yieldQuantity: number;
|
|
89
|
+
yieldUnitId?: string;
|
|
90
|
+
yieldUnitName?: string;
|
|
91
|
+
preparationTimeMinutes?: number;
|
|
92
|
+
instructions?: string;
|
|
93
|
+
isActive: boolean;
|
|
94
|
+
ingredientCount?: number;
|
|
95
|
+
tenantId: string;
|
|
96
|
+
createdAt: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
}
|
|
99
|
+
export interface RecipeIngredient {
|
|
100
|
+
id: string;
|
|
101
|
+
recipeId: string;
|
|
102
|
+
productId: string;
|
|
103
|
+
productName?: string;
|
|
104
|
+
quantity: number;
|
|
105
|
+
unitId?: string;
|
|
106
|
+
unitName?: string;
|
|
107
|
+
displayOrder: number;
|
|
108
|
+
notes?: string;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
}
|
|
111
|
+
export interface MeasurementUnit {
|
|
112
|
+
id: string;
|
|
113
|
+
name: string;
|
|
114
|
+
abbreviation: string;
|
|
115
|
+
isActive: boolean;
|
|
116
|
+
tenantId: string;
|
|
117
|
+
createdAt: string;
|
|
118
|
+
}
|
|
119
|
+
export interface ProductCategory {
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
parentId?: string;
|
|
123
|
+
isActive: boolean;
|
|
124
|
+
tenantId: string;
|
|
125
|
+
createdAt: string;
|
|
126
|
+
updatedAt: string;
|
|
127
|
+
}
|
|
128
|
+
export interface CreateProductInput {
|
|
129
|
+
name: string;
|
|
130
|
+
description?: string;
|
|
131
|
+
sku?: string;
|
|
132
|
+
barcode?: string;
|
|
133
|
+
brand?: string;
|
|
134
|
+
categoryId?: string;
|
|
135
|
+
productType: ProductType;
|
|
136
|
+
purpose?: ProductPurpose;
|
|
137
|
+
minQuantity?: number;
|
|
138
|
+
maxQuantity?: number;
|
|
139
|
+
costPrice?: number;
|
|
140
|
+
salePrice?: number;
|
|
141
|
+
measurementUnitId?: string;
|
|
142
|
+
supplierId?: string;
|
|
143
|
+
defaultLocationId?: string;
|
|
144
|
+
imageUrl?: string;
|
|
145
|
+
metadata?: Record<string, unknown>;
|
|
146
|
+
}
|
|
147
|
+
export interface CreateStockMovementInput {
|
|
148
|
+
productId: string;
|
|
149
|
+
quantity: number;
|
|
150
|
+
movementType: MovementType;
|
|
151
|
+
unitCost?: number;
|
|
152
|
+
stockLocationId?: string;
|
|
153
|
+
destinationLocationId?: string;
|
|
154
|
+
supplierId?: string;
|
|
155
|
+
documentNumber?: string;
|
|
156
|
+
reason?: string;
|
|
157
|
+
notes?: string;
|
|
158
|
+
movementDate?: string;
|
|
159
|
+
batchNumber?: string;
|
|
160
|
+
expirationDate?: string;
|
|
161
|
+
}
|
|
162
|
+
export interface CreateRecipeInput {
|
|
163
|
+
name: string;
|
|
164
|
+
description?: string;
|
|
165
|
+
productId: string;
|
|
166
|
+
yieldQuantity: number;
|
|
167
|
+
yieldUnitId?: string;
|
|
168
|
+
preparationTimeMinutes?: number;
|
|
169
|
+
instructions?: string;
|
|
170
|
+
ingredients: CreateRecipeIngredientInput[];
|
|
171
|
+
}
|
|
172
|
+
export interface CreateRecipeIngredientInput {
|
|
173
|
+
productId: string;
|
|
174
|
+
quantity: number;
|
|
175
|
+
unitId?: string;
|
|
176
|
+
displayOrder?: number;
|
|
177
|
+
notes?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface DateRange {
|
|
180
|
+
from: string;
|
|
181
|
+
to: string;
|
|
182
|
+
}
|
|
183
|
+
export interface ProductQuery {
|
|
184
|
+
productType?: ProductType;
|
|
185
|
+
categoryId?: string;
|
|
186
|
+
search?: string;
|
|
187
|
+
lowStockOnly?: boolean;
|
|
188
|
+
isActive?: boolean;
|
|
189
|
+
page?: number;
|
|
190
|
+
pageSize?: number;
|
|
191
|
+
}
|
|
192
|
+
export interface MovementQuery {
|
|
193
|
+
productId?: string;
|
|
194
|
+
movementType?: MovementType | MovementType[];
|
|
195
|
+
stockLocationId?: string;
|
|
196
|
+
dateRange?: DateRange;
|
|
197
|
+
search?: string;
|
|
198
|
+
page?: number;
|
|
199
|
+
pageSize?: number;
|
|
200
|
+
}
|
|
201
|
+
export interface PaginatedResult<T> {
|
|
202
|
+
data: T[];
|
|
203
|
+
total: number;
|
|
204
|
+
}
|
|
205
|
+
export interface InventorySummary {
|
|
206
|
+
totalProducts: number;
|
|
207
|
+
lowStockCount: number;
|
|
208
|
+
outOfStockCount: number;
|
|
209
|
+
totalStockValue: number;
|
|
210
|
+
recentMovementCount: number;
|
|
211
|
+
movementsByType: Record<MovementType, number>;
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
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Q,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAAA;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd;AAMD,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,eAAe,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;CAC9C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Inventory overview. KPIs and the activity panel are registered dashboard
|
|
4
|
+
* widgets (see ./dashboardWidgets), rendered through the shared DashboardCanvas;
|
|
5
|
+
* the stock-value KPI also surfaces on the global app home.
|
|
6
|
+
*/
|
|
7
|
+
export declare function DashboardView(): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DashboardView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardView.d.ts","sourceRoot":"","sources":["../../src/views/DashboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB;;;;GAIG;AACH,wBAAgB,aAAa,sBAE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MovementHistoryView.d.ts","sourceRoot":"","sources":["../../src/views/MovementHistoryView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAyB3D,wBAAgB,mBAAmB,CAAC,EAAE,YAAY,EAAE,GAAE;IAAE,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAAO,qBA8EjG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductCrudForm.d.ts","sourceRoot":"","sources":["../../src/views/ProductCrudForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAgBzB,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,qBAkF7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductFormView.d.ts","sourceRoot":"","sources":["../../src/views/ProductFormView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AA2ClD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,qBA+O7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductListView.d.ts","sourceRoot":"","sources":["../../src/views/ProductListView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AA6DlD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IACjD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B,qBA0CA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecipeDetailView.d.ts","sourceRoot":"","sources":["../../src/views/RecipeDetailView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAwClD,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,qBAuJ9F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecipeFormView.d.ts","sourceRoot":"","sources":["../../src/views/RecipeFormView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAsBvC,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,qBAoN9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecipesView.d.ts","sourceRoot":"","sources":["../../src/views/RecipesView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AA4BxC,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,qBA0EnG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MovementType, StockMovement } from '../types';
|
|
3
|
+
export declare function StockMovementView({ defaultType, onSaved, viewMovement }: {
|
|
4
|
+
defaultType: MovementType;
|
|
5
|
+
onSaved?: () => void;
|
|
6
|
+
viewMovement?: StockMovement;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=StockMovementView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StockMovementView.d.ts","sourceRoot":"","sources":["../../src/views/StockMovementView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAQ3D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAA;AAgH1E,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE;IACxE,WAAW,EAAE,YAAY,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,YAAY,CAAC,EAAE,aAAa,CAAA;CAC7B,qBAuYA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { StoreApi } from 'zustand';
|
|
2
|
+
import type { DashboardWidgetDef } from '@fayz-ai/core';
|
|
3
|
+
import { type ResolvedInventoryConfig } from '../InventoryContext';
|
|
4
|
+
import type { InventoryDataProvider } from '../data/types';
|
|
5
|
+
import type { InventoryUIState } from '../store';
|
|
6
|
+
export declare function createInventoryDashboardWidgets(ctx: {
|
|
7
|
+
config: ResolvedInventoryConfig;
|
|
8
|
+
provider: InventoryDataProvider;
|
|
9
|
+
store: StoreApi<InventoryUIState>;
|
|
10
|
+
}): DashboardWidgetDef[];
|
|
11
|
+
//# sourceMappingURL=dashboardWidgets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardWidgets.d.ts","sourceRoot":"","sources":["../../src/views/dashboardWidgets.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAMvD,OAAO,EAAmF,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AACnJ,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAiEhD,wBAAgB,+BAA+B,CAAC,GAAG,EAAE;IACnD,MAAM,EAAE,uBAAuB,CAAA;IAC/B,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;CAClC,GAAG,kBAAkB,EAAE,CAoBvB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EntityDef } from '@fayz-ai/core';
|
|
2
|
+
import { type InventoryCurrency, type ProductTypeOption } from '../InventoryContext';
|
|
3
|
+
type T = (key: string, params?: Record<string, string | number>) => string;
|
|
4
|
+
export declare function buildProductEntity(t: T, productTypes: ProductTypeOption[], currency: InventoryCurrency): EntityDef;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=productEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productEntity.d.ts","sourceRoot":"","sources":["../../src/views/productEntity.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,eAAe,CAAA;AACxD,OAAO,EAAkB,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAgBpG,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAA;AAE1E,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,CAAC,EACJ,YAAY,EAAE,iBAAiB,EAAE,EACjC,QAAQ,EAAE,iBAAiB,GAC1B,SAAS,CAmGX"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fayz-ai/plugin-inventory",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Fayz SDK — plugin-inventory plugin",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"source": "./src/index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
23
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"lucide-react": "^0.400.0",
|
|
27
|
+
"zustand": "^4.5.0",
|
|
28
|
+
"@tanstack/react-table": "^8.20.0",
|
|
29
|
+
"@fayz-ai/core": "^0.1.6",
|
|
30
|
+
"@fayz-ai/saas": "^0.1.6",
|
|
31
|
+
"@fayz-ai/ui": "^0.1.6"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/react": "^18.3.0",
|
|
35
|
+
"react": "^18.3.0",
|
|
36
|
+
"tsup": "^8.2.0",
|
|
37
|
+
"typescript": "^5.5.0",
|
|
38
|
+
"@types/react-dom": "^18.3.0"
|
|
39
|
+
},
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"keywords": [
|
|
42
|
+
"fayz",
|
|
43
|
+
"fayz-plugin",
|
|
44
|
+
"fayz-sdk"
|
|
45
|
+
],
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsup && tsc --emitDeclarationOnly --declaration --declarationMap --noEmit false",
|
|
51
|
+
"dev": "tsup --watch",
|
|
52
|
+
"typecheck": "tsc --noEmit",
|
|
53
|
+
"clean": "rm -rf dist"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createPluginContext, formatCurrency, type CurrencyConfig } from '@fayz-ai/saas'
|
|
2
|
+
import type { InventoryPluginLabels } from './index'
|
|
3
|
+
import type { InventoryDataProvider } from './data/types'
|
|
4
|
+
import type { InventoryUIState } from './store'
|
|
5
|
+
|
|
6
|
+
export interface InventoryModules {
|
|
7
|
+
recipes: boolean
|
|
8
|
+
stockLocations: boolean
|
|
9
|
+
batchTracking: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type InventoryCurrency = CurrencyConfig
|
|
13
|
+
|
|
14
|
+
export interface ProductTypeOption {
|
|
15
|
+
value: string
|
|
16
|
+
label: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface LocationOption {
|
|
20
|
+
id: string
|
|
21
|
+
name: string
|
|
22
|
+
isHQ?: boolean
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ResolvedInventoryConfig {
|
|
26
|
+
modules: InventoryModules
|
|
27
|
+
labels: InventoryPluginLabels
|
|
28
|
+
currency: InventoryCurrency
|
|
29
|
+
productTypes: ProductTypeOption[]
|
|
30
|
+
locations: LocationOption[]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const ctx = createPluginContext<ResolvedInventoryConfig, InventoryDataProvider, InventoryUIState>('InventoryPage')
|
|
34
|
+
|
|
35
|
+
export const InventoryContextProvider = ctx.ContextProvider
|
|
36
|
+
export const useInventoryConfig = ctx.useConfig
|
|
37
|
+
export const useInventoryProvider = ctx.useProvider
|
|
38
|
+
export const useInventoryStore = ctx.useStore
|
|
39
|
+
|
|
40
|
+
export { formatCurrency }
|