File History: src/main/java/com/paymentlink/repository/ExchangeRateRepository.java

← View file content

File Content at Commit 9c24ca4

1 package com.paymentlink.repository;
2
3 import com.paymentlink.model.entity.ExchangeRate;
4 import org.springframework.data.jpa.repository.JpaRepository;
5 import org.springframework.data.jpa.repository.Query;
6 import org.springframework.data.repository.query.Param;
7 import org.springframework.stereotype.Repository;
8
9 import java.time.LocalDateTime;
10 import java.util.List;
11 import java.util.Optional;
12
13 @Repository
14 public interface ExchangeRateRepository extends JpaRepository<ExchangeRate, Long> {
15
16 @Query("SELECT e FROM ExchangeRate e WHERE e.fromCurrency = :from " +
17 "AND e.toCurrency = :to AND e.expiresAt > :now ORDER BY e.fetchedAt DESC")
18 Optional<ExchangeRate> findValidRate(
19 @Param("from") String fromCurrency,
20 @Param("to") String toCurrency,
21 @Param("now") LocalDateTime now);
22
23 Optional<ExchangeRate> findByFromCurrencyAndToCurrency(String fromCurrency, String toCurrency);
24
25 @Query("SELECT e FROM ExchangeRate e WHERE e.expiresAt < :now")
26 List<ExchangeRate> findExpiredRates(@Param("now") LocalDateTime now);
27
28 void deleteByExpiresAtBefore(LocalDateTime expiryDate);
29 }
30

Commits

Commit Author Date Message File SHA Actions
f0438c2 <f69e50@finnacloud.com> 1766443042 +0300 12/22/2025, 10:37:22 PM increment once more f2cf71d View
188fc92 <f69e50@finnacloud.com> 1766442998 +0300 12/22/2025, 10:36:38 PM increment f2cf71d View
4617f76 <f69e50@finnacloud.com> 1766442953 +0300 12/22/2025, 10:35:53 PM rename branch from main to master oops f2cf71d View
e6d1548 <f69e50@finnacloud.com> 1766442769 +0300 12/22/2025, 10:32:49 PM add initial test workflow file f2cf71d View
9c24ca4 <f69e50@finnacloud.com> 1766442705 +0300 12/22/2025, 10:31:45 PM add CI configuration and test script for Jenkins build f2cf71d Hide
690c1f6 <f69e50@finnacloud.com> 1766368110 +0300 12/22/2025, 1:48:30 AM initialize backend structure with controllers, DTOs, and configuration files f2cf71d View