using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATUser")]
[Index("ObjectId", Name = "UK_User", IsUnique = true)]
public partial class Atuser
{
    [Key]
    [StringLength(255)]
    public string UserName { get; set; } = null!;

    [StringLength(255)]
    public string? DisplayName { get; set; }

    public int? UserStore { get; set; }

    public int? Type { get; set; }

    [StringLength(255)]
    public string? Description { get; set; }

    public int? Status { get; set; }

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

    [Column("ADDomain")]
    [StringLength(255)]
    public string? Addomain { get; set; }

    [InverseProperty("ExceptionUserNavigation")]
    public virtual ICollection<AtexceptionNote> AtexceptionNotes { get; set; } = new List<AtexceptionNote>();

    [InverseProperty("CreatorNavigation")]
    public virtual ICollection<AtprocessDefinition> AtprocessDefinitionCreatorNavigations { get; set; } = new List<AtprocessDefinition>();

    [InverseProperty("LockedByNavigation")]
    public virtual ICollection<AtprocessDefinition> AtprocessDefinitionLockedByNavigations { get; set; } = new List<AtprocessDefinition>();

    [InverseProperty("User")]
    public virtual ICollection<Atright> Atrights { get; set; } = new List<Atright>();

    [InverseProperty("CompletedByNavigation")]
    public virtual ICollection<AttaskInstance> AttaskInstances { get; set; } = new List<AttaskInstance>();

    [InverseProperty("UserNameNavigation")]
    public virtual ICollection<AttrackingRecord> AttrackingRecords { get; set; } = new List<AttrackingRecord>();

    [InverseProperty("UserNameNavigation")]
    public virtual ICollection<AtuserProperty> AtuserProperties { get; set; } = new List<AtuserProperty>();

    [InverseProperty("CreatorNavigation")]
    public virtual ICollection<AtworkItem> AtworkItemCreatorNavigations { get; set; } = new List<AtworkItem>();

    [InverseProperty("LockedByNavigation")]
    public virtual ICollection<AtworkItem> AtworkItemLockedByNavigations { get; set; } = new List<AtworkItem>();

    [InverseProperty("AssignedToNavigation")]
    public virtual ICollection<AtworkItemReference> AtworkItemReferenceAssignedToNavigations { get; set; } = new List<AtworkItemReference>();

    [InverseProperty("SourceUserNavigation")]
    public virtual ICollection<AtworkItemReference> AtworkItemReferenceSourceUserNavigations { get; set; } = new List<AtworkItemReference>();

    [ForeignKey("ParentId")]
    [InverseProperty("Parents")]
    public virtual ICollection<Atuser> Objects { get; set; } = new List<Atuser>();

    [ForeignKey("ObjectId")]
    [InverseProperty("Objects")]
    public virtual ICollection<Atuser> Parents { get; set; } = new List<Atuser>();
}
