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-serviceMUST treat the set of shopper-app screens and the 11 availableSectionTypes as system-fixed reference data, mirrored per tenant from a sharedmobile_default_configfallback (sentineltenant_id: "system") the first time a tenant has no saved configuration of its own. - FR-02 (Section Ordering & Toggle):
shop-service’sPUT /shop/admin/api/v1/mobile-app-configendpoint MUST let the operator set each section’sDisplayOrderandIsActiveflag 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-configMUST return the tenant’s current screens/sections and banners state (falling back tomobile_default_configif the tenant has never saved one).
Category Group Mapping
- FR-04 (Fixed Category Groups):
shop-serviceMUST treat the storefront’s category groups (Clothing, Shoes, Bags, Watches) as system-fixed — theirID/Nameare not operator-editable, onlyMappedCategoryIDs. - FR-05 (Category Mapping CRUD):
GET /shop/admin/api/v1/category-mappingMUST return all groups and their currently-mapped category IDs;PUT /shop/admin/api/v1/category-mapping/:idMUST let the operator replace one group’sMappedCategoryIDs. - FR-06 (Independent Persistence): Category-group mapping MUST be stored and updated independently of the screens/banners configuration (a separate
category_mappingscollection) — 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/bannersMUST create a persisted banner record (statuspending) 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’sImagefield 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-serviceMUST track a per-tenantstatus(DRAFT|PUBLISHED) in a dedicatedmobile_app_config_statuscollection, 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/publishMUST reject the request unless (a) every banner has a non-nil image whose status is notfailed, and (b) every screen has at least one section withIsActive == 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 stillpending, 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-serviceMUST exposegetShopSections(screenType, productId)over GraphQL, returning aShopSectionunion (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
screenscollection 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):
searchProductsMUST dispatch onfilter.sectionTypeto a section-specific query implementation (a genuine Strategy-pattern registry — see Architecture-00005), defaulting to a global search implementation whensectionTypeis absent.
Mobile Client Composition (Flutter)
- FR-15 (Common Section Rendering Contract):
ui-applicationMUST render the variable, per-tenant list ofShopSectiontypes 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-applicationtoday; 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 carrytenant_id, sourced fromauth.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 withCache-Control: no-storeso 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 callsearch-serviceover gRPC;search-serviceMUST NOT depend on or call back intoshop-service. (Note: the source architecture diagram draws this relationship as bidirectional — that is a diagramming simplification, not a second call path; see Architecture-00005.)
Related Documents
- BRD-005 — Mobile App Storefront Configuration
- Mobile App Config Admin UI — Walkthrough Overview
- ADR-00006 — GraphQL for the Mobile Storefront API, REST for Admin
- Architecture: shop-service — Mobile Storefront Screen Delivery (GraphQL)
- Technical Debt — Mobile App Storefront Configuration Gaps
- shop-service