Added 'preferred' flag to GET /call response

This commit is contained in:
harish
2024-11-11 19:40:11 +05:30
parent 64a734c504
commit a62d704124
3 changed files with 35 additions and 20 deletions

View File

@@ -15,4 +15,6 @@ public interface BeneficiaryPreferredCallRepository extends JpaRepository<Benefi
@Query("SELECT preferredCall FROM BeneficiaryPreferredCallEntity preferredCall where preferredCall.userId=:userId AND (:companyId is null OR preferredCall.companyId=:companyId)")
List<BeneficiaryPreferredCallEntity> findByUserIdAndCompanyId(@Param("userId") Long userId, @Param("companyId") Long companyId);
List<BeneficiaryPreferredCallEntity> findByBeneficiaryIdAndCompanyId(Long beneficiaryId,Long companyId);
@Query("SELECT preferredCall FROM BeneficiaryPreferredCallEntity preferredCall WHERE preferredCall.userId = :userId AND preferredCall.callId IN :callIds")
List<BeneficiaryPreferredCallEntity> findByUserIdAndCallIdIn(@Param("userId") Long userId, @Param("callIds") List<Long> callIds);
}