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

namespace PARR.API.MappingProfiles.Resolvers
{
    public class RobotTaskTemplateClosingCodeResolver : IValueResolver<RobotConfiguration, RobotTaskTemplateResponse, string>
    {
        private readonly SettingsFromDb settingsFromDb;

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

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