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.vo.PegawaiVO;
import com.jasamedika.medifirst2000.vo.ProdukVO;
import com.jasamedika.medifirst2000.entities.Pegawai;
import com.jasamedika.medifirst2000.entities.Produk;
import com.jasamedika.medifirst2000.entities.ShiftKerja;
import com.jasamedika.medifirst2000.util.JsonUtil;
import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.AbsensiPegawaiService;
import com.jasamedika.medifirst2000.service.InputDaftarPaketPelatihanService;
import com.jasamedika.medifirst2000.service.InputDaftarPaketSeminarService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.entities.AbsensiPegawai;
import com.jasamedika.medifirst2000.entities.AkreditasiPelatihan;
import com.jasamedika.medifirst2000.entities.InputDaftarPaketPelatihan;
import com.jasamedika.medifirst2000.entities.InputDaftarPaketSeminar;
import com.jasamedika.medifirst2000.entities.JadwalDokter;
import com.jasamedika.medifirst2000.entities.JenisPelatihan;
import com.jasamedika.medifirst2000.entities.NilaiKelompokJabatan;
import com.jasamedika.medifirst2000.vo.AbsensiPegawaiVO;
import com.jasamedika.medifirst2000.vo.AkreditasiPelatihanVO;
import com.jasamedika.medifirst2000.vo.InputDaftarPaketPelatihanVO;
import com.jasamedika.medifirst2000.vo.InputDaftarPaketSeminarVO;
import com.jasamedika.medifirst2000.vo.JenisPelatihanVO;
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.AbsensiPegawaiDao;
import com.jasamedika.medifirst2000.dao.InputDaftarPaketPelatihanDao;
import com.jasamedika.medifirst2000.dao.InputDaftarPaketSeminarDao;
import com.jasamedika.medifirst2000.dao.JadwalDokterDao;
import com.jasamedika.medifirst2000.dao.PegawaiDao;

/**
 * Implement class for AbsensiPegawaiService
 * 
 * @author Generator
 * @param <T>
 */
@Service("InputDaftarPaketSeminarService")
public class InputDaftarPaketSeminarServiceImpl extends BaseVoServiceImpl implements InputDaftarPaketSeminarService {
	@Autowired
	private BaseConverterImpl<InputDaftarPaketSeminarVO, InputDaftarPaketSeminar> inputDaftarPaketSeminarConverter;

	@Autowired
	private BaseConverterImpl<ProdukVO, Produk> produkConverter;
	
	@Autowired
	private InputDaftarPaketSeminarDao inputDaftarPaketSeminarDao;

	@Override
	public Map<String, Object> saveInputDaftarPaketSeminar(InputDaftarPaketSeminarVO vo) {
		Map<String, Object> result = new HashMap<String, Object>();
		InputDaftarPaketSeminar model = new InputDaftarPaketSeminar();
		model = inputDaftarPaketSeminarConverter.transferVOToModel(vo,model);
		model.setProduk(produkConverter.transferVOToModel(vo.getProduk(), new Produk()));
		InputDaftarPaketSeminar resultDomain = inputDaftarPaketSeminarDao.save(model);
		if (CommonUtil.isNotNullOrEmpty(resultDomain)) {
			result.put("noRec", resultDomain.getNoRec());
		}

		return result;
	}
}