using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IronIntel.Contractor.Maintenance
{
    public class WorkOrderInfo
    {
        public long ID { get; set; }
        public string MaintenanceID { get; set; }
        public string WorkOrderType { get; set; }
        public string AssignedTo { get; set; }
        public string AssignedToName { get; set; }
        public string Status { get; set; }
        public long AssetID { get; set; }
        public string AssetName { get; set; }
        public string VIN { get; set; }
        public string Description { get; set; }
        public DateTime? DueDate { get; set; }
        public string DueDateStr { get { return DueDate == null ? "" : DueDate.Value.ToShortDateString(); } }
        public DateTime? CompleteDate { get; set; }
        public string CompleteDateStr { get { return CompleteDate == null ? "" : CompleteDate.Value.ToShortDateString(); } }
        public string InvoiceNumber { get; set; }
    }

    public class WorkOrderDetailInfo : WorkOrderInfo
    {
        public string MeterType { get; set; }
        public double HourMeter { get; set; }

        private double _Odometer;
        public double Odometer
        {
            get
            {
                return _Odometer;
            }
            set
            {
                value = value > 0 ? value : 0;
                _Odometer = Math.Round(value, 2);
            }
        }
        public string OdometerUnits { get; set; }
        public decimal WorkOrderTotalCost { get; set; }
        public decimal HoursToComplete { get; set; }
        public string InternalID { get; set; }
        public string Notes { get; set; }
        public decimal PartsCost { get; set; }
        public decimal TravelTimeCost { get; set; }
        public decimal LaborCost { get; set; }
        public decimal HourlyRate { get; set; }
        public decimal OtherCost { get; set; }
    }
}
