Skip to content
Extraits de code Groupes Projets
Valider 89814571 rédigé par anas.roukny's avatar anas.roukny
Parcourir les fichiers

update session & activity history path

parent 698300f8
Branches
1 requête de fusion!8MLC-251/update session & activity history path
Pipeline #19275 réussi avec les étapes
in 1 minute et 28 secondes
......@@ -19,12 +19,9 @@
- MLC-296/Created getManagerById and getAllManagers methods using ManagerResponseDTO (with @Builder)
- MLC-253/Update the isAgentExists method.
- MLC-251/implement CRUD operations for Sessions & ActivityHistory
<<<<<<< HEAD
- MLC-296/Integrated call to agency-service to fetch agency details by IDs
- MLC-296/Updated AgentService to enrich AgentResponseDTO with agency name
- MLC-296/Added agency name filtering support (case-insensitive, partial match)
- MLC-296/Fixed data type mismatch for agencyId (String → Long)
=======
- MLC-251/Update Sessions & ActivityHistory Path
>>>>>>> 945934f (update session & activity history path)
......@@ -9,5 +9,5 @@ import java.util.Optional;
@Repository
public interface SessionRepository extends JpaRepository<Session, Long> {
List<Session> findByUserId(Long userId);
List<Session> findByUserIdAndIsCurrentTrue(Long userId); // Modifiée pour retourner List au lieu d'Optional
List<Session> findByUserIdAndIsCurrentTrue(Long userId);
}
\ No newline at end of file
......@@ -8,6 +8,6 @@ import java.util.List;
public interface SessionService {
SessionDTO createSession(SessionDTO sessionDTO) throws FunctionalException;
List<SessionDTO> getSessionsByUserId(Long userId) throws FunctionalException;
List<SessionDTO> getCurrentSessions(Long userId) throws FunctionalException; // Modifiée
List<SessionDTO> getCurrentSessions(Long userId) throws FunctionalException;
void invalidateSession(Long sessionId) throws FunctionalException;
}
\ No newline at end of file
......@@ -47,9 +47,6 @@ public class SessionServiceImpl implements SessionService {
session.setLastActive(LocalDateTime.now());
session.setCurrent(true);
// Suppression de la logique qui invalide les sessions existantes
// Maintenant plusieurs sessions peuvent avoir isCurrent = true
Session savedSession = sessionRepository.save(session);
return SessionMapper.toDTO(savedSession);
}
......@@ -60,7 +57,6 @@ public class SessionServiceImpl implements SessionService {
throw new FunctionalException(Message.USER_ID_NULL);
}
// Check if user exists
userRepository.findById(userId)
.orElseThrow(() -> new FunctionalException(Message.USER_NOT_FOUND + userId));
......@@ -76,7 +72,6 @@ public class SessionServiceImpl implements SessionService {
throw new FunctionalException(Message.USER_ID_NULL);
}
// Check if user exists
userRepository.findById(userId)
.orElseThrow(() -> new FunctionalException(Message.USER_NOT_FOUND + userId));
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter