Use this page for technical screen behavior, source references, and active Playwright coverage.
Inventory batches management showing FIFO cost layers with batch details and remaining quantities.
Page: Batches.razor
Route: /batches
Menu Position: 4 (Batches)
Inventory batches management showing FIFO cost layers with batch details and remaining quantities.
| 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 |
| 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 |
| 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 |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-BATMGT-015 | Actions | Click "View Details" button | Modal opens with batch details | JS 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 |
| 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 |
| 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 |
Location: Rabbit.Accounts.Tests/Batches/BatchCalculationTests.cs
Test Categories:
FIFO Consumption Logic:
Total Use Cases: 25