-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesign.drawio
57 lines (57 loc) · 7.53 KB
/
design.drawio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<mxfile host="65bd71144e">
<diagram id="l8TtVwg_FT4pCI3KlZWi" name="Page-1">
<mxGraphModel dx="590" dy="380" 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">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="<b>Class:&nbsp; Account</b>" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="70" y="20" width="160" height="420" as="geometry"/>
</mxCell>
<mxCell id="3" value="<b>variables:&nbsp;</b><br>-balance (2 point float)<br>- transactions (array of transaction instances)<br>-transactionLogs (array of strings which are generated from the transaction instances)<br>-instructions (a set string which is printed on the REPL to instruct user)<br><br><br>" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="160" height="130" as="geometry"/>
</mxCell>
<mxCell id="18" value="<b>function: makeTransaction(type, date, amount)</b><br><i>-once an account is instantiated, this function is used with the required data to create the relevant Transaction class instance</i>" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="160" width="160" height="130" as="geometry"/>
</mxCell>
<mxCell id="4" value="<b>private function: createLogRecord</b><br><i>-once a transaction instance is created and not null type or amount, and stored in the account instance, a log is created</i>" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="290" width="160" height="130" as="geometry"/>
</mxCell>
<mxCell id="6" value="<b>Class: Transaction</b>" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="340" y="170" width="300" height="440" as="geometry"/>
</mxCell>
<mxCell id="7" value="<b>private function:&nbsp; deposit(balance, amount, date)</b><br><i>-called by account instance with current balance, amount to add and today's date as arguments. returns as transaction instance with type data and new account instance balance</i>" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="6" vertex="1">
<mxGeometry y="30" width="300" height="90" as="geometry"/>
</mxCell>
<mxCell id="8" value="<b>private function: withdraw(balance, amount, date)</b><br><i>- same as above except with amount being subtracted instead of added</i>" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="6" vertex="1">
<mxGeometry y="120" width="300" height="60" as="geometry"/>
</mxCell>
<mxCell id="9" value="<b>private function: dateCheck(date)</b><br><i>- takes input date and returns valid current timestamp if date input formatting is incorrect. dates are available to input manually (rather than just being a live timestamp) because the acceptance criteria show a use case of transactions over multiple days, which would otherwise be impossible to test and implement</i><br><br><b>private function: amountCheck(amount)</b><br><i style=""><b>- </b>takes amount figure that's attempting to be used in the transaction calculations and checks if it is a number, and if it is not 0 (and therefore a pointless and invalid transaction)</i>" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="6" vertex="1">
<mxGeometry y="180" width="300" height="260" as="geometry"/>
</mxCell>
<mxCell id="10" value="<b>Class: StatementPrinter</b>" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="40" y="510" width="260" height="140" as="geometry"/>
</mxCell>
<mxCell id="11" value="<b>function: printStatement(account)<br></b><i>- takes an account instance as an argument, and returns a formatted print out statement of all transactions chronologically</i>" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="10" vertex="1">
<mxGeometry y="30" width="260" height="110" as="geometry"/>
</mxCell>
<mxCell id="15" style="edgeStyle=none;html=1;entryX=-0.003;entryY=-0.091;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="18" target="8" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="17" style="edgeStyle=none;html=1;entryX=0.418;entryY=-0.034;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="4" target="10" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="19" style="edgeStyle=none;html=1;entryX=1.005;entryY=0.123;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="7" target="18" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="X3huD8HtOQgaazuK9_Nj" name="Page-2">
<mxGraphModel dx="372" dy="380" 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">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
</root>
</mxGraphModel>
</diagram>
</mxfile>