/*
 * 
 */
package com.bankaudit.service;

import java.util.List;
import java.util.Map;

import com.bankaudit.dto.DataTableResponse;
import com.bankaudit.model.MaintEntity;
import com.bankaudit.model.MaintEntityWrk;

/**
 * {@link MaintEntityService} interface define the CRUD methods for
 * {@link MaintEntity} class object.
 *
 * @author amit.patel
 * @version 1.0
 */
public interface MaintEntityService {

	/**
	 * This method is use to Creates the maint entity.
	 *
	 * @param maintEntityWrk
	 *            specify the maint entity wrk
	 */
	void createMaintEntity(MaintEntityWrk maintEntityWrk);

	/**
	 * This method is use to Gets the unique.
	 *
	 * @param legalEntityCode
	 *            specify the legal entity code
	 * @param unitCode
	 *            specify the unit code
	 * @param status
	 *            specify the status
	 * @return the maint entity .
	 */
	MaintEntity getUnique(Integer legalEntityCode, String unitCode,String status);

	/**
	 * This method is use to Update maint entity.
	 *
	 * @param maintEntityWrk
	 *            specify the maint entity wrk
	 */
	void updateMaintEntity(MaintEntityWrk  maintEntityWrk);

	/**
	 * This method is use to Gets the maint entity.
	 *
	 * @param legalEntityCode
	 *            specify the legal entity code
	 * @param levelCodeStr
	 *            specify the level code str
	 * @param userId
	 *            specify the user id
	 * @param parentUnitCode
	 *            specify the parent unit code
	 * @param search
	 *            specify the search
	 * @param orderColumn
	 *            specify the order column
	 * @param orderDirection
	 *            specify the order direction
	 * @param page
	 *            specify the page
	 * @param size
	 *            specify the size
	 * @return the data table response .
	 */
	DataTableResponse getMaintEntity(Integer legalEntityCode, String levelCodeStr,String userId,String parentUnitCode, String search, Integer orderColumn,
			String orderDirection, Integer page, Integer size);

	/**
	 * This method is use to Gets the maint entity by legal entity code and
	 * level code.
	 *
	 * @param legalEntityCode
	 *            specify the legal entity code
	 * @param levelCode
	 *            specify the level code
	 * @return the list .
	 */
	List<MaintEntity> getMaintEntityByLegalEntityCodeAndLevelCode(Integer legalEntityCode, String levelCode);

	/**
	 * This method is use to Gets the maint entity by legal entity code.
	 *
	 * @param legalEntityCode
	 *            specify the legal entity code
	 * @return the list .
	 */
	List<MaintEntity> getMaintEntityByLegalEntityCode(Integer legalEntityCode);

	/**
	 * This method is use to Checks if is head user.
	 *
	 * @param legalEntityCode
	 *            specify the legal entity code
	 * @param userId
	 *            specify the user id
	 * @param unitCode
	 *            specify the unit code
	 * @return the boolean .
	 */
	Boolean isHeadUser(Integer legalEntityCode, String userId, String unitCode);

	/**
	 * This method is use to Checks if is maint entity.
	 *
	 * @param legalEntityCode
	 *            specify the legal entity code
	 * @param unitCode
	 *            specify the unit code
	 * @return the boolean .
	 */
	Boolean isMaintEntity(Integer legalEntityCode, String unitCode);
	
	Boolean isChildUnitActivated(Integer legalEntityCode, String unitCode);

	/**
	 * This method is use to Gets the sub-branches by legalEntityCode and user/unitId
	 *
	 * @param legalEntityCode
	 *            specify the legal entity code
	 * @param userIdOrUnitId
	 *            specify the unit-code/user-id
	 * @return the list .
	 */
	List<MaintEntity> getSubBranchesGyUserIdOrUnitId(Integer legalEntityCode,String role,String type,String userIdOrUnitId);
	
	List<String> getSubBranchesGyUserIdOrUnitId(Integer legalEntityCode,String type,String userIdOrUnitId);
	
	List<MaintEntity> getImmediateChild(Integer legalEntityCode,String unitCode);

	MaintEntity getUniqueByUserId(int legalEntityCode, String userId);
	
	List<MaintEntity> getMaintEntityByLEAndUser(Integer legalEntityCode, String userId, String role, String unitCode);
	
	Map<String, String> getRiskManagerDetails(Integer legalEntityCode, String userId, String role, String unitCode);
	
	void deleteMaintEntityByID(Integer legalEntityCode, String unitCode, String userId);
	
	List<MaintEntity> getEntityByLevelAndNotInGrpEntityMapping (Integer legalEntityCode, String levelCode, String status);

	List<MaintEntity> getMaintEntityByLegalEntityCodeAndAuditTypeCode(Integer legalEntityCode, String auditTypeCode);
	
	MaintEntity getUnitDetails(Integer legalEntityCode, String unitCode);
	
	Map<String, String> getUnitCodes(Integer legalEntityCode, String userId, String role);
	
	List<MaintEntity> getEntityForPlanLevel(Integer legalEntityCode, String userId, String levelCode);
	
	String getLicenseeCodeForUnitCode(Integer legalEntityCode, String unitCode);
	
}
