Repository navigation
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
Draft
Follow-up alignment with Pinakes 0.9.0: consultation switch, closed-day approvals, offline quotes#56fabiodalez-dev wants to merge 6 commits into
fabiodalez-dev wants to merge 6 commits into
Conversation
…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
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: prenotatowithstart_dateonPOST /reservations(487ec78d),override_limitsonPOST /staff/reservations, and quoted exact-spelling search (#501). On an older server nothing changes: a server withoutconsultation_onlykeeps tying consultation tocirculation_rulesas in #55, one withoutprenotatonever sends it, andoverride_limitsis 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_typetoGET /meandconsultation_onlyto staff copies and toPUT /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
circulation_rulesoff andconsultation_onlyon,loanablecan still be false. The book page fetched the reader's rules only withcirculation_ruleson, so a consultation-only title offered the loan button and the request was refused after sending.InstanceFeaturesnow readsconsultation_only(off in catalogue mode or with app access off), and the book page asks for the rules when either switch is on.prenotatowithstart_date. The app read every auto-approved request as ready for pickup. A newLoanScheduledkind carriesstart_date, and the confirmation names the pickup day, worded as the server's message.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.override_limits: true; without it the key is left out.codice_tesseraas 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.features.consultation_onlyon, the staff copy editor has the book page's switch.consultation_onlyis sent onPUT /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_finesanddebt_blockneed no client change: the server leaves accruing fines out and sendsdebt_block_threshold_cents: nullanddebt_blocked: falsewhen they are off. They are added to_contract/health-sample.jsonwithconsultation_only. Strings in the four locales.STATUS.mdupdated. No Room schema change.Tests
New unit tests:
consultation_onlymapping and the rules fetch (FeatureFlags090Test);prenotatoparsed asLoanScheduled(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:
testDebugUnitTestandtestReleaseUnitTest521 tests each, none failed or skipped;lintDebugandlintReleasezero errors;assembleDebug,assembleReleaseandcompileDebugAndroidTestKotlin. No emulator could run here (no KVM), so the device tests were not run.🤖 Generated with Claude Code
https://claude.ai/code/session_015Q7hZ3Sw9KSZbwUyZA34hB