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

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

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

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