feat(dashboard): add date filter and stat groups components
- Implemented DashboardDateFilter component for selecting date ranges including custom options. - Created DashboardStatGroups component to display various statistical cards grouped by categories. - Added dashboard-chart-data module to handle chart specifications and data processing for dashboard charts. - Introduced Chart component with tooltip and legend functionalities for better data visualization.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
namespace ERPCore.Dtos.Dashboard;
|
||||
|
||||
/// <summary>
|
||||
/// Every dataset behind the dashboard graphs, in one computed-on-read object (same idea as
|
||||
/// <see cref="DashboardStatsDto"/>). Time-based sets follow the From-To period the dashboard filter sends;
|
||||
/// "snapshot" sets (ageing, batches expiring, low stock, warranties) describe what is open now.
|
||||
/// Purchases-vs-sales by month and stock value by warehouse are already in <see cref="DashboardStatsDto"/>.
|
||||
/// </summary>
|
||||
public sealed record DashboardChartsDto(
|
||||
// Sales
|
||||
IReadOnlyList<DailySalesPointDto> DailySales,
|
||||
IReadOnlyList<ChartPointDto> PaymentSplit,
|
||||
IReadOnlyList<ChartPointDto> TopItems,
|
||||
IReadOnlyList<ChartPointDto> SalesByCategory,
|
||||
IReadOnlyList<ChartPointDto> SalesByCustomer,
|
||||
IReadOnlyList<DocumentStatusDto> DocumentStatus,
|
||||
// Money
|
||||
IReadOnlyList<ChartPointDto> CashInHandByDay,
|
||||
IReadOnlyList<ChartPointDto> ReceivablesAgeing,
|
||||
IReadOnlyList<ChartPointDto> PayablesAgeing,
|
||||
IReadOnlyList<ChartPointDto> ExpenseBreakdown,
|
||||
// Purchasing
|
||||
IReadOnlyList<ChartPointDto> TopVendors,
|
||||
// Stock
|
||||
IReadOnlyList<ChartPairDto> StockInVsOut,
|
||||
IReadOnlyList<ChartPointDto> BatchesExpiring,
|
||||
// HR
|
||||
IReadOnlyList<ChartPointDto> AttendanceMix,
|
||||
IReadOnlyList<ChartPointDto> PayrollCostByMonth,
|
||||
IReadOnlyList<ChartPointDto> LeaveStatus,
|
||||
// Service and production
|
||||
IReadOnlyList<ChartPairDto> TicketsOverTime,
|
||||
IReadOnlyList<ChartPointDto> ProductionStatus,
|
||||
IReadOnlyList<ChartPointDto> WarrantyExpiryByMonth);
|
||||
|
||||
/// <summary>One labelled value: a bar, a donut slice or a point on a line.</summary>
|
||||
public sealed record ChartPointDto(string Label, decimal Value);
|
||||
|
||||
/// <summary>Two values under one label (stock in/out by warehouse, tickets opened/resolved by day).</summary>
|
||||
public sealed record ChartPairDto(string Label, decimal First, decimal Second);
|
||||
|
||||
/// <summary>One day of the Daily Sales, Gross Profit and Expenses line chart.</summary>
|
||||
public sealed record DailySalesPointDto(string Label, decimal Sales, decimal GrossProfit, decimal Expenses);
|
||||
|
||||
/// <summary>Draft / Posted / Cancelled counts for one kind of document.</summary>
|
||||
public sealed record DocumentStatusDto(string Doc, int Draft, int Posted, int Cancelled);
|
||||
Reference in New Issue
Block a user