Technical use-case library

Sales | 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.
S06

Sales

Sales order management with create, edit, view, filter, and payment tracking capabilities.

Route/sales
Entry pathMain nav > Sales
Product manualOpen user manual page
Playwright coverage

Functional

Detailed source

06-UC-Sales.md

UC-SALESORD: Sales Orders Page Use Cases

Page: Sales.razor Route: /sales Menu Position: 6 (Sales)


Overview

Sales order management with create, edit, view, filter, and payment tracking capabilities.


Section: Page Header & Actions

ID Section Action Expected Outcome Controls Affected
UC-SALESORD-001 Header Load Sales Orders page Title "Sales Orders - [BusinessName]", h2 shows "Sales Orders" with cart icon PageTitle, h2, fa-shopping-cart icon
UC-SALESORD-002 Header No business selected Alert "Please select a business to view sales" alert alert-info
UC-SALESORD-003 Actions Click "New Sale" button Modal opens with title "New Sales Order", empty form fields salesOrderModal, modal-title
UC-SALESORD-004 Empty State No sales orders Shows cart icon, "No Sales Orders Found" heading, "Create First Sale" button Empty state UI
UC-SALESORD-005 Empty State Click "Create First Sale" Opens New Sales Order modal salesOrderModal

Section: Loading State

ID Section Action Expected Outcome Controls Affected
UC-SALESORD-006 Loading During load Spinner with "Loading sales orders..." text spinner-border, loading text

Section: Sales Filters

ID Section Action Expected Outcome Controls Affected
UC-SALESORD-007 Filter View filter section 4 filters: Customer search, Order Status, Date Range, Payment Status StandardFilterSection, 4 filter fields
UC-SALESORD-008 Filter Type in Customer search Table filters by customer name in real-time customer search input, table rows
UC-SALESORD-009 Filter Select "Pending" from Order Status Shows only Pending status orders Order Status select, table rows
UC-SALESORD-010 Filter Select "Completed" from Order Status Shows only Completed status orders Order Status select, table rows
UC-SALESORD-011 Filter Select "Cancelled" from Order Status Shows only Cancelled status orders Order Status select, table rows
UC-SALESORD-012 Filter Select date range using DateRangeFilter Orders filtered to selected date range DateRangeFilter, table rows
UC-SALESORD-013 Filter Select "Unpaid" from Payment Status Shows orders with ₹0 paid Payment Status select, table rows
UC-SALESORD-014 Filter Select "Partially Paid" from Payment Status Shows orders with partial payment Payment Status select, table rows
UC-SALESORD-015 Filter Select "Fully Paid" from Payment Status Shows orders fully paid Payment Status select, table rows
UC-SALESORD-016 Filter Select "Overdue" from Payment Status Shows orders past due date with balance Payment Status select, table rows
UC-SALESORD-017 Filter Click "Clear" in filter section All filters reset, full order list shown Clear btn, all filters, table rows
UC-SALESORD-018 Filter Combine multiple filters Filters AND together (e.g., Pending + Unpaid) All filter controls, table rows

Section: Summary Row

ID Section Action Expected Outcome Controls Affected
UC-SALESORD-019 Summary View summary row Shows: Total X orders, Filtered X orders, Total Value ₹X, Outstanding ₹X summary-count, summary-filtered, summary-value, summary-outstanding
UC-SALESORD-020 Summary Apply filter All 4 summary values recalculate for filtered orders All summary fields
UC-SALESORD-021 Summary Total Value calculation Sum of TotalAmount for filtered orders summary-value
UC-SALESORD-022 Summary Outstanding calculation Sum of BalanceAmount for filtered orders summary-outstanding

Section: Sales Orders Table

ID Section Action Expected Outcome Controls Affected
UC-SALESORD-023 Table View table headers 10 columns: Order #, Date, Customer, Items, Total Amount, Paid Amount, Balance, Status, Payment Status, Actions thead th × 10
UC-SALESORD-024 Table View order row Shows all columns with correct formatting tr cells
UC-SALESORD-025 Table Order # column Shows order number (bold), notes below if exists (muted) Order # td
UC-SALESORD-026 Table Date column Shows date "dd MMM yyyy", due date below if exists Date td
UC-SALESORD-027 Table Customer column Customer name, phone number below if exists Customer td
UC-SALESORD-028 Table Items column Badge showing "X items" count badge bg-info
UC-SALESORD-029 Table Total Amount column Green bold ₹X,XX,XXX.XX format text-success strong
UC-SALESORD-030 Table Paid Amount column Blue ₹X,XX,XXX.XX format text-primary
UC-SALESORD-031 Table Balance > 0 Red ₹X,XX,XXX.XX format text-danger
UC-SALESORD-032 Table Balance = 0 Green ₹0.00 format text-success
UC-SALESORD-033 Table Status = Pending Badge styling for Pending status Status badge
UC-SALESORD-034 Table Status = Completed Badge styling for Completed status Status badge
UC-SALESORD-035 Table Status = Cancelled Badge styling for Cancelled status Status badge
UC-SALESORD-036 Table Payment = Unpaid Badge for unpaid orders Payment badge
UC-SALESORD-037 Table Payment = Partial Badge for partially paid orders Payment badge
UC-SALESORD-038 Table Payment = Paid Badge for fully paid orders Payment badge
UC-SALESORD-039 Table Payment = Overdue Badge for overdue orders Payment badge
UC-SALESORD-040 Table No matching orders Empty state: search icon, "No sales orders found", "Try adjusting filters" Empty state in table

Section: Order Actions

ID Section Action Expected Outcome Controls Affected
UC-SALESORD-041 Actions Click "View" button Opens order detail view/modal View modal
UC-SALESORD-042 Actions Click "Edit" button Opens edit modal with order data pre-filled Edit modal
UC-SALESORD-043 Actions Click "Delete" button Confirmation prompt, then order deleted Confirm dialog, table update

Section: Add/Edit Sales Order Modal

ID Section Action Expected Outcome Controls Affected
UC-SALESORD-044 Modal View New Sales Order modal Title "New Sales Order", empty form fields Modal title, form
UC-SALESORD-045 Modal View Edit Sales Order modal Title "Edit Sales Order", pre-filled form Modal title, form
UC-SALESORD-046 Modal Order Number field Required field, text input Order Number input
UC-SALESORD-047 Modal Order Date field Required field, date picker Order Date input
UC-SALESORD-048 Modal Customer dropdown Lists all customers, required field Customer select
UC-SALESORD-049 Modal Customers loading Shows "Loading customers..." disabled Customer select disabled
UC-SALESORD-050 Modal Status dropdown Options: Pending, Confirmed, Shipped, Delivered, Cancelled Status select
UC-SALESORD-051 Modal Total Amount field Required field, number input with step 0.01 Total Amount input
UC-SALESORD-052 Modal Discount Amount field Optional field, number input Discount Amount input
UC-SALESORD-053 Modal Notes field Optional textarea, 3 rows Notes textarea
UC-SALESORD-054 Modal Submit without required Validation messages for Order Number, Order Date, Customer, Total Amount ValidationMessage components
UC-SALESORD-055 Modal Click "Save Order" Spinner shows, order saved, modal closes, table refreshes spinner, modal close, table refresh
UC-SALESORD-056 Modal Click "Update" (edit mode) Spinner shows, order updated, modal closes spinner, modal close, table refresh
UC-SALESORD-057 Modal Click "Cancel" Modal closes, no changes saved Modal closes
UC-SALESORD-058 Modal Saving state Save button disabled, spinner visible Button state

Section: Data Validation Requirements

ID Validation Requirement
UC-SALESORD-059 Order Count Must show orders when sales exist in database
UC-SALESORD-060 Currency Format All ₹ amounts use Indian format (₹X,XX,XXX.XX)

Section: Unit Test Coverage

Test Class Test Count Coverage Areas Related Use Cases
SalesOrderCalculationTests 42 Balance, payment status, order status badges, summary calculations, discounts, date filtering UC-SALESORD-013 to UC-SALESORD-016, UC-SALESORD-021, UC-SALESORD-022, UC-SALESORD-028 to UC-SALESORD-039

Unit Tests Summary

Location: Rabbit.Accounts.Tests/Sales/SalesOrderCalculationTests.cs

Test Categories:

  1. Balance Calculation Tests (4 tests) - TotalAmount minus PaidAmount with edge cases
  2. Payment Status Tests (7 tests) - Unpaid/PartiallyPaid/Paid/Overdue determination
  3. Order Status Badge Tests (13 tests) - Badge classes and status validation
  4. Payment Status Badge Tests (4 tests) - Badge class by payment status
  5. Summary Calculation Tests (3 tests) - Total value and outstanding balance sums
  6. Discount Calculation Tests (3 tests) - Final amount after discount
  7. Item Count Display Tests (5 tests) - "X items" pluralization
  8. Date Filtering Tests (3 tests) - Date range boundary testing

Payment Status Logic:

  • Paid: Balance ≤ 0
  • Overdue: Balance > 0 AND DueDate < Today
  • PartiallyPaid: Balance > 0 AND PaidAmount > 0
  • Unpaid: Balance > 0 AND PaidAmount = 0

Total Use Cases: 60

Visual walkthrough

Screen snapshots

Open any image for a closer look. The manual keeps screenshots on screen pages so the index stays light.