We currently have a single type of transaction which appears under /audits:
{
"id": 0,
"created_at": "2017-09-27T18:45:15Z",
"difference": 5,
"product": 0
}
But there are actually at least two different types of transactions here:
- buying a product (
product specifies what was bought; difference is negative)
- depositing money (
product is None; difference is positive)
- paying money (
product is None; difference is positive)
We distinguish these via the product and via the difference field.
But there can probably be more types:
I just wanted to hear your opinions about changing the data model of a transaction and how we could achieve transferring money.