Batch meter registration, downloadable receipts, request logging, a11y improvements - #720
Merged
Dev-AdeTutu merged 2 commits intoAug 27, 2026
Conversation
…ments - contracts: add batch_register_meters(meters: Vec<(String, Address)>) to register up to 100 meters in a single admin transaction, skipping duplicates/non-allowlisted owners/already-registered IDs with a batch_skip event, and emitting meter_registered per success (Dev-AdeTutu#682) - backend: wire batch_register_meters via new POST /api/meters/batch, with request validation and duplicate-id rejection (Dev-AdeTutu#682) - backend: add requestLogger middleware — per-request request_id (X-Request-Id header), sensitive-field redaction, 10% sampling of successful requests with all errors logged, toggle via LOG_REQUESTS (Dev-AdeTutu#684) - frontend: add "Download Receipt" PDF generation (jsPDF + QR code linking to the blockchain explorer) on payment history rows (Dev-AdeTutu#683) - frontend: accessibility pass — skip-to-content link, high-contrast focus-visible outline, modal focus trap + Escape-to-close (useModalA11y), Escape closes mobile nav, aria-labels on icon buttons, nav landmark label, main-content landmarks on every page (Dev-AdeTutu#681) - docs: document the above in backend/API.md, contracts/README.md, and new docs/ACCESSIBILITY.md Closes Dev-AdeTutu#681, Dev-AdeTutu#682, Dev-AdeTutu#683, Dev-AdeTutu#684 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HL4h1sEGCEoCUuH1qxex3j
|
@autostack-art Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Closes #681, closes #682, closes #683, closes #684
batch_register_meters(meters: Vec<(String, Address)>)contract function (admin-only, max 100 per batch). Duplicate meter IDs within the batch, already-registered meter IDs, and non-allowlisted owners are skipped individually (batch_skipevent) rather than failing the whole transaction; successes emitmeter_registered. Wired up via a newPOST /api/meters/batchbackend endpoint with request validation and an early duplicate-ID check.backend/src/lib/requestLogger.tsassigns arequest_idper request (returned asX-Request-Id), redacts sensitive fields (secrets, tokens, passwords, API keys), always logs errors, and samples 10% of successful requests. Toggle withLOG_REQUESTS=false.jspdf) with a QR code (viaqrcode) linking to the blockchain explorer, plus a best-effort XLM→USD conversion.:focus-visibleoutline site-wide, a reusableuseModalA11yhook providing focus trap + Escape-to-close + focus restore (applied toOfflinePaymentModal), Escape closes the mobile nav menu,aria-labels on icon-only buttons, a labeled nav landmark, and a#main-contentlandmark on every page.Documentation updated in
backend/API.md,contracts/README.md, and newdocs/ACCESSIBILITY.md.Testing
Per instructions, automated tests were skipped for this change. Verified with
tsc --noEmiton the frontend (no new type errors introduced) and manual review of the Rust contract addition.