Files
Core_Be/Models/AccessDeviceBinding.cs
Dhananjaya99 bffc9b1686 first commit
2026-09-28 11:44:26 +05:30

45 lines
1.4 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Fitness_core_BE.Models
{
/// <summary>
/// Maps one tenant access profile to one physical terminal user record.
/// DeviceEmployeeNo is the terminal's person identifier, not a fingerprint template.
/// </summary>
public class AccessDeviceBinding
{
[Key]
public Guid AccessDeviceBindingId { get; set; }
public long FKAccessProfileId { get; set; }
[ForeignKey(nameof(FKAccessProfileId))]
public AccessProfile AccessProfile { get; set; } = null!;
public Guid FKDeviceId { get; set; }
[ForeignKey(nameof(FKDeviceId))]
public AccessDevice AccessDevice { get; set; } = null!;
[MaxLength(32)]
public string DeviceEmployeeNo { get; set; } = string.Empty;
[MaxLength(20)]
public string ProvisionStatus { get; set; } = "Pending";
[MaxLength(20)]
public string ActualAccessState { get; set; } = "Unknown";
public int FingerprintCount { get; set; }
[MaxLength(128)]
public string? DeviceReportedName { get; set; }
[MaxLength(1000)]
public string? LastError { get; set; }
public DateTime? LastSyncedAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
}