Architecture — Customer Settings: Component Topology and Data Flow

By Engineering Team•October 10, 2026•6 min read
Metadata Details
System Customer Settings — ui-application’s dashboard/setting feature
Document ID ARCH-2026-SET-001
Author Engineering Team
Status Implemented

Implements SR-026, per the service-split and partial-update decisions in ADR-00040.

Components

Component Language / Runtime Role
Settings landing screen & sheets Dart / Flutter (GetX) Region, fashion/size profile, and notification pickers; all state held on SettingController, sheets are stateless pickers
Settings sub-screens (profile, address, payment, support, about, terms, privacy, returns) Dart / Flutter (GetX) Routed, root-Navigator pushed screens, each its own Feature Triad
SettingRepository Dart Client for user-preference-service’s Settings API — region/fashion/notifications/addresses/card references
ProfileRepository / OtpRepository / ConsentRepository Dart Clients for user-secure-engine’s profile/OTP/consent endpoints
TenantInfoService / TenantInfoRepository Dart Aggregate tenant-info read, shared across About/Support/Terms/Privacy/Returns/footer
MediaService / MediaRepository Dart Presigned-upload client for avatar images
user-preference-service Go (MongoDB) Owns region, fashion profile, notification preferences, address references, and card references via its SectionStrategy set
user-secure-engine Rust Owns profile identity fields, OTP issuance/verification, Terms/Privacy consent, Firebase identity sync
pii-service Rust (gRPC) Encrypted-at-rest store for address body content, read/written by user-preference-service on the shopper’s behalf
pci-service Rust (gRPC) Encrypted-at-rest store for card body content — never hydrated back to the mobile app from this feature
media-access-service Rust Issues presigned upload URLs and resolves download URLs for the avatar image
content-processor Go Asynchronous image pipeline — resizes/crops/encodes the uploaded avatar, publishes completion
tenant-service Go Serves the tenant-info aggregate (store identity, support contact, registered address, policy versions)

End-to-end flow (A) — Region, fashion profile, and notification preference update

  1. A shopper opens a sheet (pincode/city, country, currency, language, fashion department/size, or a notification toggle) from the landing screen; the sheet reads its current value from SettingController’s already-loaded state.
  2. On save, SettingController calls SettingRepository, which sends a partial-update request carrying only the changed section’s fields (SR-026 FR-06/FR-07/FR-08; ADR-00040 Decision 2).
  3. user-preference-service routes the request to the matching SectionStrategy (RegionLocationStrategy/RegionCountryStrategy/RegionCurrencyStrategy/RegionLanguageStrategy/FashionProfileStrategy/NotificationStrategy), which merges only its own section of the stored document.
  4. The response reflects the updated settings; SettingController updates its local reactive state so every section on the landing screen stays in sync without a full reload.

End-to-end flow (B) — Saved address management

  1. On the Address screen, adding or editing an address opens AddressFormSheet, validated client-side by AddressValidator (SR-026 FR-09; NFR-05).
  2. SettingRepository sends the address body to user-preference-service’s AddressReferenceStrategy, which validates it again server-side (AddressBody.Validate — line1, city, firstName, lastName, phoneNumber required) and stores the encrypted body in pii-service, keeping only a reference locally.
  3. Adding the shopper’s first-ever address automatically marks it default shipping and default billing; AddressController reloads the full list after any mutation that can fan out to other addresses’ default flags (add, set-default), and mutates its in-memory list directly for delete (optimistic, revert-on-failure — NFR-03).
  4. Reading the address list hydrates each reference back into a full address body via pii-service before returning it to the client.

End-to-end flow (C) — Saved payment-method reference view and removal

  1. The Payment screen loads via SettingRepository, which returns card references (cardId, createdAt) only — never a card number, holder name, or expiry, since that body lives in pci-service and no hydration path exists for the mobile client (SR-026 FR-10).
  2. Removing a card calls user-preference-service’s delete-by-id endpoint; the UI removes the card optimistically and reverts with a visible error on failure (NFR-03).
  3. The same screen’s “Recent Transactions” section always renders empty — no backend path in this feature area supplies order/payment history (tracked as TD-00020).

End-to-end flow (D) — Profile identity edit and avatar upload

  1. Name, date of birth, and gender are edited locally on the Profile screen and committed in one request via ProfileRepository to user-secure-engine (SR-026 FR-01) — phone and email are never part of this request.
  2. Avatar upload is a separate pipeline: pick/capture → square crop → MediaService requests a presigned URL from media-access-service → the cropped image is PUT directly to that URL, bypassing the app’s own authenticated client → content-processor consumes the upload event, resizes/crops/encodes it, and publishes completion.
  3. user-secure-engine’s own avatar-event subscriber commits the processed image’s storage path against the shopper’s row, keyed by the shopper’s user id (not tenant id, since an avatar is per-user).
  4. The Profile screen bounded-polls ProfileRepository.getProfile() until the avatar path changes, then resolves it to a displayable URL via MediaService (SR-026 FR-02).

End-to-end flow (E) — Decoupled OTP-commit phone/email change

  1. The shopper taps “Change” next to phone or email, opening ChangeContactSheet’s step 1 — a validated text field for the new value.
  2. “Send OTP” calls OtpRepository.requestOtp, advancing to step 2 on success.
  3. On “Verify”, OtpRepository.verifyOtp calls user-secure-engine’s OTP verification for the profile-update purpose; a successful verification commits the new phone or email value immediately, server-side — there is no separate save step, and the client holds no verification-ticket state in between (SR-026 FR-03; NFR-01).
  4. The sheet returns the newly-committed value to the Profile screen, which re-fetches the profile to refresh its verified-status badge. A phone change additionally syncs the shopper’s Firebase identity and forces re-login; an email change does not.
  1. The Terms and Privacy screens each load the shopper’s current consent record via ConsentRepository.
  2. Each screen renders its policy’s HTML body (sourced from the tenant-info aggregate in flow (G)) alongside an “Accept Agreement” button, enabled only while that policy’s acceptance flag is not yet set.
  3. Accepting calls ConsentRepository, recording acceptance against the policy’s current version (also sourced from the tenant-info aggregate) — not a value baked into the client build (SR-026 FR-04/FR-05; NFR-04).
  4. The Returns screen renders the same HTML-policy-viewer component with no acceptance action at all, by deliberate design — the shopper is never asked to “accept” a returns policy.

End-to-end flow (G) — Tenant-info aggregate read

  1. TenantInfoService is registered once per Settings-tab entry and begins loading immediately, independent of which sub-screen the shopper opens first.
  2. It reads tenant-service’s tenant-info aggregate — store name, descriptions, support contact details, registered address, and the current Terms/Privacy policy versions — falling back to a static default on fetch failure (SR-026 FR-11; NFR-06). This is the same aggregate read documented from the producing side in Architecture — Tenant Master, Flow (D); every field it returns was entered by the tenant’s own admin through the Tenant Master wizard (Basic/Contact/Address/Policy steps).
  3. About, Help & Support, Terms, Privacy, Returns, and the landing screen’s own version footer all read from this single shared service instance, so none of them issue a redundant fetch of the same data.

Why this is simple, and what it does not yet guarantee

Splitting the preference and identity concerns across two services each service already specializes in (ADR-00040) keeps every flow above a short, direct hop rather than a chain of internal re-delegation — the mobile client is the only component that ever composes both services for one screen. Using Merge Patch for preference updates means adding an eighth SectionStrategy in the future needs no change to the request shape at all.

What it does not yet guarantee:

  • No re-acceptance prompt when a policy version changes. A shopper who accepted Terms at version 1 is never re-prompted after a version-2 publish — see TD-00020.
  • Support contact details are not actionable. Email and toll-free entries render as static text with no tap-to-contact wiring — see TD-00020.
  • Complaint submission, data export, and account deletion have no backend path. All three are local no-op stubs today — see TD-00020.
  • Postal-code format validation is India-only and client-side only. The Address screen’s pincode field enforces a 6-digit, India-shaped pattern with no equivalent server-side check — see TD-00020.