package com.nisum.myteam.service.impl;

import java.util.List;

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

import com.nisum.myteam.exception.handler.MyTeamException;
import com.nisum.myteam.model.dao.MasterData;
import com.nisum.myteam.repository.MasterDataRepo;
import com.nisum.myteam.service.IMasterDataService;

@Service("masterDataService")
public class MasterDataService implements IMasterDataService {

	@Autowired
	private MasterDataRepo masterDataRepo;

	@Override
	public List<MasterData> getMasterData() throws MyTeamException {
		return masterDataRepo.findAll();
	}

	@Override
	public List<MasterData> findByMasterDataTypeAndMasterDataNameAndActiveStatus(String masterDataType, String masterDataName,
			boolean activeStatus) {
		return masterDataRepo.findByMasterDataTypeAndMasterDataNameAndActiveStatus(masterDataType, masterDataName,
				activeStatus);
	}
}
