// Path: databoundary/src/main/java/eu/rampsoftware/er/data/CurrencyRepository.java
// public interface CurrencyRepository {
// 
//     Observable<CurrencyData> getCurrencies(final Date date);
// 
//     Observable<SingleValue> getSeries(Date from, Date to, String currencyCode);
// }
// 
// Path: domain/src/main/java/eu/rampsoftware/er/domain/usecases/GetCurrencySeriesUseCase.java
// public class GetCurrencySeriesUseCase extends QueryUseCase<SingleValue, GetCurrencySeriesUseCase.CurrencySeriesParam> {
// 
//     private final CurrencyRepository mRepository;
// 
//     public GetCurrencySeriesUseCase(final Scheduler workScheduler,
//                                     final Scheduler observeScheduler,
//                                     CurrencyRepository repository) {
//         super(workScheduler, observeScheduler);
//         mRepository = repository;
// 
//     }
// 
//     @Override
//     protected Observable<SingleValue> buildUseCaseObservable(final CurrencySeriesParam params) {
//         return mRepository.getSeries(params.from, params.to, params.currencyCode);
//     }
// 
//     public static class CurrencySeriesParam {
//         Date from;
//         Date to;
//         String currencyCode;
// 
//         public CurrencySeriesParam(final Date from,
//                                    final Date to,
//                                    final String currencyCode) {
//             this.from = checkNotNull(from);
//             this.to = checkNotNull(to);
//             this.currencyCode = checkNotNull(currencyCode);
//             if(currencyCode.isEmpty()){
//                 throw new InvalidParameterException("CURRENCY CODE parameter cannot be empty");
//             }
//             if(from.getTime() > to.getTime()){
//                 throw new InvalidParameterException("START date cannot be after TO date.");
//             }
//         }
//     }
// }
// 
// Path: presentation/src/main/java/eu/rampsoftware/er/viewmodel/details/CurrencyDetailsViewModel.java
// public class CurrencyDetailsViewModel extends BaseDisposableViewModel implements BaseViewModel {
// 
//     public static final String KEY_CURRENCY_CODE = "KEY_CURRENCY_CODE";
//     private GetCurrencySeriesUseCase mGetSeriesUseCase;
//     private boolean mIsProgressVisible;
//     private List<SingleValue> mCurrencySeries;
//     private String mCurrencyCode;
// 
//     public CurrencyDetailsViewModel(final GetCurrencySeriesUseCase getSeriesUseCase) {
//         mGetSeriesUseCase = getSeriesUseCase;
//         mCurrencySeries = new ArrayList<>();
//     }
// 
//     @Bindable
//     public String getCurrencyCode() {
//         return mCurrencyCode;
//     }
// 
//     public void setCurrencyCode(final String currencyCode) {
//         mCurrencyCode = currencyCode;
//         notifyPropertyChanged(BR.currencyCode);
//     }
// 
//     @Bindable
//     public List<SingleValue> getCurrencySeries() {
//         return mCurrencySeries;
//     }
// 
//     @Override
//     public void onLoad(final Bundle bundle) {
//         checkNotNull(bundle);
//         checkArgument(bundle.containsKey(KEY_CURRENCY_CODE), "Currency code must be provided to onLoad method");
//         setCurrencyCode(bundle.getString(KEY_CURRENCY_CODE));
//         performRequest();
//     }
// 
//     @Bindable
//     public boolean isProgressVisible() {
//         return mIsProgressVisible;
//     }
// 
//     public void setProgressVisible(final boolean progressVisible) {
//         mIsProgressVisible = progressVisible;
//         notifyPropertyChanged(BR.progressVisible);
//     }
// 
//     public void performRefresh() {
//         performRequest();
//     }
// 
//     private void performRequest() {
//         setProgressVisible(true);
//         Date endDate = new Date();
//         int daysRange = 10;
//         mCurrencySeries.clear();
//         final Calendar calendar = Calendar.getInstance();
//         calendar.setTime(endDate);
//         calendar.add(Calendar.DAY_OF_YEAR, -daysRange);
//         Date from = calendar.getTime();
//         CurrencySeriesParam params = new CurrencySeriesParam(from, endDate, mCurrencyCode);
//         addDisposable(
//                 mGetSeriesUseCase.run(params)
//                         .doFinally(() -> {
//                             setProgressVisible(false);
//                             notifyPropertyChanged(BR.currencySeries);
//                         })
//                         .subscribe(currencyData -> {
//                             mCurrencySeries.add(currencyData);
//                         })
//         );
//     }
// 
// }


import eu.rampsoftware.er.data.CurrencyRepository;
import eu.rampsoftware.er.domain.usecases.GetCurrencySeriesUseCase;
import eu.rampsoftware.er.viewmodel.details.CurrencyDetailsViewModel;
package eu.rampsoftware.er.di;


interface ICurrencyDetailsActivityModule {
    GetCurrencySeriesUseCase provideGetCurrenciesUseCase(CurrencyRepository currencyRepository);

// Path: databoundary/src/main/java/eu/rampsoftware/er/data/CurrencyRepository.java
// public interface CurrencyRepository {
// 
//     Observable<CurrencyData> getCurrencies(final Date date);
// 
//     Observable<SingleValue> getSeries(Date from, Date to, String currencyCode);
// }
// 
// Path: domain/src/main/java/eu/rampsoftware/er/domain/usecases/GetCurrencySeriesUseCase.java
// public class GetCurrencySeriesUseCase extends QueryUseCase<SingleValue, GetCurrencySeriesUseCase.CurrencySeriesParam> {
// 
//     private final CurrencyRepository mRepository;
// 
//     public GetCurrencySeriesUseCase(final Scheduler workScheduler,
//                                     final Scheduler observeScheduler,
//                                     CurrencyRepository repository) {
//         super(workScheduler, observeScheduler);
//         mRepository = repository;
// 
//     }
// 
//     @Override
//     protected Observable<SingleValue> buildUseCaseObservable(final CurrencySeriesParam params) {
//         return mRepository.getSeries(params.from, params.to, params.currencyCode);
//     }
// 
//     public static class CurrencySeriesParam {
//         Date from;
//         Date to;
//         String currencyCode;
// 
//         public CurrencySeriesParam(final Date from,
//                                    final Date to,
//                                    final String currencyCode) {
//             this.from = checkNotNull(from);
//             this.to = checkNotNull(to);
//             this.currencyCode = checkNotNull(currencyCode);
//             if(currencyCode.isEmpty()){
//                 throw new InvalidParameterException("CURRENCY CODE parameter cannot be empty");
//             }
//             if(from.getTime() > to.getTime()){
//                 throw new InvalidParameterException("START date cannot be after TO date.");
//             }
//         }
//     }
// }
// 
// Path: presentation/src/main/java/eu/rampsoftware/er/viewmodel/details/CurrencyDetailsViewModel.java
// public class CurrencyDetailsViewModel extends BaseDisposableViewModel implements BaseViewModel {
// 
//     public static final String KEY_CURRENCY_CODE = "KEY_CURRENCY_CODE";
//     private GetCurrencySeriesUseCase mGetSeriesUseCase;
//     private boolean mIsProgressVisible;
//     private List<SingleValue> mCurrencySeries;
//     private String mCurrencyCode;
// 
//     public CurrencyDetailsViewModel(final GetCurrencySeriesUseCase getSeriesUseCase) {
//         mGetSeriesUseCase = getSeriesUseCase;
//         mCurrencySeries = new ArrayList<>();
//     }
// 
//     @Bindable
//     public String getCurrencyCode() {
//         return mCurrencyCode;
//     }
// 
//     public void setCurrencyCode(final String currencyCode) {
//         mCurrencyCode = currencyCode;
//         notifyPropertyChanged(BR.currencyCode);
//     }
// 
//     @Bindable
//     public List<SingleValue> getCurrencySeries() {
//         return mCurrencySeries;
//     }
// 
//     @Override
//     public void onLoad(final Bundle bundle) {
//         checkNotNull(bundle);
//         checkArgument(bundle.containsKey(KEY_CURRENCY_CODE), "Currency code must be provided to onLoad method");
//         setCurrencyCode(bundle.getString(KEY_CURRENCY_CODE));
//         performRequest();
//     }
// 
//     @Bindable
//     public boolean isProgressVisible() {
//         return mIsProgressVisible;
//     }
// 
//     public void setProgressVisible(final boolean progressVisible) {
//         mIsProgressVisible = progressVisible;
//         notifyPropertyChanged(BR.progressVisible);
//     }
// 
//     public void performRefresh() {
//         performRequest();
//     }
// 
//     private void performRequest() {
//         setProgressVisible(true);
//         Date endDate = new Date();
//         int daysRange = 10;
//         mCurrencySeries.clear();
//         final Calendar calendar = Calendar.getInstance();
//         calendar.setTime(endDate);
//         calendar.add(Calendar.DAY_OF_YEAR, -daysRange);
//         Date from = calendar.getTime();
//         CurrencySeriesParam params = new CurrencySeriesParam(from, endDate, mCurrencyCode);
//         addDisposable(
//                 mGetSeriesUseCase.run(params)
//                         .doFinally(() -> {
//                             setProgressVisible(false);
//                             notifyPropertyChanged(BR.currencySeries);
//                         })
//                         .subscribe(currencyData -> {
//                             mCurrencySeries.add(currencyData);
//                         })
//         );
//     }
// 
// }


// Path: presentation/src/main/java/eu/rampsoftware/er/di/ICurrencyDetailsActivityModule.java
import eu.rampsoftware.er.data.CurrencyRepository;
import eu.rampsoftware.er.domain.usecases.GetCurrencySeriesUseCase;
import eu.rampsoftware.er.viewmodel.details.CurrencyDetailsViewModel;

package eu.rampsoftware.er.di;


interface ICurrencyDetailsActivityModule {
    GetCurrencySeriesUseCase provideGetCurrenciesUseCase(CurrencyRepository currencyRepository);

    CurrencyDetailsViewModel provideCurrencyDetailsViewModel(GetCurrencySeriesUseCase getSeriesUseCase);