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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATDocumentCabinetDef")]
[Index("FieldId", Name = "ATDocumentCabinetDef_IX_FieldID")]
[Index("CabinetId", "FieldName", Name = "UK_ATDocumentCabinetDef_FieldName_CabinetId", IsUnique = true)]
[Index("ObjectId", Name = "UK_ATDocumentCabinetDef_ObjectId", IsUnique = true)]
public partial class AtdocumentCabinetDef
{
    [Key]
    [Column("FieldID")]
    public int FieldId { get; set; }

    [Column("CabinetID")]
    public int CabinetId { get; set; }

    [StringLength(255)]
    public string FieldName { get; set; } = null!;

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

    [StringLength(255)]
    public string FieldDataType { get; set; } = null!;

    public int? FieldDataTypeId { get; set; }

    public int FieldSize { get; set; }

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

    public Guid ObjectId { get; set; }

    public bool Display { get; set; }

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

    [ForeignKey("FieldDataTypeId")]
    [InverseProperty("AtdocumentCabinetDefs")]
    public virtual AtdocumentCabinetFiledType? FieldDataTypeNavigation { get; set; }
}
