Update sync models for device-to-device transfer

Introduce model support for the Device → Device sync flow.

- Replace DbToDevice sync operation with DeviceToDevice
- Update sync history display text for the renamed operation
- Add source display and face display fields for selectable machine users
- Add DeviceTransferUser model for transferring selected users
main
SYED MUSTUFA AHMED NAQVI 2026-08-28 12:44:29 +05:00
parent 688588eff1
commit ab084ebb50
1 changed files with 8 additions and 3 deletions

View File

@ -6,7 +6,7 @@ public enum SyncOperationKind
UserCreation,
UserDeletion,
DeviceToDb,
DbToDevice,
DeviceToDevice,
DepartmentalUserSync,
FaceEnrollment
}
@ -32,7 +32,7 @@ public sealed class SyncHistoryEntry
SyncOperationKind.UserCreation => "User Creation",
SyncOperationKind.UserDeletion => "User Deletion",
SyncOperationKind.DeviceToDb => "Device → DB",
SyncOperationKind.DbToDevice => "DB → Device",
SyncOperationKind.DeviceToDevice => "Device → Device",
SyncOperationKind.DepartmentalUserSync => "Departmental User Sync",
SyncOperationKind.FaceEnrollment => "Face Enrollment",
_ => Operation.ToString()
@ -103,16 +103,19 @@ public sealed class SelectableMachineUser : System.ComponentModel.INotifyPropert
{
private bool _isSelected;
public SelectableMachineUser(string serialNumber, string employeeName, bool hasFaceTemplate)
public SelectableMachineUser(string serialNumber, string employeeName, bool hasFaceTemplate, string sourceDisplay)
{
SerialNumber = serialNumber;
EmployeeName = employeeName;
HasFaceTemplate = hasFaceTemplate;
SourceDisplay = sourceDisplay;
}
public string SerialNumber { get; }
public string EmployeeName { get; }
public bool HasFaceTemplate { get; }
public string SourceDisplay { get; }
public string FaceDisplay => HasFaceTemplate ? "Yes" : "No";
public bool IsSelected
{
@ -128,6 +131,8 @@ public sealed class SelectableMachineUser : System.ComponentModel.INotifyPropert
public event System.ComponentModel.PropertyChangedEventHandler? PropertyChanged;
}
public sealed record DeviceTransferUser(string SerialNumber, string EmployeeName);
public sealed record AttendanceSyncProgress(int Fetched, int Inserted, int Skipped, int Failed, string Message);
public sealed record AttendancePunch(string EmployeeNo, DateTime CheckTime, int InOutTypeId);