Business · Product · Technology · AI

Design clinic discovery as a bounded public read contract

A Movo-X discovery case tracing clinic/doctor query namespaces, geographic bounds, signed-out routing, network context and source-level filtering before pagination.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: discovery should work before account access

A prospective patient may need to find a clinic before signing in. That public read journey has a different audience from clinic registration, account history or a medical record. Reusing nearby route modules is convenient, but it must not silently turn every operation in that module into a public action.

The pinned Movo-X source provides separate discovery wrappers around a shared query/action mapper. Three selected existing and two supplemental local cases passed for query parsing, route dispatch and signed-out refusal. They use invented identifiers and fake adapters. No real clinic listing, geographic dataset, patient account or public search service was queried.

Give each discovery resource its own query namespace

The parser permits different keys for clinics, doctors and detail views. Clinic queries can carry country and selected availability flags, while doctor queries have a smaller key set. Detail queries accept the selected proximity context rather than a list page’s entire filter set.

Existing and supplemental cases refuse unknown keys and selected keys used in the wrong namespace. Search and specialty text are trimmed and bounded, with empty search text omitted from the forwarded object. The route passes only the parsed representation to its adapter. That is input-contract evidence, not validation that every displayed clinic satisfies a real-world service claim.

Bound proximity and pagination before database work

A proximity string carries latitude and longitude together. The parser checks selected decimal syntax and geographic endpoints, and a radius requires the proximity pair. The supplemental case exercises valid negative and positive endpoints, minimum/maximum selected radii, out-of-range values, excess selected radius precision and the maximum list-page bound.

The resulting object contains numeric coordinates and pagination. These deterministic cases do not measure distance-calculation accuracy against a map service or establish search latency. They also do not locate a user: the client-provided coordinates are query input, not proof of residence, physical presence or eligibility for a clinic service.

Avoid turning an invalid credential into anonymous success

The public wrapper rejects a presented authorization header rather than silently retrying that request as signed out. The existing fixture supplies an invalid bearer value; the supplemental fixture supplies even an empty authorization header and records no call to its discovery dependency.

The handler source separately selects public hooks when it has no parsed bearer claims and uses the authenticated route path when claims exist. Those broader handler branches were inspected, not executed by the two small wrapper suites. A full integration case should cover expired and malformed tokens through the real handler as well as the pure public wrapper.

Keep the anonymous adapter read-only

The existing public-route fixture records the selected discovery action, parsed input and supplied rate key. A POST to the discovery list is refused, and a registration mutation is not handled by this public discovery wrapper. The signed-in discovery case separately records its account-adapter operation.

The reviewed SQL entry point restricts public discovery to four named actions, validates a service secret and applies a network-keyed limit before dispatch. That SQL was not run here. The fixture establishes that the wrapper forwards context; it does not prove deployed rate-limit state, actual secret configuration or global coordination across application processes.

Apply visibility and ordering before slicing list results

The selected SQL reads enabled public entries and applies a visibility helper that excludes selected nonpublic/demo facilities. Its clinic list applies selected geographic, language, specialty and text predicates before producing paginated cards. It computes a total for the matched set and uses a deterministic ordering with tie-break fields.

Those are source observations, not a benchmark or a newly executed database result. The inspected implementation gathers intermediate JSON before its page slice; this review does not claim efficient index use at any production scale. A performance acceptance record needs representative data, an execution plan, resource measurements and the intended query mix.

Explain what filter values mean at the authoritative layer

The TypeScript parser preserves true and false for selected Boolean query flags. In the inspected clinic SQL, positive open-now or accepting-new flags activate those predicates; false does not mean exclusively closed clinics or clinics refusing new patients. That semantic distinction is separate from successfully parsing a Boolean.

The doctor source also groups selected clinician rows before creating result cards. Neither grouping nor an availability field proves a currently bookable appointment or a clinical credential’s validity. Public discovery, scheduling acceptance and registration authorization need their own contract and authoritative checks.

Keep proximity context separate from clinic-record selectors

The selected detail mapper forwards a clinic slug or doctor identifier plus allowed proximity data. The supplemental namespace case refuses a patient-selector key in a clinic-list query. Registration and private clinical access are separate actions rather than consequences of selecting a discovered result.

The tests do not inspect every field in a real database projection or certify the privacy of every public response. A complete review should inventory allowed public fields, verify visibility changes and ensure that internal identifiers, private media and unrelated records do not leak through alternate routes or error responses.

A practical discovery acceptance package

Retain the parser, endpoint namespace, geographic boundary, invalid-credential and action-forwarding fixtures. Add database cases for visibility, grouping, filters, deterministic ordering, totals and page edges. Then exercise the actual handler with signed-out, valid-session and invalid-session requests using controlled synthetic facilities.

For a product or engineering leader, this creates a clear division between finding a service and gaining access to records or booking. The local cases establish selected request boundaries. Current listing content, actual availability, deployed limits, search performance and complete public-field privacy remain independent acceptance work.

Compare the reviewed boundaries

Discovery evidence at separate boundaries

On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.

BoundarySelected evidenceSeparate acceptance
Query shapeEndpoint-specific parser casesAuthoritative filter semantics
Public routingInvalid/empty credential refusalFull handler integration
Result selectionSQL source reviewedExecuted visibility/order/page cases
Service eligibilityDiscovery selectors onlyBooking, registration and record access

Illustrative control flow

Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.

query = parse_allowed_keys_for_resource(request.query)
if request_has_authorization_header_but_no_valid_identity:
    refuse_instead_of_downgrading()
result = invoke_read_only_discovery(query, network_context)
# Selecting a result does not grant booking or clinic-record authority.

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 ↗
WhatsApp Omer about this project ↗