tools: private tools tracker (/trackers/tools): inventory of tools, batteries and consumables by category, +/- quantities, add/edit dialog, scripts/tools-run.sh for bots
Deploy production / deploy (push) Successful in 1m39s
Deploy production / deploy (push) Successful in 1m39s
This commit is contained in:
1 parent
42711253b7
commit
7f71e88953
18 files changed
+47392
-3
No files matched your search
@@ -0,0 +1,29 @@
|
||||
# Tools tracker (/trackers/tools)
|
||||
|
||||
Private (owner-only, 404 for everyone else) inventory of Stan's physical tools, batteries and
|
||||
consumables. One row per kind of thing with a quantity (32 AAA batteries is one row).
|
||||
|
||||
- **Table** `tools.items`: name (unique, case-insensitive), brand, model, category, quantity,
|
||||
location, purchased_on, price_eur, specs (jsonb, verified specs only), notes, timestamps.
|
||||
- **Categories** live in `src/lib/tools/index.ts` (label, colours) and are validated in code, so
|
||||
adding one needs no migration: batteries, power_tools, hand_tools, measuring, electrical,
|
||||
fasteners, consumables, safety, other.
|
||||
- **Page**: grouped by category with item/piece totals, search, category filter, +/- quantity
|
||||
buttons and an add/edit dialog (specs as `key: value` lines).
|
||||
|
||||
## Adding items as a bot
|
||||
|
||||
On stan-ovh, from an up-to-date checkout of stan/website (e.g. `~/work/tools-tracker`, `git pull`
|
||||
first; never ~/dev/personal-website):
|
||||
|
||||
```sh
|
||||
scripts/tools-run.sh list # id, category, quantity, name
|
||||
scripts/tools-run.sh add '{"name":"AA batteries","category":"batteries","quantity":24,"specs":{"size":"AA"}}'
|
||||
scripts/tools-run.sh add '{"name":"AAA batteries","add":-4}' # used 4 (quantity delta)
|
||||
scripts/tools-run.sh import ~/imports/tools.json --dry-run # array of entries
|
||||
scripts/tools-run.sh delete 12
|
||||
```
|
||||
|
||||
Entries are upserted by name (or `id`): only the given fields change, `specs` are merged (a
|
||||
`null` value removes a key), `quantity` sets and `add` changes the count. DB_URL is read from
|
||||
the app container and never printed.
|
||||
Reference in new issue
Block a user