feat: NBP service outline
This commit is contained in:
parent
d6e9136a68
commit
ef5125fb0d
1 changed files with 44 additions and 0 deletions
44
src/main/java/eu/ztsh/wymiana/service/NbpService.java
Normal file
44
src/main/java/eu/ztsh/wymiana/service/NbpService.java
Normal file
|
@ -0,0 +1,44 @@
|
|||
package eu.ztsh.wymiana.service;
|
||||
|
||||
import eu.ztsh.wymiana.model.Rates;
|
||||
import org.assertj.core.util.VisibleForTesting;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* NBP exchange rates service
|
||||
*/
|
||||
@Service
|
||||
public class NbpService {
|
||||
|
||||
public double getSellRate(String currency) {
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
|
||||
public double getBuyRate(String currency) {
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates date for data fetch.
|
||||
* <p>
|
||||
* Usually this would be today, but as rates are set only Mon-Fri, during weekends it is needed to fetch last friday rates.
|
||||
*
|
||||
* @return date for data fetch
|
||||
*/
|
||||
@VisibleForTesting
|
||||
LocalDate getFetchDate() {
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
Rates fetchData(String date) {
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
|
||||
private record RatesCache(LocalDate date, double buy, double sell) {
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue