package com.jasamedika.medifirst2000.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


	

import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.PengembalianService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.entities.Pengembalian;
import com.jasamedika.medifirst2000.vo.PengembalianVO;
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.PengembalianDao;

/**
 * Implement class for PengembalianService
 * 
 * @author Generator
 * @param <T>
 */
@Service("pengembalianService")
public class PengembalianServiceImpl extends BaseVoServiceImpl implements PengembalianService 
{	
	@Autowired
	private BaseConverterImpl<PengembalianVO,Pengembalian>pengembalianConverter;
	
	@Autowired
	private PengembalianDao pengembalianDao;

	
	@Override
	public Map<String, Object> savePengembalian(PengembalianVO vo) {
		Map<String, Object> result = new HashMap<String, Object>();
		Pengembalian model = new Pengembalian();
		model = pengembalianConverter.transferVOToModel(vo,model);
		
		Pengembalian resultDomain = pengembalianDao.save(model);
		if (CommonUtil.isNotNullOrEmpty(resultDomain)) {
			result.put("noRec", resultDomain.getNoRec());
		}

		return result;
	}
}