using AutoMapper;
using Qusion.Cms.Media.Core;
using Qusion.Cms.Media.Documents;

namespace Qusion.WebApp.Areas.cms.Models.Documents
{
    public class DocumentProfile : Profile
    {
        private readonly LibraryService _libraryService;

        public DocumentProfile(LibraryService libraryService)
        {
            _libraryService = libraryService;
        }

        protected override void Configure()
        {
            Mapper.CreateMap<DocumentItem, DocumentListModel>()
                .ForMember(x => x.LibraryID, o => o.MapFrom(x => x.Library.ID));

            Mapper.CreateMap<DocumentItem, DocumentModel>();

            Mapper.CreateMap<DocumentQueryInput, DocumentQuery>()
                .ConstructUsing(x => DocumentQuery.Default);

            Mapper.CreateMap<DocumentsSettings, DocumentSettingsModel>();

            Mapper.CreateMap<DocumentSettingsInput, DocumentsSettings>();


        }
    }
}