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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATFieldInstanceNumber")]
[Index("FieldId", Name = "ATFieldInstanceNumber_IX_FId")]
[Index("FieldName", Name = "ATFieldInstanceNumber_IX_FName")]
[Index("WorkItemId", Name = "ATFieldInstanceNumber_IX_WIId")]
public partial class AtfieldInstanceNumber
{
    [Key]
    [Column("FieldInstanceID")]
    public int FieldInstanceId { get; set; }

    [Column("FieldID")]
    public int FieldId { get; set; }

    [Column(TypeName = "numeric(28, 14)")]
    public decimal? FieldValue { get; set; }

    [Column("WorkItemID")]
    public int WorkItemId { get; set; }

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

    [ForeignKey("FieldId")]
    [InverseProperty("AtfieldInstanceNumbers")]
    public virtual AtfieldDefinition Field { get; set; } = null!;

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