using AutoMapper;

namespace WebTest.Models
{
    public class MappingProfile : Profile
    {
        public MappingProfile()
        {
            CreateMap<MDSUserResponse, User>().ForMember(t => t.TeamId, opt => opt.MapFrom(f => f.DepartmentId))
                                              .ForMember(t => t.TeamName, opt => opt.MapFrom(f => f.DepartmentName))
                                              .ForMember(t => t.Name, opt => opt.MapFrom(f => f.UserName));

            CreateMap<ShopResponse, Shop>().ForMember(t => t.VenderType, opt => opt.MapFrom(f => f.ShopType))
                                           .ForMember(t => t.Platform, opt => opt.MapFrom(f => f.PlatformId))
                                           .ForMember(t => t.PurchaseAccountList, opt => opt.MapFrom(f => f.PurchaseList));

            CreateMap<PurchaseAccountResponse, PurchaseAccount>();
            CreateMap<DepartmentResponse, Department>();
        }
    }
}