Beneficiary must be able to Delete Company
This commit is contained in:
@@ -38,6 +38,7 @@ public interface ApplicationRepository extends JpaRepository<ApplicationEntity,
|
||||
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'DRAFT'")
|
||||
Long countDraftApplications();
|
||||
|
||||
List<ApplicationEntity> findByCompanyIdAndUserIdAndIsDeletedFalse(Long companyId,Long userId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,5 +19,6 @@ public interface FaqRepository extends JpaRepository<FaqEntity, Long> {
|
||||
List<FaqEntity> findByCallIdAndIsDeletedFalse(Long callId);
|
||||
|
||||
Optional<FaqEntity> findByIdAndCallIdAndIsDeletedFalse(Long id, Long callId);
|
||||
List<FaqEntity> findByCompanyIdAndUserIdAndIsDeletedFalse(Long companyId,Long userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -12,11 +12,13 @@ import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
||||
|
||||
public interface UserWithCompanyRepository extends JpaRepository<UserWithCompanyEntity, Long> {
|
||||
|
||||
void deleteByCompanyId(Long companyId);
|
||||
void deleteByCompanyIdAndIsDeletedFalse(Long companyId);
|
||||
|
||||
@Query("SELECT uwc.companyId FROM UserWithCompanyEntity uwc WHERE uwc.userId = :userId")
|
||||
List<Long> findCompanyIdByUserId(@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> findByUserIdAndCompanyId(Long userId, Long companyId);
|
||||
|
||||
|
||||
Optional<UserWithCompanyEntity> findByUserIdAndCompanyIdAndIsDeletedFalse(Long userId, Long companyId);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user