The scenario: a household profile moves to its own account
A household manager can maintain a dependent’s profile before that person uses an independent account. Transferring that profile is more consequential than editing a contact field: recipient confirmation, ownership, caregiver decisions and access to clinic records need separate treatment. An invitation being prepared is not the completed transfer.
The pinned Movo-X handoff design separates a phone-confirmation stage from a profile-claim invitation. One existing and one supplemental local TypeScript case passed for selected routing and configuration boundaries. Selected database transitions were inspected without execution. All identifiers, phone numbers and codes in the fixtures are invented; no actual profile or message was used.
Confirm a proposed phone before using it as an invitation target
The phone-start route accepts a selected person and an international-format phone input, creates a code and forwards a keyed proof value with a delivery message to its adapter. The existing case checks the operation name, selected proof shape and message-code presence through that fake adapter.
The inspected SQL ties a phone check to person, originating account, target phone and expiry. Its comparison incorporates the target phone and person alongside the keyed proof input, with selected attempt handling. Those are source observations rather than executed proof-state tests. A valid number’s syntax is not evidence that the intended person controls it.
Separate proof material from the delivery message
The confirmation route accepts a selected six-digit code and forwards a keyed value rather than that raw code. Existing and supplemental fixtures check that captured confirmation inputs do not contain the supplied raw value. This is the proof-verification request boundary.
The earlier delivery message necessarily contains a code so it can be sent. It is therefore incorrect to generalize these confirmation assertions into a claim that no raw code ever reaches an outbox or messaging component. Storage access, message expiry, logging and provider handling each need their own acceptance evidence.
Do not accept a new recipient on the final invitation call
The final handoff route does not accept a phone override. The existing case supplies one and observes refusal, then submits the selected empty-input form and records a person_claim_invite operation with handoff mode and no caller-selected destination number.
The inspected invitation SQL obtains its destination from the person’s stored verified-phone state in handoff mode. That binding is the important policy boundary: the final operation should not bypass the earlier confirmation with a newly supplied recipient. The route fixture checks the forwarded request; it does not execute the stored-state lookup or prove the recipient was actually confirmed.
Distinguish configured sending from completed delivery
The route requires the selected outbox configuration before starting a new phone check or invitation. Existing and supplemental cases exercise the configured-off response. The inspected SQL additionally checks a recent bridge-status timestamp before selected new sends. That database check was not exercised in these local cases.
A configured outbox or recent heartbeat is still not proof that a message arrived. The source inserts a message for later delivery rather than observing a recipient’s device. The broader bridge chapters separately discuss polling, journaling and provider outcomes; an accepted handoff request must not become an assertion of confirmed message receipt.
Allow status and proof completion to have different dependencies
The supplemental fixture disables new-send configuration and still exercises status, cancellation and an already supplied confirmation code through its fake adapter. It records those selected operation names, while new phone/invitation requests are refused before an adapter call.
This describes route dependency ordering. The fake confirmation success is not evidence that a real stored challenge exists or would pass its code, attempt, ownership and expiry checks. A robust integration suite should explicitly separate a temporarily unavailable sender from invalid proof and from a completed or cancelled workflow.
Keep cancellation narrower than rolling back ownership
The inspected cancellation branch marks pending handoff claim invitations used and records a selected audit event. It does not describe a reversal of a completed profile claim or wholesale removal of every earlier confirmation record. The route fixture only records that it dispatched the cancellation operation.
The SQL also uses selected request-identity and transaction locking mechanisms around consequential operations. Those mechanisms were source-reviewed without concurrency tests. Cancellation, duplicate requests, expired invitations and a claim racing with cancellation require authoritative transactional acceptance, rather than assumptions based on an HTTP success from a fake adapter.
Treat product eligibility and clinic access as separate policies
The inspected source defines age/relationship eligibility for this product workflow. These are pinned implementation rules, not a statement of legal requirements across countries. A completed claim’s selected transition also distinguishes new self-account links from clinic-verified access and clears selected handoff-specific phone state.
That means transferring an application profile should not be described as independently verifying a clinic identity. Caregiver retention, former-manager access and clinic re-verification need their own contract and tests. This chapter does not certify the complete ownership/consent migration or resolve every module-sharing policy.
A practical ownership-handoff acceptance package
Retain the phone/confirmation/invitation route case and configuration-dependency case. Add isolated database tests for recipient binding, wrong account, expiry, attempts, duplicate request identity, cancellation races and post-claim link state. Then exercise a controlled synthetic end-to-end journey through the intended delivery channel and both account roles.
For a CTO, the useful output is a state-transition contract that names each authority and observation. The selected local cases establish request construction and configuration branches. They leave durable challenge consumption, actual delivery, final ownership and complete clinic/caregiver access to independent acceptance evidence.
Compare the reviewed boundaries
Independent handoff transitions
On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.
| Transition | Selected local/source evidence | Separate acceptance |
|---|---|---|
| Phone check | Route proof/message construction and SQL review | Actual control of intended phone |
| Invitation target | No final override; stored-phone SQL branch | Executed recipient-state binding |
| Cancellation | Selected operation and pending-claim source | Claim/cancel transaction races |
| Ownership/access | Post-claim source reviewed | Clinic verification and caregiver policy |
Illustrative control flow
Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.
phone_check = begin_authoritative_recipient_confirmation(person, proposed_phone)
confirm_stored_phone_check(phone_check, supplied_code)
invite = create_handoff_using_stored_verified_recipient(person)
claim = redeem_invitation_in_recipient_account(invite)
reconcile_ownership_caregivers_and_clinic_links_separately(claim)
# Invitation creation and actual ownership/access transitions are different facts.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 ↗