package com.bankaudit.rest.process.dao;

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

import com.bankaudit.dao.Dao;
import com.bankaudit.dto.DataTableResponse;
import com.bankaudit.dto.process.AuditObservationComplianceDto;
import com.bankaudit.dto.process.NonCompliancePersistenceChecklistDto;
import com.bankaudit.process.model.AuditObservation;
import com.bankaudit.process.model.AuditObservationReportReviewCapture;
import com.bankaudit.process.model.AuditObservationReportReviewCaptureWrk;
import com.bankaudit.process.model.AuditObservationRespondReviewCapture;
import com.bankaudit.process.model.AuditSchedule;

public interface AuditObservationDao extends Dao {
	
	DataTableResponse  getAuditObservationList(int legalEntityCode,String planId,String auditId, String search,Integer orderColumn,
			String orderDirection, Integer page, Integer size, String userId);

	void deleteObservationByGrpId(String groupObservationId);

	List<AuditObservation> getObservationByObservationGroupId(String observationGroupId,Integer legalEntityCode);

	AuditSchedule getObservationCounts(Integer legalEntityCode, String auditTypeCode, String planId, String auditId);

	/*List<AuditDocumentDetails> getAuditDocumentDetails(Integer legalEntityCode, String auditTypeCode, String planId,
			String auditId, String observationId, String documentType);*/

	AuditObservation getAuditObservation(Integer legalEntityCode, String auditTypeCode, String planId, String auditId,
			String groupObservationId, String observationId);

	List<AuditObservationRespondReviewCapture> getAuditObservationRespondReviewCaptureByObservation(
			Integer legalEntityCode, String auditTypeCode, String planId, String auditId, String groupObservationId,
			String observationId);

	void deleteById(AuditObservation auditObservationStored);
	
	Map<String, String> validateAccObsMapping(Integer legalEntityCode,String auditTypeCode,String planId,String auditId,String custId,String accountNo,String captureType,String mappingId,String type);
	
	List<AuditObservation> getAllPossibleRiskFromMapping(int legalEntityCode, String auditTypeCode, String auditId, String planId, String userId);
	
	List<AuditObservation> getAllPossibleRiskFromPrevAssessment(int legalEntityCode, String auditTypeCode, String auditId, String planId, String userId);
	
	// void insertBulkRiskCapture(int legalEntityCode, String auditTypeCode, String auditId);
	
	AuditObservation getRiskDtlsByRiskId(Integer legalEntityCode, String auditId, String observationId, String userId, String status); 
	
	void deleteObservationById(String observationId);
	
	List<AuditObservation> getAllPossibleCheckListFromMapping(int legalEntityCode, String auditTypeCode, String auditId, String planId, String userId);
	
	AuditObservation getInspectionObservation(Integer legalEntityCode,String auditId, String auditTypeCode, String groupObservationId, String observationId);

    void deleteAuditObservationReportReviewCaptureWrk(AuditObservationReportReviewCaptureWrk auditObservationReportReviewCaptureWrk);
	
	void deleteAllAuditObservationReportReviewCaptureWrk(Integer legalEntityCode,String auditId);
	
	List<AuditObservationReportReviewCaptureWrk> getAuditObservationReportReviewCaptureWrk(Integer legalEntityCode,String auditId);
	
	List<AuditObservationReportReviewCapture> getObservationReportReviewCaptureRemark(String legalEntityCode, String observationId );

	//public String deleteIndividualObservationDocument(Integer documentId);
	
	/*public String deleteAllObservationDocument(Integer legalEntityCode, String auditTypeCode,
			String planId, String auditId, String observationId, String documentType);*/
	
	AuditObservation updateObservationSpecificField(AuditObservation auditObservation, String fieldToUpdate);
	
	/***********************For Notes*********************/
	Boolean checkIfLatestNoteIsGivenBySameUser(AuditObservation auditObservation);	
	AuditObservationReportReviewCapture getAuditObservationReportReviewCaptureLatest(AuditObservation auditObservation);
	List<AuditObservationReportReviewCapture> getObservationReportReviewCaptureNotes(Integer legalEntityCode, String observationId, String role);
	void markedNotesAsCycleCompleted(Integer legalEntityCode, String auditTypeCode, String planId, String auditId);
	String submitObservationNotes(Integer legalEntityCode, String auditTypeCode,String auditId, String planId,  String role );
	/***********************For Notes End*********************/
	
	String updateAuditObservationRecordStatus(Integer legalEntityCode, String auditTypeCode, String planId, String auditId, String status);
	
	/***********************Remarks related Service -Compliance Scrutiny *********************/
		Boolean checkIfLatestRemarksIsGivenBySameUserGroup(AuditObservation auditObservation, List<String> roles);	
		
		AuditObservationRespondReviewCapture getAuditObservationRespondReviewCaptureLatest(AuditObservation auditObservation, List<String> roles); 	
		
		List<AuditObservationRespondReviewCapture> getAuditObservationRespondReviewCapture(Integer legalEntityCode, 
				String auditTypeCode,String auditId, String planId, String observationId, String role);
	/***********************Remarks related Service -Compliance Scrutiny  End*********************/
		
	int getCountRespondRejectedRecords(Integer legalEntityCode, String auditId);
	
	void updateComplianceScrutinyRemarkStatus(Integer legalEntityCode, String auditTypeCode,
			String planId, String auditId, String status);
	
	Map<String, AuditObservationComplianceDto> getCompNonCompCountProcesswise(Integer legalEntityCode, String auditTypeCode, String auditId);
	
	String getNonComplianceBehavior(Integer legalEntityCode, String auditId, String auditTypeCode, String unitId, String observationId, String mappingId);
	
	String updatingOthersToNA(Integer legalEntityCode, String auditTypeCode,String auditId);
	
	List<NonCompliancePersistenceChecklistDto> getNonCompliancePersistenceChecklist(Integer legalEntityCode, String auditTypeCode, String auditId);
	
	void saveNonCompliancePersistenceRemarks(List<NonCompliancePersistenceChecklistDto> nonCompliancePersistenceChecklistDtoList);
	
	void updateComplinaceRating(AuditObservation auditObservation);
	
	List<Object[]> getObservationsCountByStatusAttributesOnSubmit(Integer legalEntityCode, String auditTypeCode, String auditId,
			Boolean onInspectionSubmit, Boolean onComplianceSubmit, Boolean onScrutinySubmit);
	
}
