SR-005 — Mobile App Storefront Configuration System Requirements

By Lead Systems Architect•September 26, 2026•5 min read
Metadata Details
System Name Mobile App Storefront Configuration
Document ID SR-2026-MAC-005
Author Lead Systems Architect
Status Draft

1. Functional Requirements (FR)

Screens & Sections

  • FR-01 (Fixed Screen/Section Catalog): shop-service MUST treat the set of shopper-app screens and the 11 available SectionTypes as system-fixed reference data, mirrored per tenant from a shared mobile_default_config fallback (sentinel tenant_id: "system") the first time a tenant has no saved configuration of its own.
  • FR-02 (Section Ordering & Toggle): shop-service’s PUT /shop/admin/api/v1/mobile-app-config endpoint MUST let the operator set each section’s DisplayOrder and IsActive flag per screen, and MUST NOT let the operator add, remove, or retype a section.
  • FR-03 (Screens Read): GET /shop/admin/api/v1/mobile-app-config MUST return the tenant’s current screens/sections and banners state (falling back to mobile_default_config if the tenant has never saved one).

Category Group Mapping

  • FR-04 (Fixed Category Groups): shop-service MUST treat the storefront’s category groups (Clothing, Shoes, Bags, Watches) as system-fixed — their ID/Name are not operator-editable, only MappedCategoryIDs.
  • FR-05 (Category Mapping CRUD): GET /shop/admin/api/v1/category-mapping MUST return all groups and their currently-mapped category IDs; PUT /shop/admin/api/v1/category-mapping/:id MUST let the operator replace one group’s MappedCategoryIDs.
  • FR-06 (Independent Persistence): Category-group mapping MUST be stored and updated independently of the screens/banners configuration (a separate category_mappings collection) — saving one MUST NOT require or trigger a save of the other.

Banners

  • FR-07 (Document-First Banner Creation): POST /shop/admin/api/v1/mobile-app-config/banners MUST create a persisted banner record (status pending) at the moment an operator starts uploading its image, rather than waiting for the next full configuration save — this avoids a last-write-wins race on the banner’s Image field between concurrent edits.
  • FR-08 (Banner Field Editing): The operator MUST be able to edit a banner’s title, subtitle, link, active state, and display order via PUT /shop/admin/api/v1/mobile-app-config.

Draft / Publish Lifecycle

  • FR-09 (Status Tracking): shop-service MUST track a per-tenant status (DRAFT | PUBLISHED) in a dedicated mobile_app_config_status collection, separate from the screens/banners/category-mapping data itself.
  • FR-10 (Save Without Validation): PUT /shop/admin/api/v1/mobile-app-config (Save Draft) MUST persist the submitted state without enforcing publish-readiness validation.
  • FR-11 (Publish Validation): POST /shop/admin/api/v1/mobile-app-config/publish MUST reject the request unless (a) every banner has a non-nil image whose status is not failed, and (b) every screen has at least one section with IsActive == true. These are the only two server-side publish checks — enforced server-side so they cannot be bypassed by calling the API directly, independent of any client-side check the admin UI performs. (Gap — a banner whose image is still pending, i.e. queued for async processing but not yet confirmed, passes this check; there is no additional readiness/poll step server-side before publish succeeds. Tracked as technical debt, see Technical Debt — Mobile App Storefront Configuration Gaps, TD-01.)

Shopper-App Delivery (GraphQL)

  • FR-12 (GraphQL Storefront Query): shop-service MUST expose getShopSections(screenType, productId) over GraphQL, returning a ShopSection union (13 concrete types) so the mobile client can request only the section shapes relevant to the screen it is rendering in a single round trip, rather than one REST call per section type. See ADR-00006.
  • FR-13 (Configuration-Driven Section Order): The Shop screen’s returned section list MUST reflect the tenant’s screens collection state (DisplayOrder, IsActive) exactly as configured in Step 1 of the admin wizard (FR-02) — inactive sections MUST be omitted, active sections MUST appear in configured order. Structural sections (ProductFullSection, CartSection, WishlistSection, DeliveryLocationSection) are exempt from this ordering — they are not tenant-configurable content and are always present, consistent with BRD-005’s scope boundary (only content sections are tenant-configurable).
  • FR-14 (Search Dispatch by Section Type): searchProducts MUST dispatch on filter.sectionType to a section-specific query implementation (a genuine Strategy-pattern registry — see Architecture-00005), defaulting to a global search implementation when sectionType is absent.

Mobile Client Composition (Flutter)

  • FR-15 (Common Section Rendering Contract): ui-application MUST render the variable, per-tenant list of ShopSection types returned by FR-12/FR-13 through one shared component contract — a common base widget type that every concrete section implements, composed into a single screen by one parent (a Composite structure) — so adding a new section type never requires rewriting the Shop/Search screen’s own render logic. This is what makes FR-02’s per-tenant reorder/toggle produce a genuinely dynamic screen at render time, not just at the data layer. See Architecture-00005.
  • FR-16 (Reusable Query Field Definitions): GraphQL queries fetching the product field set shared across multiple section types SHOULD use reusable named fragments rather than duplicating that field list inline per section’s union-type condition, so a shared field’s addition or change is a single edit rather than one edit per section query. (Gap — no named GraphQL fragments exist in ui-application today; every section’s field list is duplicated inline in raw query strings. Tracked as technical debt, see Technical Debt — Mobile App Storefront Configuration Gaps, TD-02.)

2. Non-Functional Requirements (NFR)

Multi-Tenancy

  • NFR-01 (Tenant Scoping): All four collections this feature touches (screens, banners, mobile_app_config_status, category_mappings) MUST carry tenant_id, sourced from auth.GetTenantID(ctx) and used as the Mongo filter/upsert key on every repository call — never from the request body, per the platform’s security standards.
  • NFR-02 (Auth Enforcement): Every endpoint in this feature MUST sit behind AuthMiddleware, and every mutating response MUST be served with Cache-Control: no-store so a stale cached copy of a draft never leaks between sessions.

Data Integrity

  • NFR-03 (System-Fixed Reference Data Isolation): The fixed screen/section catalog and the fixed category-group list MUST NOT be mutable through any endpoint in this feature — only per-tenant ordering, activation, and category-mapping assignments are.
  • NFR-04 (No Cross-Collection Transaction): Saving screens/banners and saving category mapping are independent writes to independent collections; the system MUST NOT assume atomicity between them.
  • NFR-05 (One-Directional Search Dependency): shop-service’s default search path MUST call search-service over gRPC; search-service MUST NOT depend on or call back into shop-service. (Note: the source architecture diagram draws this relationship as bidirectional — that is a diagramming simplification, not a second call path; see Architecture-00005.)