package com.ejie.ab79.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;

import com.ejie.ab79.clientesWS.ab61WebService.Usuario;
import com.ejie.ab79.model.RelEstIns;
import com.ejie.ab79.model.expedientes.DatosTerceros;
import com.ejie.ab79.model.inspecciones.Inspecciones;
import com.ejie.x38.dto.JerarquiaDto;
import com.ejie.x38.dto.TableRequestDto;
import com.ejie.x38.dto.TableResponseDto;
import com.ejie.x38.dto.TableRowDto;

/**
 * RelEstInsService  
 * 
 *  
 */

public interface RelEstInsService {

	/**
	 * Inserts a single row in the RelEstIns table.
	 *
	 * @param relEstIns
	 *            RelEstIns
	 * @return RelEstIns
	 */
	RelEstIns add(RelEstIns relEstIns);

	/**
	 * Updates a single row in the RelEstIns table.
	 *
	 * @param relEstIns
	 *            RelEstIns
	 * @return RelEstIns
	 */
	RelEstIns update(RelEstIns relEstIns);

	/**
	 * Finds a single row in the RelEstIns table.
	 *
	 * @param relEstIns
	 *            RelEstIns
	 * @return RelEstIns
	 */
	RelEstIns find(RelEstIns relEstIns);

	/**
	 * Deletes a single row in the RelEstIns table.
	 *
	 * @param relEstIns
	 *            RelEstIns
	 */
	void remove(RelEstIns relEstIns);

	/**
	 * Finds a list of rows in the RelEstIns table.
	 *
	 * @param relEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @return List<RelEstIns>
	 */
	List<RelEstIns> findAll(RelEstIns relEstIns, TableRequestDto tableRequestDto);

	/**
	 * Finds rows in the RelEstIns table using like.
	 *
	 * @param relEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return List<RelEstIns>
	 */
	List<RelEstIns> findAllLike(RelEstIns relEstIns, TableRequestDto tableRequestDto, Boolean startsWith);

	/*
	 * OPERACIONES RUP_TABLE
	 */

	/**
	 * Removes rows from the RelEstIns table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 */
	void removeMultiple(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto, Boolean startsWith);

	/**
	 * Filter method in the RelEstIns table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return TableResponseDto<RelEstIns>
	 */
	TableResponseDto<RelEstIns> filter(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto, Boolean startsWith);

	/**
	 * Searches rows in the RelEstIns table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param searchRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return List<TableRowDto<RelEstIns>>
	 */
	List<TableRowDto<RelEstIns>> search(RelEstIns filterRelEstIns, RelEstIns searchRelEstIns,
			TableRequestDto tableRequestDto, Boolean startsWith);

	/**
	 * Reorder the selection made in RelEstIns table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return Object
	 */
	Object reorderSelection(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto, Boolean startsWith);

	/*
	 * OPERACIONES RUP_TABLE JERARQUIA
	 */

	/**
	 * Finder method in the hierarchical the RelEstIns table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return TableResponseDto<JerarquiaDto<RelEstIns>>
	 */
	TableResponseDto<JerarquiaDto<RelEstIns>> jerarquia(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto,
			Boolean startsWith);

	/**
	 * Finder method for siblings rows in the hierarchical the RelEstIns table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @return TableResponseDto<JerarquiaDto<RelEstIns>>
	 */
	TableResponseDto<JerarquiaDto<RelEstIns>> jerarquiaChildren(RelEstIns filterRelEstIns,
			TableRequestDto tableRequestDto);

	/**
	 * Exporta Datos al clipBoard
	 *
	 */
	List<RelEstIns> getMultiple(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto, Boolean startsWith);

	RelEstIns findByInspeccion(Inspecciones inspecciones);

	void guardarSinExpediente(HttpServletRequest request, Model model, Usuario usuario, Integer idInspeccion);

	void removeByInspeccion(Inspecciones inspeccion);

	void eliminarTercero(DatosTerceros datosTercero);

	void actualizarTituloInspeccion(RelEstIns relEstIns);

}
