using GreenTree.Strohrmann.ERP.Core.Domain.Business;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace GreenTree.Strohrmann.ERP.Web.Models.Business
{
    public class UnitModel
    {
        #region Properties

        /// <summary>
        /// Unit id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// Unit name
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Unit short name
        /// </summary>
        public string ShortName { get; set; }

        /// <summary>
        /// Unit description
        /// </summary>
        public string Description { get; set; }

        #endregion

        #region Ctor

        /// <summary>
        /// Initializes a new instance of the UnitModel class
        /// </summary>
        public UnitModel() {  }

        /// <summary>
        /// Initializes a new instance of the UnitModel class
        /// </summary>
        /// <param name="unit">The base unit.</param>
        public UnitModel(Unit unit)
        {
            if (unit == null) return;

            Id = unit.Id;
            Name = unit.Name;
            ShortName = unit.ShortName;
            Description = unit.Description;
        }

        #endregion
    }
}
