package gov.va.vss.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import gov.va.shared.service.validation.ServiceValidationException;
import gov.va.vss.model.organization.NationalOfficial;
import gov.va.vss.service.NationalOfficialService;

@Service
public class NationalOfficialServiceImpl extends AbstractServiceImpl implements NationalOfficialService {
	private static final Logger log = LoggerFactory.getLogger(NationalOfficialServiceImpl.class);

	
	@Override
	public NationalOfficial saveOrUpdate(NationalOfficial nationalOfficial) throws ServiceValidationException {
		
		/*if (nationalOfficial.getStdVAVSTitle().getLookupType() ==  StdVAVSTitleValue.NATIONAL_REPRESENTATIVE) {
			if (nationalOfficialDAO.findByVAVSTitle(nationalOfficial.getOrganization().getId(), StdVAVSTitleValue.NATIONAL_REPRESENTATIVE.getName()) != null) {
				throw new ServiceValidationException("nationalOfficial.saveOrUpdate.error.singleNationalRep"); 
			}
		}*/
		
		return nationalOfficialDAO.saveOrUpdate(nationalOfficial);
	}

	@Override
	public void delete(long nationalOfficialId) {
		nationalOfficialDAO.delete(nationalOfficialId);
	}
}
