afdfb4d5

Author: Michael Lynch <git@mtlynch.io>

Committer: Michael Lynch <mtlynch@noreply.codeberg.org>

Use ItemName type for grocery item names throughout core logic (#76)

Item names were passed around as plain strings, so the validated
ItemName type only existed momentarily inside the sqlite layer before
being converted back. This widens ItemName usage so names stay typed
across the store interface, business logic, and shared types, matching
how the Section type already flows through the codebase.

Strings are now used for item names only at the true boundaries:
- handlers parse user-controlled form/path input into ItemName and
  render names back to strings (templates, JSON)
- the sqlite package converts ItemName to/from string immediately
  adjacent to SQL reads and writes

types.StoredListItem.Name now uses ItemName (types.ItemSection.Name
already did), and the Store interface methods that take/return item
names use ItemName rather than string. Adds MustCreateNewItemName as a
test helper, mirroring MustCreateNewSection.

Reviewed-on: https://codeberg.org/mtlynch/grosiree/pulls/76

Suite timing

Time to Start Worker time Duration Time to finish
Config 2s 7s 7s 10s
Eval 7s 28s 28s 35s
Build 10s 1m35s 23s 34s
Suite 2s 2m11s 33s 35s

Timeline

0s10s20s30s