Add the list block and the module layer with the note module
Security / Vulnerability check (push) Successful in 41s
Test / Lint and test (push) Successful in 1m50s

The list block prints items with a dot, dash, number or checkbox bullet,
wrapping a long item with a hanging indent; a checkbox list ticks its
done items as [√], or [x] on code pages without √. It stands alone or
inside a box, and its items, bullet and done fields carry their enums
and limits as jsonschema tags.

internal/pkg/modules holds modules that build ordinary jobs from their
own payloads: a registry by name, an Env with the clock, time zone and
time layout, strict payload decoding that reports every problem, ErrSkip
and PayloadError. The note module prints a boxed note with an optional
checklist and a time stamp in the footer.

Three routes join the route table: POST /api/v1/print/{module} and
POST /api/v1/preview/{module}, which take ?copies and a reserved
?printer, and GET /api/v1/modules. Print and the module route share one
submit path, and preview shares one too. New error codes:
invalid_payload, invalid_query, unknown_printer, module_not_found and
module_failed; a module that builds an invalid receipt is logged and
reported to Sentry once. [format] gains timezone and time_layout, the
binary embeds the time zone database, and uberbringer preview takes
--module.

The note receipt passed on the TM-T88IV, and its bytes are pinned in
TestPaperReceipts. docs/api.md describes the list block, the module
routes and the note payload; docs/swagger.json is regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-11-30 10:55:50 -06:00
1 parent 6b2e402f1a
commit 3e9779f71a
69 files changed
+3092 -262

No files matched your search

+11
View File
@@ -111,6 +111,9 @@ func TestEnumTagsMatchValidation(t *testing.T) {
{"Leader", "leader", func(v string) []Element {
return []Element{{Type: TypeKV, Pairs: []Pair{{Key: "k", Value: "v"}}, Leader: v}}
}},
{"Bullet", "bullet", func(v string) []Element {
return []Element{{Type: TypeList, Items: []string{"i"}, Bullet: v}}
}},
}
for _, tt := range tests {
t.Run(tt.field, func(t *testing.T) {
@@ -193,6 +196,14 @@ func TestBoundTagsMatchValidation(t *testing.T) {
func(n int) Job { return one(kv(n, "k")) }},
{reflect.TypeFor[Pair](), "Key", "key", "minLength", "",
func(n int) Job { return one(kv(1, strings.Repeat("k", n))) }},
{reflect.TypeFor[Element](), "Items", "items", "minItems", "maxItems",
func(n int) Job { return one(Element{Type: TypeList, Items: slices.Repeat([]string{"i"}, n)}) }},
{reflect.TypeFor[Element](), "Items", "items", "minLength", "",
func(n int) Job { return one(Element{Type: TypeList, Items: []string{strings.Repeat("i", n)}}) }},
{reflect.TypeFor[Element](), "Done", "done", "minimum", "maximum",
func(n int) Job {
return one(Element{Type: TypeList, Bullet: "checkbox", Items: slices.Repeat([]string{"i"}, MaxItems), Done: []int{n}})
}},
}
for _, tt := range tests {
t.Run(tt.json, func(t *testing.T) {