diff options
| author | Joe Carstairs <jcarstairs@scottlogic.com> | 2025-07-23 16:30:49 +0100 |
|---|---|---|
| committer | Joe Carstairs <jcarstairs@scottlogic.com> | 2025-07-23 16:30:49 +0100 |
| commit | 74f388d9b4a6746596b28bf056528ee8b54df6e4 (patch) | |
| tree | f055180e912f015af52b1dd87c61d168884cd889 /requirements/catalogue/req-092.md | |
| parent | 576ae825d343c8fbad1d7edff6d4bac992414a4c (diff) | |
task-059: req-eng's tank balance UI
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`. |
