@happyvertical/smrt-manufacturing 0.57.34 → 0.57.35
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +275 -45
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +429 -22
- package/dist/models/Assembly.d.ts.map +1 -1
- package/dist/models/BillOfMaterials.d.ts.map +1 -1
- package/dist/models/BomLine.d.ts.map +1 -1
- package/dist/models/Operation.d.ts.map +1 -1
- package/dist/models/ProductionRun.d.ts.map +1 -1
- package/dist/models/ProductionRunCompletion.d.ts.map +1 -1
- package/dist/models/RoutingStep.d.ts.map +1 -1
- package/dist/recipes.d.ts +279 -0
- package/dist/recipes.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +391 -29
- package/package.json +8 -8
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-manufacturing",
|
|
6
|
-
"packageVersion": "0.57.
|
|
6
|
+
"packageVersion": "0.57.35",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "7d5d0a17b1b1cd075cd19b14cd1c9b09ebb8283bd663fc19e135de0fdeafec2f",
|
|
11
|
+
"packageJson": "0254c9ddadb3748487ebb0b67f397a89091651d945b426cc069168cf00ba57d8",
|
|
12
12
|
"agents": "53bbb8d8dfd7e1dbd438a4ad1559be8cd1ad8ed46c726d5498d2dda5b3535054",
|
|
13
13
|
"moduleDoc:agents/multilevel-and-runs.md": "544d519356801f3cb3beb9e6d49a3e0eec93fdddf3f56150cf3141f766f98c9d"
|
|
14
14
|
},
|
|
@@ -553,21 +553,24 @@
|
|
|
553
553
|
"type": "integer",
|
|
554
554
|
"required": false,
|
|
555
555
|
"columnType": "INTEGER",
|
|
556
|
-
"default": 0
|
|
556
|
+
"default": 0,
|
|
557
|
+
"description": "About how many minutes it takes to make one."
|
|
557
558
|
},
|
|
558
559
|
{
|
|
559
560
|
"name": "defaultOperationId",
|
|
560
561
|
"type": "foreignKey",
|
|
561
562
|
"required": false,
|
|
562
563
|
"related": "Operation",
|
|
563
|
-
"columnType": "UUID"
|
|
564
|
+
"columnType": "UUID",
|
|
565
|
+
"description": "The kind of work usually booked to this assembly."
|
|
564
566
|
},
|
|
565
567
|
{
|
|
566
568
|
"name": "partReference",
|
|
567
569
|
"type": "text",
|
|
568
570
|
"required": false,
|
|
569
571
|
"columnType": "TEXT",
|
|
570
|
-
"default": ""
|
|
572
|
+
"default": "",
|
|
573
|
+
"description": "Your own drawing or part number for this assembly."
|
|
571
574
|
}
|
|
572
575
|
],
|
|
573
576
|
"relationships": [
|
|
@@ -822,34 +825,39 @@
|
|
|
822
825
|
"type": "text",
|
|
823
826
|
"required": true,
|
|
824
827
|
"columnType": "TEXT",
|
|
825
|
-
"default": ""
|
|
828
|
+
"default": "",
|
|
829
|
+
"description": "The assembly this list of parts is for."
|
|
826
830
|
},
|
|
827
831
|
{
|
|
828
832
|
"name": "version",
|
|
829
833
|
"type": "integer",
|
|
830
834
|
"required": true,
|
|
831
835
|
"columnType": "INTEGER",
|
|
832
|
-
"default": 1
|
|
836
|
+
"default": 1,
|
|
837
|
+
"description": "The revision number, so you can change a list and keep the old one."
|
|
833
838
|
},
|
|
834
839
|
{
|
|
835
840
|
"name": "effectiveDate",
|
|
836
841
|
"type": "datetime",
|
|
837
842
|
"required": false,
|
|
838
|
-
"columnType": "TIMESTAMP"
|
|
843
|
+
"columnType": "TIMESTAMP",
|
|
844
|
+
"description": "The day this list starts to be used."
|
|
839
845
|
},
|
|
840
846
|
{
|
|
841
847
|
"name": "status",
|
|
842
848
|
"type": "text",
|
|
843
849
|
"required": true,
|
|
844
850
|
"columnType": "TEXT",
|
|
845
|
-
"default": "draft"
|
|
851
|
+
"default": "draft",
|
|
852
|
+
"description": "Whether this list is a draft, in use or retired."
|
|
846
853
|
},
|
|
847
854
|
{
|
|
848
855
|
"name": "notes",
|
|
849
856
|
"type": "text",
|
|
850
857
|
"required": false,
|
|
851
858
|
"columnType": "TEXT",
|
|
852
|
-
"default": ""
|
|
859
|
+
"default": "",
|
|
860
|
+
"description": "Anything people making it should know."
|
|
853
861
|
},
|
|
854
862
|
{
|
|
855
863
|
"name": "currency",
|
|
@@ -972,27 +980,31 @@
|
|
|
972
980
|
"type": "text",
|
|
973
981
|
"required": true,
|
|
974
982
|
"columnType": "TEXT",
|
|
975
|
-
"default": ""
|
|
983
|
+
"default": "",
|
|
984
|
+
"description": "The list of parts this line belongs to."
|
|
976
985
|
},
|
|
977
986
|
{
|
|
978
987
|
"name": "componentSkuId",
|
|
979
988
|
"type": "text",
|
|
980
989
|
"required": true,
|
|
981
990
|
"columnType": "TEXT",
|
|
982
|
-
"default": ""
|
|
991
|
+
"default": "",
|
|
992
|
+
"description": "The part that goes into the assembly."
|
|
983
993
|
},
|
|
984
994
|
{
|
|
985
995
|
"name": "qtyPerUnit",
|
|
986
996
|
"type": "decimal",
|
|
987
997
|
"required": false,
|
|
988
|
-
"columnType": "REAL"
|
|
998
|
+
"columnType": "REAL",
|
|
999
|
+
"description": "How much of this part goes into one unit."
|
|
989
1000
|
},
|
|
990
1001
|
{
|
|
991
1002
|
"name": "uom",
|
|
992
1003
|
"type": "text",
|
|
993
1004
|
"required": false,
|
|
994
1005
|
"columnType": "TEXT",
|
|
995
|
-
"default": "each"
|
|
1006
|
+
"default": "each",
|
|
1007
|
+
"description": "What the amount is counted in, such as each or kilograms."
|
|
996
1008
|
},
|
|
997
1009
|
{
|
|
998
1010
|
"name": "wastePercent",
|
|
@@ -1145,21 +1157,24 @@
|
|
|
1145
1157
|
"type": "text",
|
|
1146
1158
|
"required": true,
|
|
1147
1159
|
"columnType": "TEXT",
|
|
1148
|
-
"default": ""
|
|
1160
|
+
"default": "",
|
|
1161
|
+
"description": "A short code for this kind of work."
|
|
1149
1162
|
},
|
|
1150
1163
|
{
|
|
1151
1164
|
"name": "name",
|
|
1152
1165
|
"type": "text",
|
|
1153
1166
|
"required": true,
|
|
1154
1167
|
"columnType": "TEXT",
|
|
1155
|
-
"default": ""
|
|
1168
|
+
"default": "",
|
|
1169
|
+
"description": "What this kind of work is called, such as cutting."
|
|
1156
1170
|
},
|
|
1157
1171
|
{
|
|
1158
1172
|
"name": "category",
|
|
1159
1173
|
"type": "text",
|
|
1160
1174
|
"required": false,
|
|
1161
1175
|
"columnType": "TEXT",
|
|
1162
|
-
"default": ""
|
|
1176
|
+
"default": "",
|
|
1177
|
+
"description": "A group to sort similar work together."
|
|
1163
1178
|
},
|
|
1164
1179
|
{
|
|
1165
1180
|
"name": "isActive",
|
|
@@ -1272,26 +1287,30 @@
|
|
|
1272
1287
|
"type": "foreignKey",
|
|
1273
1288
|
"required": true,
|
|
1274
1289
|
"related": "BillOfMaterials",
|
|
1275
|
-
"columnType": "UUID"
|
|
1290
|
+
"columnType": "UUID",
|
|
1291
|
+
"description": "The list of parts this run makes from."
|
|
1276
1292
|
},
|
|
1277
1293
|
{
|
|
1278
1294
|
"name": "targetQty",
|
|
1279
1295
|
"type": "decimal",
|
|
1280
1296
|
"required": false,
|
|
1281
|
-
"columnType": "REAL"
|
|
1297
|
+
"columnType": "REAL",
|
|
1298
|
+
"description": "How many you plan to make."
|
|
1282
1299
|
},
|
|
1283
1300
|
{
|
|
1284
1301
|
"name": "completedQty",
|
|
1285
1302
|
"type": "decimal",
|
|
1286
1303
|
"required": false,
|
|
1287
|
-
"columnType": "REAL"
|
|
1304
|
+
"columnType": "REAL",
|
|
1305
|
+
"description": "How many have been finished so far."
|
|
1288
1306
|
},
|
|
1289
1307
|
{
|
|
1290
1308
|
"name": "status",
|
|
1291
1309
|
"type": "text",
|
|
1292
1310
|
"required": true,
|
|
1293
1311
|
"columnType": "TEXT",
|
|
1294
|
-
"default": "planned"
|
|
1312
|
+
"default": "planned",
|
|
1313
|
+
"description": "Whether the run is planned, under way, done or cancelled."
|
|
1295
1314
|
}
|
|
1296
1315
|
],
|
|
1297
1316
|
"relationships": [
|
|
@@ -1399,19 +1418,22 @@
|
|
|
1399
1418
|
"type": "foreignKey",
|
|
1400
1419
|
"required": true,
|
|
1401
1420
|
"related": "ProductionRun",
|
|
1402
|
-
"columnType": "UUID"
|
|
1421
|
+
"columnType": "UUID",
|
|
1422
|
+
"description": "The production run this batch belongs to."
|
|
1403
1423
|
},
|
|
1404
1424
|
{
|
|
1405
1425
|
"name": "qty",
|
|
1406
1426
|
"type": "decimal",
|
|
1407
1427
|
"required": false,
|
|
1408
|
-
"columnType": "REAL"
|
|
1428
|
+
"columnType": "REAL",
|
|
1429
|
+
"description": "How many were finished in this batch."
|
|
1409
1430
|
},
|
|
1410
1431
|
{
|
|
1411
1432
|
"name": "completedAt",
|
|
1412
1433
|
"type": "datetime",
|
|
1413
1434
|
"required": false,
|
|
1414
|
-
"columnType": "TIMESTAMP"
|
|
1435
|
+
"columnType": "TIMESTAMP",
|
|
1436
|
+
"description": "When this batch was finished."
|
|
1415
1437
|
}
|
|
1416
1438
|
],
|
|
1417
1439
|
"relationships": [
|
|
@@ -1502,27 +1524,31 @@
|
|
|
1502
1524
|
"type": "foreignKey",
|
|
1503
1525
|
"required": true,
|
|
1504
1526
|
"related": "BillOfMaterials",
|
|
1505
|
-
"columnType": "UUID"
|
|
1527
|
+
"columnType": "UUID",
|
|
1528
|
+
"description": "The list of parts this step is part of."
|
|
1506
1529
|
},
|
|
1507
1530
|
{
|
|
1508
1531
|
"name": "operationId",
|
|
1509
1532
|
"type": "foreignKey",
|
|
1510
1533
|
"required": true,
|
|
1511
1534
|
"related": "Operation",
|
|
1512
|
-
"columnType": "UUID"
|
|
1535
|
+
"columnType": "UUID",
|
|
1536
|
+
"description": "The kind of work done in this step."
|
|
1513
1537
|
},
|
|
1514
1538
|
{
|
|
1515
1539
|
"name": "sequence",
|
|
1516
1540
|
"type": "integer",
|
|
1517
1541
|
"required": true,
|
|
1518
1542
|
"columnType": "INTEGER",
|
|
1519
|
-
"default": 1
|
|
1543
|
+
"default": 1,
|
|
1544
|
+
"description": "The order of this step, starting at 1."
|
|
1520
1545
|
},
|
|
1521
1546
|
{
|
|
1522
1547
|
"name": "estimatedMinutes",
|
|
1523
1548
|
"type": "decimal",
|
|
1524
1549
|
"required": false,
|
|
1525
|
-
"columnType": "REAL"
|
|
1550
|
+
"columnType": "REAL",
|
|
1551
|
+
"description": "About how many minutes this step takes."
|
|
1526
1552
|
},
|
|
1527
1553
|
{
|
|
1528
1554
|
"name": "notes",
|
|
@@ -2124,6 +2150,342 @@
|
|
|
2124
2150
|
"content": "# Multi-level walks and production runs\n\nDetail for `services/structure-walk.ts`, the multi-level forms of `BomService`, and `ProductionRunService`. Orientation and gotchas stay in the package [AGENTS.md](../AGENTS.md).\n\n## Multi-level walks (sub-assemblies)\n\nEvery `BomService` method takes `{ levels }` (`1` by default: the single-level behaviour, unchanged; a number up to `MAX_EXPLOSION_DEPTH` = 32; or `'all'`). The walk is `services/structure-walk.ts`, shared by all of them: resolve each line through `AssemblyService.resolveComponent` (in the top bill's tenant), open an assembly's active bill while `levels` allows, stop at materials, bought items, missing components and assemblies without an active bill.\n\n| Method | Multi-level behaviour |\n|---|---|\n| `explode(bomId, qty, { levels })` | Gross: every line depth first with `level`, `path` (bills from the top), `totalQty` (waste compounds: a child is the parent line's quantity times its own effective quantity), `buildable`, `expanded`; `totals` sums the lines not opened per SKU (first unit kept, as before). |\n| `planRequirements(bomId, qty, { levels })` | Net: per line, `available` stock not yet allocated to an earlier line and `short`; a short buildable sub-assembly is opened for the shortfall only. Lines short and not opened are `shortages`, each at its own level. Facts only: no make-or-buy policy. |\n| `explodeRequirements` / `canProduce` | `explode().totals` / the plan's shortages (`level`, `path`, `uom`, `buildable` added). |\n| `computeMaterialCost` | An opened sub-assembly is costed from its bill (`subBomId`, nested `components`); a missing price below marks it. A sub-assembly bill in another currency is not added: its line is priced through the resolver. |\n| `computeLabourEstimate` | Adds each opened sub-assembly's routing times its units per top unit (`subAssemblies`); `steps` stays the top routing. Minutes always count; cost from a bill in another currency does not, and sets `hasMissingRates`. |\n\nSafety: a loop already in stored data (written around the save-time refusal) fails with `BomStructureCycleError` (a `BomCycleError`) naming it; `'all'` past 32 levels or a walk past `MAX_EXPLOSION_LINES` (10,000, counted per use of a shared sub-assembly) fails with `BomExplosionLimitError`. Stock in a plan is summed across locations, as in `canProduce`, counting only the top bill's tenant's rows and global ones (like the lines the walk reads), whatever tenant context is active.\n\n## Production runs\n\n`ProductionRunService` (`createRun({ bomId } | { productId }, targetQty)`, `start`, `recordCompletion`, `finish`, `cancel`, `setTarget`, `get`, `listCompletions`). Every write is one transaction that saves the run row first; the revision-guarded save locks it, and a concurrent writer's conflict reruns its whole transaction (up to 10 attempts), so concurrent completions all count and never pass the target. The service refuses an adapter without `transaction()`; it never falls back to step-by-step writes.\n\n- Tenant: every structure read goes through `src/tenant-scope.ts`: list reads run in `withTenantGlobalRead` for the owning tenant (its rows plus global rows; a tenant context alone would hide global rows, no context would show every tenant's) and keep own-or-global rows. Routing and operations in `computeLabourEstimate`, and the top bill itself under a tenant context, are read the same way. `createRun` reads the active tenant's bills and global ones (no context: global bills only, by `productId` or `bomId`). The run takes its bill's tenant; a completion takes the run's; stock legs run inside `withTenant(run.tenantId)`, so the bill's lines and the levels read and written are that tenant's whatever the caller's context. `ProductionService` consumes only a bill's own tenant's lines and global ones (a global bill: global lines only), for every caller; a global run's stock legs run in the caller's context.\n- A completion moves no stock unless asked. With `consume` / `produce` it calls `ProductionService` (`runProduction` for both) on the transaction's stock service, stamping movements `sourceType: 'ProductionRunCompletion'` with the completion id; a shortfall rolls the completion back. Consumption is the run's bill's own lines: a sub-assembly is taken from stock, and building it is its own run.\n- Quantities are kept to `QUANTITY_DECIMALS` (6) places, never compared with a tolerance. A run's target, completed quantity and each report are summed and compared as whole millionths, exactly; a run accepts quantities up to `MAX_QUANTITY` (999,999,999, so every value has at most 15 significant digits and survives a double exactly) and refuses one that rounds to zero. A plan's `short` is rounded with `roundQuantity`.\n- Reaching the target marks the run `done`; `finish` closes it short; `cancel` keeps its completions; `setTarget` cannot go below what is done.\n- Why not commerce `ProductionOrder`: that is a `Contract` (terms, money, customer or vendor, a contract status flow), owned by `smrt-commerce`, which this package does not depend on. A run is the shop-floor record of building; one order may need several runs, and make-to-stock needs none. An application that has both links them.\n- Deliberately absent (nothing here would use them): a link to an order, who did the work, a location on the run (passed per call, as in `ProductionService`).\n"
|
|
2125
2151
|
}
|
|
2126
2152
|
],
|
|
2153
|
+
"recipes": [
|
|
2154
|
+
{
|
|
2155
|
+
"id": "manufacturing.assemblies",
|
|
2156
|
+
"className": "AssembliesRecipe",
|
|
2157
|
+
"label": "Assemblies",
|
|
2158
|
+
"summary": "Define what you make, what goes into it and the steps to make it.",
|
|
2159
|
+
"synonyms": [
|
|
2160
|
+
"bill of materials",
|
|
2161
|
+
"bills of materials",
|
|
2162
|
+
"bom",
|
|
2163
|
+
"recipes",
|
|
2164
|
+
"products you make",
|
|
2165
|
+
"routing"
|
|
2166
|
+
],
|
|
2167
|
+
"models": [
|
|
2168
|
+
"@happyvertical/smrt-manufacturing:Assembly",
|
|
2169
|
+
"@happyvertical/smrt-manufacturing:BillOfMaterials",
|
|
2170
|
+
"@happyvertical/smrt-manufacturing:BomLine",
|
|
2171
|
+
"@happyvertical/smrt-manufacturing:Operation",
|
|
2172
|
+
"@happyvertical/smrt-manufacturing:RoutingStep"
|
|
2173
|
+
],
|
|
2174
|
+
"nav": [
|
|
2175
|
+
{
|
|
2176
|
+
"label": "Assemblies",
|
|
2177
|
+
"model": "@happyvertical/smrt-manufacturing:Assembly",
|
|
2178
|
+
"icon": "package",
|
|
2179
|
+
"description": "The things you make, each built from parts.",
|
|
2180
|
+
"noun": "assembly"
|
|
2181
|
+
},
|
|
2182
|
+
{
|
|
2183
|
+
"label": "Bills of materials",
|
|
2184
|
+
"model": "@happyvertical/smrt-manufacturing:BillOfMaterials",
|
|
2185
|
+
"icon": "fileText",
|
|
2186
|
+
"description": "The list of parts and amounts that go into each assembly.",
|
|
2187
|
+
"noun": "bill of materials"
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
"label": "Operations",
|
|
2191
|
+
"model": "@happyvertical/smrt-manufacturing:Operation",
|
|
2192
|
+
"icon": "wrench",
|
|
2193
|
+
"description": "The kinds of work done to make something, like cutting."
|
|
2194
|
+
}
|
|
2195
|
+
],
|
|
2196
|
+
"requires": [],
|
|
2197
|
+
"requiresAny": [
|
|
2198
|
+
[
|
|
2199
|
+
"products.simple",
|
|
2200
|
+
"products.clothing"
|
|
2201
|
+
]
|
|
2202
|
+
],
|
|
2203
|
+
"section": {
|
|
2204
|
+
"id": "make",
|
|
2205
|
+
"label": "Make",
|
|
2206
|
+
"icon": "wrench",
|
|
2207
|
+
"description": "Make what you sell from the parts you hold."
|
|
2208
|
+
},
|
|
2209
|
+
"options": {
|
|
2210
|
+
"@happyvertical/smrt-manufacturing:Assembly": {
|
|
2211
|
+
"fields": {
|
|
2212
|
+
"name": {
|
|
2213
|
+
"order": 1
|
|
2214
|
+
},
|
|
2215
|
+
"partReference": {
|
|
2216
|
+
"order": 2
|
|
2217
|
+
},
|
|
2218
|
+
"description": {
|
|
2219
|
+
"order": 3
|
|
2220
|
+
},
|
|
2221
|
+
"price": {
|
|
2222
|
+
"order": 4
|
|
2223
|
+
},
|
|
2224
|
+
"estimatedLabourMinutes": {
|
|
2225
|
+
"label": "Minutes to make one",
|
|
2226
|
+
"order": 5
|
|
2227
|
+
},
|
|
2228
|
+
"defaultOperationId": {
|
|
2229
|
+
"label": "Usual operation",
|
|
2230
|
+
"order": 6
|
|
2231
|
+
},
|
|
2232
|
+
"tenantId": {
|
|
2233
|
+
"visibility": "hidden"
|
|
2234
|
+
},
|
|
2235
|
+
"productType": {
|
|
2236
|
+
"visibility": "hidden"
|
|
2237
|
+
},
|
|
2238
|
+
"category": {
|
|
2239
|
+
"visibility": "advanced"
|
|
2240
|
+
},
|
|
2241
|
+
"manufacturer": {
|
|
2242
|
+
"visibility": "hidden"
|
|
2243
|
+
},
|
|
2244
|
+
"model": {
|
|
2245
|
+
"visibility": "hidden"
|
|
2246
|
+
},
|
|
2247
|
+
"inStock": {
|
|
2248
|
+
"visibility": "hidden",
|
|
2249
|
+
"default": true
|
|
2250
|
+
},
|
|
2251
|
+
"specifications": {
|
|
2252
|
+
"visibility": "hidden"
|
|
2253
|
+
},
|
|
2254
|
+
"tags": {
|
|
2255
|
+
"visibility": "advanced"
|
|
2256
|
+
},
|
|
2257
|
+
"defaultSalesTaxCodeId": {
|
|
2258
|
+
"visibility": "hidden"
|
|
2259
|
+
},
|
|
2260
|
+
"defaultPurchaseTaxCodeId": {
|
|
2261
|
+
"visibility": "hidden"
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
},
|
|
2265
|
+
"@happyvertical/smrt-manufacturing:BillOfMaterials": {
|
|
2266
|
+
"fields": {
|
|
2267
|
+
"productId": {
|
|
2268
|
+
"label": "Assembly",
|
|
2269
|
+
"order": 1
|
|
2270
|
+
},
|
|
2271
|
+
"version": {
|
|
2272
|
+
"order": 2
|
|
2273
|
+
},
|
|
2274
|
+
"status": {
|
|
2275
|
+
"order": 3
|
|
2276
|
+
},
|
|
2277
|
+
"effectiveDate": {
|
|
2278
|
+
"order": 4
|
|
2279
|
+
},
|
|
2280
|
+
"notes": {
|
|
2281
|
+
"order": 5
|
|
2282
|
+
},
|
|
2283
|
+
"tenantId": {
|
|
2284
|
+
"visibility": "hidden"
|
|
2285
|
+
},
|
|
2286
|
+
"currency": {
|
|
2287
|
+
"visibility": "advanced"
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
},
|
|
2291
|
+
"@happyvertical/smrt-manufacturing:BomLine": {
|
|
2292
|
+
"fields": {
|
|
2293
|
+
"bomId": {
|
|
2294
|
+
"label": "Bill of materials",
|
|
2295
|
+
"order": 1
|
|
2296
|
+
},
|
|
2297
|
+
"componentSkuId": {
|
|
2298
|
+
"label": "Part",
|
|
2299
|
+
"order": 2
|
|
2300
|
+
},
|
|
2301
|
+
"qtyPerUnit": {
|
|
2302
|
+
"label": "Amount per unit",
|
|
2303
|
+
"order": 3
|
|
2304
|
+
},
|
|
2305
|
+
"uom": {
|
|
2306
|
+
"label": "Unit of measure",
|
|
2307
|
+
"order": 4
|
|
2308
|
+
},
|
|
2309
|
+
"wastePercent": {
|
|
2310
|
+
"visibility": "advanced"
|
|
2311
|
+
},
|
|
2312
|
+
"notes": {
|
|
2313
|
+
"visibility": "advanced"
|
|
2314
|
+
},
|
|
2315
|
+
"tenantId": {
|
|
2316
|
+
"visibility": "hidden"
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
},
|
|
2320
|
+
"@happyvertical/smrt-manufacturing:Operation": {
|
|
2321
|
+
"fields": {
|
|
2322
|
+
"name": {
|
|
2323
|
+
"order": 1
|
|
2324
|
+
},
|
|
2325
|
+
"code": {
|
|
2326
|
+
"order": 2
|
|
2327
|
+
},
|
|
2328
|
+
"category": {
|
|
2329
|
+
"order": 3
|
|
2330
|
+
},
|
|
2331
|
+
"isActive": {
|
|
2332
|
+
"visibility": "advanced"
|
|
2333
|
+
},
|
|
2334
|
+
"requiredQualificationId": {
|
|
2335
|
+
"visibility": "advanced"
|
|
2336
|
+
},
|
|
2337
|
+
"tenantId": {
|
|
2338
|
+
"visibility": "hidden"
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
},
|
|
2342
|
+
"@happyvertical/smrt-manufacturing:RoutingStep": {
|
|
2343
|
+
"fields": {
|
|
2344
|
+
"bomId": {
|
|
2345
|
+
"label": "Bill of materials",
|
|
2346
|
+
"order": 1
|
|
2347
|
+
},
|
|
2348
|
+
"operationId": {
|
|
2349
|
+
"label": "Operation",
|
|
2350
|
+
"order": 2
|
|
2351
|
+
},
|
|
2352
|
+
"sequence": {
|
|
2353
|
+
"label": "Step number",
|
|
2354
|
+
"order": 3
|
|
2355
|
+
},
|
|
2356
|
+
"estimatedMinutes": {
|
|
2357
|
+
"order": 4
|
|
2358
|
+
},
|
|
2359
|
+
"notes": {
|
|
2360
|
+
"visibility": "advanced"
|
|
2361
|
+
},
|
|
2362
|
+
"tenantId": {
|
|
2363
|
+
"visibility": "hidden"
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
},
|
|
2368
|
+
"help": {
|
|
2369
|
+
"markdown": "## Overview\n\nAssemblies is where you describe what you make. An assembly is a product built\nfrom parts. Its bill of materials lists those parts and how much of each goes\ninto one unit, and its steps say which operations, such as cutting or painting,\nit passes through and how long each takes.\n\n## Tasks\n\n### Add something you make\n\n1. Open the list of assemblies and choose **New**.\n2. Give it a **{field:Assembly.name}** and your own **{field:Assembly.partReference}**, such as a drawing or part number.\n3. Note roughly how long one takes in **{field:Assembly.estimatedLabourMinutes}**.\n4. Save.\n\n### List what goes into it\n\n1. Open the bills of materials and choose **New**.\n2. Pick the **{field:BillOfMaterials.productId}** the list is for.\n3. Save, then add a line for each part.\n4. For each line pick the **{field:BomLine.componentSkuId}** and set the **{field:BomLine.qtyPerUnit}** that goes into one unit.\n\n### Change how something is made\n\n1. Create a new bill of materials with a higher **{field:BillOfMaterials.version}**.\n2. Set its **{field:BillOfMaterials.status}** to active when it is ready to use.\n3. Set the old version's **{field:BillOfMaterials.status}** to superseded so only one version is in use.\n4. The old version stays on file, so past runs still make sense.\n\n### See the kinds of work\n\nOperations are set up by the manufacturing service, not by hand in the app.\n\n1. Open the operations.\n2. Read each **{field:Operation.name}** and its short **{field:Operation.code}**.\n3. The steps of a bill of materials use these, each with its **{field:RoutingStep.estimatedMinutes}**.\n",
|
|
2370
|
+
"fieldRefs": [
|
|
2371
|
+
"Assembly.estimatedLabourMinutes",
|
|
2372
|
+
"Assembly.name",
|
|
2373
|
+
"Assembly.partReference",
|
|
2374
|
+
"BillOfMaterials.productId",
|
|
2375
|
+
"BillOfMaterials.status",
|
|
2376
|
+
"BillOfMaterials.version",
|
|
2377
|
+
"BomLine.componentSkuId",
|
|
2378
|
+
"BomLine.qtyPerUnit",
|
|
2379
|
+
"Operation.code",
|
|
2380
|
+
"Operation.name",
|
|
2381
|
+
"RoutingStep.estimatedMinutes"
|
|
2382
|
+
]
|
|
2383
|
+
},
|
|
2384
|
+
"demo": {
|
|
2385
|
+
"mode": "server",
|
|
2386
|
+
"reasons": [
|
|
2387
|
+
"Needs a server because its package depends on @happyvertical/smrt-products, @happyvertical/smrt-tenancy, which do not build for a browser (#3616, #3624, #3626)."
|
|
2388
|
+
]
|
|
2389
|
+
}
|
|
2390
|
+
},
|
|
2391
|
+
{
|
|
2392
|
+
"id": "manufacturing.production",
|
|
2393
|
+
"className": "ProductionRecipe",
|
|
2394
|
+
"label": "Production",
|
|
2395
|
+
"summary": "Plan how many to make, record what came out and see each run through to done.",
|
|
2396
|
+
"synonyms": [
|
|
2397
|
+
"production runs",
|
|
2398
|
+
"work orders",
|
|
2399
|
+
"manufacturing",
|
|
2400
|
+
"batches",
|
|
2401
|
+
"build orders"
|
|
2402
|
+
],
|
|
2403
|
+
"models": [
|
|
2404
|
+
"@happyvertical/smrt-manufacturing:ProductionRun",
|
|
2405
|
+
"@happyvertical/smrt-manufacturing:ProductionRunCompletion"
|
|
2406
|
+
],
|
|
2407
|
+
"nav": [
|
|
2408
|
+
{
|
|
2409
|
+
"label": "Production runs",
|
|
2410
|
+
"model": "@happyvertical/smrt-manufacturing:ProductionRun",
|
|
2411
|
+
"icon": "layers",
|
|
2412
|
+
"description": "Each batch you plan to make, and how far along it is.",
|
|
2413
|
+
"noun": "production run"
|
|
2414
|
+
}
|
|
2415
|
+
],
|
|
2416
|
+
"requires": [
|
|
2417
|
+
"manufacturing.assemblies"
|
|
2418
|
+
],
|
|
2419
|
+
"section": {
|
|
2420
|
+
"id": "make",
|
|
2421
|
+
"label": "Make",
|
|
2422
|
+
"icon": "wrench",
|
|
2423
|
+
"description": "Make what you sell from the parts you hold."
|
|
2424
|
+
},
|
|
2425
|
+
"options": {
|
|
2426
|
+
"@happyvertical/smrt-manufacturing:ProductionRun": {
|
|
2427
|
+
"fields": {
|
|
2428
|
+
"bomId": {
|
|
2429
|
+
"label": "Bill of materials",
|
|
2430
|
+
"order": 1
|
|
2431
|
+
},
|
|
2432
|
+
"targetQty": {
|
|
2433
|
+
"label": "How many to make",
|
|
2434
|
+
"order": 2
|
|
2435
|
+
},
|
|
2436
|
+
"completedQty": {
|
|
2437
|
+
"label": "How many made so far",
|
|
2438
|
+
"locked": true,
|
|
2439
|
+
"order": 3
|
|
2440
|
+
},
|
|
2441
|
+
"status": {
|
|
2442
|
+
"locked": true,
|
|
2443
|
+
"order": 4
|
|
2444
|
+
},
|
|
2445
|
+
"tenantId": {
|
|
2446
|
+
"visibility": "hidden"
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
},
|
|
2450
|
+
"@happyvertical/smrt-manufacturing:ProductionRunCompletion": {
|
|
2451
|
+
"fields": {
|
|
2452
|
+
"runId": {
|
|
2453
|
+
"label": "Production run",
|
|
2454
|
+
"order": 1
|
|
2455
|
+
},
|
|
2456
|
+
"qty": {
|
|
2457
|
+
"label": "How many finished",
|
|
2458
|
+
"order": 2
|
|
2459
|
+
},
|
|
2460
|
+
"completedAt": {
|
|
2461
|
+
"label": "Finished on",
|
|
2462
|
+
"order": 3
|
|
2463
|
+
},
|
|
2464
|
+
"tenantId": {
|
|
2465
|
+
"visibility": "hidden"
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
},
|
|
2470
|
+
"help": {
|
|
2471
|
+
"markdown": "## Overview\n\nProduction is where you plan and follow what you make. A production run says\nhow many of an assembly you intend to make, using one of its bills of\nmaterials. As batches come off the line they are recorded against it, and the run\nkeeps count until it is done.\n\n## Tasks\n\nProduction runs and their finished batches are created and updated by the\nproduction service, not by hand in the app. Here you follow them.\n\n### Find a run\n\n1. Open the production runs.\n2. Check the **{field:ProductionRun.bomId}** it makes from and the **{field:ProductionRun.targetQty}** you want.\n\n### See how a run is going\n\nOpen the run and compare **{field:ProductionRun.completedQty}** with\n**{field:ProductionRun.targetQty}**. Its **{field:ProductionRun.status}** shows\nwhether it is planned, under way, finished or cancelled.\n\n### See what was finished\n\n1. Open the run's finished batches.\n2. Each one shows the **{field:ProductionRunCompletion.runId}** it belongs to and **{field:ProductionRunCompletion.qty}**, how many came out.\n",
|
|
2472
|
+
"fieldRefs": [
|
|
2473
|
+
"ProductionRun.bomId",
|
|
2474
|
+
"ProductionRun.completedQty",
|
|
2475
|
+
"ProductionRun.status",
|
|
2476
|
+
"ProductionRun.targetQty",
|
|
2477
|
+
"ProductionRunCompletion.qty",
|
|
2478
|
+
"ProductionRunCompletion.runId"
|
|
2479
|
+
]
|
|
2480
|
+
},
|
|
2481
|
+
"demo": {
|
|
2482
|
+
"mode": "server",
|
|
2483
|
+
"reasons": [
|
|
2484
|
+
"Needs a server because its package depends on @happyvertical/smrt-products, @happyvertical/smrt-tenancy, which do not build for a browser (#3616, #3624, #3626)."
|
|
2485
|
+
]
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
],
|
|
2127
2489
|
"browser": {
|
|
2128
2490
|
"status": "server-only",
|
|
2129
2491
|
"issues": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-manufacturing",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.35",
|
|
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",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@happyvertical/logger": "^0.108.0",
|
|
39
|
-
"@happyvertical/smrt-core": "0.57.
|
|
40
|
-
"@happyvertical/smrt-inventory": "0.57.
|
|
41
|
-
"@happyvertical/smrt-products": "0.57.
|
|
42
|
-
"@happyvertical/smrt-tenancy": "0.57.
|
|
43
|
-
"@happyvertical/smrt-types": "0.57.
|
|
44
|
-
"@happyvertical/smrt-ui": "0.57.
|
|
39
|
+
"@happyvertical/smrt-core": "0.57.35",
|
|
40
|
+
"@happyvertical/smrt-inventory": "0.57.35",
|
|
41
|
+
"@happyvertical/smrt-products": "0.57.35",
|
|
42
|
+
"@happyvertical/smrt-tenancy": "0.57.35",
|
|
43
|
+
"@happyvertical/smrt-types": "0.57.35",
|
|
44
|
+
"@happyvertical/smrt-ui": "0.57.35",
|
|
45
45
|
"@happyvertical/sql": "^0.108.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@happyvertical/smrt-vitest": "0.57.
|
|
56
|
+
"@happyvertical/smrt-vitest": "0.57.35",
|
|
57
57
|
"@sveltejs/package": "^2.5.8",
|
|
58
58
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
59
59
|
"@types/node": "24.13.6",
|