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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATDocument")]
[Index("WorkItemId", Name = "ATDocument_IX_WorkItemId")]
public partial class Atdocument
{
    [Key]
    public int DocumentId { get; set; }

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

    public int ReviewStatusId { get; set; }

    public int ReviewNumber { get; set; }

    public int CabinetId { get; set; }

    public int WorkItemId { get; set; }

    public int DocumentSize { get; set; }

    public int? DisplayOrder { get; set; }

    [Column(TypeName = "image")]
    public byte[]? Document { get; set; }

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

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

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

    [Column(TypeName = "datetime")]
    public DateTime LastModified { get; set; }

    [InverseProperty("Document")]
    public virtual ICollection<Atnote> Atnotes { get; set; } = new List<Atnote>();

    [ForeignKey("CabinetId")]
    [InverseProperty("Atdocuments")]
    public virtual AtdocumentCabinet Cabinet { get; set; } = null!;

    [ForeignKey("ReviewStatusId")]
    [InverseProperty("Atdocuments")]
    public virtual AtdocumenctReviewStatus ReviewStatus { get; set; } = null!;

    [ForeignKey("WorkItemId")]
    [InverseProperty("Atdocuments")]
    public virtual AtworkItem WorkItem { get; set; } = null!;
}
