first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Fitness_core_BE.Models
|
||||
{
|
||||
public class DeviceCommand
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
public Guid FKClientId { get; set; }
|
||||
[ForeignKey("FKClientId")]
|
||||
public Client Client { get; set; }
|
||||
public Guid? FKDeviceId { get; set; }
|
||||
[ForeignKey("FKDeviceId")]
|
||||
public AccessDevice? AccessDevice { get; set; }
|
||||
|
||||
public Guid? FKAccessDeviceBindingId { get; set; }
|
||||
[ForeignKey(nameof(FKAccessDeviceBindingId))]
|
||||
public AccessDeviceBinding? AccessDeviceBinding { get; set; }
|
||||
|
||||
// e.g. "AddUser", "WhiteListMember", "BlackListMember"
|
||||
public string CommandType { get; set; }
|
||||
public string PayloadJson { get; set; }
|
||||
|
||||
// "Pending" / "InProgress" / "Completed" / "Failed"
|
||||
public string Status { get; set; } = "Pending";
|
||||
public string? ResultJson { get; set; }
|
||||
public int DesiredVersion { get; set; }
|
||||
public int AttemptCount { get; set; }
|
||||
public int MaxAttempts { get; set; } = 5;
|
||||
public DateTime? LeaseExpiresAt { get; set; }
|
||||
public DateTime? NextAttemptAt { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? ProcessedAt { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user