The main feature of our application is to track the user's expenses. A user should be able to insert expenses, be persisted in the system, and see the exact balance for his/her account.
There should always be a clear view of what is desired to be achieved. Let's take a high-level view of what we want to achieve:
A user should be able to persist an expense in the system
A user should be able to get all their expenses
A user should be able to get the balance of their expenses
A user should be able to define a category in which to save expenses, for example, groceries
In our case, an expense will store the exact value of money spent. In some cases, working with monetary data can get tricky. Often, applications that handle monetary data are required to work with fractional units of the currency.
We could store data in floating-point numbers. However, in JavaScript, floating-point arithmetic often does not conform to monetary arithmetic. In other words, values like...