Skip to content

Commit

Permalink
Spec: Document keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Aug 19, 2024
1 parent 343058e commit 780ba63
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,28 @@ If a commit message starts with a special prefix, it will be parsed:
- `Transaction: <description>`: Create a transaction
- `Revert: <description>`: Revert a transaction

The `<description>` is a human-readable desription of the transaction.
The `<description>` is a human-readable description of the transaction.

The data of the transaction (in TOML format) is inserted between two markers
(`---` on a dedicated line). This allows adding more metadata before or after
the data section, which won't be parsed.

### TOML keys

The TOML section can use the following keys:

- `from` (required): The source account
- `to` (required): The destination account
- `amount` (required): The amount (must fit in i32, i.e. between `-2147483648`
and `2147483647` inclusive)
- `description` (optional): A free-form string to describe the transaction
- `meta` (optional): A table containing meta information

The following meta keys may be used, all of them are optional:

- `class`: The product class as a string, e.g. "softdrink".
- `ean`: The EAN code as an unsigned integer.

### Example commits

Deposit some cash:
Expand Down

0 comments on commit 780ba63

Please sign in to comment.