using CsvHelper.Configuration;
using GreenTree.Maschinenbestellungen.Core.Domain.Business;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;

namespace GreenTree.Maschinenbestellungen.Web.ImportMaps
{
    public sealed class CustomerMap : ClassMap<Customer>
    {
        #region Ctor

        /// <summary>
        /// Initialzes a new instnce of the CustomerMap class
        /// </summary>
        public CustomerMap()
        {
            AutoMap(CultureInfo.InvariantCulture);

            Map(m => m.Title.Id).Name("TitleId").Default(1);
            Map(m => m.Title.Name).Ignore();

            Map(m => m.Tax.Id).Name("TaxId").Default(-1);
            Map(m => m.Tax.Name).Ignore();
            Map(m => m.Tax.ShortName).Ignore();
            Map(m => m.Tax.Value).Ignore();

            Map(m => m.CreatedOn).Ignore();
            Map(m => m.CreatedBy).Ignore();

            Map(m => m.ChangedOn).Ignore();
            Map(m => m.ChangedBy).Ignore();

            Map(m => m.CreationStatus).Ignore();

            Map(m => m.Crafts).Ignore();
        }

        #endregion
    }
}
