Skip to content

feat(#489): show the last V-code / L-code in use on Admin → Health, with the next free number - #490

Merged
guycorbaz merged 1 commit into
mainfrom
feat/489-health-label-watermarks
Sep 23, 2026
Merged

guycorbaz merged 1 commit into
mainfrom
feat/489-health-label-watermarks

Conversation

@guycorbaz

Copy link
Copy Markdown
Owner

Closes #489.

What

Admin → Health gains a Barcode labels section under the entity counters: the last volume number (V-code) and the last shelf number (L-code) ever printed, each with the next free number — V0142 (next: V0143). An empty family reads "None yet"; X9999 reads "none left".

Why

The librarian prints sheets of pre-generated barcode labels in advance and needs to know where the occupied range ends. Since #428 the answer lived only on the /catalog info line; the Health tab already aggregates catalog counters, so it is the natural second home.

How

  • services/admin_health: LabelWatermarks + label_watermarks() reuse the two highest_label_any model lookups (soft-deleted rows included — a printed sticker outlives the row, so its number is never reissued, same semantics as /catalog). next_label() increments within the fixed X9999 width and returns None once exhausted or on malformed input.
  • routes/admin + admin_health_panel.html: pre-formatted strings, ids #health-last-vcode / #health-last-lcode.
  • Seven locale keys in en/fr/de/it; manual (en/fr) Health bullet updated.

Tests

  • Unit: next_label (increment, exhaustion, malformed); sqlx: empty catalog, trashed rows still count.
  • E2E admin-health-label-watermarks.spec.ts: blank-browser login → create shelf + volume → read both values (highest ≥ created code, next = highest + 1) → trash the volume → watermark does not drop. Parallel-safe and idempotent on re-run.
  • Local: cargo clippy -D warnings, cargo test (lib + integration), cargo sqlx prepare --check, full Playwright suite at CI=true --workers=2 on a fresh stack: 335 passed.

🤖 Generated with Claude Code

…ith the next free number

The librarian prints sheets of pre-generated barcode labels in advance
and needs to know where the occupied range ends. Since #428 the answer
lived only on the /catalog info line; the Health tab, which already
aggregates catalog counters, now carries it too, each value paired with
the next free number ("V0142 (next: V0143)").

- services/admin_health: `LabelWatermarks` + `label_watermarks()` reuse
  the two `highest_label_any` model lookups (soft-deleted rows included,
  so a printed sticker is never reissued) and `next_label()` increments
  within the fixed X9999 width, returning None once the space is
  exhausted or the input is malformed.
- routes/admin + fragment: a "Barcode labels" section under the entity
  counters, with a "none yet" / "none left" placeholder per family.
- locales: seven keys in en/fr/de/it.
- manual en/fr: the Health tab bullet now mentions the rows.
- tests: pure unit tests for `next_label`, sqlx tests for the service
  (empty catalog, trashed rows still count), and an E2E smoke journey
  that creates a shelf and a volume, reads both values, then trashes the
  volume and checks the watermark does not drop.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@guycorbaz
guycorbaz marked this pull request as ready for review September 23, 2026 19:08
@guycorbaz
guycorbaz merged commit 528e6b6 into main Sep 23, 2026
8 checks passed
@guycorbaz
guycorbaz deleted the feat/489-health-label-watermarks branch September 23, 2026 19:08
guycorbaz added a commit that referenced this pull request Sep 23, 2026
* release: v1.20.0 — where the labels end (#489)

Version bump plus the Foundation Rule 19 documentation sweep. No source
change: the feature is already on main (#490).

- Cargo.toml + Cargo.lock → 1.20.0
- Manual EN + FR: title-page version, install snippets, "What's new in
  1.20.0" in chapter 8, PDFs rebuilt and committed
- README: image-size badge, status line, live-install label, current
  release paragraph
- ROADMAP: current-stable header, v1.20.0 shipped section
- docs/dockerhub-overview.md: tags list
- website: nav badges, hero, JSON-LD softwareVersion, roadmap meta and
  narratives, sitemap lastmod
- sprint-status.yaml: last_updated header

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* release: bump rustls 0.23.40 → 0.23.45 for RUSTSEC-2026-0285

The release-cut cargo audit flagged the transitive rustls in Cargo.lock
(TLS 1.3 handshake messages accepted across encryption-level boundaries,
medium). Lockfile-only update; noted in the v1.20.0 roadmap entry and
in both manuals' "What's new", PDFs rebuilt.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CR] Show the last V-code and L-code in use on Admin → Health, with the next free number

1 participant