Repository navigation
feat(facility): scan-to-verify orders (#52) and payout ledger with escrow terms (#53) - #144
Merged
afeezorobsco-cyber merged 1 commit intoOct 18, 2026
Conversation
… with escrow terms (DocForum#53) - DocForum#52 Scan-to-verify orders with device camera: * Camera QR scanner with native BarcodeDetector API and fallback decoder * Explicit camera media stream track teardown on unmount / screen exit * Manual token entry fallback and permission denied handling * 5 verified order states (valid, superseded, expired, fulfilled, not_eligible) * Jump straight into fulfillment queue from valid orders * Clear HTTP 429 rate-limit error surface against token enumeration - DocForum#53 Facility payout ledger with escrow terms: * Payout totals (held, released, refunded) across XLM and USDC * BigInt-safe amount formatting (formatStroops) preventing IEEE 754 precision loss * Plain-language escrow terms (releaser rules, refund deadline countdowns) * Threat model T8 approaching deadline warnings (< 48h) on unfulfilled escrows * Deep links to Stellar Expert testnet transaction explorer * Filter by status and asset; cursor-paginated ledger - Added tests for camera teardown, all 5 verification states, 429 rate limit, totals calculations, deadline warnings, and explorer links. - Updated ARCHITECTURE_ESSENTIALS.md Known assumptions and ROADMAP.md. - Generated desktop and mobile screenshots.
|
@oluwa1to9-web 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 #52
Closes #53
Implements the Phase W4 Facility core-flow extensions:
What changed & why
1. Scan-to-Verify Orders with Device Camera (#52)
When patients arrive with digital or paper order tokens, facility staff need immediate verification that an order is authentic, current, and eligible for fulfillment, rather than relying on unverified screenshots.
/facility/verify(OrderVerifyPage) accessible from facility navigation tabs.BarcodeDetectorAPI with targeting reticle and animated scan beam (respectingprefers-reduced-motion).MediaStreamTracks (track.stop()) when navigating away, unmounting, or pausing.valid: Shows authentic order confirmation, minimal order summary (patient name, medication/lab test, issued/expires dates, instructions), and an instant "Proceed to fulfil →" button that jumps straight into the fulfillment flow (/facility?orderId=...).superseded: Warning banner displaying the physician replacement order ID (supersededBy) and instructing staff not to dispense.expired: Clear expiration cutoff notice prohibiting fulfillment of expired prescriptions or lab orders.fulfilled: Informs staff that the order was already completed, displaying previous fulfillment timestamp and dispensing facility to prevent duplicate dispensing.not_eligible: Rejection notice explaining specialty tier or network restrictions.2. Facility Payout Ledger with Escrow Status & Terms (#53)
Under threat model T8 of
docforum-escrow, payees must review escrow terms (releaser rules, refund deadlines) before relying on held funds. This page exposes escrow conditions in plain language./facility/payments(FacilityPaymentsPage) with responsive tab navigation.XLMvsUSDC).BigInt(formatStroops) to prevent IEEE 754 precision errors.https://stellar.expert/explorer/testnet/tx/...) for funding transactions, release transactions, and refund transactions.all,held,released,refunded) and asset (all,XLM,USDC).Verification & Test Output
All linters, TypeScript typechecks, test suites, and production builds pass green:
Screenshots
Captured at desktop (1280px) and mobile (390px) widths:
screenshots/facility-verify-desktop.png(Desktop Order Verification screen with camera scanner, tabs, and manual entry)screenshots/facility-verify-mobile.png(Mobile Order Verification screen)screenshots/facility-payments-desktop.png(Desktop Payout Ledger with totals cards, approaching deadline warning, and explorer links)screenshots/facility-payments-mobile.png(Mobile Payout Ledger screen)Documentation
ARCHITECTURE_ESSENTIALS.mdwith documented assumed API shapes forPOST /facilities/me/verify-orderandGET /facilities/:facilityId/payout-ledger.ROADMAP.mdPhase W4 checklist items and added contribution changelog line.