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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATFieldInstanceDate")]
[Index("FieldId", Name = "ATFieldInstanceDate_IX_FId")]
[Index("FieldName", Name = "ATFieldInstanceDate_IX_FName")]
[Index("WorkItemId", Name = "ATFieldInstanceDate_IX_WIId")]
public partial class AtfieldInstanceDate
{
    [Key]
    [Column("FieldInstanceID")]
    public int FieldInstanceId { get; set; }

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

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

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

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

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

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