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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATScheduledTask")]
public partial class AtscheduledTask
{
    [Key]
    public int TaskId { get; set; }

    public int ScheduleId { get; set; }

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

    public int TaskTypeId { get; set; }

    public string? CommandText { get; set; }

    [StringLength(1024)]
    public string? ExecutablePath { get; set; }

    public int? OnSuccessActionId { get; set; }

    public int? OnFailureActionId { get; set; }

    public bool Enabled { get; set; }

    public int SortOrder { get; set; }

    [ForeignKey("OnFailureActionId")]
    [InverseProperty("AtscheduledTaskOnFailureActions")]
    public virtual AttaskActionType? OnFailureAction { get; set; }

    [ForeignKey("OnSuccessActionId")]
    [InverseProperty("AtscheduledTaskOnSuccessActions")]
    public virtual AttaskActionType? OnSuccessAction { get; set; }

    [ForeignKey("ScheduleId")]
    [InverseProperty("AtscheduledTasks")]
    public virtual AtscheduledItem Schedule { get; set; } = null!;

    [ForeignKey("TaskTypeId")]
    [InverseProperty("AtscheduledTasks")]
    public virtual AttaskType TaskType { get; set; } = null!;
}
