feat: NBP service outline

This commit is contained in:
Piotr Dec 2024-05-23 18:54:53 +02:00
parent d6e9136a68
commit ef5125fb0d
Signed by: stawros
GPG key ID: F89F27AD8F881A91

View 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) {
}
}