using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace OpenWarehouse.auth.api.Data;

public class ApplicationUserTokenRepository
{
    public ApplicationUserTokenRepository()
    {
        IsLocked = false;
    }
    public ApplicationUserTokenRepository(string? guid,ApplicationUser? user ,DateTime? createdTime, DateTime? expireTime) : this()
    {
        this.Creator = user;
        this.GuidToken = guid;
        this.CreatedTime = createdTime;
        ExpireTime = expireTime;
    }
    [Key]
    public long Id { get; set; }
    [Required]
    public ApplicationUser? Creator { get; set; }
    [Required, MaxLength(37)]
    public string? GuidToken { get; set; }
    [Required]
    public DateTime? CreatedTime { get; set; }
    public DateTime? ExpireTime { get; set; }
    [Required]
    [DefaultValue(false)]
    public bool IsLocked { get; set; }
}