package com.palmnest.service.repair.impl;

import com.palmnest.dao.repair.RepairConfigDao;
import com.palmnest.model.repair.RepairConfig;
import com.palmnest.service.impl.GenericManagerImpl;
import com.palmnest.service.repair.RepairConfigManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("repairConfigManager")
public class RepairConfigManagerImpl extends GenericManagerImpl<RepairConfig, Long> implements RepairConfigManager {

	private RepairConfigDao repairConfigDao;

	@Autowired
	public void setRepairConfigDao(RepairConfigDao repairConfigDao) {
		this.repairConfigDao = repairConfigDao;
		this.dao = repairConfigDao;
	}


	@Override
	public RepairConfig getByOrgId(Integer org_id) {
		RepairConfig c=repairConfigDao.getByOrgId(org_id);
		if(null == c){
			return c;
		}
		if(null == c.getSupportReport()){
			c.setSupportReport(0);
		}
		return c;
	}

}
