Ultronprime commited on
Commit
86dae55
·
verified ·
1 Parent(s): 7ddaf41

Update config.js

Browse files
Files changed (1) hide show
  1. config.js +45 -52
config.js CHANGED
@@ -1,59 +1,59 @@
1
- // config.js - FACTORY CONFIGURATION FILE - v3.0 (Debloated & Dynamic)
2
 
3
  export const MATERIALS_CONFIG = [
4
  // Frame Materials
5
- { name: "5/32 x 3/4 Tube", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
6
- { name: "1/8 x 1/2 Tube", unit: "pcs", maxStock: 4000, currentStock: 4000, reorderPoint: 500 },
7
- { name: "1/8 x 3/4 Tube", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
8
- { name: "End Knob Round", unit: "pcs", maxStock: 3000, currentStock: 3000, reorderPoint: 300 },
9
- { name: "End Knob Square 1/2x1/2", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
10
- { name: "Dipole (CI Cup)", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
11
- { name: "U-Clip", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
12
- { name: "12cm Round Tube 7/8 MF", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
13
- { name: "15cm Round Tube 5/8 MF", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
14
- { name: "5/8 x 4 CSK Screw", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
15
- { name: "3/8 x 4 Screw", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
16
 
17
  // Wire/Connector Materials
18
- { name: "16 1/2 Ygr Wire", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
19
- { name: "F-Connector Male (4005)", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
20
- { name: "F-Connector Female (2002)", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
21
 
22
  // Booster Materials
23
- { name: "Macking Coil", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
24
- { name: "Coil 28gsm (25cm)", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
25
- { name: "Coil 26gsm (16cm)", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
26
- { name: "Coil 25gsm (36cm)", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
27
- { name: "Resistor 1k", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
28
- { name: "Resistor 100-ohm", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
29
- { name: "Resistor 68k", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
30
- { name: "Resistor 2k", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
31
- { name: "Resistor 150-R", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
32
- { name: "Resistor 10k", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
33
- { name: "LED Multicolour", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
34
- { name: "LED 5mm", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
35
- { name: "PF 12", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
36
- { name: "PF 39", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
37
- { name: "PF 102 Indian", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
38
- { name: "PF 102 Normal", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
39
- { name: "Capacitor 25v 100uF", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
40
- { name: "Capacitor 25v 220uF", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
41
- { name: "Transistor (2355)", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 100 },
42
 
43
  // Power Supply Materials
44
- { name: "Plastic Box (Power)", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
45
- { name: "Transformer", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
46
- { name: "IN4007 Diode", unit: "pcs", maxStock: 1000, currentStock: 1000, reorderPoint: 200 },
47
- { name: "5C 2V Wire 3-yard", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
48
- { name: "4-Antenna Jack", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
49
- { name: "AC Cord", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
50
 
51
  // Packing Materials
52
- { name: "Packing Bag", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
53
- { name: "Warranty Card", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
54
- { name: "Round Sticker", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
55
- { name: "Box Plastic Cover", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 },
56
- { name: "Box Sticker", unit: "pcs", maxStock: 500, currentStock: 500, reorderPoint: 50 }
57
  ];
58
 
59
  const subAssemblyRecipes = {
@@ -64,12 +64,6 @@ const subAssemblyRecipes = {
64
  "Packaging Set": { "Packing Bag": 1, "Warranty Card": 1, "Round Sticker": 1, "Box Plastic Cover": 1, "Box Sticker": 1 },
65
  };
66
 
67
- /**
68
- * Dynamically generates the recipe for the complete unit by aggregating sub-assemblies.
69
- * This prevents data duplication and ensures the master recipe is always up-to-date.
70
- * @param {Object} recipes - The collection of all sub-assembly recipes.
71
- * @returns {Object} The aggregated recipe for the complete unit.
72
- */
73
  function generateCompleteUnitRecipe(recipes) {
74
  const completeRecipe = {};
75
  const componentAssemblies = [
@@ -79,7 +73,6 @@ function generateCompleteUnitRecipe(recipes) {
79
  recipes["Wire Assembly"],
80
  recipes["Packaging Set"]
81
  ];
82
-
83
  for (const assembly of componentAssemblies) {
84
  for (const material in assembly) {
85
  if (completeRecipe[material]) {
 
1
+ // config.js - FACTORY CONFIGURATION FILE - v4.0 (Zero Initial Stock, No Max)
2
 
3
  export const MATERIALS_CONFIG = [
4
  // Frame Materials
5
+ { name: "5/32 x 3/4 Tube", unit: "pcs", currentStock: 0, reorderPoint: 100 },
6
+ { name: "1/8 x 1/2 Tube", unit: "pcs", currentStock: 0, reorderPoint: 500 },
7
+ { name: "1/8 x 3/4 Tube", unit: "pcs", currentStock: 0, reorderPoint: 100 },
8
+ { name: "End Knob Round", unit: "pcs", currentStock: 0, reorderPoint: 300 },
9
+ { name: "End Knob Square 1/2x1/2", unit: "pcs", currentStock: 0, reorderPoint: 100 },
10
+ { name: "Dipole (CI Cup)", unit: "pcs", currentStock: 0, reorderPoint: 50 },
11
+ { name: "U-Clip", unit: "pcs", currentStock: 0, reorderPoint: 50 },
12
+ { name: "12cm Round Tube 7/8 MF", unit: "pcs", currentStock: 0, reorderPoint: 100 },
13
+ { name: "15cm Round Tube 5/8 MF", unit: "pcs", currentStock: 0, reorderPoint: 50 },
14
+ { name: "5/8 x 4 CSK Screw", unit: "pcs", currentStock: 0, reorderPoint: 100 },
15
+ { name: "3/8 x 4 Screw", unit: "pcs", currentStock: 0, reorderPoint: 100 },
16
 
17
  // Wire/Connector Materials
18
+ { name: "16 1/2 Ygr Wire", unit: "pcs", currentStock: 0, reorderPoint: 50 },
19
+ { name: "F-Connector Male (4005)", unit: "pcs", currentStock: 0, reorderPoint: 100 },
20
+ { name: "F-Connector Female (2002)", unit: "pcs", currentStock: 0, reorderPoint: 100 },
21
 
22
  // Booster Materials
23
+ { name: "Macking Coil", unit: "pcs", currentStock: 0, reorderPoint: 50 },
24
+ { name: "Coil 28gsm (25cm)", unit: "pcs", currentStock: 0, reorderPoint: 50 },
25
+ { name: "Coil 26gsm (16cm)", unit: "pcs", currentStock: 0, reorderPoint: 50 },
26
+ { name: "Coil 25gsm (36cm)", unit: "pcs", currentStock: 0, reorderPoint: 50 },
27
+ { name: "Resistor 1k", unit: "pcs", currentStock: 0, reorderPoint: 200 },
28
+ { name: "Resistor 100-ohm", unit: "pcs", currentStock: 0, reorderPoint: 200 },
29
+ { name: "Resistor 68k", unit: "pcs", currentStock: 0, reorderPoint: 200 },
30
+ { name: "Resistor 2k", unit: "pcs", currentStock: 0, reorderPoint: 200 },
31
+ { name: "Resistor 150-R", unit: "pcs", currentStock: 0, reorderPoint: 200 },
32
+ { name: "Resistor 10k", unit: "pcs", currentStock: 0, reorderPoint: 200 },
33
+ { name: "LED Multicolour", unit: "pcs", currentStock: 0, reorderPoint: 200 },
34
+ { name: "LED 5mm", unit: "pcs", currentStock: 0, reorderPoint: 200 },
35
+ { name: "PF 12", unit: "pcs", currentStock: 0, reorderPoint: 200 },
36
+ { name: "PF 39", unit: "pcs", currentStock: 0, reorderPoint: 200 },
37
+ { name: "PF 102 Indian", unit: "pcs", currentStock: 0, reorderPoint: 200 },
38
+ { name: "PF 102 Normal", unit: "pcs", currentStock: 0, reorderPoint: 200 },
39
+ { name: "Capacitor 25v 100uF", unit: "pcs", currentStock: 0, reorderPoint: 50 },
40
+ { name: "Capacitor 25v 220uF", unit: "pcs", currentStock: 0, reorderPoint: 50 },
41
+ { name: "Transistor (2355)", unit: "pcs", currentStock: 0, reorderPoint: 100 },
42
 
43
  // Power Supply Materials
44
+ { name: "Plastic Box (Power)", unit: "pcs", currentStock: 0, reorderPoint: 50 },
45
+ { name: "Transformer", unit: "pcs", currentStock: 0, reorderPoint: 50 },
46
+ { name: "IN4007 Diode", unit: "pcs", currentStock: 0, reorderPoint: 200 },
47
+ { name: "5C 2V Wire 3-yard", unit: "pcs", currentStock: 0, reorderPoint: 50 },
48
+ { name: "4-Antenna Jack", unit: "pcs", currentStock: 0, reorderPoint: 50 },
49
+ { name: "AC Cord", unit: "pcs", currentStock: 0, reorderPoint: 50 },
50
 
51
  // Packing Materials
52
+ { name: "Packing Bag", unit: "pcs", currentStock: 0, reorderPoint: 50 },
53
+ { name: "Warranty Card", unit: "pcs", currentStock: 0, reorderPoint: 50 },
54
+ { name: "Round Sticker", unit: "pcs", currentStock: 0, reorderPoint: 50 },
55
+ { name: "Box Plastic Cover", unit: "pcs", currentStock: 0, reorderPoint: 50 },
56
+ { name: "Box Sticker", unit: "pcs", currentStock: 0, reorderPoint: 50 }
57
  ];
58
 
59
  const subAssemblyRecipes = {
 
64
  "Packaging Set": { "Packing Bag": 1, "Warranty Card": 1, "Round Sticker": 1, "Box Plastic Cover": 1, "Box Sticker": 1 },
65
  };
66
 
 
 
 
 
 
 
67
  function generateCompleteUnitRecipe(recipes) {
68
  const completeRecipe = {};
69
  const componentAssemblies = [
 
73
  recipes["Wire Assembly"],
74
  recipes["Packaging Set"]
75
  ];
 
76
  for (const assembly of componentAssemblies) {
77
  for (const material in assembly) {
78
  if (completeRecipe[material]) {