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

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

import org.springframework.stereotype.Service;

import com.uas.platform.b2b.erp.model.SaleProdInOutDown;
import com.uas.platform.b2b.erp.service.SaleProdInOutDownService;
import com.uas.platform.b2b.model.PurchaseAccept;
import com.uas.platform.b2b.model.PurchaseBadIn;
import com.uas.platform.b2b.model.PurchaseBadOut;
import com.uas.platform.b2b.model.PurchaseReturn;

@Service
public class SaleProdInOutDownServiceImpl implements SaleProdInOutDownService {

	@Override
	public List<SaleProdInOutDown> convertPurchaseAccepts(
			List<PurchaseAccept> purchaseAccepts) {
		List<SaleProdInOutDown> prodInOutDowns = new ArrayList<SaleProdInOutDown>();
		for(PurchaseAccept purchaseAccept : purchaseAccepts) {
			prodInOutDowns.add(new SaleProdInOutDown(purchaseAccept));
		}
		return prodInOutDowns;
	}

	@Override
	public List<SaleProdInOutDown> convertPurchaseReturns(
			List<PurchaseReturn> purchaseReturns) {
		List<SaleProdInOutDown> prodInOutDowns = new ArrayList<SaleProdInOutDown>();
		for(PurchaseReturn purchaseReturn : purchaseReturns) {
			prodInOutDowns.add(new SaleProdInOutDown(purchaseReturn));
		}
		return prodInOutDowns;
	}

	@Override
	public List<SaleProdInOutDown> convertPurchaseBadIns(
			List<PurchaseBadIn> purchaseBadIns) {
		List<SaleProdInOutDown> prodInOutDowns = new ArrayList<SaleProdInOutDown>();
		for(PurchaseBadIn purchaseBadIn : purchaseBadIns) {
			prodInOutDowns.add(new SaleProdInOutDown(purchaseBadIn));
		}
		return prodInOutDowns;
	}

	@Override
	public List<SaleProdInOutDown> convertPurchaseBadOuts(
			List<PurchaseBadOut> purchaseBadOuts) {
		List<SaleProdInOutDown> prodInOutDowns = new ArrayList<SaleProdInOutDown>();
		for(PurchaseBadOut purchaseBadOut : purchaseBadOuts) {
			prodInOutDowns.add(new SaleProdInOutDown(purchaseBadOut));
		}
		return prodInOutDowns;
	}

}
