using AutoMapper;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Domain.Models;

namespace IRaCIS.Core.Application.Service
{
    public class InstitutionConfig : Profile
    {
        public InstitutionConfig()
        {
            CreateMap<HospitalCommand, Hospital>();
            CreateMap<SiteCommand, Site>();
            CreateMap<SponsorCommand, Sponsor>();

            CreateMap<Hospital, HospitalDTO>();
            CreateMap<CRO, CROCompanyDTO>().ReverseMap();
            CreateMap<Sponsor, SponsorDTO>();
            CreateMap<CRO, CroSelectDTO>();
            CreateMap<Sponsor, SponsorSelectDTO>();
            CreateMap<Site, SiteSelectionDTO>();


            //CreateMap<CRO, InstitutionDTO>()
            //    .ForMember(o => o.InstitutionName, t => t.MapFrom(u => u.CROName));
            //CreateMap<Sponsor, InstitutionDTO>()
            //    .ForMember(o => o.InstitutionName, t => t.MapFrom(u => u.SponsorName));
            //CreateMap<Hospital, InstitutionDTO>()
            //   .ForMember(o => o.InstitutionName, t => t.MapFrom(u => u.HospitalName));
            //CreateMap<Site, InstitutionDTO>()
            //   .ForMember(o => o.InstitutionName, t => t.MapFrom(u => u.SiteName));
        }
    }
   
}
