package com.jasamedika.medifirst2000.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.PosisiLamaranDao;
import com.jasamedika.medifirst2000.entities.PosisiLamaran;
import com.jasamedika.medifirst2000.service.PosisiLamaranService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.vo.PosisiLamaranVO;

/**
 * Implement class for PosisiLamaranService
 * 
 * @author Generator
 * @param <T>
 */
@Service("posisiLamaranService")
public class PosisiLamaranServiceImpl extends BaseVoServiceImpl implements PosisiLamaranService 
{	
	@Autowired
	private BaseConverterImpl<PosisiLamaranVO,PosisiLamaran>posisiLamaranConverter;
	
	@Autowired
	private PosisiLamaranDao posisiLamaranDao;

	
	@Override
	public Map<String, Object> savePosisiLamaran(PosisiLamaranVO vo) {
		Map<String, Object> result = new HashMap<String, Object>();
		PosisiLamaran model = new PosisiLamaran();
		model = posisiLamaranConverter.transferVOToModel(vo,model);
	
		PosisiLamaran resultDomain = posisiLamaranDao.save(model);
		if (CommonUtil.isNotNullOrEmpty(resultDomain)) {
			result.put("noRec", resultDomain.getNoRec());
		}

		return result;
	}
}