using Valg.EVA.Skanning.Scan.ReadSoftContracts.Model;

namespace Valg.EVA.Skanning.Scan.Api
{
    public class FieldValueAssignerFactory : IFieldValueAssignerFactory
    {
        private readonly FillPercentageFieldValueAssigner fillPercentageFieldValueAssigner = new FillPercentageFieldValueAssigner();
        private readonly SimpleFieldValueAssigner simpleFieldValueAssigner = new SimpleFieldValueAssigner();

        public IFieldValueAssigner GetFieldValueAssigner(ScannableFieldType fieldType)
        {
            if (fieldType == ScannableFieldType.MarkIncr
                || fieldType == ScannableFieldType.Stamp
                || fieldType == ScannableFieldType.Ref_opt
                || fieldType == ScannableFieldType.MultipleStamps
                || fieldType == ScannableFieldType.MarkDecr)
            {
                return fillPercentageFieldValueAssigner;
            }

            return simpleFieldValueAssigner;
        }
    }
}
