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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATTrackingRecord")]
[Index("UserName", "TrackingDate", Name = "ATTrackingRecord_Composite1")]
[Index("LastActionId", "TrackingDate", Name = "ATTrackingRecord_Composite2")]
[Index("Id", "WorkItemId", Name = "SYSIDGUIDOrderd")]
[Index("TrackingDate", "WorkItemId", Name = "WorkitemIDandDate")]
public partial class AttrackingRecord
{
    [Key]
    public int Id { get; set; }

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

    public int WorkItemId { get; set; }

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

    public int? TrackingDefinitionId { get; set; }

    public int? LastActionId { get; set; }

    public string? Message { get; set; }

    [ForeignKey("LastActionId")]
    [InverseProperty("AttrackingRecords")]
    public virtual Atbutton? LastAction { get; set; }

    [ForeignKey("TrackingDefinitionId")]
    [InverseProperty("AttrackingRecords")]
    public virtual AttrackingDefinition? TrackingDefinition { get; set; }

    [ForeignKey("UserName")]
    [InverseProperty("AttrackingRecords")]
    public virtual Atuser? UserNameNavigation { get; set; }

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