diff options
Diffstat (limited to 'requirements/catalogue/req-092.md')
| -rw-r--r-- | requirements/catalogue/req-092.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/requirements/catalogue/req-092.md b/requirements/catalogue/req-092.md new file mode 100644 index 0000000..cde945e --- /dev/null +++ b/requirements/catalogue/req-092.md @@ -0,0 +1,21 @@ +# req-092 + +As a user, when I'm creating, updating and deleting my buckets and pipes, I want +to see the result of the procedure, +`calculate_tank_balance`, described below, +so that I see a prominent number which I know summarises what the difference +between my incomings and outgoings has actually been in the past, so that my +incomings and outgoings are roughly equal in the long run. + +Source: req-091 + +Satisfied by: dml-drip, dml-transaction, dml-bucket, ass-009, ass-021, req-093, req-094 + +## calculate_tank_balance + +1. Let `drip_sum` be the sum of all `drip.amount` for all drips `drip`. +2. Let `transaction_sum` be the sum of all `transaction.amount` for all + transactions `transaction`. +3. Let `bucket_overdraw_sum` be the sum of all `bucket.balance` for all buckets + `bucket` such that `bucket.balance < 0`. +4. Return `transaction_sum + bucket_overdraw_sum - drip_sum`. |
