Updated synchronization progress implementation.

This commit is contained in:
Burak Kaan Köse
2026-04-11 12:57:51 +02:00
parent 40318ef99c
commit 5cb49efeb4
20 changed files with 444 additions and 145 deletions
@@ -0,0 +1,30 @@
using System;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Models.Synchronization;
public record AccountSynchronizationProgress(
Guid AccountId,
SynchronizationProgressCategory Category,
bool IsInProgress,
bool IsIndeterminate,
double ProgressPercentage,
int TotalUnits,
int RemainingUnits,
string Status,
AccountSynchronizerState State)
{
public int CompletedUnits => Math.Max(0, TotalUnits - RemainingUnits);
public static AccountSynchronizationProgress Idle(Guid accountId, SynchronizationProgressCategory category)
=> new(
accountId,
category,
false,
false,
0,
0,
0,
string.Empty,
AccountSynchronizerState.Idle);
}