Class PrestamoServiceImp
java.lang.Object
com.tfg.crud.GestorBiblioteca.service.PrestamoServiceImp
- All Implemented Interfaces:
PrestamoService
- Author:
- Usuario
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidActualiza el estado de los préstamos retrasados en el sistema.buscarPrestamoPorId(Long idPrestamo) Busca préstamos por su identificador.org.springframework.data.domain.Page<Prestamo> buscarPrestamos(String busqueda, EstadoPrestamo estadoPrestamo, org.springframework.data.domain.Pageable pageable) Busca préstamos aplicando filtros y paginaciónvoidcambiarEstado(Long idPrestamo, EstadoPrestamo estadoPrestamo) Cambia el estado de un préstamo.editarPrestamo(Long idPrestamo, PrestamoDTO prestamoDTO) Edita un préstamo existente.voidfinalizarPrestamo(LocalDate fechaDevolucion, Long idPrestamo, String codigo) Finaliza un préstamo estableciendo su fecha de devolución.Obtiene el préstamo activo asociado a un ejemplar.listarPrestamosPorUsuario(Long idUsuario) Lista de todos los préstamoas asociados a un usuario.voidreabrirPrestamo(Long idPrestamo) Reabre un préstamo previamente finalizado.registrarPrestamo(PrestamoDTO prestamoDTO) Registra un nuevo préstamo en el sistema.sumarDiasHabiles(LocalDate fechaInicio) Calcula una fecha sumando días hábiles a una fecha inicial.
-
Constructor Details
-
PrestamoServiceImp
public PrestamoServiceImp()
-
-
Method Details
-
registrarPrestamo
Description copied from interface:PrestamoServiceRegistra un nuevo préstamo en el sistema.- Specified by:
registrarPrestamoin interfacePrestamoService- Parameters:
prestamoDTO- datos necesarios para crear el préstamo- Returns:
- préstamo registrado
-
buscarPrestamoPorId
Description copied from interface:PrestamoServiceBusca préstamos por su identificador.- Specified by:
buscarPrestamoPorIdin interfacePrestamoService- Parameters:
idPrestamo- identificador del préstamo- Returns:
- préstamo encontrado
-
editarPrestamo
Description copied from interface:PrestamoServiceEdita un préstamo existente.- Specified by:
editarPrestamoin interfacePrestamoService- Parameters:
idPrestamo- identificador del préstamoprestamoDTO- datos actualizados del préstamo- Returns:
- préstamo modificado
-
finalizarPrestamo
Description copied from interface:PrestamoServiceFinaliza un préstamo estableciendo su fecha de devolución.- Specified by:
finalizarPrestamoin interfacePrestamoService- Parameters:
fechaDevolucion- fecha en la que se devuelve el ejemplaridPrestamo- indentificador del préstamocodigo- código del ejemplar
-
reabrirPrestamo
Description copied from interface:PrestamoServiceReabre un préstamo previamente finalizado.- Specified by:
reabrirPrestamoin interfacePrestamoService- Parameters:
idPrestamo- identificador del préstamo
-
sumarDiasHabiles
Description copied from interface:PrestamoServiceCalcula una fecha sumando días hábiles a una fecha inicial.- Specified by:
sumarDiasHabilesin interfacePrestamoService- Parameters:
fechaInicio- fecha de inicio- Returns:
- fecha resultante
-
cambiarEstado
Description copied from interface:PrestamoServiceCambia el estado de un préstamo.- Specified by:
cambiarEstadoin interfacePrestamoService- Parameters:
idPrestamo- identificador del préstamoestadoPrestamo- nuevo estado del préstamo
-
buscarPrestamos
public org.springframework.data.domain.Page<Prestamo> buscarPrestamos(String busqueda, EstadoPrestamo estadoPrestamo, org.springframework.data.domain.Pageable pageable) Description copied from interface:PrestamoServiceBusca préstamos aplicando filtros y paginación- Specified by:
buscarPrestamosin interfacePrestamoService- Parameters:
busqueda- texto de búsquedaestadoPrestamo- estado del préstamopageable- configuración de paginación- Returns:
- página de préstamos encontrados
-
listarPrestamosPorUsuario
Description copied from interface:PrestamoServiceLista de todos los préstamoas asociados a un usuario.- Specified by:
listarPrestamosPorUsuarioin interfacePrestamoService- Parameters:
idUsuario- identificador del usuario- Returns:
- lista de préstamos del usuario
-
getPrestamoActivo
Description copied from interface:PrestamoServiceObtiene el préstamo activo asociado a un ejemplar.- Specified by:
getPrestamoActivoin interfacePrestamoService- Parameters:
e- ejemplar consultado- Returns:
- préstamo activo si existe
-
actualizarPrestamosRetrasados
public void actualizarPrestamosRetrasados()Description copied from interface:PrestamoServiceActualiza el estado de los préstamos retrasados en el sistema.- Specified by:
actualizarPrestamosRetrasadosin interfacePrestamoService
-