mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-01 20:23:13 +00:00
30 lines
858 B
C#
30 lines
858 B
C#
|
|
using SeaHaven.DataServices.Interfaces;
|
||
|
|
using SeaHaven.Services.DTOs;
|
||
|
|
using SeaHaven.Services.Interfaces;
|
||
|
|
|
||
|
|
namespace SeaHaven.Services.Implementation
|
||
|
|
{
|
||
|
|
public class DashboardService : IDashboardService
|
||
|
|
{
|
||
|
|
private readonly IDashboardDataService _dataService;
|
||
|
|
|
||
|
|
public DashboardService(IDashboardDataService dataService)
|
||
|
|
{
|
||
|
|
_dataService = dataService;
|
||
|
|
}
|
||
|
|
|
||
|
|
public async Task<DashboardStatsDTO> GetStatsAsync(CancellationToken cancellationToken)
|
||
|
|
{
|
||
|
|
var counts = await _dataService.GetWorkOrderCountsAsync(cancellationToken);
|
||
|
|
|
||
|
|
return new DashboardStatsDTO
|
||
|
|
{
|
||
|
|
Total = counts.Total,
|
||
|
|
Open = counts.Open,
|
||
|
|
NotDispatched = counts.NotDispatched,
|
||
|
|
Completed = counts.Completed
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|