Skip to content

Follow-up alignment with Pinakes 0.9.0: consultation switch, closed-day approvals, offline quotes - #56

Draft
fabiodalez-dev wants to merge 6 commits into
feat/server-090-alignmentfrom
feat/server-090-followup
Draft

fabiodalez-dev wants to merge 6 commits into
feat/server-090-alignmentfrom
feat/server-090-followup

Conversation

@fabiodalez-dev

@fabiodalez-dev fabiodalez-dev commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #55. Closes the gaps between #55 and the Mobile API the Pinakes 0.9.0 stack sends today, and brings 0.9.0 features to the app.

Server requirement

Pinakes 0.9.0 as on its current stack: /health.features.consultation_only (Pinakes 71514e3a), status: prenotato with start_date on POST /reservations (487ec78d), override_limits on POST /staff/reservations, and quoted exact-spelling search (#501). On an older server nothing changes: a server without consultation_only keeps tying consultation to circulation_rules as in #55, one without prenotato never sends it, and override_limits is sent only when staff tick it with the rules on.

The profile's patron type (#55) and the copy editor's consultation switch also need fabiodalez-dev/Pinakes#516, which adds patron_type to GET /me and consultation_only to staff copies and to PUT /staff/copies/{id}. Until it is merged the profile row stays hidden, every copy reads lendable, and a change of the switch is ignored by the server.

What changes

  • Consultation-only copies on their own switch. Pinakes 0.9.0 split them off the rules matrix: with circulation_rules off and consultation_only on, loanable can still be false. The book page fetched the reader's rules only with circulation_rules on, so a consultation-only title offered the loan button and the request was refused after sending. InstanceFeatures now reads consultation_only (off in catalogue mode or with app access off), and the book page asks for the rules when either switch is on.
  • A loan approved on a closed day. With the library closed today an auto-approved request comes back prenotato with start_date. The app read every auto-approved request as ready for pickup. A new LoanScheduled kind carries start_date, and the confirmation names the pickup day, worded as the server's message.
  • Quoted searches offline. Online, quotes ask the server for the exact spelling (#501). Offline the key folds accents, and the quotes themselves were searched for, so a quoted query found nothing. SearchText.withoutSearchQuotes() drops straight and typographic quotes as the server reads them, in the text query and in the author and publisher filters (filterPattern()). An inch mark after a digit (12") stays.
  • Staff reservations beyond the patron type's limits. The website's new-reservation form has "Ignora i limiti di prenotazione della tipologia del lettore" with patron-type rules on. The staff new-reservation form now has the same switch and sends override_limits: true; without it the key is left out.
  • Library card barcode. Pinakes 0.9.0 prints library cards with codice_tessera as Code128 by default, and the desk and the visitor-log kiosk scan it. The profile now draws the same Code128 under the card details, black on white whatever the theme, with the ZXing core the scanner already uses. Only printable ASCII is encoded, as on the printed card.
  • Consultation-only copies from the copy editor. With features.consultation_only on, the staff copy editor has the book page's switch. consultation_only is sent on PUT /staff/copies/{id} only for an existing copy and only when it changed. The server applies it through the book page's own toggle and refuses it for a copy on loan, awaiting pickup or requested.
  • automatic_fines and debt_block need no client change: the server leaves accruing fines out and sends debt_block_threshold_cents: null and debt_blocked: false when they are off. They are added to _contract/health-sample.json with consultation_only. Strings in the four locales. STATUS.md updated. No Room schema change.

Tests

New unit tests: consultation_only mapping and the rules fetch (FeatureFlags090Test); prenotato parsed as LoanScheduled (LatestReleaseContractTest); quoted, typographic, unclosed and inch-mark queries (SearchTextTest) and quoted text, author and publisher on the offline database (CatalogDaoTest); the reservation override in the body only when ticked with the rules on (StaffReservationOverrideTest); the copy flag sent only when changed, for an existing copy, with the module on, and read from the server (StaffCopyConsultationTest); every card code drawn as Code128 read back with ZXing's reader, and codes Code128 cannot hold not drawn (CardBarcodeTest).

Locally: testDebugUnitTest and testReleaseUnitTest 521 tests each, none failed or skipped; lintDebug and lintRelease zero errors; assembleDebug, assembleRelease and compileDebugAndroidTestKotlin. No emulator could run here (no KVM), so the device tests were not run.

🤖 Generated with Claude Code

https://claude.ai/code/session_015Q7hZ3Sw9KSZbwUyZA34hB

…ay approvals, offline quotes

Consultation-only copies have their own /health switch since Pinakes 0.9.0
(features.consultation_only), independent of circulation_rules. The book
page fetched the reader's rules only with circulation_rules on, so with the
patron-type rules off a consultation-only title still offered the loan
button and the request was refused after sending. It now asks with either
switch; a server without the key keeps tying it to circulation_rules.

POST /reservations answers status prenotato with start_date when a request
is auto-approved while the library is closed today: the loan starts on the
next open day. The app read every auto-approved request as ready for pickup;
the confirmation now names the day the book can be picked up.

Quoted queries ask the server for the exact spelling (Pinakes #501). The
offline search key folds accents and cannot tell spellings apart, and it was
searching for the quote characters themselves, so a quoted query found
nothing offline. The quotes are dropped as the server reads them (straight
and typographic; an inch mark after a digit stays).

The health sample gains automatic_fines, debt_block and consultation_only.
automatic_fines and debt_block need no client change: the server already
leaves accruing fines out and sends a null threshold with debt blocking off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q7hZ3Sw9KSZbwUyZA34hB
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…site

The website's "new reservation" form has "Ignora i limiti di prenotazione
della tipologia del lettore" when patron-type rules are on, and the Mobile
API reads override_limits on POST /staff/reservations (Pinakes 0.9.0). The
app had no way to send it, so a reservation refused with
reservation_limit_reached could only be made on the website.

The staff new-reservation form shows the same switch when
features.circulation_rules is on. override_limits is sent only when it is
ticked and the rules are on; otherwise the key is left out, so an older
server never sees it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q7hZ3Sw9KSZbwUyZA34hB
The author and publisher filters are quoted for an exact spelling as the
text query is (Pinakes #501). Offline they were escaped as typed, so
'"Italo Calvino"' looked for the quote characters and found nothing.
SearchText.filterPattern() drops the quotes as the server reads them, for
both filters, and the DAO test goes through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q7hZ3Sw9KSZbwUyZA34hB
Pinakes 0.9.0 prints library cards with the card code (codice_tessera) as a
Code128 barcode by default, and the desk and the visitor-log kiosk scan it.
The profile only showed the number as text. It now draws the same Code128
under the card details, black on white whatever the theme, so the reader
can show the phone at the desk. As on the printed card only printable ASCII
is encoded; otherwise the text line alone stays. The barcode is generated
with the ZXing core the scanner already uses, and a unit test reads every
drawn code back with ZXing's Code128 reader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q7hZ3Sw9KSZbwUyZA34hB
…ter quotes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q7hZ3Sw9KSZbwUyZA34hB
Pinakes 0.9.0 lets staff keep a single copy for in-house consultation from
the book page. The app showed the flag on a copy but could not change it.
With features.consultation_only on, the copy editor now has the switch;
consultation_only is sent on PUT /staff/copies/{id} only for an existing
copy and only when it changed, so saving a copy untouched sends no flag.
The server applies it through the book page's own toggle and refuses it
for a copy on loan, awaiting pickup or requested (Pinakes #516).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q7hZ3Sw9KSZbwUyZA34hB

This branch has not been deployed

No deployments
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.

2 participants