Use this page for technical screen behavior, source references, and active Playwright coverage.
Product management with inventory view, batch view, filters, Excel import, and CRUD operations.
Page: Products.razor
Route: /products
Menu Position: 3 (Products)
Product management with inventory view, batch view, filters, Excel import, and CRUD operations.
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-001 | Header | Load Products page | Page title "Products - [BusinessName]", h2 shows "Products", Products tab is active (btn-primary) | PageTitle, h2 title, Products btn active |
| UC-PROD-002 | Header | No business selected | Alert shows "Please select a business to view products" | alert alert-info |
| UC-PROD-003 | Tabs | Click Products tab | View switches to Products, header says "Products", Add Product/Import Excel/Download Template buttons show | Products btn active, h2="Products", action buttons |
| UC-PROD-004 | Tabs | Click Inventory tab | View switches to Inventory, header says "Products - Inventory View", Refresh Inventory/Adjust Stock buttons show | Inventory btn active, h2="Products - Inventory View", action buttons |
| UC-PROD-005 | Tabs | Click Batches tab | View switches to Batches, header says "Products - Batch View", Refresh Batches/Batch Details buttons show | Batches btn active, h2="Products - Batch View", action buttons |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-006 | Actions | Click "Add Product" | Modal opens with title "Add New Product", empty form fields | productModal opens, modal-title="Add New Product" |
| UC-PROD-007 | Actions | Click "Import Excel" | Import modal opens with file upload field | importModal opens |
| UC-PROD-008 | Actions | Click "Download Template" | Excel template file downloads | Browser download |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-009 | Filter | View filter section | Shows 4 filters: Search Products, Category, Stock Level, Price Range | StandardFilterSection, 4 filter fields |
| UC-PROD-010 | Filter | Type in Search box | Products table filters in real-time (debounced) to match search term in product name/code | Search textbox, products table rows |
| UC-PROD-011 | Filter | Select "Smartphones" from Category | Products table shows only Smartphones category products, Filtered count updates | Category select, summary-filtered, table rows |
| UC-PROD-012 | Filter | Select "Low Stock" from Stock Level | Products table shows only products with stock <= 10, status badge = "Low Stock" | Stock Level select, table rows, status badges |
| UC-PROD-013 | Filter | Select "Out of Stock" from Stock Level | Products table shows only products with stock = 0, status badge = "Out of Stock" | Stock Level select, table rows |
| UC-PROD-014 | Filter | Select "In Stock" from Stock Level | Products table shows products with stock > 10 | Stock Level select, table rows |
| UC-PROD-015 | Filter | Select "Under ₹5,000" from Price Range | Products table shows only products with price < 5000 | Price Range select, table rows |
| UC-PROD-016 | Filter | Select "₹5,000 - ₹10,000" | Products with price 5000-10000 shown | Price Range select, table rows |
| UC-PROD-017 | Filter | Select "₹10,000 - ₹20,000" | Products with price 10000-20000 shown | Price Range select, table rows |
| UC-PROD-018 | Filter | Select "Over ₹20,000" | Products with price > 20000 shown | Price Range select, table rows |
| UC-PROD-019 | Filter | Click "Clear" button | All filters reset to defaults, full product list shown | Clear btn, all filter controls, table rows |
| UC-PROD-020 | Filter | Combine filters | Multiple filters AND together (e.g., Smartphones + Low Stock) | All filter controls, table rows |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-021 | Summary | View summary | Shows: (1) "Total: X items" = total products, (2) "Filtered: X items" = after filters, (3) "Stock: X units" = sum of filtered stock, (4) "Filtered Value: ₹X" = sum of (stock × price) | summary-count, summary-filtered, summary-stock, summary-value |
| UC-PROD-022 | Summary | Apply filter | Filtered count, Stock units, and Filtered Value recalculate for filtered products | summary-filtered, summary-stock, summary-value |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-023 | Table | View table headers | 8 columns: Product Name, Code, Category, Price, Stock, Stock Value, Status, Actions | thead th × 8 |
| UC-PROD-024 | Table | View product row | Shows: product name, code, category name, price (₹X,XX,XXX.XX), stock count, stock value (₹X), status badge, Edit/Delete buttons | tr cells |
| UC-PROD-025 | Table | Stock <= 10 | Stock number shows red bold text, Status = "Low Stock" yellow badge | product-stock text-danger fw-bold, badge bg-warning |
| UC-PROD-026 | Table | Stock = 0 | Status = "Out of Stock" red badge | badge bg-danger |
| UC-PROD-027 | Table | Stock > 10 | Stock shows green text, Status = "In Stock" green badge | product-stock text-success, badge bg-success |
| UC-PROD-028 | Table | Stock 11-50 | Stock shows yellow/warning text | product-stock text-warning |
| UC-PROD-029 | Table | Price column | Right-aligned, format ₹X,XX,XXX.XX | product-price text-end |
| UC-PROD-030 | Table | Stock Value | Right-aligned, green, format ₹X,XX,XXX | product-stock-value text-end text-success |
| UC-PROD-031 | Table | Max rows | Shows max 25 rows (pagination if more) | tbody tr × 25 max |
| UC-PROD-032 | Table | No products | Empty state: "No products found" heading, "Add some products to get started" | products-empty-state |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-033 | Actions | Click Edit button | Modal opens with title "Edit Product", form pre-filled with product data | productModal, modal-title="Edit Product", all form fields populated |
| UC-PROD-034 | Actions | Click Delete button | Confirmation prompt, then product deleted from list | Confirmation dialog, product removed from table |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-035 | Modal | View modal fields | Fields: Product Name*, Product Code*, Description, Unit Price*, Unit*, Current Stock, Minimum Stock Level, Category | 8 form fields |
| UC-PROD-036 | Modal | Submit without required fields | Validation messages show for Product Name, Product Code, Unit Price, Unit | ValidationMessage components |
| UC-PROD-037 | Modal | Enter valid data and submit | Spinner shows, product saved, modal closes, table refreshes with new/updated product | spinner, modal closes, table updates |
| UC-PROD-038 | Modal | Click Cancel | Modal closes, no changes saved | Modal closes |
| UC-PROD-039 | Modal | Click X button | Modal closes | Modal closes |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-040 | Import | View import modal | File upload field, "Supported formats: .xlsx, .xls", Cancel/Import buttons | InputFile, format text, buttons |
| UC-PROD-041 | Import | Select file | File info shows: name, size in KB | alert alert-info with file details |
| UC-PROD-042 | Import | Click Import Products | Spinner shows, import processes | spinner, processing |
| UC-PROD-043 | Import | Import success | Shows 3 cards: Total Rows, Successful, Failed. If errors: warning list | Summary cards, error list |
| UC-PROD-044 | Import | Import errors | Orange warning shows first 10 errors with row numbers | alert alert-warning, error list |
| UC-PROD-045 | Import | Click "Import Another File" | Resets modal for new import | Modal resets |
| UC-PROD-046 | Import | Click Close after import | Modal closes, products table refreshes | Modal closes, table refreshes |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-047 | Inventory | Click Inventory tab | Switches to inventory view showing stock levels | Inventory btn active |
| UC-PROD-048 | Inventory | View table headers | Columns: Product, Current Stock, Reserved, Available, Reorder Level, Status | thead |
| UC-PROD-049 | Inventory | Available calculation | Available = Current Stock - Reserved | Available column |
| UC-PROD-050 | Inventory | Below reorder | Yellow warning badge "Reorder" | badge bg-warning |
| UC-PROD-051 | Inventory | Click Adjust Stock | Opens stock adjustment modal | Adjust Stock btn |
| UC-PROD-052 | Inventory | Click Refresh Inventory | Reloads inventory data | Refresh Inventory btn |
| ID | Section | Action | Expected Outcome | Controls Affected |
|---|---|---|---|---|
| UC-PROD-053 | Batches | Click Batches tab | Switches to batch view showing FIFO batches | Batches btn active |
| UC-PROD-054 | Batches | View table headers | Columns: Product, Batch #, Receipt Date, Qty Received, Qty Remaining, Unit Cost, Total Value | thead |
| UC-PROD-055 | Batches | Sort order | Batches ordered by Receipt Date (FIFO) | Data ordering |
| UC-PROD-056 | Batches | Click Batch Details | Opens batch detail modal | Batch Details btn |
| UC-PROD-057 | Batches | Click Refresh Batches | Reloads batch data | Refresh Batches btn |
| ID | Validation | Requirement |
|---|---|---|
| UC-PROD-058 | Product Count | Must show products when products exist in database |
| UC-PROD-059 | Currency Format | All ₹ amounts use Indian format (₹X,XX,XXX.XX) |
| UC-PROD-060 | Stock Accuracy | Stock values must match InventoryCostLayer remaining quantities |
| UC-PROD-061 | FIFO Order | Batch view must show oldest batches first |
| Test Class | Test Count | Coverage Areas | Related Use Cases |
|---|---|---|---|
ProductInventoryTests |
61 | Price calculations, stock status, price range filtering, inventory levels, reorder logic | UC-PROD-012 to UC-PROD-018, UC-PROD-025 to UC-PROD-030, UC-PROD-049, UC-PROD-050 |
Location: Rabbit.Accounts.Tests/Products/ProductInventoryTests.cs
Test Categories:
Stock Status Thresholds:
Price Range Boundaries:
Total Use Cases: 61