@happyvertical/smrt-manufacturing 0.53.5 → 0.54.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/AGENTS.md +18 -7
- package/README.md +70 -5
- package/agents/multilevel-and-runs.md +28 -0
- package/dist/collections/ProductionRunCollection.d.ts +15 -0
- package/dist/collections/ProductionRunCollection.d.ts.map +1 -0
- package/dist/collections/ProductionRunCompletionCollection.d.ts +14 -0
- package/dist/collections/ProductionRunCompletionCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +2 -0
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/index.d.ts +13 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +972 -81
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +630 -2
- package/dist/models/ProductionRun.d.ts +67 -0
- package/dist/models/ProductionRun.d.ts.map +1 -0
- package/dist/models/ProductionRunCompletion.d.ts +36 -0
- package/dist/models/ProductionRunCompletion.d.ts.map +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/operation-types.d.ts +9 -0
- package/dist/operation-types.d.ts.map +1 -1
- package/dist/production-run-types.d.ts +100 -0
- package/dist/production-run-types.d.ts.map +1 -0
- package/dist/quantity.d.ts +36 -0
- package/dist/quantity.d.ts.map +1 -0
- package/dist/services/AssemblyService.d.ts +7 -2
- package/dist/services/AssemblyService.d.ts.map +1 -1
- package/dist/services/BomService.d.ts +84 -5
- package/dist/services/BomService.d.ts.map +1 -1
- package/dist/services/ProductionRunService.d.ts +123 -0
- package/dist/services/ProductionRunService.d.ts.map +1 -0
- package/dist/services/ProductionService.d.ts +11 -0
- package/dist/services/ProductionService.d.ts.map +1 -1
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/structure-walk.d.ts +77 -0
- package/dist/services/structure-walk.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +514 -9
- package/dist/svelte/components/AssemblyForm.svelte +423 -52
- package/dist/svelte/components/AssemblyForm.svelte.d.ts +17 -32
- package/dist/svelte/components/AssemblyForm.svelte.d.ts.map +1 -1
- package/dist/svelte/components/AssemblyList.svelte +18 -12
- package/dist/svelte/components/AssemblyList.svelte.d.ts +2 -13
- package/dist/svelte/components/AssemblyList.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ProductionRunList.svelte +213 -0
- package/dist/svelte/components/ProductionRunList.svelte.d.ts +18 -0
- package/dist/svelte/components/ProductionRunList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/RequirementsTree.svelte +125 -0
- package/dist/svelte/components/RequirementsTree.svelte.d.ts +13 -0
- package/dist/svelte/components/RequirementsTree.svelte.d.ts.map +1 -0
- package/dist/svelte/components/RequirementsTreeLevel.svelte +120 -0
- package/dist/svelte/components/RequirementsTreeLevel.svelte.d.ts +12 -0
- package/dist/svelte/components/RequirementsTreeLevel.svelte.d.ts.map +1 -0
- package/dist/svelte/i18n.d.ts +55 -0
- package/dist/svelte/i18n.d.ts.map +1 -1
- package/dist/svelte/i18n.js +55 -0
- package/dist/svelte/index.d.ts +11 -6
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +11 -6
- package/dist/svelte/types.d.ts +182 -0
- package/dist/svelte/types.d.ts.map +1 -1
- package/dist/svelte/types.js +250 -0
- package/dist/tenant-scope.d.ts +25 -0
- package/dist/tenant-scope.d.ts.map +1 -0
- package/dist/types.d.ts +207 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +13 -1
- package/dist/types.js.map +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +23 -1
- package/dist/ui.js.map +1 -1
- package/package.json +10 -10
package/dist/types.d.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
+
import type { LabourEstimate } from './operation-types.js';
|
|
11
|
+
import type { ComponentKind } from './services/AssemblyService.js';
|
|
10
12
|
/**
|
|
11
13
|
* Lifecycle state of a {@link BillOfMaterials}.
|
|
12
14
|
*
|
|
@@ -50,6 +52,13 @@ export interface BomLineCost {
|
|
|
50
52
|
* flag lets UIs warn the user that the cost rollup is incomplete.
|
|
51
53
|
*/
|
|
52
54
|
costUnavailable: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Multi-level only: the active bill this sub-assembly line was rolled up
|
|
57
|
+
* from. `unitCost` is then that bill's material cost per unit.
|
|
58
|
+
*/
|
|
59
|
+
subBomId?: string;
|
|
60
|
+
/** Multi-level only: the sub-assembly bill's own lines, rolled up the same way. */
|
|
61
|
+
components?: BomLineCost[];
|
|
53
62
|
}
|
|
54
63
|
/**
|
|
55
64
|
* Aggregate cost rollup returned by {@link BomService.computeMaterialCost}.
|
|
@@ -64,8 +73,9 @@ export interface BomCostRollup {
|
|
|
64
73
|
/** Per-line breakdown. Empty array when the BOM has no lines. */
|
|
65
74
|
lineBreakdown: BomLineCost[];
|
|
66
75
|
/**
|
|
67
|
-
* `true` when at least one line's unit cost could not be resolved
|
|
68
|
-
* Callers should treat `totalCost` as a lower bound in that
|
|
76
|
+
* `true` when at least one line's unit cost could not be resolved, at any
|
|
77
|
+
* level walked. Callers should treat `totalCost` as a lower bound in that
|
|
78
|
+
* case.
|
|
69
79
|
*/
|
|
70
80
|
hasMissingCosts: boolean;
|
|
71
81
|
}
|
|
@@ -83,14 +93,36 @@ export interface MaterialRequirement {
|
|
|
83
93
|
}
|
|
84
94
|
/**
|
|
85
95
|
* A single shortage discovered by {@link BomService.canProduce}.
|
|
96
|
+
*
|
|
97
|
+
* A single-level check (the default) reports one entry per component SKU
|
|
98
|
+
* with the run's total and the SKU's whole available stock. A multi-level
|
|
99
|
+
* check (`{ levels }`) reports each shortage on the line where it occurs, so
|
|
100
|
+
* the same SKU can appear once per place it is used, and adds `level`,
|
|
101
|
+
* `path`, `uom` and `buildable`.
|
|
86
102
|
*/
|
|
87
103
|
export interface MaterialShortage {
|
|
88
104
|
/** Plain string reference to the missing component {@link Sku}. */
|
|
89
105
|
componentSkuId: string;
|
|
90
106
|
/** Total quantity required for the requested production run. */
|
|
91
107
|
requested: number;
|
|
92
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Available stock across all locations (`available` state). In a
|
|
110
|
+
* multi-level check, the part of it not already allocated to lines planned
|
|
111
|
+
* earlier in the walk.
|
|
112
|
+
*/
|
|
93
113
|
available: number;
|
|
114
|
+
/** Multi-level only: the level of the line that is short (1 = the bill's own lines). */
|
|
115
|
+
level?: number;
|
|
116
|
+
/** Multi-level only: the bills from the top down to the one the line is on. */
|
|
117
|
+
path?: ExplosionPathEntry[];
|
|
118
|
+
/** Multi-level only: the line's unit of measure. */
|
|
119
|
+
uom?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Multi-level only: `true` for a sub-assembly with an active bill that the
|
|
122
|
+
* walk did not open because the `levels` limit was reached. It is short,
|
|
123
|
+
* but could be built.
|
|
124
|
+
*/
|
|
125
|
+
buildable?: boolean;
|
|
94
126
|
}
|
|
95
127
|
/**
|
|
96
128
|
* Result returned by {@link BomService.canProduce}.
|
|
@@ -126,4 +158,176 @@ export declare class NoActiveBomForProductError extends Error {
|
|
|
126
158
|
name: string;
|
|
127
159
|
constructor(productId: string);
|
|
128
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* How many bill levels a walk reads. `1` is the bill's own lines only (the
|
|
163
|
+
* single-level behaviour every method keeps by default); `2` also opens each
|
|
164
|
+
* sub-assembly's active bill; and so on. `'all'` walks down to materials,
|
|
165
|
+
* bought items and assemblies without an active bill, up to
|
|
166
|
+
* {@link MAX_EXPLOSION_DEPTH} levels.
|
|
167
|
+
*/
|
|
168
|
+
export type ExplosionLevels = number | 'all';
|
|
169
|
+
/** Options for the multi-level forms of the {@link BomService} methods. */
|
|
170
|
+
export interface ExplosionOptions {
|
|
171
|
+
/** How deep to walk. Default `1`. See {@link ExplosionLevels}. */
|
|
172
|
+
levels?: ExplosionLevels;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The deepest structure a walk opens. A numeric `levels` above it is refused;
|
|
176
|
+
* `'all'` on a structure deeper than this fails with
|
|
177
|
+
* {@link BomExplosionLimitError} rather than running unbounded.
|
|
178
|
+
*/
|
|
179
|
+
export declare const MAX_EXPLOSION_DEPTH = 32;
|
|
180
|
+
/**
|
|
181
|
+
* The most lines one walk returns. A structure that shares sub-assemblies
|
|
182
|
+
* widely can multiply out; past this a walk fails with
|
|
183
|
+
* {@link BomExplosionLimitError}.
|
|
184
|
+
*/
|
|
185
|
+
export declare const MAX_EXPLOSION_LINES = 10000;
|
|
186
|
+
/** One bill on the way down a multi-level walk. */
|
|
187
|
+
export interface ExplosionPathEntry {
|
|
188
|
+
/** The bill. */
|
|
189
|
+
bomId: string;
|
|
190
|
+
/** The product the bill makes. */
|
|
191
|
+
productId: string;
|
|
192
|
+
/** The product's name, or its id when it has none or cannot be read. */
|
|
193
|
+
name: string;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* One bill line in a multi-level walk, in depth-first order: an expanded
|
|
197
|
+
* sub-assembly is followed by its own bill's lines.
|
|
198
|
+
*/
|
|
199
|
+
export interface ExplodedLine {
|
|
200
|
+
/** The `BomLine` id. */
|
|
201
|
+
lineId: string;
|
|
202
|
+
/** The bill the line is on. */
|
|
203
|
+
bomId: string;
|
|
204
|
+
/** 1 for the top bill's own lines, 2 for a sub-assembly's lines, ... */
|
|
205
|
+
level: number;
|
|
206
|
+
/** The bills from the top down to the one this line is on (`level` entries). */
|
|
207
|
+
path: ExplosionPathEntry[];
|
|
208
|
+
/** The component SKU. */
|
|
209
|
+
componentSkuId: string;
|
|
210
|
+
/** What the component is (see `AssemblyService.resolveComponent`). */
|
|
211
|
+
kind: ComponentKind;
|
|
212
|
+
/** The component product's name; `''` when it cannot be resolved. */
|
|
213
|
+
name: string;
|
|
214
|
+
/** The component SKU's code; `''` when it cannot be resolved. */
|
|
215
|
+
skuCode: string;
|
|
216
|
+
/** Quantity per unit of the parent, as on the line (before waste). */
|
|
217
|
+
qtyPerUnit: number;
|
|
218
|
+
/** Waste percent on the line. */
|
|
219
|
+
wastePercent: number;
|
|
220
|
+
/** Quantity per unit of the parent including this line's waste. */
|
|
221
|
+
effectiveQtyPerUnit: number;
|
|
222
|
+
/** The line's own unit of measure; never converted. */
|
|
223
|
+
uom: string;
|
|
224
|
+
/**
|
|
225
|
+
* Quantity needed for the run: the parent's quantity times
|
|
226
|
+
* `effectiveQtyPerUnit`, so waste compounds down the levels.
|
|
227
|
+
*/
|
|
228
|
+
totalQty: number;
|
|
229
|
+
/** `true` for a sub-assembly with an active bill (it can be built here). */
|
|
230
|
+
buildable: boolean;
|
|
231
|
+
/** The sub-assembly's active bill id, or `null`. */
|
|
232
|
+
subBomId: string | null;
|
|
233
|
+
/** `true` when the sub-assembly's bill was opened: its lines follow this one. */
|
|
234
|
+
expanded: boolean;
|
|
235
|
+
}
|
|
236
|
+
/** Result of {@link BomService.explode}: the gross multi-level requirements. */
|
|
237
|
+
export interface Explosion {
|
|
238
|
+
/** The top bill. */
|
|
239
|
+
bomId: string;
|
|
240
|
+
/** The product the top bill makes. */
|
|
241
|
+
productId: string;
|
|
242
|
+
/** Units of the top product the run makes. */
|
|
243
|
+
qty: number;
|
|
244
|
+
/** The `levels` the walk used. */
|
|
245
|
+
levels: ExplosionLevels;
|
|
246
|
+
/** Every line walked, depth first. */
|
|
247
|
+
lines: ExplodedLine[];
|
|
248
|
+
/**
|
|
249
|
+
* The rolled-up shopping list: every line that was not expanded (materials,
|
|
250
|
+
* bought items, missing components, sub-assemblies without an active bill
|
|
251
|
+
* or past the `levels` limit), summed per component SKU. As in the
|
|
252
|
+
* single-level form, a SKU listed in two units keeps the first unit.
|
|
253
|
+
*/
|
|
254
|
+
totals: MaterialRequirement[];
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* One line of {@link RequirementsPlan}. `totalQty` is the *net* quantity: the
|
|
258
|
+
* run's quantity for the top bill's lines, and only a sub-assembly's
|
|
259
|
+
* shortfall for the lines of its bill.
|
|
260
|
+
*/
|
|
261
|
+
export interface PlannedLine extends ExplodedLine {
|
|
262
|
+
/**
|
|
263
|
+
* Available stock of the component (all locations) not already allocated
|
|
264
|
+
* to lines planned earlier in the walk, so stock used once is not counted
|
|
265
|
+
* twice.
|
|
266
|
+
*/
|
|
267
|
+
available: number;
|
|
268
|
+
/** `totalQty` minus what `available` covers; `0` when covered. */
|
|
269
|
+
short: number;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Result of {@link BomService.planRequirements}: facts for deciding what to
|
|
273
|
+
* build, buy or pull. A sub-assembly that is short and has an active bill is
|
|
274
|
+
* opened for its shortfall only; whether the application builds or buys it is
|
|
275
|
+
* the application's decision.
|
|
276
|
+
*/
|
|
277
|
+
export interface RequirementsPlan {
|
|
278
|
+
/** The top bill. */
|
|
279
|
+
bomId: string;
|
|
280
|
+
/** The product the top bill makes. */
|
|
281
|
+
productId: string;
|
|
282
|
+
/** Units of the top product the run makes. */
|
|
283
|
+
qty: number;
|
|
284
|
+
/** The `levels` the walk used. */
|
|
285
|
+
levels: ExplosionLevels;
|
|
286
|
+
/** Every line planned, depth first. */
|
|
287
|
+
lines: PlannedLine[];
|
|
288
|
+
/**
|
|
289
|
+
* Every line that is short and was not opened (a material, a bought item,
|
|
290
|
+
* a missing component, or a sub-assembly with no active bill or past the
|
|
291
|
+
* `levels` limit), reported at its own level.
|
|
292
|
+
*/
|
|
293
|
+
shortages: MaterialShortage[];
|
|
294
|
+
/** `true` when `shortages` is empty. */
|
|
295
|
+
ok: boolean;
|
|
296
|
+
}
|
|
297
|
+
/** One sub-assembly's labour in a multi-level {@link LabourEstimate}. */
|
|
298
|
+
export interface SubAssemblyLabour {
|
|
299
|
+
/** The line naming the sub-assembly. */
|
|
300
|
+
lineId: string;
|
|
301
|
+
/** The sub-assembly's component SKU. */
|
|
302
|
+
componentSkuId: string;
|
|
303
|
+
/** The sub-assembly's name. */
|
|
304
|
+
name: string;
|
|
305
|
+
/** The level of the line naming it (1 = on the top bill). */
|
|
306
|
+
level: number;
|
|
307
|
+
/** The bills from the top down to the one the line is on. */
|
|
308
|
+
path: ExplosionPathEntry[];
|
|
309
|
+
/**
|
|
310
|
+
* Units of the sub-assembly per unit of the top product, waste compounded
|
|
311
|
+
* through every level above.
|
|
312
|
+
*/
|
|
313
|
+
unitsPerUnit: number;
|
|
314
|
+
/** The sub-assembly bill's own routing, per unit of the sub-assembly. */
|
|
315
|
+
estimate: LabourEstimate;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Thrown when a multi-level walk would exceed {@link MAX_EXPLOSION_DEPTH}
|
|
319
|
+
* levels (with `levels: 'all'`) or {@link MAX_EXPLOSION_LINES} lines.
|
|
320
|
+
*/
|
|
321
|
+
export declare class BomExplosionLimitError extends Error {
|
|
322
|
+
/** The bill the walk started from. */
|
|
323
|
+
readonly bomId: string;
|
|
324
|
+
/** Which limit was reached. */
|
|
325
|
+
readonly limit: 'depth' | 'lines';
|
|
326
|
+
name: string;
|
|
327
|
+
constructor(
|
|
328
|
+
/** The bill the walk started from. */
|
|
329
|
+
bomId: string,
|
|
330
|
+
/** Which limit was reached. */
|
|
331
|
+
limit: 'depth' | 'lines');
|
|
332
|
+
}
|
|
129
333
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;I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,+BAA+B;aACf,KAAK,EAAE,OAAO,GAAG,OAAO;IANjC,IAAI,SAA4B;;IAGvC,sCAAsC;IACtB,KAAK,EAAE,MAAM;IAC7B,+BAA+B;IACf,KAAK,EAAE,OAAO,GAAG,OAAO;CAQ3C"}
|
package/dist/types.js
CHANGED
|
@@ -15,7 +15,19 @@ var NoActiveBomForProductError = class extends Error {
|
|
|
15
15
|
productId;
|
|
16
16
|
name = "NoActiveBomForProductError";
|
|
17
17
|
};
|
|
18
|
+
var MAX_EXPLOSION_DEPTH = 32;
|
|
19
|
+
var MAX_EXPLOSION_LINES = 1e4;
|
|
20
|
+
var BomExplosionLimitError = class extends Error {
|
|
21
|
+
constructor(bomId, limit) {
|
|
22
|
+
super(limit === "depth" ? `Bill ${bomId} is nested deeper than 32 levels.` : `Bill ${bomId} explodes to more than ${MAX_EXPLOSION_LINES} lines.`);
|
|
23
|
+
this.bomId = bomId;
|
|
24
|
+
this.limit = limit;
|
|
25
|
+
}
|
|
26
|
+
bomId;
|
|
27
|
+
limit;
|
|
28
|
+
name = "BomExplosionLimitError";
|
|
29
|
+
};
|
|
18
30
|
//#endregion
|
|
19
|
-
export { BomNotFoundError, NoActiveBomForProductError };
|
|
31
|
+
export { BomExplosionLimitError, BomNotFoundError, MAX_EXPLOSION_DEPTH, MAX_EXPLOSION_LINES, NoActiveBomForProductError };
|
|
20
32
|
|
|
21
33
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Shared types and error classes for `@happyvertical/smrt-manufacturing`.\n *\n * Strictly industry-neutral. The same vocabulary serves apparel, furniture,\n * automotive, CPG, electronics, food production, custom hardware, and any\n * other vertical that builds finished goods from raw inputs by recipe.\n *\n * @packageDocumentation\n */\n\n/**\n * Lifecycle state of a {@link BillOfMaterials}.\n *\n * - `draft` — under construction; not yet released for production. Cost\n * rollups can still be computed, but the BOM should not yet be referenced\n * by a production order.\n * - `active` — currently in use. New production orders should reference the\n * active BOM for a given product.\n * - `superseded` — an older revision that has been replaced by a newer\n * `active` BOM. Historical production orders may still reference the\n * superseded row for audit, but no new orders should pick it up.\n */\nexport type BomStatus = 'draft' | 'active' | 'superseded';\n\n/**\n * Per-line cost breakdown returned by {@link BomService.computeMaterialCost}.\n * Lets callers surface \"here's where the $42 came from\" UIs without\n * recomputing on the client.\n */\nexport interface BomLineCost {\n /**\n * Plain string reference to a component SKU id. The `Sku` model\n * itself lives in `@happyvertical/smrt-products`; inventory only\n * tracks stock motion against that id.\n */\n componentSkuId: string;\n /** Quantity per produced unit (pre-waste). */\n qtyPerUnit: number;\n /** Waste percent applied to this line (`0` if none). */\n wastePercent: number;\n /** Effective quantity used per produced unit, including waste. */\n effectiveQty: number;\n /** Latest known unit cost, or `0` if unavailable. */\n unitCost: number;\n /** Effective unit-cost contribution to the rolled-up total. */\n lineCost: number;\n /** Unit of measure as declared on the line (`'yards'`, `'each'`, ...). */\n uom: string;\n /**\n * `true` when the unit cost could not be resolved from upstream\n * `smrt-products`. The line still contributes `0` to the total; the\n * flag lets UIs warn the user that the cost rollup is incomplete.\n */\n costUnavailable: boolean;\n}\n\n/**\n * Aggregate cost rollup returned by {@link BomService.computeMaterialCost}.\n */\nexport interface BomCostRollup {\n /** BOM that was rolled up. */\n bomId: string;\n /** Total material cost per produced unit. */\n totalCost: number;\n /** ISO 4217 currency code. Defaults to `'USD'`. */\n currency: string;\n /** Per-line breakdown. Empty array when the BOM has no lines. */\n lineBreakdown: BomLineCost[];\n /**\n * `true` when at least one line's unit cost could not be resolved.\n * Callers should treat `totalCost` as a lower bound in that case.\n */\n hasMissingCosts: boolean;\n}\n\n/**\n * A single entry on a requirements explosion. Multiple BOM lines pointing\n * at the same component SKU are summed.\n */\nexport interface MaterialRequirement {\n /** Plain string reference to the required component {@link Sku}. */\n componentSkuId: string;\n /** Total quantity needed across the full production run (waste included). */\n totalQty: number;\n /** Unit of measure carried over from the originating BOM line(s). */\n uom: string;\n}\n\n/**\n * A single shortage discovered by {@link BomService.canProduce}.\n */\nexport interface MaterialShortage {\n /** Plain string reference to the missing component {@link Sku}. */\n componentSkuId: string;\n /** Total quantity required for the requested production run. */\n requested: number;\n /** Available stock across all locations (`available` state). */\n available: number;\n}\n\n/**\n * Result returned by {@link BomService.canProduce}.\n *\n * `ok: true` means every material requirement is currently covered by\n * available stock; `ok: false` means at least one component is short.\n */\nexport type CanProduceResult =\n | { ok: true; shortages: [] }\n | { ok: false; shortages: MaterialShortage[] };\n\n/**\n * Thrown when a service operation needs to resolve a BOM by id but the row\n * does not exist. Carries the requested id so callers can surface a\n * meaningful message.\n */\nexport class BomNotFoundError extends Error {\n override name = 'BomNotFoundError';\n\n constructor(public readonly bomId: string) {\n super(`Bill of Materials not found: ${bomId}`);\n }\n}\n\n/**\n * Thrown when a production-order operation needs a BOM to plan against but\n * no active BOM is currently registered for the production order's\n * `productId`. The caller should either link a BOM by passing one in\n * explicitly or activate one for the given product.\n */\nexport class NoActiveBomForProductError extends Error {\n override name = 'NoActiveBomForProductError';\n\n constructor(public readonly productId: string) {\n super(\n `No active Bill of Materials found for product: ${productId}. ` +\n `Activate a BOM for this product or pass one explicitly.`,\n );\n }\n}\n"],"mappings":";AAmHO,IAAM,mBAAN,cAA+B,MAAM;CAG1C,YAA4B,OAAe;EACzC,MAAM,gCAAgC,OAAO;EADnB,KAAA,QAAA;CAE5B;CAF4B;CAFnB,OAAO;AAKlB;AAQO,IAAM,6BAAN,cAAyC,MAAM;CAGpD,YAA4B,WAAmB;EAC7C,MACE,kDAAkD,UAAS,0DAE7D;EAJ0B,KAAA,YAAA;CAK5B;CAL4B;CAFnB,OAAO;AAQlB"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Shared types and error classes for `@happyvertical/smrt-manufacturing`.\n *\n * Strictly industry-neutral. The same vocabulary serves apparel, furniture,\n * automotive, CPG, electronics, food production, custom hardware, and any\n * other vertical that builds finished goods from raw inputs by recipe.\n *\n * @packageDocumentation\n */\n\nimport type { LabourEstimate } from './operation-types.js';\nimport type { ComponentKind } from './services/AssemblyService.js';\n\n/**\n * Lifecycle state of a {@link BillOfMaterials}.\n *\n * - `draft` — under construction; not yet released for production. Cost\n * rollups can still be computed, but the BOM should not yet be referenced\n * by a production order.\n * - `active` — currently in use. New production orders should reference the\n * active BOM for a given product.\n * - `superseded` — an older revision that has been replaced by a newer\n * `active` BOM. Historical production orders may still reference the\n * superseded row for audit, but no new orders should pick it up.\n */\nexport type BomStatus = 'draft' | 'active' | 'superseded';\n\n/**\n * Per-line cost breakdown returned by {@link BomService.computeMaterialCost}.\n * Lets callers surface \"here's where the $42 came from\" UIs without\n * recomputing on the client.\n */\nexport interface BomLineCost {\n /**\n * Plain string reference to a component SKU id. The `Sku` model\n * itself lives in `@happyvertical/smrt-products`; inventory only\n * tracks stock motion against that id.\n */\n componentSkuId: string;\n /** Quantity per produced unit (pre-waste). */\n qtyPerUnit: number;\n /** Waste percent applied to this line (`0` if none). */\n wastePercent: number;\n /** Effective quantity used per produced unit, including waste. */\n effectiveQty: number;\n /** Latest known unit cost, or `0` if unavailable. */\n unitCost: number;\n /** Effective unit-cost contribution to the rolled-up total. */\n lineCost: number;\n /** Unit of measure as declared on the line (`'yards'`, `'each'`, ...). */\n uom: string;\n /**\n * `true` when the unit cost could not be resolved from upstream\n * `smrt-products`. The line still contributes `0` to the total; the\n * flag lets UIs warn the user that the cost rollup is incomplete.\n */\n costUnavailable: boolean;\n /**\n * Multi-level only: the active bill this sub-assembly line was rolled up\n * from. `unitCost` is then that bill's material cost per unit.\n */\n subBomId?: string;\n /** Multi-level only: the sub-assembly bill's own lines, rolled up the same way. */\n components?: BomLineCost[];\n}\n\n/**\n * Aggregate cost rollup returned by {@link BomService.computeMaterialCost}.\n */\nexport interface BomCostRollup {\n /** BOM that was rolled up. */\n bomId: string;\n /** Total material cost per produced unit. */\n totalCost: number;\n /** ISO 4217 currency code. Defaults to `'USD'`. */\n currency: string;\n /** Per-line breakdown. Empty array when the BOM has no lines. */\n lineBreakdown: BomLineCost[];\n /**\n * `true` when at least one line's unit cost could not be resolved, at any\n * level walked. Callers should treat `totalCost` as a lower bound in that\n * case.\n */\n hasMissingCosts: boolean;\n}\n\n/**\n * A single entry on a requirements explosion. Multiple BOM lines pointing\n * at the same component SKU are summed.\n */\nexport interface MaterialRequirement {\n /** Plain string reference to the required component {@link Sku}. */\n componentSkuId: string;\n /** Total quantity needed across the full production run (waste included). */\n totalQty: number;\n /** Unit of measure carried over from the originating BOM line(s). */\n uom: string;\n}\n\n/**\n * A single shortage discovered by {@link BomService.canProduce}.\n *\n * A single-level check (the default) reports one entry per component SKU\n * with the run's total and the SKU's whole available stock. A multi-level\n * check (`{ levels }`) reports each shortage on the line where it occurs, so\n * the same SKU can appear once per place it is used, and adds `level`,\n * `path`, `uom` and `buildable`.\n */\nexport interface MaterialShortage {\n /** Plain string reference to the missing component {@link Sku}. */\n componentSkuId: string;\n /** Total quantity required for the requested production run. */\n requested: number;\n /**\n * Available stock across all locations (`available` state). In a\n * multi-level check, the part of it not already allocated to lines planned\n * earlier in the walk.\n */\n available: number;\n /** Multi-level only: the level of the line that is short (1 = the bill's own lines). */\n level?: number;\n /** Multi-level only: the bills from the top down to the one the line is on. */\n path?: ExplosionPathEntry[];\n /** Multi-level only: the line's unit of measure. */\n uom?: string;\n /**\n * Multi-level only: `true` for a sub-assembly with an active bill that the\n * walk did not open because the `levels` limit was reached. It is short,\n * but could be built.\n */\n buildable?: boolean;\n}\n\n/**\n * Result returned by {@link BomService.canProduce}.\n *\n * `ok: true` means every material requirement is currently covered by\n * available stock; `ok: false` means at least one component is short.\n */\nexport type CanProduceResult =\n | { ok: true; shortages: [] }\n | { ok: false; shortages: MaterialShortage[] };\n\n/**\n * Thrown when a service operation needs to resolve a BOM by id but the row\n * does not exist. Carries the requested id so callers can surface a\n * meaningful message.\n */\nexport class BomNotFoundError extends Error {\n override name = 'BomNotFoundError';\n\n constructor(public readonly bomId: string) {\n super(`Bill of Materials not found: ${bomId}`);\n }\n}\n\n/**\n * Thrown when a production-order operation needs a BOM to plan against but\n * no active BOM is currently registered for the production order's\n * `productId`. The caller should either link a BOM by passing one in\n * explicitly or activate one for the given product.\n */\nexport class NoActiveBomForProductError extends Error {\n override name = 'NoActiveBomForProductError';\n\n constructor(public readonly productId: string) {\n super(\n `No active Bill of Materials found for product: ${productId}. ` +\n `Activate a BOM for this product or pass one explicitly.`,\n );\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Multi-level walks (sub-assemblies)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * How many bill levels a walk reads. `1` is the bill's own lines only (the\n * single-level behaviour every method keeps by default); `2` also opens each\n * sub-assembly's active bill; and so on. `'all'` walks down to materials,\n * bought items and assemblies without an active bill, up to\n * {@link MAX_EXPLOSION_DEPTH} levels.\n */\nexport type ExplosionLevels = number | 'all';\n\n/** Options for the multi-level forms of the {@link BomService} methods. */\nexport interface ExplosionOptions {\n /** How deep to walk. Default `1`. See {@link ExplosionLevels}. */\n levels?: ExplosionLevels;\n}\n\n/**\n * The deepest structure a walk opens. A numeric `levels` above it is refused;\n * `'all'` on a structure deeper than this fails with\n * {@link BomExplosionLimitError} rather than running unbounded.\n */\nexport const MAX_EXPLOSION_DEPTH = 32;\n\n/**\n * The most lines one walk returns. A structure that shares sub-assemblies\n * widely can multiply out; past this a walk fails with\n * {@link BomExplosionLimitError}.\n */\nexport const MAX_EXPLOSION_LINES = 10_000;\n\n/** One bill on the way down a multi-level walk. */\nexport interface ExplosionPathEntry {\n /** The bill. */\n bomId: string;\n /** The product the bill makes. */\n productId: string;\n /** The product's name, or its id when it has none or cannot be read. */\n name: string;\n}\n\n/**\n * One bill line in a multi-level walk, in depth-first order: an expanded\n * sub-assembly is followed by its own bill's lines.\n */\nexport interface ExplodedLine {\n /** The `BomLine` id. */\n lineId: string;\n /** The bill the line is on. */\n bomId: string;\n /** 1 for the top bill's own lines, 2 for a sub-assembly's lines, ... */\n level: number;\n /** The bills from the top down to the one this line is on (`level` entries). */\n path: ExplosionPathEntry[];\n /** The component SKU. */\n componentSkuId: string;\n /** What the component is (see `AssemblyService.resolveComponent`). */\n kind: ComponentKind;\n /** The component product's name; `''` when it cannot be resolved. */\n name: string;\n /** The component SKU's code; `''` when it cannot be resolved. */\n skuCode: string;\n /** Quantity per unit of the parent, as on the line (before waste). */\n qtyPerUnit: number;\n /** Waste percent on the line. */\n wastePercent: number;\n /** Quantity per unit of the parent including this line's waste. */\n effectiveQtyPerUnit: number;\n /** The line's own unit of measure; never converted. */\n uom: string;\n /**\n * Quantity needed for the run: the parent's quantity times\n * `effectiveQtyPerUnit`, so waste compounds down the levels.\n */\n totalQty: number;\n /** `true` for a sub-assembly with an active bill (it can be built here). */\n buildable: boolean;\n /** The sub-assembly's active bill id, or `null`. */\n subBomId: string | null;\n /** `true` when the sub-assembly's bill was opened: its lines follow this one. */\n expanded: boolean;\n}\n\n/** Result of {@link BomService.explode}: the gross multi-level requirements. */\nexport interface Explosion {\n /** The top bill. */\n bomId: string;\n /** The product the top bill makes. */\n productId: string;\n /** Units of the top product the run makes. */\n qty: number;\n /** The `levels` the walk used. */\n levels: ExplosionLevels;\n /** Every line walked, depth first. */\n lines: ExplodedLine[];\n /**\n * The rolled-up shopping list: every line that was not expanded (materials,\n * bought items, missing components, sub-assemblies without an active bill\n * or past the `levels` limit), summed per component SKU. As in the\n * single-level form, a SKU listed in two units keeps the first unit.\n */\n totals: MaterialRequirement[];\n}\n\n/**\n * One line of {@link RequirementsPlan}. `totalQty` is the *net* quantity: the\n * run's quantity for the top bill's lines, and only a sub-assembly's\n * shortfall for the lines of its bill.\n */\nexport interface PlannedLine extends ExplodedLine {\n /**\n * Available stock of the component (all locations) not already allocated\n * to lines planned earlier in the walk, so stock used once is not counted\n * twice.\n */\n available: number;\n /** `totalQty` minus what `available` covers; `0` when covered. */\n short: number;\n}\n\n/**\n * Result of {@link BomService.planRequirements}: facts for deciding what to\n * build, buy or pull. A sub-assembly that is short and has an active bill is\n * opened for its shortfall only; whether the application builds or buys it is\n * the application's decision.\n */\nexport interface RequirementsPlan {\n /** The top bill. */\n bomId: string;\n /** The product the top bill makes. */\n productId: string;\n /** Units of the top product the run makes. */\n qty: number;\n /** The `levels` the walk used. */\n levels: ExplosionLevels;\n /** Every line planned, depth first. */\n lines: PlannedLine[];\n /**\n * Every line that is short and was not opened (a material, a bought item,\n * a missing component, or a sub-assembly with no active bill or past the\n * `levels` limit), reported at its own level.\n */\n shortages: MaterialShortage[];\n /** `true` when `shortages` is empty. */\n ok: boolean;\n}\n\n/** One sub-assembly's labour in a multi-level {@link LabourEstimate}. */\nexport interface SubAssemblyLabour {\n /** The line naming the sub-assembly. */\n lineId: string;\n /** The sub-assembly's component SKU. */\n componentSkuId: string;\n /** The sub-assembly's name. */\n name: string;\n /** The level of the line naming it (1 = on the top bill). */\n level: number;\n /** The bills from the top down to the one the line is on. */\n path: ExplosionPathEntry[];\n /**\n * Units of the sub-assembly per unit of the top product, waste compounded\n * through every level above.\n */\n unitsPerUnit: number;\n /** The sub-assembly bill's own routing, per unit of the sub-assembly. */\n estimate: LabourEstimate;\n}\n\n/**\n * Thrown when a multi-level walk would exceed {@link MAX_EXPLOSION_DEPTH}\n * levels (with `levels: 'all'`) or {@link MAX_EXPLOSION_LINES} lines.\n */\nexport class BomExplosionLimitError extends Error {\n override name = 'BomExplosionLimitError';\n\n constructor(\n /** The bill the walk started from. */\n public readonly bomId: string,\n /** Which limit was reached. */\n public readonly limit: 'depth' | 'lines',\n ) {\n super(\n limit === 'depth'\n ? `Bill ${bomId} is nested deeper than ${MAX_EXPLOSION_DEPTH} levels.`\n : `Bill ${bomId} explodes to more than ${MAX_EXPLOSION_LINES} lines.`,\n );\n }\n}\n"],"mappings":";AAoJO,IAAM,mBAAN,cAA+B,MAAM;CAG1C,YAA4B,OAAe;EACzC,MAAM,gCAAgC,OAAO;EADnB,KAAA,QAAA;CAE5B;CAF4B;CAFnB,OAAO;AAKlB;AAQO,IAAM,6BAAN,cAAyC,MAAM;CAGpD,YAA4B,WAAmB;EAC7C,MACE,kDAAkD,UAAS,0DAE7D;EAJ0B,KAAA,YAAA;CAK5B;CAL4B;CAFnB,OAAO;AAQlB;AA0BO,IAAM,sBAAsB;AAO5B,IAAM,sBAAsB;AA+I5B,IAAM,yBAAN,cAAqC,MAAM;CAGhD,YAEkB,OAEA,OAChB;EACA,MACE,UAAU,UACN,QAAQ,MAAK,qCACb,QAAQ,MAAK,yBAA0B,oBAAmB,QAChE;EARgB,KAAA,QAAA;EAEA,KAAA,QAAA;CAOlB;CATkB;CAEA;CANT,OAAO;AAclB"}
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAoE/D,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,cAwBvC,CAAC"}
|
package/dist/ui.js
CHANGED
|
@@ -44,18 +44,38 @@ var MANUFACTURING_UI_SLOTS = {
|
|
|
44
44
|
category: "form",
|
|
45
45
|
order: 5,
|
|
46
46
|
propsInterface: "BomEditorProps"
|
|
47
|
+
},
|
|
48
|
+
"production-run-list": {
|
|
49
|
+
id: "production-run-list",
|
|
50
|
+
label: "Production Run List",
|
|
51
|
+
description: "Production runs with target, completed quantity and status, and completion reporting",
|
|
52
|
+
icon: "list",
|
|
53
|
+
category: "list",
|
|
54
|
+
order: 6,
|
|
55
|
+
propsInterface: "ProductionRunListProps"
|
|
56
|
+
},
|
|
57
|
+
"requirements-tree": {
|
|
58
|
+
id: "requirements-tree",
|
|
59
|
+
label: "Requirements Tree",
|
|
60
|
+
description: "A bill's exploded requirements by level, with totals and available and short stock",
|
|
61
|
+
icon: "tree",
|
|
62
|
+
category: "detail",
|
|
63
|
+
order: 7,
|
|
64
|
+
propsInterface: "RequirementsTreeProps"
|
|
47
65
|
}
|
|
48
66
|
};
|
|
49
67
|
var MANUFACTURING_MODULE_META = {
|
|
50
68
|
name: "@happyvertical/smrt-manufacturing",
|
|
51
69
|
displayName: "Manufacturing",
|
|
52
|
-
description: "Assemblies, bills of materials, routing operations, cost and labour rollup, and production-order stock movement",
|
|
70
|
+
description: "Assemblies, multi-level bills of materials, routing operations, cost and labour rollup, production runs, and production-order stock movement",
|
|
53
71
|
uiSlots: MANUFACTURING_UI_SLOTS,
|
|
54
72
|
models: [
|
|
55
73
|
"Assembly",
|
|
56
74
|
"BillOfMaterials",
|
|
57
75
|
"BomLine",
|
|
58
76
|
"Operation",
|
|
77
|
+
"ProductionRun",
|
|
78
|
+
"ProductionRunCompletion",
|
|
59
79
|
"RoutingStep"
|
|
60
80
|
],
|
|
61
81
|
collections: [
|
|
@@ -63,6 +83,8 @@ var MANUFACTURING_MODULE_META = {
|
|
|
63
83
|
"BillOfMaterialsCollection",
|
|
64
84
|
"BomLineCollection",
|
|
65
85
|
"OperationCollection",
|
|
86
|
+
"ProductionRunCollection",
|
|
87
|
+
"ProductionRunCompletionCollection",
|
|
66
88
|
"RoutingStepCollection"
|
|
67
89
|
]
|
|
68
90
|
};
|
package/dist/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","names":[],"sources":["../src/ui.ts"],"sourcesContent":["/**\n * Manufacturing Module UI Slot Declarations\n *\n * UI extension points for the manufacturing module. Components live in the\n * ./svelte subpath and are props-driven: hosts load records through the\n * services and pass plain view objects.\n */\n\nimport type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';\n\n/**\n * Manufacturing module UI slots\n */\nexport const MANUFACTURING_UI_SLOTS: Record<string, ModuleUISlot> = {\n 'operation-list': {\n id: 'operation-list',\n label: 'Operation List',\n description:\n 'Table of operations with category, status and retire or reinstate actions',\n icon: 'list',\n category: 'list',\n order: 1,\n propsInterface: 'OperationListProps',\n },\n 'operation-form': {\n id: 'operation-form',\n label: 'Operation Form',\n description: 'Add an operation, or rename and recategorize an existing one',\n icon: 'edit',\n category: 'form',\n order: 2,\n propsInterface: 'OperationFormProps',\n },\n 'assembly-list': {\n id: 'assembly-list',\n label: 'Assembly List',\n description: 'Table of assemblies with part reference, SKU, price and bill',\n icon: 'list',\n category: 'list',\n order: 3,\n propsInterface: 'AssemblyListProps',\n },\n 'assembly-form': {\n id: 'assembly-form',\n label: 'Assembly Form',\n description: 'Policy-driven create and edit form for an assembly',\n icon: 'edit',\n category: 'form',\n order: 4,\n propsInterface: 'AssemblyFormProps',\n },\n 'bom-editor': {\n id: 'bom-editor',\n label: 'Bill of Materials Editor',\n description:\n \"Edits an assembly's bill: materials and sub-assemblies, each sub-assembly expandable to its own bill\",\n icon: 'tree',\n category: 'form',\n order: 5,\n propsInterface: 'BomEditorProps',\n },\n};\n/**\n * Manufacturing module metadata\n */\nexport const MANUFACTURING_MODULE_META: SmrtModuleMeta = {\n name: '@happyvertical/smrt-manufacturing',\n displayName: 'Manufacturing',\n description:\n 'Assemblies, bills of materials, routing operations, cost and labour rollup, and production-order stock movement',\n uiSlots: MANUFACTURING_UI_SLOTS,\n models: [\n 'Assembly',\n 'BillOfMaterials',\n 'BomLine',\n 'Operation',\n 'RoutingStep',\n ],\n collections: [\n 'AssemblyCollection',\n 'BillOfMaterialsCollection',\n 'BomLineCollection',\n 'OperationCollection',\n 'RoutingStepCollection',\n ],\n};\n"],"mappings":";AAaO,IAAM,yBAAuD;CAClE,kBAAkB;EAChB,IAAI;EACJ,OAAO;EACP,aACE;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,kBAAkB;EAChB,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,iBAAiB;EACf,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,iBAAiB;EACf,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,cAAc;EACZ,IAAI;EACJ,OAAO;EACP,aACE;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;AACF;AAIO,IAAM,4BAA4C;CACvD,MAAM;CACN,aAAa;CACb,aACE;CACF,SAAS;CACT,QAAQ;EACN;EACA;EACA;EACA;EACA;CACF;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"ui.js","names":[],"sources":["../src/ui.ts"],"sourcesContent":["/**\n * Manufacturing Module UI Slot Declarations\n *\n * UI extension points for the manufacturing module. Components live in the\n * ./svelte subpath and are props-driven: hosts load records through the\n * services and pass plain view objects.\n */\n\nimport type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';\n\n/**\n * Manufacturing module UI slots\n */\nexport const MANUFACTURING_UI_SLOTS: Record<string, ModuleUISlot> = {\n 'operation-list': {\n id: 'operation-list',\n label: 'Operation List',\n description:\n 'Table of operations with category, status and retire or reinstate actions',\n icon: 'list',\n category: 'list',\n order: 1,\n propsInterface: 'OperationListProps',\n },\n 'operation-form': {\n id: 'operation-form',\n label: 'Operation Form',\n description: 'Add an operation, or rename and recategorize an existing one',\n icon: 'edit',\n category: 'form',\n order: 2,\n propsInterface: 'OperationFormProps',\n },\n 'assembly-list': {\n id: 'assembly-list',\n label: 'Assembly List',\n description: 'Table of assemblies with part reference, SKU, price and bill',\n icon: 'list',\n category: 'list',\n order: 3,\n propsInterface: 'AssemblyListProps',\n },\n 'assembly-form': {\n id: 'assembly-form',\n label: 'Assembly Form',\n description: 'Policy-driven create and edit form for an assembly',\n icon: 'edit',\n category: 'form',\n order: 4,\n propsInterface: 'AssemblyFormProps',\n },\n 'bom-editor': {\n id: 'bom-editor',\n label: 'Bill of Materials Editor',\n description:\n \"Edits an assembly's bill: materials and sub-assemblies, each sub-assembly expandable to its own bill\",\n icon: 'tree',\n category: 'form',\n order: 5,\n propsInterface: 'BomEditorProps',\n },\n 'production-run-list': {\n id: 'production-run-list',\n label: 'Production Run List',\n description:\n 'Production runs with target, completed quantity and status, and completion reporting',\n icon: 'list',\n category: 'list',\n order: 6,\n propsInterface: 'ProductionRunListProps',\n },\n 'requirements-tree': {\n id: 'requirements-tree',\n label: 'Requirements Tree',\n description:\n \"A bill's exploded requirements by level, with totals and available and short stock\",\n icon: 'tree',\n category: 'detail',\n order: 7,\n propsInterface: 'RequirementsTreeProps',\n },\n};\n/**\n * Manufacturing module metadata\n */\nexport const MANUFACTURING_MODULE_META: SmrtModuleMeta = {\n name: '@happyvertical/smrt-manufacturing',\n displayName: 'Manufacturing',\n description:\n 'Assemblies, multi-level bills of materials, routing operations, cost and labour rollup, production runs, and production-order stock movement',\n uiSlots: MANUFACTURING_UI_SLOTS,\n models: [\n 'Assembly',\n 'BillOfMaterials',\n 'BomLine',\n 'Operation',\n 'ProductionRun',\n 'ProductionRunCompletion',\n 'RoutingStep',\n ],\n collections: [\n 'AssemblyCollection',\n 'BillOfMaterialsCollection',\n 'BomLineCollection',\n 'OperationCollection',\n 'ProductionRunCollection',\n 'ProductionRunCompletionCollection',\n 'RoutingStepCollection',\n ],\n};\n"],"mappings":";AAaO,IAAM,yBAAuD;CAClE,kBAAkB;EAChB,IAAI;EACJ,OAAO;EACP,aACE;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,kBAAkB;EAChB,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,iBAAiB;EACf,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,iBAAiB;EACf,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,cAAc;EACZ,IAAI;EACJ,OAAO;EACP,aACE;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,uBAAuB;EACrB,IAAI;EACJ,OAAO;EACP,aACE;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,qBAAqB;EACnB,IAAI;EACJ,OAAO;EACP,aACE;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;AACF;AAIO,IAAM,4BAA4C;CACvD,MAAM;CACN,aAAa;CACb,aACE;CACF,SAAS;CACT,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-manufacturing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Bills of materials, cost rollup, and production-order operations for the SMRT framework — strictly industry-neutral",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"CLAUDE.md",
|
|
13
|
-
"AGENTS.md"
|
|
13
|
+
"AGENTS.md",
|
|
14
|
+
"agents"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
@@ -31,13 +32,12 @@
|
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@happyvertical/logger": "^0.100.3",
|
|
34
|
-
"@happyvertical/smrt-core": "0.
|
|
35
|
-
"@happyvertical/smrt-
|
|
36
|
-
"@happyvertical/smrt-
|
|
37
|
-
"@happyvertical/smrt-
|
|
38
|
-
"@happyvertical/smrt-
|
|
39
|
-
"@happyvertical/smrt-
|
|
40
|
-
"@happyvertical/smrt-ui": "0.53.5",
|
|
35
|
+
"@happyvertical/smrt-core": "0.54.0",
|
|
36
|
+
"@happyvertical/smrt-inventory": "0.54.0",
|
|
37
|
+
"@happyvertical/smrt-products": "0.54.0",
|
|
38
|
+
"@happyvertical/smrt-tenancy": "0.54.0",
|
|
39
|
+
"@happyvertical/smrt-types": "0.54.0",
|
|
40
|
+
"@happyvertical/smrt-ui": "0.54.0",
|
|
41
41
|
"@happyvertical/sql": "^0.100.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@happyvertical/smrt-vitest": "0.
|
|
52
|
+
"@happyvertical/smrt-vitest": "0.54.0",
|
|
53
53
|
"@sveltejs/package": "^2.5.8",
|
|
54
54
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
55
55
|
"@types/node": "24.13.6",
|