using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Fitness_core_BE.Models { public class Attendance { [Key] public Guid AttendanceId { get; set; } public Guid FKClientId { get; set; } [ForeignKey("FKClientId")] public Client Client { get; set; } public Guid? FKDeviceId { get; set; } [ForeignKey(nameof(FKDeviceId))] public AccessDevice? AccessDevice { get; set; } // Tenant-bucket entity: this FK holds a TenantCustomerLinkId (not the central // Customer.CusId directly) -- see Models/TenantCustomerLink.cs. public Guid? FKCustomerId { get; set; } [ForeignKey("FKCustomerId")] public TenantCustomerLink? TenantCustomerLink { get; set; } public Guid? FKUserId { get; set; } [ForeignKey(nameof(FKUserId))] public User? User { get; set; } public long? FKAccessProfileId { get; set; } [ForeignKey(nameof(FKAccessProfileId))] public AccessProfile? AccessProfile { get; set; } public int DeviceUserId { get; set; } [MaxLength(32)] public string DeviceEmployeeNo { get; set; } = string.Empty; [MaxLength(64)] public string? SourceEventKey { get; set; } public DateTime EventTime { get; set; } public string EventType { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; } }