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

namespace IWS5.DatabaseAccess.IwsDataModels;

[PrimaryKey("TaskId", "WorkItemReferenceId")]
[Table("ATTaskInstance")]
[Index("WorkItemReferenceId", Name = "ATTaskinstance_IX_WIRId")]
public partial class AttaskInstance
{
    [Key]
    [Column("TaskID")]
    public int TaskId { get; set; }

    [Key]
    [Column("WorkItemReferenceID")]
    public int WorkItemReferenceId { get; set; }

    public int Status { get; set; }

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

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

    [ForeignKey("CompletedBy")]
    [InverseProperty("AttaskInstances")]
    public virtual Atuser? CompletedByNavigation { get; set; }

    [ForeignKey("TaskId")]
    [InverseProperty("AttaskInstances")]
    public virtual AttaskDefinition Task { get; set; } = null!;

    [ForeignKey("WorkItemReferenceId")]
    [InverseProperty("AttaskInstances")]
    public virtual AtworkItemReference WorkItemReference { get; set; } = null!;
}
