akuntansi-sia/resources/diagrams/erd.drawio

88 lines
5.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" modified="2026-06-08T00:00:00.000Z" agent="GitHub Copilot" etag="1">
<diagram id="erd1" name="ERD">
<![CDATA[<mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- Products -->
<mxCell id="p1" value="&lt;b&gt;products&lt;/b&gt;&lt;br/&gt;PK id&lt;br/&gt;name&lt;br/&gt;category&lt;br/&gt;purchase_price&lt;br/&gt;selling_price&lt;br/&gt;image&lt;br/&gt;branch (string)&lt;br/&gt;created_at, updated_at" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#FFF2CC;strokeColor=#D6B656;" vertex="1" parent="1">
<mxGeometry x="40" y="40" width="220" height="160" as="geometry"/>
</mxCell>
<!-- Stocks -->
<mxCell id="s1" value="&lt;b&gt;stocks&lt;/b&gt;&lt;br/&gt;PK id&lt;br/&gt;product_id (FK)&lt;br/&gt;branch (string)&lt;br/&gt;quantity&lt;br/&gt;unit&lt;br/&gt;created_at, updated_at" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#E2F0D9;strokeColor=#6AA84F;" vertex="1" parent="1">
<mxGeometry x="320" y="40" width="220" height="160" as="geometry"/>
</mxCell>
<!-- Sales -->
<mxCell id="sa1" value="&lt;b&gt;sales&lt;/b&gt;&lt;br/&gt;PK id&lt;br/&gt;date&lt;br/&gt;branch (string)&lt;br/&gt;product_id (FK, nullable)&lt;br/&gt;item&lt;br/&gt;quantity&lt;br/&gt;total_price&lt;br/&gt;created_at, updated_at" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F4CCCC;strokeColor=#B85454;" vertex="1" parent="1">
<mxGeometry x="600" y="40" width="240" height="180" as="geometry"/>
</mxCell>
<!-- Purchases -->
<mxCell id="pu1" value="&lt;b&gt;purchases&lt;/b&gt;&lt;br/&gt;PK id&lt;br/&gt;date&lt;br/&gt;branch (string)&lt;br/&gt;product_id (FK, nullable)&lt;br/&gt;item&lt;br/&gt;quantity&lt;br/&gt;total_price&lt;br/&gt;created_at, updated_at" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F4CCCC;strokeColor=#B85454;" vertex="1" parent="1">
<mxGeometry x="600" y="240" width="240" height="180" as="geometry"/>
</mxCell>
<!-- Branches -->
<mxCell id="b1" value="&lt;b&gt;branches&lt;/b&gt;&lt;br/&gt;PK id&lt;br/&gt;name (unique)&lt;br/&gt;created_at, updated_at" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#D9E1FF;strokeColor=#6D9EEB;" vertex="1" parent="1">
<mxGeometry x="320" y="240" width="220" height="120" as="geometry"/>
</mxCell>
<!-- Users -->
<mxCell id="u1" value="&lt;b&gt;users&lt;/b&gt;&lt;br/&gt;PK id&lt;br/&gt;name&lt;br/&gt;email&lt;br/&gt;password&lt;br/&gt;role (enum)&lt;br/&gt;branch (string)&lt;br/&gt;created_at, updated_at" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EAD1DC;strokeColor=#A64D79;" vertex="1" parent="1">
<mxGeometry x="40" y="240" width="220" height="160" as="geometry"/>
</mxCell>
<!-- Operational Costs -->
<mxCell id="oc1" value="&lt;b&gt;operational_costs&lt;/b&gt;&lt;br/&gt;PK id&lt;br/&gt;branch (string)&lt;br/&gt;date&lt;br/&gt;label&lt;br/&gt;amount&lt;br/&gt;created_at, updated_at" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#EFEFEF;strokeColor=#999999;" vertex="1" parent="1">
<mxGeometry x="600" y="460" width="240" height="140" as="geometry"/>
</mxCell>
<!-- Edges: product -> stocks -->
<mxCell id="e1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#6AA84F;" edge="1" parent="1" source="p1" target="s1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- product -> sales -->
<mxCell id="e2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#B85454;" edge="1" parent="1" source="p1" target="sa1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- product -> purchases -->
<mxCell id="e3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#B85454;" edge="1" parent="1" source="p1" target="pu1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- branches referenced by stocks -->
<mxCell id="e4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#6D9EEB;" edge="1" parent="1" source="b1" target="s1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- branches referenced by sales -->
<mxCell id="e5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#6D9EEB;" edge="1" parent="1" source="b1" target="sa1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- branches referenced by purchases -->
<mxCell id="e6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#6D9EEB;" edge="1" parent="1" source="b1" target="pu1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- branches referenced by users -->
<mxCell id="e7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#6D9EEB;" edge="1" parent="1" source="b1" target="u1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- branches referenced by operational_costs -->
<mxCell id="e8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#6D9EEB;" edge="1" parent="1" source="b1" target="oc1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>]]>
</diagram>
</mxfile>