2026-07-24 17:35:34 -03:00
|
|
|
namespace SeaHaven.DataServices.Interfaces
|
|
|
|
|
{
|
2026-09-16 17:28:21 -03:00
|
|
|
using Data.SeaHavenIndustries.Enums;
|
|
|
|
|
|
2026-07-24 17:35:34 -03:00
|
|
|
public interface IDashboardDataService
|
|
|
|
|
{
|
2026-09-16 17:12:03 -03:00
|
|
|
Task<DashboardCounts> GetWorkOrderCountsAsync(
|
|
|
|
|
int? accountId,
|
|
|
|
|
CancellationToken cancellationToken);
|
2026-09-16 17:28:21 -03:00
|
|
|
|
2026-09-16 19:19:10 -03:00
|
|
|
Task<DashboardKpiCounts> GetKpiCountsAsync(
|
|
|
|
|
int? accountId,
|
|
|
|
|
string? dispatcherId,
|
|
|
|
|
DateOnly today,
|
|
|
|
|
CancellationToken cancellationToken);
|
|
|
|
|
|
2026-09-24 21:02:28 -03:00
|
|
|
/// <summary>
|
|
|
|
|
/// Open work orders with no dispatcher in the period, counted with the
|
2026-09-25 03:38:31 -03:00
|
|
|
/// same filters as GET /board/search for Dispatcher=Unassigned,
|
2026-09-24 21:02:28 -03:00
|
|
|
/// so the Dashboard number matches the list it drills into.
|
|
|
|
|
/// </summary>
|
|
|
|
|
Task<int> CountOpenUnassignedAsync(
|
|
|
|
|
int? accountId,
|
|
|
|
|
string? dispatcherId,
|
|
|
|
|
DateOnly? dateFrom,
|
|
|
|
|
DateOnly? dateTo,
|
|
|
|
|
CancellationToken cancellationToken);
|
|
|
|
|
|
2026-09-16 17:28:21 -03:00
|
|
|
Task<IReadOnlyList<DashboardWorkOrder>> GetDashboardWorkOrdersAsync(
|
|
|
|
|
int? accountId,
|
|
|
|
|
string? dispatcherId,
|
|
|
|
|
DateOnly? dateFrom,
|
|
|
|
|
DateOnly? dateTo,
|
|
|
|
|
CancellationToken cancellationToken);
|
2026-09-16 17:43:49 -03:00
|
|
|
|
|
|
|
|
Task<IReadOnlyList<DashboardDispatcherWorkload>> GetDispatcherWorkloadAsync(
|
|
|
|
|
int? accountId,
|
|
|
|
|
string? dispatcherId,
|
|
|
|
|
DateOnly? dateFrom,
|
|
|
|
|
DateOnly? dateTo,
|
|
|
|
|
CancellationToken cancellationToken);
|
2026-07-24 17:35:34 -03:00
|
|
|
}
|
|
|
|
|
|
2026-09-16 17:28:21 -03:00
|
|
|
public sealed record DashboardWorkOrder(
|
|
|
|
|
int Id,
|
|
|
|
|
string? AssignTo,
|
|
|
|
|
WorkOrderType? WorkOrderType,
|
|
|
|
|
LifecycleStatus? LifecycleStatus,
|
|
|
|
|
string? LegacyStatus,
|
|
|
|
|
DateTime? ScheduledDate,
|
|
|
|
|
DateOnly? OriginalDate,
|
2026-09-16 18:01:42 -03:00
|
|
|
DateTime? CompletedDate,
|
2026-09-16 18:10:42 -03:00
|
|
|
string? LocationState = null,
|
|
|
|
|
int RescheduleCount = 0,
|
|
|
|
|
int? VendorCompanyId = null,
|
|
|
|
|
string? VendorCompanyName = null,
|
|
|
|
|
bool VendorIsActive = false,
|
|
|
|
|
bool VendorCompanyIsDeleted = false);
|
2026-09-16 17:28:21 -03:00
|
|
|
|
2026-09-16 17:43:49 -03:00
|
|
|
public sealed record DashboardDispatcherWorkload(
|
|
|
|
|
string DispatcherId,
|
|
|
|
|
string DispatcherName,
|
2026-09-16 17:58:08 -03:00
|
|
|
string? Color,
|
2026-09-16 17:43:49 -03:00
|
|
|
int TotalCount,
|
|
|
|
|
int OpenCount);
|
|
|
|
|
|
2026-07-24 17:35:34 -03:00
|
|
|
public class DashboardCounts
|
|
|
|
|
{
|
|
|
|
|
public int Total { get; set; }
|
|
|
|
|
public int Open { get; set; }
|
|
|
|
|
public int NotDispatched { get; set; }
|
|
|
|
|
public int Completed { get; set; }
|
|
|
|
|
}
|
2026-09-16 19:19:10 -03:00
|
|
|
|
|
|
|
|
public sealed record DashboardKpiCounts(
|
|
|
|
|
int ScheduledTomorrow,
|
|
|
|
|
int PendingUplifts,
|
|
|
|
|
int AvetaPending);
|
2026-07-24 17:35:34 -03:00
|
|
|
}
|