internal static IResult <List <InventoryPickOrderItemParameter> > ToParsedItems(this ISetInventoryPickOrderParameters parameters)
        {
            if (parameters.InventoryPickOrderItems == null)
            {
                return(new InvalidResult <List <InventoryPickOrderItemParameter> >(null, "Inventory Pick Order Items required."));
            }

            return(parameters.InventoryPickOrderItems.ToParsedItems());
        }
        internal static IResult <TreatmentOrderSetPickOrderParameters> ToTreatmentOrderParsedParameters(this ISetInventoryPickOrderParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            var treatmentOrderKey = KeyParserHelper.ParseResult <ITreatmentOrderKey>(parameters.OrderKey);

            if (!treatmentOrderKey.Success)
            {
                return(treatmentOrderKey.ConvertTo <TreatmentOrderSetPickOrderParameters>());
            }

            var parsedItems = parameters.ToParsedItems();

            if (!parsedItems.Success)
            {
                return(parsedItems.ConvertTo <TreatmentOrderSetPickOrderParameters>());
            }

            return(new SuccessResult <TreatmentOrderSetPickOrderParameters>(new TreatmentOrderSetPickOrderParameters
            {
                Parameters = parameters,
                TreatmentOrderKey = new TreatmentOrderKey(treatmentOrderKey.ResultingObject),
                PickedItems = parsedItems.ResultingObject
            }));
        }