The scenario: two tabs can legitimately work in different clinics
A staff member can open one clinic in one tab and another clinic in a second tab. A shared active-clinic selector can make a later request ambiguous if it silently changes the destination expected by the first page. Explicit location context makes that destination visible and repeatable.
The inspected Movo-X workspace constructs navigation and API paths from a supplied tenant/facility pair. Eight isolated cases examine selected path transformations. The component and server call sites were reviewed separately; the cases do not operate two real tabs or establish current staff access.
Require an explicit scope before constructing the namespace
The path helper validates the selected identifier representations, then embeds the tenant and facility into separate page and API namespaces. The existing fixture calls it with two facilities and checks different destinations. It also checks refusal of a malformed scope identifier.
That verifies deterministic construction from the supplied context, not permission to use either context. An identifier that has the right format can still refer to an unassigned or inactive facility. The server must obtain current identity and access information rather than treating the path’s presence as an authorization result.
Keep legacy application paths within the selected workspace
The helper maps selected legacy page aliases into the current workspace and translates API-relative paths into the clinic API namespace. It refuses selected absolute, protocol-relative, script-like and namespace-escape inputs instead of using a legacy external origin as the destination.
These are specific tested rules, not a general-purpose URL sanitizer for arbitrary navigation. Callers supply the supported application route form. A complete review should trace where those callers obtain both the scope and the route, particularly when adding a new embedded module or importing a legacy link.
Distinguish encoded path structure from search data
The helper checks selected encoded separators and dot-like path content before allowing the destination. Supplemental cases cover encoded slash, backslash, dot segments and a normalized parent traversal. The same selected encodings can remain in a search query without changing the tenant/facility namespace.
That separation matters for legitimate search values such as a unit number containing a slash. It does not remove the privacy implications of search text or validate each endpoint’s query semantics. The fixture establishes path construction and preservation of selected encoded query data, not a universal parser-bypass audit.
Specify how fragments and special page selectors are projected
Ordinary page paths can retain their query and fragment. The API path projection retains its query while omitting the fragment. Settings and staff links use their own selected clinic/facility/tab destination instead of blindly preserving every supplied query value.
The supplemental fixture checks those three outcomes. A broad statement that the helper always preserves every part of a URL would therefore be inaccurate. Each link family has its own projection rule, and new aliases should receive explicit fixtures for the information they must carry forward.
Bind component callbacks to the provider’s scope
The reviewed React provider creates its navigation, API and fetch callbacks from the scope supplied to that provider. Its scoped fetch wrapper constructs the clinic-relative request and chooses selected same-origin, cache and redirect options. It also has a local read-only check for mutations.
Those call sites explain how the helper is intended to be used by the workspace. The pure path tests do not render the provider, exercise request lifecycles or certify every component uses it. Client-side read-only behaviour is an interface control; current write permission still requires server enforcement.
Translate old workspace links using reviewed selectors
The legacy target helper maps selected sections and identifier-shaped deep links to their clinic-scoped destinations. Existing fixtures cover patient detail, encounter-oriented pages, invoice links, inventory search and the staff-management destination. Unknown section names fall back to the caller’s entry path.
That entry is a caller responsibility. The reviewed legacy page derives it from a selected permitted facility and workspace landing policy before redirecting. A route availability set also describes selected ported screens; it is not a role-permission engine or proof that every listed page is correctly deployed.
Recheck identity and access at the server boundary
The inspected server access helper checks configured feature gates, verified identity, active membership, facility assignment, organization/facility status and workspace readiness before returning clinic context. Its query failures are distinguished from an ordinary absence of access in the source.
The API handler calls that helper for its selected read and mutation paths. The reviewed mutation entry additionally checks origin policy, read-only state, request identity and selected body-scope mismatches. These branches were inspected without endpoint or database execution. Their presence is not presented as a complete audit of every downstream record operation.
A practical multi-clinic workspace acceptance package
Keep scope-pair, namespace-refusal, encoded-query, fragment, alias, legacy-selector and unknown-section fixtures. Add component tests for independent page contexts and authenticated integration tests for unassigned, inactive, read-only and changed-access facilities. Exercise actual tab switching with controlled synthetic accounts when the environment is available.
For a CTO, the design makes request ownership visible while preserving a separate authorization boundary. The pinned implementation and eight scoped cases establish selected URL behaviour and inspected server placement. They do not certify current tenant isolation, staff permissions or every clinical workflow.
Compare the reviewed boundaries
Separate ownership, navigation and authorization
On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.
| Layer | Selected evidence | Separate acceptance |
|---|---|---|
| Path helper | Explicit scope, namespace and projection fixtures | Trusted source of the selected identifiers |
| Workspace provider | Scope-derived callbacks in source | Actual independent tab and request behaviour |
| Legacy redirect | Selected section/deep-link fixtures and caller review | Current landing and route availability |
| Server access | Membership/facility/read-only branches reviewed | Installed permissions and downstream record scope |
Illustrative control flow
Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.
scope = page_owned_tenant_and_facility_context()
url = construct_supported_clinic_namespace(scope, requested_route)
request(url)
# At the server, independently:
identity = read_current_staff_identity()
access = verify_current_membership_facility_and_workspace_state(identity, url)
authorize_selected_record_operation(access)About this engineering series
Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.
Explore the Movo-X engineering series → · Related implementation experience →
Discuss a similar engineering problem
Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.
Discuss your project on WhatsApp ↗