using e_suite.Database.Audit.Attributes;
using e_suite.Database.Core.Models;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace e_suite.Database.Core.Tables.Contacts
{
    [DisplayName("Contact")]
    [Table("Contacts", Schema = "Contacts")]
    [Index(nameof(Id), IsUnique = true)]
    [Index(nameof(Guid), IsUnique = true)]
    public class Contact : IGeneralId
    {
        [Key]
        public long Id { get; set; }

        [Required]
        public Guid Guid { get; set; }

        [AuditName]
        [Required]
        public string JCard { get; set; } = string.Empty;

        [AuditLastUpdated]
        public DateTimeOffset LastUpdated { get; set; }
    }
}
