using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;


namespace AyaNova.Models
{
    public class dtWorkOrderItem : ICoreBizObjectModel
    {
        public dtWorkOrderItem()
        {
            Tags = new List<string>();
        }
        public long Id { get; set; }
        public uint Concurrency { get; set; }
        public string Notes { get; set; }
        public string Wiki { get; set; }
        public string CustomFields { get; set; }
        public List<string> Tags { get; set; }

        //Principle
        [Required]
        public long WorkOrderId { get; set; }

        [NotMapped, JsonIgnore]
        public AyaType AyaType { get => AyaType.WorkOrderItem; }
    }//eoc

    public class WorkOrderItem : ICoreBizObjectModel
    {
        public WorkOrderItem()
        {
            Tags = new List<string>();
            //dependents
            Expenses = new List<WorkOrderItemExpense>();
            Labors = new List<WorkOrderItemLabor>();
            Loans = new List<WorkOrderItemLoan>();
            Parts = new List<WorkOrderItemPart>();
            PartRequests = new List<WorkOrderItemPartRequest>();
            ScheduledUsers = new List<WorkOrderItemScheduledUser>();
            Tasks = new List<WorkOrderItemTask>();
            Travels = new List<WorkOrderItemTravel>();
            Units = new List<WorkOrderItemUnit>();
        }
        public long Id { get; set; }
        public uint Concurrency { get; set; }
        public string Notes { get; set; }
        public string Wiki { get; set; }
        public string CustomFields { get; set; }
        public List<string> Tags { get; set; }

        //Principle
        [Required]
        public long WorkOrderId { get; set; }
        [JsonIgnore]
        public WorkOrder WorkOrder { get; set; }

        //dependents
        public List<WorkOrderItemExpense> Expenses { get; set; }
        public List<WorkOrderItemLabor> Labors { get; set; }
        public List<WorkOrderItemLoan> Loans { get; set; }
        public List<WorkOrderItemPart> Parts { get; set; }
        public List<WorkOrderItemPartRequest> PartRequests { get; set; }
        public List<WorkOrderItemScheduledUser> ScheduledUsers { get; set; }
        public List<WorkOrderItemTask> Tasks { get; set; }
        public List<WorkOrderItemTravel> Travels { get; set; }
        public List<WorkOrderItemUnit> Units { get; set; }

        [NotMapped, JsonIgnore]
        public AyaType AyaType { get => AyaType.WorkOrderItem; }
    }//eoc

}//eons
