package com.bankaudit.rest.process.service;

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

import com.bankaudit.dto.DataTableResponse;
import com.bankaudit.dto.EntityAuditDataDto;
import com.bankaudit.dto.process.AuditDto;
import com.bankaudit.dto.process.AuditObservationDto;
import com.bankaudit.process.model.AuditActionItem;
import com.bankaudit.process.model.AuditSchedule;
import com.bankaudit.process.model.RiskSummaryDtls;

public interface MyAuditsService {

	 DataTableResponse  getMuAuditsList(int legalEntityCode,String userId, String search,Integer orderColumn,
				String orderDirection, Integer page, Integer size, String role, LocalDate financialYear, String auditTypeCode);
	 
	 DataTableResponse  getAuditsForView(int legalEntityCode,String userId, String unitCode, String roleId, String search,Integer orderColumn,
				String orderDirection, Integer page, Integer size, LocalDate financialYear, String auditTypeCode);
	 
	 DataTableResponse  getAuditsForLetter(int legalEntityCode,String userId, String search,Integer orderColumn,
				String orderDirection, Integer page, Integer size, String role, LocalDate financialYear, String auditTypeCode);
	 
	 DataTableResponse  getMyBranchAudits(int legalEntityCode, String auditId, String unitCode, String userId, String role, String search,Integer orderColumn,
				String orderDirection, Integer page, Integer size, LocalDate financialYear, String auditTypeCode);
	 
	 AuditSchedule getAuditByPlanIdAndAuditId(int legalEntityCode,String auditTypeCode, String planId,String auditId); 
	 
	 List getRatingAndObsCntGrpSGrpwiseByAuditId(int legalEntityCode,String auditTypeCode, String planId,String auditId); 
	 
	 void updateMyAuditStatus(AuditSchedule auditSchedule);

	 void updateAuditScheduleCounts(AuditSchedule auditSchedule);
	 
	 List getAuditsForDashboard(int legalEntityCode,String userId,String role,String period,String fromDate,String toDate);

	DataTableResponse getAdHocAuditsForAuditor(int parseInt, String userId, String search, Integer orderColumn,
			String orderDirection, Integer page, Integer size, LocalDate financialYear, String auditTypeCode); 
	
	String chkAuditEarlyStartAllowed(AuditSchedule auditSchedule);

	DataTableResponse getAdHocAuditsForManagement(int parseInt, String userId, String search, Integer orderColumn,
			String orderDirection, Integer page, Integer size, LocalDate financialYear, String auditTypeCode);
	
	String isAuditObsPendingBfrAuditSubmit(AuditSchedule auditSchedule);
	
	String isAuditObsPending(AuditDto auditDto, String status);
	
	String isAuditReviewPending(AuditDto auditDto, String status);
	
	List getAuditDetailsForReport(int legalEntityCode,String userId,String role,String auditId,String planId,String auditTypeCode);
	
	List getAuditObservationDetailsForReport(int legalEntityCode,String userId,String role,String auditId,String planId,String auditTypeCode);
	
	Boolean getFetchObservationsExtrnlAndInsertInternal(int legalEntityCode,String userId,String unitId,String auditId,String planId,String auditTypeCode);
	
	String getAlreadyFetchObsStatus(int legalEntityCode,String userId,String auditId,String planId,String auditTypeCode);
	
	DataTableResponse  getAuditsOnDashboard(int legalEntityCode,String userId, String search,Integer orderColumn,
			String orderDirection, Integer page, Integer size, String auditStatus, String auditTypeCode);
	
	List<RiskSummaryDtls> getRiskCntByBusinssAndProdByRiskCapId(int legalEntityCode,String auditTypeCode, String planId,String auditId, String auditStatus); 
	
	void createRiskSummary(List<RiskSummaryDtls> riskSummaryDtlsLst);
	
	boolean isPreviousAuditExist(int legalEntityCode,String unitId,String auditTypeCode,String auditId);
	
	List<RiskSummaryDtls> getObservationCntByAgAsgActByAuditIdOrType(int legalEntityCode,String auditTypeCode, String planId,String auditId, String auditStatus);
	
	List<RiskSummaryDtls> getObservationCntByAgAsgActByAuditIdOrTypeRespRvw(int legalEntityCode,String auditTypeCode, String planId,String auditId, String auditStatus, String process);
	
	List<RiskSummaryDtls> getObservationCntByAuditIdReview(int legalEntityCode, String auditTypeCode, String planId,String auditId, String auditStatus);
	
	void updateReportStatus(AuditSchedule auditSchedule);
	
	String updateReportStatus(AuditDto auditDto);
	
	AuditSchedule getAuditDetailsByPlanIdAndAuditId(int legalEntityCode,String auditTypeCode, String planId,String auditId); 
	
	void updateMyAuditRatingParameterStatus(AuditSchedule auditSchedule);

	void updateMyAuditRatingParameterRemarksSave(AuditSchedule auditSchedule);
	
	void updateMyAuditRatingComplianceObsScoreStatus(AuditSchedule auditSchedule);
	
	AuditSchedule getAuditByAuditId(int legalEntityCode, String auditTypeCode, String planId, String auditId);
	
	EntityAuditDataDto getEntityAuditData(int legalEntityCode, String auditTypeCode, String auditId, String unitId);
	
	List<AuditActionItem> getAuditActionItem(Integer legalEntityCode, String auditTypeCode, String auditId);
	
	List<AuditSchedule> getAuditSchedules(Integer legalEntityCode, String auditTypeCode);
	
	AuditSchedule checkLatestITISAuditDetailsForUnit(Integer legalEntityCode, String unitId);
	
	String getFinancialYearByAuditId(Integer legalEntityCode, String auditTypeCode, String auditId);
	
	void updateAuditStatusDetailAfterInitiate(Integer legalEntityCode, String auditTypeCode, String planId, String auditId, Integer totalObservations);
}
