package com.uas.platform.b2b.erp.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import com.uas.platform.b2b.erp.model.SaleDownChange;
import com.uas.platform.b2b.erp.service.OutsourceChangeService;
import com.uas.platform.b2b.model.MakeOrderChangeItem;

@Service
public class OutsourceChangeServiceImpl implements OutsourceChangeService {

	@Override
	public List<SaleDownChange> convertMakeOrderChange(
			List<MakeOrderChangeItem> items) {
		List<SaleDownChange> changes = new ArrayList<SaleDownChange>();
		if(! CollectionUtils.isEmpty(items)) {
			for(MakeOrderChangeItem item : items) {
				changes.add(new SaleDownChange(item));
			}
		}
		return changes;
	}

}