package com.bankaudit.rest.process.dao;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

import com.bankaudit.dao.Dao;
import com.bankaudit.dto.DataTableResponse;
import com.bankaudit.dto.process.AuditRatingParameterScoreDto;
import com.bankaudit.dto.process.AuditRatingScoreDto;
import com.bankaudit.dto.process.AuditRatingSummaryDto;
import com.bankaudit.dto.process.RatingParameterCategoryDto;
import com.bankaudit.model.MaintRatingModelOverlay;
import com.bankaudit.process.model.AuditRatingModelOverlay;
import com.bankaudit.process.model.AuditRatingParameterScore;

public interface AuditRatingParameterScoreDao extends Dao {
	DataTableResponse getMuAuditsList(int legalEntityCode,String userId, String search,Integer orderColumn,	String orderDirection, Integer page, Integer size, String role, String userLevel,
			LocalDate financialYear, String auditTypeCode, List<LocalDate>  financialYearStrtEndList);
	
	DataTableResponse  getAuditsForView(int legalEntityCode,String userId, String unitCode, String roleId, String search,Integer orderColumn,
			String orderDirection, Integer page, Integer size);
	
	boolean verifyCSVUpload(int legalEntityCode,String auditId);
	
	boolean verifyDataPresentForParamScore(int legalEntityCode,String auditId);
	
	List<AuditRatingParameterScoreDto> getRatingParamDataFromMaint(Integer legalEntityCode, String auditId, String unitId, String auditTypeCode, String userId);
	
    boolean createAndGetAuditRatingParamScore(int legalEntityCode,String auditId, String unitId, String auditTypeCode, String userId);
    
    void createAuditParameterScore(AuditRatingParameterScoreDto scoreDto);
    
    void updateAuditParameterScore(AuditRatingParameterScoreDto scoreDto); // When CSV is uploading
	
	List<AuditRatingParameterScore> getParametersByAuditId(int legalEntityCode,String auditId, String auditTypeCode, String userType);
	
	void updateAuditParamScores(List<AuditRatingParameterScore> auditRatingParameterScores, int legalEntityCode, String auditId, String userType); // When updating from the screen
	
	boolean executeAnUpdateWeightedScore(int legalEntityCode, String auditId, String userType);
	
	List<AuditRatingSummaryDto> getAuditRatingSummary(int legalEntityCode, String auditId, String rmCode, String userType);
	
	List<AuditRatingSummaryDto> getAuditRatingSummaryNoWeightage(int legalEntityCode, String auditId, String rmCode, String userType, String overLay);
	
	boolean isModelOverlayApplied(int legalEntityCode,String auditId);
	
	List<MaintRatingModelOverlay> isModelOverlayExistForRatingModel(int legalEntityCode, String rmCode);
	
	List<AuditRatingModelOverlay> getModelOverlayByAuditId(int legalEntityCode, String auditId);
	
	List<AuditRatingModelOverlay> createAndGetAuditRatingModelOverlays(int legalEntityCode, String rmCode, String auditId, String userId);
	
	void updateAuditRatingModelOverlays(List<AuditRatingModelOverlay> auditRatingModelOverlays);
	
	void updateAuditRatingParameterCategoryScore(List<AuditRatingSummaryDto> auditRatingParameterCategoryLst, int legalEntityCode, String auditId, String auditTypeCode);
	
	AuditRatingScoreDto getAuditRatingScores(int legalEntityCode, String auditId, String rmCode);
	
	AuditRatingScoreDto getAuditRatingScoresHO(int legalEntityCode, String auditId, String rmCode);
	
	AuditRatingScoreDto getAuditRatingScoresNoWeightage(int legalEntityCode, String auditId, String rmCode, List<AuditRatingSummaryDto> sumDto); // for Existing Audit types
	
	String getContinuousScoreForParamCode(AuditRatingParameterScoreDto scoreDto);
	
	String getDescreteScoreForParamCode(AuditRatingParameterScoreDto scoreDto);
		
	List<AuditRatingParameterScore> downloadRatingParameterScoresByAuditId(int legalEntityCode, String auditId, String auditTypeCode,
			 String paramBasis);
	//List getRatingAndObsCntGrpSGrpwiseByAuditId(int legalEntityCode,String auditTypeCode, String planId,String auditId); 
	
	String updateAuditRatingParamEffectiveScores(Integer legalEntityCode, String auditId, String auditRatingParamStatus);
	
	String updateAuditRatingParamRemarks(Integer legalEntityCode, String auditId, String auditRatingParamStatus);
	
	String getRatingFromScore(Integer legalEntityCode, String auditId, String rmCode, String ratingScr );
	
	Map<String, String> getRatingFromDeflatorScore(Integer legalEntityCode, String auditId, String rmCode, String ratingScr, String userType);
	
	/** for Rating PDF Report **/
	
	List<RatingParameterCategoryDto> getCategoryWiseRatingsByAuditId(int legalEntityCode,String auditId, String auditTypeCode);
	
	List<RatingParameterCategoryDto> getCategoryWiseRatingsByAuditIdHORO(int legalEntityCode,String auditId, String auditTypeCode);
	
	List<AuditRatingSummaryDto> getAuditRatingSummaryForReport(int legalEntityCode, String auditId, String rmCode, String userType);	
	
	/** End here **/
}
