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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATQueue")]
[Index("EventId", Name = "ATQueue_IX_EventId")]
[Index("ProcessId", Name = "ATQueue_IX_ProcessId")]
[Index("Queue", Name = "ATQueue_IX_Queue")]
[Index("ObjectId", Name = "ATQueue_ObjectID")]
[Index("Queue", "ProcessId", Name = "UK_Queue_ProcessId", IsUnique = true)]
public partial class Atqueue
{
    [Key]
    public int Id { get; set; }

    [StringLength(32)]
    public string Queue { get; set; } = null!;

    public int EventId { get; set; }

    public int ProcessId { get; set; }

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

    public int SortType { get; set; }

    public int Type { get; set; }

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

    public Guid ObjectId { get; set; }

    public bool Signable { get; set; }

    [InverseProperty("Queue")]
    public virtual ICollection<Atbutton> Atbuttons { get; set; } = new List<Atbutton>();

    [InverseProperty("Inbox")]
    public virtual ICollection<AtinboxEvent> AtinboxEvents { get; set; } = new List<AtinboxEvent>();

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

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

    [ForeignKey("EventId")]
    [InverseProperty("Atqueues")]
    public virtual AteventDefinition Event { get; set; } = null!;

    [ForeignKey("ProcessId")]
    [InverseProperty("Atqueues")]
    public virtual AtprocessDefinition Process { get; set; } = null!;
}
