using AutoMapper;
using PARR.API.Contracts.V1.Responses;
using PARR.Domain.Entities;
using PARR.Domain.Settings;

namespace PARR.API.MappingProfiles.Resolvers
{
    //todo: удалить
    public class TemplateClosingCodeResolver : IValueResolver<Template, TemplateResponse, string>
    {
        private readonly SettingsFromDb settingsFromDb;

        public TemplateClosingCodeResolver(SettingsFromDb settingsFromDb)
        {
            this.settingsFromDb = settingsFromDb;
        }

        public string Resolve(Template source, TemplateResponse destination, string destMember, ResolutionContext context)
        {
            return settingsFromDb.ClosingCode;
        }
    }
}
