summaryrefslogtreecommitdiff
path: root/requirements/data_models/dml-bucket.md
blob: 809fe33dde169a00391c2f034af71a1d56031b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# dml-bucket

A bucket represents a real category of spending, like beer or holidays.

| Field             | Type    | Description                                               |
| ----------------- | ------- | --------------------------------------------------------- |
| id                | string  | A unique identifier for the bucket.                       |
| name              | string  | A short description of the real category of spending.     |
| balance           | number  | The amount of money the user intends to be free to spend. |
| balance_cache_key | string  | A cache key for the balance. See notes.                   |
| group             | string  | The name of a group of buckets to which this belongs.     |
| is_hidden         | boolean | Whether this bucket should be hidden in the UI.           |
| is_favourite      | boolean | Whether this bucket should be given priority in the UI.   |

Constraints:

- `name` must be unique.
- `id` must be equal to `name`, that is, `id` is an alias of the property,
  `name`.
- `is_hidden` should never be true when `balance` is non-zero.

Notes:

- `balance_cache_key` must be of the format: `<drip_id>:<transaction_id>`.
- `is_hidden` is used as an equivalent of soft-deletion. Buckets should never be
  actually deleted.

Sources: req-027, req-098, req-110, req-111, task-028, ui-designs/desktop-views