SR-021 — Warehouse Stock Entry Administration Console System Requirements
By Engineering Team•October 8, 2026•8 min read
| Metadata | Details |
|---|---|
| System Name | ui-admin-application — Stock Entry Console (features/stockEntry) |
| Document ID | SR-2026-INV-003 |
| Author | Engineering Team |
| Status | Approved |
Traces back to BRD-020 — Warehouse Stock Entry: Administration Console.
See it first: Admin UI Walkthrough — Warehouse Stock Entry Console — the page-by-page, screenshot-anchored walkthrough of the console this spec describes. Reading that first gives the visual context for every FR below.
This document specifies ui-admin-application’s features/stockEntry/ console — the browser-side wizard, list page, and the inventory-service REST endpoints it calls (StockEntryRepository.ts). It does not restate SR-020’s server-side sign validation, deferred mutation, or ledger-immutability guarantees — this console is a client of that spec, not a second implementation of it.
Functional Requirements
Step 1 — Transaction Info (pages/transactionInfo/TransactionInfoPage.tsx)
- FR-01 (Five Operator-Selectable Movement Types, Each With Its Own Plain-Language Guidance): the Transaction Mode selector MUST offer exactly five operator-selectable types — Purchase, Return, Adjustment, Loss, Damage — each paired with a contextual helper message shown the moment that type is selected, stating in plain language how an entered quantity will be interpreted for that type (e.g. Loss/Damage: “positive input values are treated as outward counts and will reduce stock”; Adjustment: “type positive values to add stock, negative values to subtract”). Opening Entry and Sale exist as movement types at the data layer (SR-020 FR-01) but MUST NOT appear in this selector — Opening Entry is a separate bulk-initialization operation outside this console, and Sale is reachable only through checkout.
- FR-02 (Required Fields Gate Advancing to Step 2): advancing from Step 1 MUST be blocked, with an inline warning, unless a Reference/Invoice ID, a target Warehouse, and a Posting Date have all been supplied; Operations Notes and the supervisor-review toggle remain optional.
- FR-03 (A Supervisor-Review Toggle Is Settable at Entry Time): Step 1 MUST expose a toggle (“Strict Quality Control & Supervisor Safeguard”) that sets whether the resulting movement requires supervisor sign-off — carried through to SR-020 FR-07’s approval step, though not yet enforced as an approver-role gate there (tracked gap, TD-00014 TD-01).
Step 2 — Variant Matrix Entry (pages/variantMatrixEntry/VariantMatrixEntryPage.tsx)
- FR-04 (A Product Must Be Selected Before Any Quantity Can Be Entered): Step 2 MUST require a product to be searched and selected (via
searchPublishedProducts) before its variant matrix becomes available; once selected, the console MUST load that product’s live current stock for the chosen warehouse (fetchProductSkuBalances) rather than any stale or cached figure. - FR-05 (Every Color/Size Combination Is Shown Together, With a Live Projected Count): the matrix MUST render one row per color/size combination, each showing its SKU code, current stock, an editable quantity field, and a continuously-recomputed projected stock value — computed client-side from the entered quantity and the selected movement type’s sign rule, never fetched from the server. For Loss/Damage, the quantity field MUST be constrained to zero or greater (the UI always collects a positive magnitude for these two types; the signed value sent to the server is derived at submission time, per FR-08).
- FR-06 (Mass-Entry Shortcuts): the matrix MUST offer at least two bulk-fill actions across all visible rows (“+10 to All”, “Zero Out”) so a staff member isn’t forced to type into every cell individually for a uniform adjustment.
- FR-07 (A Running Summary of the Whole Matrix Is Always Visible): below the matrix, the console MUST show four continuously-recomputed figures — count of modified SKUs, gross movement units, sum of current stock, and sum of projected stock — so a staff member can sanity-check the matrix’s aggregate effect without manually totaling individual rows.
- FR-08 (The UI’s Entered Quantity Is Converted to the Server’s Signed Contract Only At Submission): the quantity a staff member types is always a plain, type-appropriate number as described by FR-01’s guidance; it MUST be converted to the signed value SR-020 FR-02 requires (Loss/Damage negated, Purchase/Return/Adjustment passed through as-is) only when building the create/update payload — the matrix display itself always works in the staff member’s own, non-negated terms.
- FR-09 (Advancing to Step 3 Requires At Least One Non-Zero Quantity): advancing from Step 2 MUST be blocked, with an inline warning, unless a product is selected and at least one variant’s quantity is non-zero.
Step 3 — Review & Post (pages/reviewPost/ReviewPostPage.tsx)
- FR-10 (One Consolidated Summary, Shared Between a New Submission and an Existing Pending Review): Step 3 MUST render a single component showing the movement’s configuration (type, reference, warehouse, posting date, notes, supervisor-flag state) and its quantitative effect (product, count of SKUs adjusted, total net delta, and a per-variant table of current stock / signed delta / resulting stock) — and this same component MUST be used both when reviewing a brand-new, not-yet-submitted movement and when reviewing an already-submitted movement still awaiting approval, per BRD-020 BR-05. The two cases differ only in which action buttons are shown (FR-11), never in the summary content itself.
- FR-11 (Submit Action Set Depends on Whether the Movement Already Exists): when reviewing a movement that has not yet been created, Step 3’s only action MUST be “Submit Stock Entry”. When reviewing a movement that already exists and is still
PENDING, Step 3 MUST instead offer “Save Changes” (re-submits the edited movement), “Reject”, and “Approve” — “Reject” and “Approve” MUST each require a distinct, explicit confirmation step describing their consequence (approve: “will update inventory balances and cannot be undone”; reject: “no inventory changes will be applied”) before the action fires. - FR-12 (An Approved Movement’s Displayed Before/After Figures Are Read Back From the Server, Never Recomputed): when viewing a movement already at
APPROVEDstatus, the per-variant “current stock” value shown MUST be thebalance_beforefigure returned by the server for that line — the same frozen, ledger-sourced value SR-020 FR-10 specifies — never a value re-fetched from current live stock or recalculated client-side. For a movement stillPENDING, this figure is0(no ledger entry has been written yet to supply one).
List & History (StockEntryListPage.tsx)
- FR-13 (The Full Movement History Is Searchable, Filterable, and Paginated): the list MUST support filtering by Warehouse, Transaction Mode, Status, and product (via product search), and MUST paginate results rather than loading the full unfiltered history at once.
- FR-14 (Row Actions Are Status-Gated): each row MUST always offer “View”; it MUST offer “Edit” only while that movement’s status is
PENDING; it MUST always offer “Clone”. (Gap — Clone always succeeds from the console’s perspective, but the endpoint it calls does not yet copy the source movement’s line items, so the cloned movement opens with zero pre-filled quantities; tracked as technical debt, see TD-00014 TD-02.) - FR-15 (Starting a New Movement From “Add Stock Entry” Pre-Fills a Fresh Reference Number and Today’s Date): starting a brand-new movement (not a clone) MUST pre-populate a generated reference number and the current date, defaulting to Purchase mode, so a staff member isn’t starting from entirely blank fields.
API Surface Consumed
- FR-16 (One Repository Function Per Endpoint, One Service Layer For All Derived Values): every server call this console makes MUST go through
StockEntryRepository.ts’s one-function-per-endpoint set —fetchStockEntries/fetchStockEntry(GET /inventory/admin/api/v1/stock-entries[/:id]),createStockEntry/updateStockEntry(POST/PUT .../stock-entries[/:id]),approveStockEntry/rejectStockEntry/cloneStockEntry(POST .../stock-entries/:id/{approve,reject,clone}),fetchProductSkuBalances(GET .../stock-balance/product-skus),fetchVariantBuilderForStock(GET .../variant-builder) — every derived value shown in the UI (projected stock, matrix stats, review lines, total delta, sign conversion) MUST be computed instockEntryService.ts’s pure functions, never inline inside a page or controller component.
Non-Functional Requirements
Composition & Reuse
- NFR-01 (Feature Triad): the feature MUST follow
ui-admin-application’s standard Types/Repository/Service/Controller/Page split —StockEntryTypes.ts,StockEntryRepository.ts,stockEntryService.ts,StockEntryController.ts/StockEntryListController.ts, and the page components — per the platform’s coding standards. - NFR-02 (No Raw HTTP Client Outside the Repository): no page or controller component MUST hold or call
apiClientdirectly — every outbound call is a namedStockEntryRepository.tsfunction.
Multi-Tenancy & Auth Propagation
- NFR-03 (Tenant Scope Is Never Carried in Component Props or Local State):
tenant_idMUST never be injected as anapiClientheader from within this feature, read fromauthStoreinside a repository/service function, or passed as a prop through the wizard’s component tree — tenant scope flows the platform’s standard one-directional path (authStore→ controller → service/repository argument), per security standards.
Client-Side Validation Is a Convenience, Not the Guarantee
- NFR-04 (Step-Gating Validation Does Not Replace Server-Side Enforcement): FR-02/FR-09’s step-advance gating exists to catch an incomplete entry early and give immediate feedback — it MUST NOT be relied on as the system’s actual sign/completeness guarantee, which SR-020 FR-02 already enforces independently at the server, twice, regardless of what this console does or does not block client-side.
Related Documents
- BRD-020 — Warehouse Stock Entry: Administration Console
- SR-020 — Warehouse Stock Entry: Ledger & Approval Control System Requirements — the server-side sign contract, deferred-mutation, and immutability guarantees this console is a client of
- Technical Debt — Warehouse Stock Entry Gaps — FR-03/FR-14’s gaps, in full
- Architecture — Warehouse Stock Entry: Creation, Approval-Gated Balance Mutation, and Immutable Ledger
- Admin UI Walkthrough — Warehouse Stock Entry Console — the page-by-page, screenshot-anchored walkthrough implementing every FR in this spec
- Microservices: inventory-service