Updated Apis, Code, Configurations for Notification.
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.NotificationEntity;
|
||||
import net.gepafin.tendermanagement.enums.NotificationTypeEnum;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface NotificationRepository extends JpaRepository<NotificationEntity, Long> {
|
||||
|
||||
NotificationEntity findByIdAndIsDeletedFalse(Long id);
|
||||
NotificationEntity findByIdAndIsDeletedFalse(Long id);
|
||||
|
||||
List<NotificationEntity> findByUserIdAndIsDeletedFalse(Long userId);
|
||||
|
||||
List<NotificationEntity> findByUserIdAndUserWithCompanyIdAndIsDeletedFalseAndStatusIn(Long userId,Long
|
||||
userWithCompanyId,List<String> statuses);
|
||||
List<NotificationEntity> findByUserIdAndUserWithCompanyIdAndIsDeletedFalseAndStatusIn(Long userId, Long userWithCompanyId, List<String> statuses);
|
||||
|
||||
List<NotificationEntity> findByUserIdAndIsDeletedFalseAndStatusIn(Long userId, List<String> statuses);
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface UserWithCompanyRepository extends JpaRepository<UserWithCompanyEntity, Long> {
|
||||
|
||||
void deleteByCompanyIdAndIsDeletedFalse(Long companyId);
|
||||
void deleteByCompanyIdAndIsDeletedFalse(Long companyId);
|
||||
|
||||
@Query("SELECT u.companyId FROM UserWithCompanyEntity u WHERE u.userId = :userId AND u.isDeleted = false")
|
||||
List<Long> findActiveCompanyIdsByUserId(@Param("userId") Long userId);
|
||||
@Query("SELECT u.companyId FROM UserWithCompanyEntity u WHERE u.userId = :userId AND u.isDeleted = false")
|
||||
List<Long> findActiveCompanyIdsByUserId(@Param("userId") Long userId);
|
||||
|
||||
Optional<UserWithCompanyEntity> findByUserIdAndCompanyIdAndIsDeletedFalse(Long userId, Long companyId);
|
||||
Optional<UserWithCompanyEntity> findByUserIdAndCompanyIdAndIsDeletedFalse(Long userId, Long companyId);
|
||||
|
||||
@Query("SELECT u FROM UserWithCompanyEntity u WHERE u.userId = :userId AND u.companyId = :companyId AND u.isDeleted = false")
|
||||
UserWithCompanyEntity findByUserIdAndCompanyIdAndIsDeletedFalseForNotification(Long userId, Long companyId);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user