Technical use-case library

Batches | Rabbit Accounts Use-Case Library

Use this page for technical screen behavior, source references, and active Playwright coverage.

Rabbit Accounts This library is for reviewers, QA, and implementation traceability. Use the product manual for customer-facing guidance.
S04

Batches

Inventory batches management showing FIFO cost layers with batch details and remaining quantities.

Route/batches
Entry pathMain nav > Batches
Product manualOpen user manual page
Playwright coverage

Screen smoke

Detailed source

04-UC-Batches.md

UC-BATMGT: Batches Page Use Cases

Page: Batches.razor Route: /batches Menu Position: 4 (Batches)


Overview

Inventory batches management showing FIFO cost layers with batch details and remaining quantities.


Section: Page Header

ID Section Action Expected Outcome Controls Affected
UC-BATMGT-001 Header Load Batches page Card header shows "Inventory Batches" with boxes icon, blue background card-header bg-primary, h4, fa-boxes icon

Section: Loading & Empty States

ID Section Action Expected Outcome Controls Affected
UC-BATMGT-002 Loading During load Spinner centered in card body spinner-border text-primary
UC-BATMGT-003 Empty State No batch data Info alert "No batch data available" with info icon alert alert-info

Section: Batches Table

ID Section Action Expected Outcome Controls Affected
UC-BATMGT-004 Table View table headers 7 columns: Batch Number, Product, Receipt Date, Unit Cost, Remaining Qty, Total Value, Action thead table-dark, 7 th
UC-BATMGT-005 Table View batch row Shows all columns with batch data tr row
UC-BATMGT-006 Table Batch Number column Bold batch number strong
UC-BATMGT-007 Table Product column Product name from GoodsReceiptItem.Product Product cell
UC-BATMGT-008 Table Receipt Date column Format: "dd-MMM-yyyy" (e.g., "19-Dec-2025") Date cell
UC-BATMGT-009 Table Unit Cost column Right-aligned ₹X,XX,XXX.XX text-end
UC-BATMGT-010 Table Remaining Qty column Right-aligned integer text-end
UC-BATMGT-011 Table Total Value column Bold, right-aligned ₹X,XX,XXX.XX (RemainingQty × UnitCost) text-end strong
UC-BATMGT-012 Table Table styling Striped and hover effects table-striped table-hover
UC-BATMGT-013 Table Only show active batches Only batches with RemainingQuantity > 0 shown Filtered data
UC-BATMGT-014 Table Sort order Sorted by Receipt Date ascending (FIFO order) Data order

Section: Batch Actions

ID Section Action Expected Outcome Controls Affected
UC-BATMGT-015 Actions Click "View Details" button Modal opens with batch details JS modal

Section: Batch Details Modal

ID Section Action Expected Outcome Controls Affected
UC-BATMGT-016 Modal View modal title "Batch [BatchNumber] Details" Modal title
UC-BATMGT-017 Modal Left column info Product, Product Code, Unit Cost, Original Quantity, Remaining Quantity Left column
UC-BATMGT-018 Modal Right column info Receipt Date, Receipt Number, Total Value, Allocated Quantity Right column
UC-BATMGT-019 Modal Allocated Quantity Original - Remaining = Allocated Calculated field
UC-BATMGT-020 Modal Total Value RemainingQuantity × UnitCost Calculated field

Section: Data Validation Requirements

ID Validation Requirement
UC-BATMGT-021 Batch Loading Must show batches when InventoryCostLayers exist for business
UC-BATMGT-022 FIFO Order Batches must be displayed in FIFO order (oldest first)
UC-BATMGT-023 Active Batches Only Only batches with RemainingQuantity > 0 displayed
UC-BATMGT-024 Currency Format All ₹ amounts use Indian format (₹X,XX,XXX.XX)
UC-BATMGT-025 Business Filter Only batches for current business shown

Section: Unit Test Coverage

Test Class Test Count Coverage Areas Related Use Cases
BatchCalculationTests 28 Total value, allocated quantity, FIFO ordering, active batch filtering, consumption logic UC-BATMGT-011, UC-BATMGT-019, UC-BATMGT-020, UC-BATMGT-022, UC-BATMGT-023

Unit Tests Summary

Location: Rabbit.Accounts.Tests/Batches/BatchCalculationTests.cs

Test Categories:

  1. Total Value Tests (5 tests) - RemainingQuantity × UnitCost calculations with edge cases
  2. Allocated Quantity Tests (4 tests) - OriginalQuantity - RemainingQuantity calculations
  3. FIFO Order Tests (2 tests) - Sorting by ReceiptDate ascending (oldest first)
  4. Active Batch Filter Tests (3 tests) - RemainingQuantity > 0 filtering
  5. Batch Consumption Tests (7 tests) - Single batch and multi-batch FIFO consumption with weighted average cost
  6. Date Formatting Tests (4 tests) - dd-MMM-yyyy format validation

FIFO Consumption Logic:

  • Batches sorted by ReceiptDate ascending
  • Oldest batches consumed first
  • Partial consumption supported
  • Weighted average cost calculated from consumed batches

Total Use Cases: 25