using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using TeamManiacs.Core.Enums;

namespace TeamManiacs.Core.Models
{
    public class AuthCode
    {
        [Key]
        [Required]        
        public int Uid { get; set; }
         
        [StringLength(200)]
        public string? Code { get; set; }

        [Column(TypeName = "Date")]
        public DateTime CreatedDate { get; set; }

        [Column(TypeName = "Date")]
        public DateTime Expiration { get; set; }

        [Required]
        [JsonConverter(typeof(JsonStringEnumMemberConverter))]
        public CodeType Type { get; set; }
    }
}
