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
- 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. - On save,
SettingControllercallsSettingRepository, 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). user-preference-serviceroutes the request to the matchingSectionStrategy(RegionLocationStrategy/RegionCountryStrategy/RegionCurrencyStrategy/RegionLanguageStrategy/FashionProfileStrategy/NotificationStrategy), which merges only its own section of the stored document.- The response reflects the updated settings;
SettingControllerupdates 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
- On the Address screen, adding or editing an address opens
AddressFormSheet, validated client-side byAddressValidator(SR-026 FR-09; NFR-05). SettingRepositorysends the address body touser-preference-service’sAddressReferenceStrategy, which validates it again server-side (AddressBody.Validate—line1,city,firstName,lastName,phoneNumberrequired) and stores the encrypted body inpii-service, keeping only a reference locally.- Adding the shopper’s first-ever address automatically marks it default shipping and default billing;
AddressControllerreloads 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). - Reading the address list hydrates each reference back into a full address body via
pii-servicebefore returning it to the client.
End-to-end flow (C) — Saved payment-method reference view and removal
- 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 inpci-serviceand no hydration path exists for the mobile client (SR-026 FR-10). - 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). - 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
- Name, date of birth, and gender are edited locally on the Profile screen and committed in one request via
ProfileRepositorytouser-secure-engine(SR-026 FR-01) — phone and email are never part of this request. - Avatar upload is a separate pipeline: pick/capture → square crop →
MediaServicerequests a presigned URL frommedia-access-service→ the cropped image is PUT directly to that URL, bypassing the app’s own authenticated client →content-processorconsumes the upload event, resizes/crops/encodes it, and publishes completion. 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).- The Profile screen bounded-polls
ProfileRepository.getProfile()until the avatar path changes, then resolves it to a displayable URL viaMediaService(SR-026 FR-02).
End-to-end flow (E) — Decoupled OTP-commit phone/email change
- The shopper taps “Change” next to phone or email, opening
ChangeContactSheet’s step 1 — a validated text field for the new value. - “Send OTP” calls
OtpRepository.requestOtp, advancing to step 2 on success. - On “Verify”,
OtpRepository.verifyOtpcallsuser-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). - 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.
End-to-end flow (F) — One-shot Terms and Privacy consent
- The Terms and Privacy screens each load the shopper’s current consent record via
ConsentRepository. - 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.
- 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). - 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
TenantInfoServiceis registered once per Settings-tab entry and begins loading immediately, independent of which sub-screen the shopper opens first.- 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). - 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.
Related Documents
- SR-026 — Customer Settings: System Requirements
- ADR-00040 — Customer Settings: Service Split and Partial-Update Semantics
- Technical Debt — Customer Settings Gaps
- Architecture — Tenant Master: Configuration Wizard, Logo Pipeline, and Aggregated Tenant-Info Read Path — upstream producer of flow (G)‘s tenant-info aggregate
- Microservices: user-preference-service, user-secure-engine, pii-service, media-access-service, tenant-service