Skip to content

Commit

Permalink
Merge pull request #234 from Bawfen/AddStorageToDG
Browse files Browse the repository at this point in the history
Add storage to dg
  • Loading branch information
Arif-Khalid authored Apr 10, 2023
2 parents a68d088 + 6ee801a commit 0451d9d
Show file tree
Hide file tree
Showing 8 changed files with 343 additions and 60 deletions.
24 changes: 18 additions & 6 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,30 @@
* [Forex component](#forex-component)
* [Open Exchange Rates API](#open-exchange-rates-api)
* [Transactions Component](#transactions-component)
* [Storage Component](#storage-component)
* [Implementation](#implementation)
* [Create/Delete account feature](#createdelete-account-feature)
* [Add/Withdraw money feature](#addwithdraw-money-feature)
* [View balance feature](#view-balance-feature)
* [Show-rate feature](#show-rate-feature)
* [Money exchange feature](#money-exchange-feature)
* [Show transactions feature](#show-transactions-feature)
* [Appendix: Requirements](#appendix58-requirements)
* [Appendix - Requirements](#appendix---requirements)
* [Product scope](#product-scope)
* [Target user profile](#target-user-profile)
* [Value proposition](#value-proposition)
* [User Stories](#user-stories)
* [Non-Functional Requirements](#non-functional-requirements)
* [Glossary](#glossary)
* [Appendix: Instructions for Manual Testing](#appendix58-instructions-for-manual-testing)
* [Appendix - Instructions for Manual Testing](#appendix---instructions-for-manual-testing)
* [Initial Launch](#initial-launch)
* [Help Command](#help-command)
* [Creating an account](#creating-an-account)
* [Creating transactions](#creating-transactions)
* [Viewing exchange rates](#viewing-exchange-rates)
* [Exchanging money between different currencies](#exchanging-money-between-different-currencies)
* [Deleting accounts](#deleting-accounts)
* [Appendix: Instructions for updating the API Key](#appendix--instructions-for-updating-the-api-key)
* [Appendix - Instructions for updating the API Key](#appendix---instructions-for-updating-the-api-key)

<!-- TOC -->

Expand Down Expand Up @@ -204,6 +205,17 @@ The `Transactions` component
- `Transactions` are only accessed through the `TransactionManager`
- `Transactions` associated to an account are deleted if and only if the account is deleted

### Storage Component

The following is a class diagram of the `Storage` component
![StoreClassDiagram](images/StoreClassDiagram.png)

- The `Storage` component is responsible for saving and loading data from disk.
- It stores the account and transaction data in JSON format using the Gson library.
- The `Storage` component makes use of dependency injection with the `StoreInterface` so that a stub (`TestStore`) can
be injected when running automated tests. This prevents the automated tests from modifying the actual data stored on
disk or having to consider potential side effects from previous tests.

## Implementation

### Create/Delete account feature
Expand Down Expand Up @@ -347,7 +359,7 @@ The following sequence diagram shows how the **Transaction command** works

![TransactionSeqDiagram](images/ShowTransactionsSeqDiagram.png)

## Appendix&#58; Requirements
## Appendix - Requirements

### Product scope

Expand Down Expand Up @@ -390,7 +402,7 @@ Command Line Interface (CLI) while still having the features of other money mana

* **Mainstream OS**: Windows, Linux, Unix, OS-X

## Appendix&#58; Instructions for Manual Testing
## Appendix - Instructions for Manual Testing

Given below are some instructions for testing the app manually. Note that they are meant to provide a starting point
and are not an exhaustive list of test cases.
Expand Down Expand Up @@ -432,7 +444,7 @@ and are not an exhaustive list of test cases.
another currency or withdrawing all the money.
2. You can then delete an account using the `delete-account` command.

## Appendix: Instructions for updating the API Key
## Appendix - Instructions for updating the API Key

- The API Key for retrieving exchange rates is stored in the `src/main/java/com/moneymoover/api/ExchangeRates.java` file
as the `APP_ID` property.
Expand Down
221 changes: 220 additions & 1 deletion docs/diagrams/BasicSequence.drawio

Large diffs are not rendered by default.

87 changes: 47 additions & 40 deletions docs/diagrams/ShowTransactionsSeqDiagram.drawio
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
<mxfile host="app.diagrams.net" modified="2023-03-29T10:26:37.161Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" etag="XObr8-MGmxFxBCZOCuhq" version="21.1.1" type="device">
<mxfile host="app.diagrams.net" modified="2023-04-10T13:26:00.840Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" etag="BeHIJlgyh3oRbSTJ9m1q" version="21.1.5" type="device">
<diagram name="Page-1" id="2YBvvXClWsGukQMizWep">
<mxGraphModel dx="2085" dy="568" 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">
<mxGraphModel dx="2156" dy="733" 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="aM9ryv3xv72pqoxQDRHE-1" value="TransactionCommand" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=0;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={&quot;edgeStyle&quot;:&quot;elbowEdgeStyle&quot;,&quot;elbow&quot;:&quot;vertical&quot;,&quot;curved&quot;:0,&quot;rounded&quot;:0};" parent="1" vertex="1">
<mxCell id="a20nSgyE2VclxuOLMxw--99" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=-0.003;entryY=0.759;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.999;exitY=0.759;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--10" target="a20nSgyE2VclxuOLMxw--10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="630" y="651" as="sourcePoint" />
<mxPoint x="51" y="650" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--98" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=0.001;entryY=0.586;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0.587;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--10" target="a20nSgyE2VclxuOLMxw--10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="629" y="490" as="sourcePoint" />
<mxPoint x="48" y="491" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--12" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=-0.003;entryY=0.404;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.999;exitY=0.402;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--10" target="a20nSgyE2VclxuOLMxw--10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="929" y="372" as="sourcePoint" />
<mxPoint x="-39" y="373" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--97" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=0.001;entryY=0.208;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1.001;exitY=0.209;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--10" target="a20nSgyE2VclxuOLMxw--10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="629" y="490" as="sourcePoint" />
<mxPoint x="48" y="491" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--10" value="alt" style="shape=umlFrame;whiteSpace=wrap;html=1;pointerEvents=0;" parent="1" vertex="1">
<mxGeometry x="40" y="130" width="580" height="870" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--1" value="alt" style="shape=umlFrame;whiteSpace=wrap;html=1;pointerEvents=0;" parent="1" vertex="1">
<mxGeometry x="-50" y="120" width="700" height="1010" as="geometry" />
</mxCell>
<mxCell id="aM9ryv3xv72pqoxQDRHE-1" value=":TransactionCommand" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=0;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={&quot;edgeStyle&quot;:&quot;elbowEdgeStyle&quot;,&quot;elbow&quot;:&quot;vertical&quot;,&quot;curved&quot;:0,&quot;rounded&quot;:0};" parent="1" vertex="1">
<mxGeometry x="110" y="30" width="130" height="1160" as="geometry" />
</mxCell>
<mxCell id="aM9ryv3xv72pqoxQDRHE-2" value="" style="html=1;points=[];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={&quot;edgeStyle&quot;:&quot;elbowEdgeStyle&quot;,&quot;elbow&quot;:&quot;vertical&quot;,&quot;curved&quot;:0,&quot;rounded&quot;:0};" parent="aM9ryv3xv72pqoxQDRHE-1" vertex="1">
Expand All @@ -18,9 +48,6 @@
<mxCell id="aM9ryv3xv72pqoxQDRHE-5" value=":UI" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=0;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={&quot;edgeStyle&quot;:&quot;elbowEdgeStyle&quot;,&quot;elbow&quot;:&quot;vertical&quot;,&quot;curved&quot;:0,&quot;rounded&quot;:0};" parent="1" vertex="1">
<mxGeometry x="465" y="30" width="100" height="1160" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--1" value="alt" style="shape=umlFrame;whiteSpace=wrap;html=1;pointerEvents=0;" parent="1" vertex="1">
<mxGeometry x="-50" y="120" width="700" height="1010" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--4" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=0.002;entryY=0.889;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1.003;exitY=0.892;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--1" target="a20nSgyE2VclxuOLMxw--1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="820" y="280" as="sourcePoint" />
Expand All @@ -33,18 +60,9 @@
<mxCell id="a20nSgyE2VclxuOLMxw--6" value="[Exception]" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="-44" y="1040" width="80" height="30" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--10" value="alt" style="shape=umlFrame;whiteSpace=wrap;html=1;pointerEvents=0;" parent="1" vertex="1">
<mxGeometry x="40" y="130" width="580" height="870" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--11" value="[args.length == 1]" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="40" y="165" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--12" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=-0.003;entryY=0.404;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.999;exitY=0.402;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--10" target="a20nSgyE2VclxuOLMxw--10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="929" y="372" as="sourcePoint" />
<mxPoint x="-39" y="373" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--23" style="edgeStyle=elbowEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;elbow=vertical;curved=0;" parent="1" source="a20nSgyE2VclxuOLMxw--13" target="a20nSgyE2VclxuOLMxw--22" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
Expand Down Expand Up @@ -415,32 +433,14 @@
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--97" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=0.001;entryY=0.208;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1.001;exitY=0.209;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--10" target="a20nSgyE2VclxuOLMxw--10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="629" y="490" as="sourcePoint" />
<mxPoint x="48" y="491" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--98" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=0.001;entryY=0.586;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0.587;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--10" target="a20nSgyE2VclxuOLMxw--10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="629" y="490" as="sourcePoint" />
<mxPoint x="48" y="491" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--99" value="" style="endArrow=none;dashed=1;html=1;rounded=0;entryX=-0.003;entryY=0.759;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.999;exitY=0.759;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="a20nSgyE2VclxuOLMxw--10" target="a20nSgyE2VclxuOLMxw--10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="630" y="651" as="sourcePoint" />
<mxPoint x="51" y="650" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--100" value="[flag == CURR_FLAG]" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="36" y="487.5" width="140" height="30" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--101" value="[flag == DATE_FLAG]" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="30" y="640" width="140" height="30" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--102" value="[flag == MONTH_FLAG]" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="31" y="797.5" width="150" height="30" as="geometry" />
<mxCell id="a20nSgyE2VclxuOLMxw--102" value="&lt;font style=&quot;font-size: 11px;&quot;&gt;[flag == MONTH_FLAG]&lt;/font&gt;" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="36" y="797.5" width="140" height="30" as="geometry" />
</mxCell>
<mxCell id="a20nSgyE2VclxuOLMxw--103" value="" style="html=1;points=[];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={&quot;edgeStyle&quot;:&quot;elbowEdgeStyle&quot;,&quot;elbow&quot;:&quot;vertical&quot;,&quot;curved&quot;:0,&quot;rounded&quot;:0};" parent="1" vertex="1">
<mxGeometry x="510" y="730" width="10" height="10" as="geometry" />
Expand Down Expand Up @@ -480,7 +480,7 @@
<mxCell id="a20nSgyE2VclxuOLMxw--108" value="" style="html=1;points=[];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={&quot;edgeStyle&quot;:&quot;elbowEdgeStyle&quot;,&quot;elbow&quot;:&quot;vertical&quot;,&quot;curved&quot;:0,&quot;rounded&quot;:0};" parent="1" vertex="1">
<mxGeometry x="510" y="1080" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-1" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" edge="1" parent="1">
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-1" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="186" y="250" as="sourcePoint" />
<mxPoint x="180" y="270" as="targetPoint" />
Expand All @@ -490,7 +490,7 @@
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-2" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" edge="1" parent="1">
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-2" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="187" y="440" as="sourcePoint" />
<mxPoint x="181" y="460" as="targetPoint" />
Expand All @@ -500,7 +500,7 @@
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-3" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" edge="1" parent="1">
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-3" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="187" y="600" as="sourcePoint" />
<mxPoint x="181" y="620" as="targetPoint" />
Expand All @@ -510,7 +510,7 @@
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-4" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" edge="1" parent="1">
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-4" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="187" y="760" as="sourcePoint" />
<mxPoint x="181" y="780" as="targetPoint" />
Expand All @@ -520,7 +520,7 @@
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-5" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" edge="1" parent="1">
<mxCell id="SmZIZ6ZhfoR9nc0BJCIU-5" value="" style="endArrow=classic;html=1;rounded=0;dashed=1;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="187" y="910" as="sourcePoint" />
<mxPoint x="181" y="930" as="targetPoint" />
Expand All @@ -530,6 +530,13 @@
</Array>
</mxGeometry>
</mxCell>
<mxCell id="miJH-btvCudlr1_XcVju-1" value="" style="html=1;verticalAlign=bottom;endArrow=open;dashed=1;endSize=8;edgeStyle=elbowEdgeStyle;elbow=horizontal;curved=0;rounded=0;" parent="1" edge="1">
<mxGeometry x="-0.0049" relative="1" as="geometry">
<mxPoint x="181" y="1150" as="sourcePoint" />
<mxPoint x="-80" y="1150" as="targetPoint" />
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
Expand Down
Loading

0 comments on commit 0451d9d

Please sign in to comment.