create-cactus 1.0.5 → 1.0.7
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/package.json +1 -1
- package/template/backend-project/1.drawio +331 -0
- package/template/backend-project/controllers/productsController.js +0 -9
- package/template/backend-project/controllers/reportController.js +5 -0
- package/template/backend-project/controllers/warehouseController.js +0 -9
- package/template/backend-project/routes/productsRoutes.js +1 -2
- package/template/backend-project/routes/warehouseRoutes.js +1 -2
- package/template/frontend-project/src/api/api.js +0 -2
- package/template/frontend-project/src/pages/Dashboard.jsx +7 -23
- package/template/frontend-project/src/pages/Transactions.jsx +7 -23
package/package.json
CHANGED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
<mxfile host="65bd71144e">
|
|
2
|
+
<diagram id="PQ5hsovL6DdM_u9k81B_" name="Page-1">
|
|
3
|
+
<mxGraphModel dx="3244" dy="1040" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
|
|
4
|
+
<root>
|
|
5
|
+
<mxCell id="0"/>
|
|
6
|
+
<mxCell id="1" parent="0"/>
|
|
7
|
+
<mxCell id="2" value="<b>PRODUCT</b>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
8
|
+
<mxGeometry x="-650" y="250" width="120" height="60" as="geometry"/>
|
|
9
|
+
</mxCell>
|
|
10
|
+
<mxCell id="4" value="STOCK<div>TRANSACTION</div>" style="rounded=0;whiteSpace=wrap;html=1;fontStyle=1" parent="1" vertex="1">
|
|
11
|
+
<mxGeometry x="-130" y="635" width="120" height="60" as="geometry"/>
|
|
12
|
+
</mxCell>
|
|
13
|
+
<mxCell id="5" value="WAREHOUSE" style="rounded=0;whiteSpace=wrap;html=1;fontStyle=1" parent="1" vertex="1">
|
|
14
|
+
<mxGeometry x="-640" y="640" width="120" height="60" as="geometry"/>
|
|
15
|
+
</mxCell>
|
|
16
|
+
<mxCell id="6" value="<u>ProductCode</u>" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
17
|
+
<mxGeometry x="-760" y="180" width="120" height="30" as="geometry"/>
|
|
18
|
+
</mxCell>
|
|
19
|
+
<mxCell id="7" value="ProductName" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
20
|
+
<mxGeometry x="-860" y="210" width="120" height="40" as="geometry"/>
|
|
21
|
+
</mxCell>
|
|
22
|
+
<mxCell id="8" value="Category" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
23
|
+
<mxGeometry x="-820" y="265" width="120" height="30" as="geometry"/>
|
|
24
|
+
</mxCell>
|
|
25
|
+
<mxCell id="9" value="QuantityIn<div>Stock</div>" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
26
|
+
<mxGeometry x="-610" y="170" width="120" height="30" as="geometry"/>
|
|
27
|
+
</mxCell>
|
|
28
|
+
<mxCell id="10" value="UnitPrice" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
29
|
+
<mxGeometry x="-860" y="330" width="120" height="20" as="geometry"/>
|
|
30
|
+
</mxCell>
|
|
31
|
+
<mxCell id="11" value="DateReceived" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
32
|
+
<mxGeometry x="-500" y="203" width="120" height="30" as="geometry"/>
|
|
33
|
+
</mxCell>
|
|
34
|
+
<mxCell id="12" value="SupplierName" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
35
|
+
<mxGeometry x="-850" y="390" width="120" height="30" as="geometry"/>
|
|
36
|
+
</mxCell>
|
|
37
|
+
<mxCell id="21" value="<u>TransactionId</u>" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
38
|
+
<mxGeometry x="40" y="535" width="120" height="40" as="geometry"/>
|
|
39
|
+
</mxCell>
|
|
40
|
+
<mxCell id="22" value="WarehouseCode(FK)" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
41
|
+
<mxGeometry x="70" y="605" width="120" height="30" as="geometry"/>
|
|
42
|
+
</mxCell>
|
|
43
|
+
<mxCell id="23" value="TransactionType" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
44
|
+
<mxGeometry x="10" y="665" width="120" height="40" as="geometry"/>
|
|
45
|
+
</mxCell>
|
|
46
|
+
<mxCell id="24" value="QuantityMoved" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
47
|
+
<mxGeometry x="-10" y="740" width="120" height="30" as="geometry"/>
|
|
48
|
+
</mxCell>
|
|
49
|
+
<mxCell id="25" value="TransactionDate" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
50
|
+
<mxGeometry x="-120" y="715" width="120" height="30" as="geometry"/>
|
|
51
|
+
</mxCell>
|
|
52
|
+
<mxCell id="26" value="ProductCode(FK)" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
53
|
+
<mxGeometry x="-250" y="730" width="120" height="40" as="geometry"/>
|
|
54
|
+
</mxCell>
|
|
55
|
+
<mxCell id="27" value="WarehouseLocation" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
56
|
+
<mxGeometry x="-560" y="760" width="120" height="30" as="geometry"/>
|
|
57
|
+
</mxCell>
|
|
58
|
+
<mxCell id="28" value="WarehouseName" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
59
|
+
<mxGeometry x="-690" y="770" width="120" height="40" as="geometry"/>
|
|
60
|
+
</mxCell>
|
|
61
|
+
<mxCell id="29" value="<u>WarehouseCode</u>" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
62
|
+
<mxGeometry x="-780" y="655" width="120" height="30" as="geometry"/>
|
|
63
|
+
</mxCell>
|
|
64
|
+
<mxCell id="30" value="has" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
65
|
+
<mxGeometry x="-405" y="240" width="80" height="80" as="geometry"/>
|
|
66
|
+
</mxCell>
|
|
67
|
+
<mxCell id="31" value="records" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
68
|
+
<mxGeometry x="-425" y="625" width="80" height="80" as="geometry"/>
|
|
69
|
+
</mxCell>
|
|
70
|
+
<mxCell id="33" value="contains" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
71
|
+
<mxGeometry x="-630" y="480" width="80" height="80" as="geometry"/>
|
|
72
|
+
</mxCell>
|
|
73
|
+
<mxCell id="36" value="" style="endArrow=none;html=1;entryX=1.005;entryY=0.413;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryPerimeter=0;" parent="1" source="31" target="5" edge="1">
|
|
74
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
75
|
+
<mxPoint x="-380" y="590" as="sourcePoint"/>
|
|
76
|
+
<mxPoint x="-330" y="540" as="targetPoint"/>
|
|
77
|
+
</mxGeometry>
|
|
78
|
+
</mxCell>
|
|
79
|
+
<mxCell id="39" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="33" target="2" edge="1">
|
|
80
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
81
|
+
<mxPoint x="-569" y="411.02" as="sourcePoint"/>
|
|
82
|
+
<mxPoint x="-570" y="330" as="targetPoint"/>
|
|
83
|
+
</mxGeometry>
|
|
84
|
+
</mxCell>
|
|
85
|
+
<mxCell id="40" value="" style="endArrow=none;html=1;exitX=0.412;exitY=0.012;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" target="33" edge="1" source="5">
|
|
86
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
87
|
+
<mxPoint x="-590" y="640" as="sourcePoint"/>
|
|
88
|
+
<mxPoint x="-590" y="570" as="targetPoint"/>
|
|
89
|
+
</mxGeometry>
|
|
90
|
+
</mxCell>
|
|
91
|
+
<mxCell id="41" value="" style="endArrow=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="31" target="4" edge="1">
|
|
92
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
93
|
+
<mxPoint x="-250" y="665" as="sourcePoint"/>
|
|
94
|
+
<mxPoint x="-135" y="665" as="targetPoint"/>
|
|
95
|
+
<Array as="points">
|
|
96
|
+
<mxPoint x="-175" y="665"/>
|
|
97
|
+
</Array>
|
|
98
|
+
</mxGeometry>
|
|
99
|
+
</mxCell>
|
|
100
|
+
<mxCell id="42" value="" style="endArrow=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" target="30" edge="1">
|
|
101
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
102
|
+
<mxPoint x="-528" y="280" as="sourcePoint"/>
|
|
103
|
+
<mxPoint x="-370" y="230" as="targetPoint"/>
|
|
104
|
+
</mxGeometry>
|
|
105
|
+
</mxCell>
|
|
106
|
+
<mxCell id="44" value="" style="endArrow=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" edge="1">
|
|
107
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
108
|
+
<mxPoint x="-60.00493141924167" y="399.99506858075836" as="sourcePoint"/>
|
|
109
|
+
<mxPoint x="-60" y="309" as="targetPoint"/>
|
|
110
|
+
</mxGeometry>
|
|
111
|
+
</mxCell>
|
|
112
|
+
<mxCell id="46" value="" style="endArrow=none;html=1;entryX=0.638;entryY=1.071;entryDx=0;entryDy=0;exitX=0.75;exitY=0;exitDx=0;exitDy=0;entryPerimeter=0;" parent="1" source="2" target="9" edge="1">
|
|
113
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
114
|
+
<mxPoint x="-630" y="310" as="sourcePoint"/>
|
|
115
|
+
<mxPoint x="-390" y="150" as="targetPoint"/>
|
|
116
|
+
</mxGeometry>
|
|
117
|
+
</mxCell>
|
|
118
|
+
<mxCell id="47" value="" style="endArrow=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=-0.017;exitY=0.15;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="2" target="7" edge="1">
|
|
119
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
120
|
+
<mxPoint x="-440" y="200" as="sourcePoint"/>
|
|
121
|
+
<mxPoint x="-390" y="150" as="targetPoint"/>
|
|
122
|
+
</mxGeometry>
|
|
123
|
+
</mxCell>
|
|
124
|
+
<mxCell id="48" value="" style="endArrow=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="2" target="8" edge="1">
|
|
125
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
126
|
+
<mxPoint x="-440" y="200" as="sourcePoint"/>
|
|
127
|
+
<mxPoint x="-690" y="280" as="targetPoint"/>
|
|
128
|
+
</mxGeometry>
|
|
129
|
+
</mxCell>
|
|
130
|
+
<mxCell id="49" value="" style="endArrow=none;html=1;entryX=0.667;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.192;exitY=-0.05;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="2" target="6" edge="1">
|
|
131
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
132
|
+
<mxPoint x="-630" y="240" as="sourcePoint"/>
|
|
133
|
+
<mxPoint x="-390" y="150" as="targetPoint"/>
|
|
134
|
+
</mxGeometry>
|
|
135
|
+
</mxCell>
|
|
136
|
+
<mxCell id="55" value="" style="endArrow=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="4" target="26" edge="1">
|
|
137
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
138
|
+
<mxPoint x="-510" y="585" as="sourcePoint"/>
|
|
139
|
+
<mxPoint x="-460" y="535" as="targetPoint"/>
|
|
140
|
+
</mxGeometry>
|
|
141
|
+
</mxCell>
|
|
142
|
+
<mxCell id="56" value="" style="endArrow=none;html=1;entryX=0.367;entryY=-0.05;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.25;exitY=1;exitDx=0;exitDy=0;" parent="1" source="5" target="28" edge="1">
|
|
143
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
144
|
+
<mxPoint x="-1010" y="860" as="sourcePoint"/>
|
|
145
|
+
<mxPoint x="-960" y="810" as="targetPoint"/>
|
|
146
|
+
</mxGeometry>
|
|
147
|
+
</mxCell>
|
|
148
|
+
<mxCell id="57" value="" style="endArrow=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=-0.005;exitY=0.345;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="5" target="29" edge="1">
|
|
149
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
150
|
+
<mxPoint x="-1010" y="860" as="sourcePoint"/>
|
|
151
|
+
<mxPoint x="-960" y="810" as="targetPoint"/>
|
|
152
|
+
</mxGeometry>
|
|
153
|
+
</mxCell>
|
|
154
|
+
<mxCell id="58" value="" style="endArrow=none;html=1;exitX=0;exitY=1;exitDx=0;exitDy=0;" parent="1" source="2" edge="1">
|
|
155
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
156
|
+
<mxPoint x="-600" y="200" as="sourcePoint"/>
|
|
157
|
+
<mxPoint x="-770" y="329" as="targetPoint"/>
|
|
158
|
+
</mxGeometry>
|
|
159
|
+
</mxCell>
|
|
160
|
+
<mxCell id="59" value="" style="endArrow=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.293;exitY=1.024;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="2" target="12" edge="1">
|
|
161
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
162
|
+
<mxPoint x="-600" y="200" as="sourcePoint"/>
|
|
163
|
+
<mxPoint x="-550" y="150" as="targetPoint"/>
|
|
164
|
+
</mxGeometry>
|
|
165
|
+
</mxCell>
|
|
166
|
+
<mxCell id="60" value="" style="endArrow=none;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;" parent="1" source="2" edge="1">
|
|
167
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
168
|
+
<mxPoint x="-602" y="310" as="sourcePoint"/>
|
|
169
|
+
<mxPoint x="-480" y="230" as="targetPoint"/>
|
|
170
|
+
</mxGeometry>
|
|
171
|
+
</mxCell>
|
|
172
|
+
<mxCell id="62" value="" style="endArrow=none;html=1;entryX=0.042;entryY=0.725;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.808;exitY=0.017;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="4" target="21" edge="1">
|
|
173
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
174
|
+
<mxPoint x="-190" y="565" as="sourcePoint"/>
|
|
175
|
+
<mxPoint x="-140" y="515" as="targetPoint"/>
|
|
176
|
+
</mxGeometry>
|
|
177
|
+
</mxCell>
|
|
178
|
+
<mxCell id="63" value="" style="endArrow=none;html=1;entryX=0.083;entryY=0.7;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0;exitDx=0;exitDy=0;" parent="1" source="4" target="22" edge="1">
|
|
179
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
180
|
+
<mxPoint x="-190" y="565" as="sourcePoint"/>
|
|
181
|
+
<mxPoint x="-140" y="515" as="targetPoint"/>
|
|
182
|
+
</mxGeometry>
|
|
183
|
+
</mxCell>
|
|
184
|
+
<mxCell id="64" value="" style="endArrow=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="4" target="23" edge="1">
|
|
185
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
186
|
+
<mxPoint x="-190" y="565" as="sourcePoint"/>
|
|
187
|
+
<mxPoint x="-140" y="515" as="targetPoint"/>
|
|
188
|
+
</mxGeometry>
|
|
189
|
+
</mxCell>
|
|
190
|
+
<mxCell id="65" value="" style="endArrow=none;html=1;entryX=0.35;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=1;exitDx=0;exitDy=0;" parent="1" source="4" target="24" edge="1">
|
|
191
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
192
|
+
<mxPoint x="-190" y="565" as="sourcePoint"/>
|
|
193
|
+
<mxPoint x="-140" y="515" as="targetPoint"/>
|
|
194
|
+
</mxGeometry>
|
|
195
|
+
</mxCell>
|
|
196
|
+
<mxCell id="66" value="" style="endArrow=none;html=1;entryX=0.375;entryY=0.033;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.442;exitY=0.983;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="4" target="25" edge="1">
|
|
197
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
198
|
+
<mxPoint x="-190" y="565" as="sourcePoint"/>
|
|
199
|
+
<mxPoint x="-140" y="515" as="targetPoint"/>
|
|
200
|
+
</mxGeometry>
|
|
201
|
+
</mxCell>
|
|
202
|
+
<mxCell id="67" value="" style="endArrow=none;html=1;entryX=0.21;entryY=-0.024;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.698;exitY=1.071;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="5" target="27" edge="1">
|
|
203
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
204
|
+
<mxPoint x="-550" y="710" as="sourcePoint"/>
|
|
205
|
+
<mxPoint x="-640" y="790" as="targetPoint"/>
|
|
206
|
+
</mxGeometry>
|
|
207
|
+
</mxCell>
|
|
208
|
+
<mxCell id="73" value="" style="endArrow=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="30" edge="1">
|
|
209
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
210
|
+
<mxPoint x="-520" y="290" as="sourcePoint"/>
|
|
211
|
+
<mxPoint x="-130" y="280" as="targetPoint"/>
|
|
212
|
+
</mxGeometry>
|
|
213
|
+
</mxCell>
|
|
214
|
+
<mxCell id="80" value="USER" style="rounded=0;whiteSpace=wrap;html=1;fontStyle=1" parent="1" vertex="1">
|
|
215
|
+
<mxGeometry x="-130" y="248" width="120" height="60" as="geometry"/>
|
|
216
|
+
</mxCell>
|
|
217
|
+
<mxCell id="81" value="password" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
218
|
+
<mxGeometry x="-250" y="233" width="120" height="20" as="geometry"/>
|
|
219
|
+
</mxCell>
|
|
220
|
+
<mxCell id="82" value="email" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
221
|
+
<mxGeometry x="-20" y="208" width="120" height="25" as="geometry"/>
|
|
222
|
+
</mxCell>
|
|
223
|
+
<mxCell id="83" value="username" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
224
|
+
<mxGeometry x="-110" y="188" width="120" height="20" as="geometry"/>
|
|
225
|
+
</mxCell>
|
|
226
|
+
<mxCell id="84" value="<span style="font-weight: 400;"><u>UserId</u></span>" style="ellipse;whiteSpace=wrap;html=1;fontStyle=1" parent="1" vertex="1">
|
|
227
|
+
<mxGeometry x="-220" y="208" width="120" height="20" as="geometry"/>
|
|
228
|
+
</mxCell>
|
|
229
|
+
<mxCell id="85" value="" style="endArrow=none;html=1;entryX=0.383;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.556;exitY=-0.002;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="80" target="83" edge="1">
|
|
230
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
231
|
+
<mxPoint x="70" y="468" as="sourcePoint"/>
|
|
232
|
+
<mxPoint x="120" y="418" as="targetPoint"/>
|
|
233
|
+
</mxGeometry>
|
|
234
|
+
</mxCell>
|
|
235
|
+
<mxCell id="86" value="" style="endArrow=none;html=1;entryX=1;entryY=1;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="80" target="81" edge="1">
|
|
236
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
237
|
+
<mxPoint x="70" y="468" as="sourcePoint"/>
|
|
238
|
+
<mxPoint x="120" y="418" as="targetPoint"/>
|
|
239
|
+
</mxGeometry>
|
|
240
|
+
</mxCell>
|
|
241
|
+
<mxCell id="87" value="" style="endArrow=none;html=1;entryX=0.725;entryY=0.9;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" target="84" edge="1">
|
|
242
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
243
|
+
<mxPoint x="-100" y="248" as="sourcePoint"/>
|
|
244
|
+
<mxPoint x="120" y="418" as="targetPoint"/>
|
|
245
|
+
</mxGeometry>
|
|
246
|
+
</mxCell>
|
|
247
|
+
<mxCell id="88" value="" style="endArrow=none;html=1;entryX=0.325;entryY=0.96;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0;exitDx=0;exitDy=0;" parent="1" source="80" target="82" edge="1">
|
|
248
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
249
|
+
<mxPoint x="70" y="468" as="sourcePoint"/>
|
|
250
|
+
<mxPoint x="120" y="418" as="targetPoint"/>
|
|
251
|
+
</mxGeometry>
|
|
252
|
+
</mxCell>
|
|
253
|
+
<mxCell id="90" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" target="98" edge="1">
|
|
254
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
255
|
+
<mxPoint x="-60" y="630" as="sourcePoint"/>
|
|
256
|
+
<mxPoint x="-49.15506858075878" y="448.28493141924184" as="targetPoint"/>
|
|
257
|
+
</mxGeometry>
|
|
258
|
+
</mxCell>
|
|
259
|
+
<mxCell id="98" value="performs" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
260
|
+
<mxGeometry x="-100" y="400" width="80" height="80" as="geometry"/>
|
|
261
|
+
</mxCell>
|
|
262
|
+
<mxCell id="100" value="involvedIn" style="rhombus;whiteSpace=wrap;html=1;rotation=45;" parent="1" vertex="1">
|
|
263
|
+
<mxGeometry x="-360" y="440" width="80" height="80" as="geometry"/>
|
|
264
|
+
</mxCell>
|
|
265
|
+
<mxCell id="101" value="" style="endArrow=none;html=1;entryX=1;entryY=1;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="100" target="2" edge="1">
|
|
266
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
267
|
+
<mxPoint x="-440" y="540" as="sourcePoint"/>
|
|
268
|
+
<mxPoint x="-390" y="490" as="targetPoint"/>
|
|
269
|
+
</mxGeometry>
|
|
270
|
+
</mxCell>
|
|
271
|
+
<mxCell id="102" value="" style="endArrow=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0;exitDx=0;exitDy=0;" parent="1" source="4" target="100" edge="1">
|
|
272
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
273
|
+
<mxPoint x="-440" y="540" as="sourcePoint"/>
|
|
274
|
+
<mxPoint x="-390" y="490" as="targetPoint"/>
|
|
275
|
+
</mxGeometry>
|
|
276
|
+
</mxCell>
|
|
277
|
+
<mxCell id="105" value="UserId(FK)" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
278
|
+
<mxGeometry x="150" y="650" width="120" height="30" as="geometry"/>
|
|
279
|
+
</mxCell>
|
|
280
|
+
<mxCell id="106" value="" style="endArrow=none;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="4" target="105" edge="1">
|
|
281
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
282
|
+
<mxPoint x="20" y="640" as="sourcePoint"/>
|
|
283
|
+
<mxPoint x="70" y="590" as="targetPoint"/>
|
|
284
|
+
</mxGeometry>
|
|
285
|
+
</mxCell>
|
|
286
|
+
<mxCell id="110" value="TransactionId(FK)" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
|
287
|
+
<mxGeometry x="-465" y="720" width="120" height="30" as="geometry"/>
|
|
288
|
+
</mxCell>
|
|
289
|
+
<mxCell id="111" value="" style="endArrow=none;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;" parent="1" source="5" target="110" edge="1">
|
|
290
|
+
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
291
|
+
<mxPoint x="-480" y="630" as="sourcePoint"/>
|
|
292
|
+
<mxPoint x="-430" y="580" as="targetPoint"/>
|
|
293
|
+
</mxGeometry>
|
|
294
|
+
</mxCell>
|
|
295
|
+
<mxCell id="200" value="1" style="text;html=1;" vertex="1" parent="1">
|
|
296
|
+
<mxGeometry x="-580" y="610" width="20" height="20" as="geometry"/>
|
|
297
|
+
</mxCell>
|
|
298
|
+
<mxCell id="201" value="M" style="text;html=1;fontStyle=1" vertex="1" parent="1">
|
|
299
|
+
<mxGeometry x="-580" y="310" width="20" height="20" as="geometry"/>
|
|
300
|
+
</mxCell>
|
|
301
|
+
<mxCell id="202" value="1" style="text;html=1;" vertex="1" parent="1">
|
|
302
|
+
<mxGeometry x="-510" y="645" width="20" height="20" as="geometry"/>
|
|
303
|
+
</mxCell>
|
|
304
|
+
<mxCell id="203" value="M" style="text;html=1;" vertex="1" parent="1">
|
|
305
|
+
<mxGeometry x="-160" y="645" width="20" height="20" as="geometry"/>
|
|
306
|
+
</mxCell>
|
|
307
|
+
<mxCell id="204" value="1" style="text;html=1;" vertex="1" parent="1">
|
|
308
|
+
<mxGeometry x="-505" y="340" width="20" height="20" as="geometry"/>
|
|
309
|
+
</mxCell>
|
|
310
|
+
<mxCell id="205" value="M" style="text;html=1;" vertex="1" parent="1">
|
|
311
|
+
<mxGeometry x="-160" y="620" width="20" height="20" as="geometry"/>
|
|
312
|
+
</mxCell>
|
|
313
|
+
<mxCell id="206" value="<b>LEGEND</b><hr><b>.Rectangle:</b>Entity<br><b>.Ellipse:</b>Attribute<br><b>.Diamond:</b>Relationship<br><u>.Underlined</u>:Primary Key (PK):<br>&nbsp; -ProductCode&nbsp;<div>&nbsp;-TransactionId</div><div>&nbsp; &nbsp; &nbsp; -WarehouseCode</div><div><b>.(FK):</b>Foreign Key:<br>&nbsp; -ProductCode<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-WarehouseCode<br>&nbsp; &nbsp; -TransactionId<br><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .1 / M:</b>Cardinality (one / many)</div>" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
314
|
+
<mxGeometry x="-1340" y="800" width="550" height="230" as="geometry"/>
|
|
315
|
+
</mxCell>
|
|
316
|
+
<mxCell id="212" value="M" style="text;html=1;" vertex="1" parent="1">
|
|
317
|
+
<mxGeometry x="-80" y="605" width="20" height="20" as="geometry"/>
|
|
318
|
+
</mxCell>
|
|
319
|
+
<mxCell id="213" value="1" style="text;html=1;" vertex="1" parent="1">
|
|
320
|
+
<mxGeometry x="-150" y="275" width="20" height="20" as="geometry"/>
|
|
321
|
+
</mxCell>
|
|
322
|
+
<mxCell id="215" value="1" style="text;html=1;" vertex="1" parent="1">
|
|
323
|
+
<mxGeometry x="-80" y="310" width="20" height="20" as="geometry"/>
|
|
324
|
+
</mxCell>
|
|
325
|
+
<mxCell id="218" value="M" style="text;html=1;fontStyle=1" vertex="1" parent="1">
|
|
326
|
+
<mxGeometry x="-520" y="275" width="20" height="20" as="geometry"/>
|
|
327
|
+
</mxCell>
|
|
328
|
+
</root>
|
|
329
|
+
</mxGraphModel>
|
|
330
|
+
</diagram>
|
|
331
|
+
</mxfile>
|
|
@@ -13,12 +13,3 @@ export const addProduct = async (req, res) => {
|
|
|
13
13
|
res.status(500).json({ message: 'internal server error', error: error.message });
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
export const getAllProducts = async (req, res) => {
|
|
18
|
-
try {
|
|
19
|
-
const result = await products.find();
|
|
20
|
-
res.status(200).json(result);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
res.status(500).json({ message: 'internal server error', error: error.message });
|
|
23
|
-
}
|
|
24
|
-
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import stocktransaction from "../models/stocktransaction.js";
|
|
2
2
|
import products from "../models/products.js";
|
|
3
|
+
import warehouse from "../models/warehouse.js";
|
|
3
4
|
|
|
4
5
|
export const getReports = async (req, res) => {
|
|
5
6
|
try {
|
|
@@ -34,8 +35,12 @@ export const getReports = async (req, res) => {
|
|
|
34
35
|
TransactionType: "OUT",
|
|
35
36
|
TransactionDate: { $gte: monthly }
|
|
36
37
|
});
|
|
38
|
+
const totalProducts = await products.countDocuments();
|
|
39
|
+
const totalWarehouses = await warehouse.countDocuments();
|
|
37
40
|
const availableStock = await products.find();
|
|
38
41
|
res.status(200).json({
|
|
42
|
+
totalProducts,
|
|
43
|
+
totalWarehouses,
|
|
39
44
|
dailyStockIn,
|
|
40
45
|
dailyStockOut,
|
|
41
46
|
|
|
@@ -13,12 +13,3 @@ export const addWareHouse = async (req, res) => {
|
|
|
13
13
|
res.status(500).json({ message: 'internal server error', error: error.message });
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
export const getAllWarehouses = async (req, res) => {
|
|
18
|
-
try {
|
|
19
|
-
const result = await warehouse.find();
|
|
20
|
-
res.status(200).json(result);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
res.status(500).json({ message: 'internal server error', error: error.message });
|
|
23
|
-
}
|
|
24
|
-
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { addProduct
|
|
2
|
+
import { addProduct } from '../controllers/productsController.js';
|
|
3
3
|
import { verifyToken } from '../middleware/authMiddleware.js';
|
|
4
4
|
|
|
5
5
|
const router = express.Router();
|
|
6
6
|
|
|
7
7
|
router.post('/insertProduct', verifyToken, addProduct);
|
|
8
|
-
router.get('/', verifyToken, getAllProducts);
|
|
9
8
|
|
|
10
9
|
export default router;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { addWareHouse
|
|
2
|
+
import { addWareHouse } from '../controllers/warehouseController.js';
|
|
3
3
|
import { verifyToken } from '../middleware/authMiddleware.js';
|
|
4
4
|
|
|
5
5
|
const router = express.Router();
|
|
6
6
|
|
|
7
7
|
router.post('/insertWarehouse', verifyToken, addWareHouse);
|
|
8
|
-
router.get('/', verifyToken, getAllWarehouses);
|
|
9
8
|
|
|
10
9
|
export default router;
|
|
@@ -15,9 +15,7 @@ api.interceptors.request.use((config) => {
|
|
|
15
15
|
export const signupUser = (data) => api.post('/api/user/register', data)
|
|
16
16
|
export const loginUser = (data) => api.post('/api/user/login', data)
|
|
17
17
|
export const addProduct = (data) => api.post('/api/products/insertProduct', data)
|
|
18
|
-
export const getAllProducts = () => api.get('/api/products')
|
|
19
18
|
export const addWarehouse = (data) => api.post('/api/warehouses/insertWarehouse', data)
|
|
20
|
-
export const getAllWarehouses = () => api.get('/api/warehouses')
|
|
21
19
|
export const addStock = (data) => api.post('/api/stocktransactions/insertStock', data)
|
|
22
20
|
export const getAllStocks = () => api.get('/api/stocktransactions/getStocks')
|
|
23
21
|
export const getStock = (id) => api.get(`/api/stocktransactions/getStock/${id}`)
|
|
@@ -1,30 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { getReports } from "../api/api";
|
|
3
3
|
|
|
4
4
|
export default function Dashboard() {
|
|
5
|
-
const [
|
|
6
|
-
const [warehouses, setWarehouses] = useState([]);
|
|
7
|
-
const [transactions, setTransactions] = useState([]);
|
|
5
|
+
const [data, setData] = useState(null);
|
|
8
6
|
useEffect(() => {
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
const [productRes, warehouseRes, transactionRes] = await Promise.all([
|
|
12
|
-
getAllProducts(),
|
|
13
|
-
getAllWarehouses(),
|
|
14
|
-
getAllStocks(),
|
|
15
|
-
]);
|
|
16
|
-
setProducts(productRes.data);
|
|
17
|
-
setWarehouses(warehouseRes.data);
|
|
18
|
-
setTransactions(transactionRes.data);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error(error.response?.data || error.message);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
fetchData();
|
|
7
|
+
getReports().then((res) => setData(res.data)).catch(console.error);
|
|
24
8
|
}, []);
|
|
25
9
|
|
|
26
|
-
const stockIn =
|
|
27
|
-
const stockOut =
|
|
10
|
+
const stockIn = data?.dailyStockIn?.length ?? 0;
|
|
11
|
+
const stockOut = data?.dailyStockOut?.length ?? 0;
|
|
28
12
|
|
|
29
13
|
return (
|
|
30
14
|
<div>
|
|
@@ -32,11 +16,11 @@ export default function Dashboard() {
|
|
|
32
16
|
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
|
33
17
|
<div className="bg-white border border-gray-200 rounded-lg p-4">
|
|
34
18
|
<p className="text-sm text-gray-500">Total Products</p>
|
|
35
|
-
<p className="text-2xl font-bold text-gray-800">{
|
|
19
|
+
<p className="text-2xl font-bold text-gray-800">{data?.totalProducts ?? 0}</p>
|
|
36
20
|
</div>
|
|
37
21
|
<div className="bg-white border border-gray-200 rounded-lg p-4">
|
|
38
22
|
<p className="text-sm text-gray-500">Warehouses</p>
|
|
39
|
-
<p className="text-2xl font-bold text-gray-800">{
|
|
23
|
+
<p className="text-2xl font-bold text-gray-800">{data?.totalWarehouses ?? 0}</p>
|
|
40
24
|
</div>
|
|
41
25
|
<div className="bg-white border border-gray-200 rounded-lg p-4">
|
|
42
26
|
<p className="text-sm text-gray-500">Stock In</p>
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
-
import { addStock,
|
|
2
|
+
import { addStock, getAllProfiles, getAllStocks, updateStock, deleteStock } from "../api/api";
|
|
3
3
|
|
|
4
4
|
export default function Stocks() {
|
|
5
5
|
const [loading, setLoading] = useState(false);
|
|
6
|
-
const [products, setProducts] = useState([]);
|
|
7
|
-
const [warehouses, setWarehouses] = useState([]);
|
|
8
6
|
const [users, setUsers] = useState([]);
|
|
9
7
|
const [transactions, setTransactions] = useState([]);
|
|
10
8
|
const [editing, setEditing] = useState(null);
|
|
@@ -12,14 +10,10 @@ export default function Stocks() {
|
|
|
12
10
|
useEffect(() => {
|
|
13
11
|
async function fetchData() {
|
|
14
12
|
try {
|
|
15
|
-
const [
|
|
16
|
-
getAllProducts(),
|
|
17
|
-
getAllWarehouses(),
|
|
13
|
+
const [uRes, tRes] = await Promise.all([
|
|
18
14
|
getAllProfiles(),
|
|
19
15
|
getAllStocks(),
|
|
20
16
|
]);
|
|
21
|
-
setProducts(pRes.data);
|
|
22
|
-
setWarehouses(wRes.data);
|
|
23
17
|
setUsers(uRes.data);
|
|
24
18
|
setTransactions(tRes.data);
|
|
25
19
|
} catch (error) {
|
|
@@ -142,22 +136,12 @@ export default function Stocks() {
|
|
|
142
136
|
</div>
|
|
143
137
|
<div className="grid grid-cols-2 gap-2">
|
|
144
138
|
<div>
|
|
145
|
-
<label className="block text-xs font-medium text-gray-700 mb-0.5">Warehouse</label>
|
|
146
|
-
<
|
|
147
|
-
<option value="">Select</option>
|
|
148
|
-
{warehouses.map((w) => (
|
|
149
|
-
<option key={w._id} value={w.WarehouseCode}>{w.WarehouseCode}</option>
|
|
150
|
-
))}
|
|
151
|
-
</select>
|
|
139
|
+
<label className="block text-xs font-medium text-gray-700 mb-0.5">Warehouse Code</label>
|
|
140
|
+
<input type="text" name="WarehouseCode" required defaultValue={editTx?.WarehouseCode || ''} disabled={!!editing} placeholder="Enter w-Code" className="w-full border border-gray-300 rounded px-2 py-1.5 text-xs focus:outline-none focus:ring-2 focus:ring-olive-500 disabled:bg-gray-100" />
|
|
152
141
|
</div>
|
|
153
142
|
<div>
|
|
154
|
-
<label className="block text-xs font-medium text-gray-700 mb-0.5">Product</label>
|
|
155
|
-
<
|
|
156
|
-
<option value="">Select</option>
|
|
157
|
-
{products.map((p) => (
|
|
158
|
-
<option key={p._id} value={p.ProductCode}>{p.ProductCode}</option>
|
|
159
|
-
))}
|
|
160
|
-
</select>
|
|
143
|
+
<label className="block text-xs font-medium text-gray-700 mb-0.5">Product Code</label>
|
|
144
|
+
<input type="text" name="ProductCode" required defaultValue={editTx?.ProductCode || ''} disabled={!!editing} placeholder="Enter p-Code" className="w-full border border-gray-300 rounded px-2 py-1.5 text-xs focus:outline-none focus:ring-2 focus:ring-olive-500 disabled:bg-gray-100" />
|
|
161
145
|
</div>
|
|
162
146
|
</div>
|
|
163
147
|
<div className="flex gap-2 pt-1">
|
|
@@ -182,7 +166,7 @@ export default function Stocks() {
|
|
|
182
166
|
<th className="px-3 py-2">T-ID</th>
|
|
183
167
|
<th className="px-3 py-2">Date</th>
|
|
184
168
|
<th className="px-3 py-2">Type</th>
|
|
185
|
-
<th className="px-3 py-2">
|
|
169
|
+
<th className="px-3 py-2">Quantity</th>
|
|
186
170
|
<th className="px-3 py-2">Product</th>
|
|
187
171
|
<th className="px-3 py-2">Warehouse</th>
|
|
188
172
|
<th className="px-3 py-2">User</th>
|