Use this page for technical screen behavior, source references, and active Playwright coverage.
Vendor Analytics supports analytics cards, trend grids, vendor segmentation, filters.
| ID | Section | Action | Expected Outcome | Controls |
|---|---|---|---|---|
| UC-VANALYTICS-001 | Page Load | Navigate to /vendor-analytics | Page loads with spinner, then displays dashboard | Page container |
| UC-VANALYTICS-002 | Auth | Access without CustomerAdmin | Redirect to unauthorized | Authorize attribute |
| UC-VANALYTICS-003 | Business | No business selected | Shows "select a business" alert | Alert info |
| UC-VANALYTICS-004 | Date Filter | Set from date | fromDate bound to input | Date input |
| UC-VANALYTICS-005 | Date Filter | Set to date | toDate bound to input | Date input |
| UC-VANALYTICS-006 | Date Filter | Click Apply | RefreshData called, reloads analytics | Apply button |
| UC-VANALYTICS-007 | Refresh | Click Refresh button | RefreshData reloads all data | Refresh button |
| UC-VANALYTICS-008 | KPI Card | Active Vendors displayed | Shows totalVendors count | Card body |
| UC-VANALYTICS-009 | KPI Card | New vendors this period | Shows newVendorsThisPeriod | Small text |
| UC-VANALYTICS-010 | KPI Card | Total Purchases | Shows totalPurchases formatted ₹N0 | Card body |
| UC-VANALYTICS-011 | KPI Card | Purchase growth | Shows purchaseGrowthPercent with +/- icon | Small text |
| UC-VANALYTICS-012 | KPI Card | Pending Payments | Shows pendingPayments formatted ₹N0 | Card body |
| UC-VANALYTICS-013 | KPI Card | Overdue invoices count | Shows overdueInvoices number | Small text |
| UC-VANALYTICS-014 | KPI Card | Avg Vendor Rating | Shows averageVendorRating F1 format | Card body |
| UC-VANALYTICS-015 | Chart | Purchase Volume Trend | Line chart with ₹ formatted tooltips | Canvas purchaseTrendChart |
| UC-VANALYTICS-016 | Chart | Top Vendors doughnut | Shows top 10 vendors by purchase | Canvas topVendorsChart |
| UC-VANALYTICS-017 | Chart | Vendor Ratings radar | 5-axis radar chart 0-100 scale | Canvas vendorRatingsChart |
| UC-VANALYTICS-018 | Chart | Payment Status pie | Paid/Pending/Overdue distribution | Canvas paymentStatusChart |
| UC-VANALYTICS-019 | Table | Vendor Name column | Shows name with icon and code | td |
| UC-VANALYTICS-020 | Table | Total Purchases | Right-aligned ₹N0 format green | td text-end |
| UC-VANALYTICS-021 | Table | Orders Count | Right-aligned bold | td text-end |
| UC-VANALYTICS-022 | Table | Avg Order Value | Right-aligned ₹N0 | td text-end |
| UC-VANALYTICS-023 | Table | Pending Amount | Conditional color warning/success | td text-end |
| UC-VANALYTICS-024 | Table | Quality Rating badge | Color by GetRatingBadgeClass | Badge |
| UC-VANALYTICS-025 | Table | Delivery Rating badge | Color by GetRatingBadgeClass | Badge |
| UC-VANALYTICS-026 | Table | Price Rating badge | Color by GetRatingBadgeClass | Badge |
| UC-VANALYTICS-027 | Table | Overall Rating badge | Color by GetRatingBadgeClass | Badge |
| UC-VANALYTICS-028 | Table | Status badge | Active=green, Inactive=secondary | Badge |
| UC-VANALYTICS-029 | Export | Click Export button | Downloads CSV with analytics | Export button |
| UC-VANALYTICS-030 | Export | CSV content | Headers + data rows properly formatted | CSV file |
| UC-VANALYTICS-031 | Rating | Score >= 80 | bg-success badge | Badge class |
| UC-VANALYTICS-032 | Rating | Score 60-79 | bg-warning badge | Badge class |
| UC-VANALYTICS-033 | Rating | Score 40-59 | bg-info badge | Badge class |
| UC-VANALYTICS-034 | Rating | Score < 40 | bg-danger badge | Badge class |
| UC-VANALYTICS-035 | Empty State | No vendor data | Shows inbox icon with message | Text center div |
| UC-VANALYTICS-036 | Business Change | Switch business | HandleBusinessChanged reloads data | Event handler |
| UC-VANALYTICS-037 | Dispose | Component disposed | Unsubscribes from OnChanged event | Dispose method |
| UC-VANALYTICS-038 | Chart Init | First render | initializeVendorAnalyticsCharts called | JS interop |
| UC-VANALYTICS-039 | Chart Update | Data loaded | updateVendorAnalyticsCharts called | JS interop |
| UC-VANALYTICS-040 | Growth Icon | Positive growth | Arrow up icon | bi-arrow-up |
| UC-VANALYTICS-041 | Growth Icon | Negative growth | Arrow down icon | bi-arrow-down |
| UC-VANALYTICS-042 | Growth Color | Positive | text-success class | Span class |
| UC-VANALYTICS-043 | Growth Color | Negative | text-danger class | Span class |
| UC-VANALYTICS-044 | Table Sort | Default order | Sorted by TotalPurchases descending | OrderByDescending |
| UC-VANALYTICS-045 | Accessibility | Table role | role="table" with aria-label | Table attributes |