// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/TransactionsViewerApp.java
// public class TransactionsViewerApp extends Application {
// 
//     private ApplicationComponent applicationComponent;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         applicationComponent = DaggerApplicationComponent.builder()
//                 .applicationModule(new ApplicationModule(this))
//                 .build();
//     }
// 
//     public ApplicationComponent component() {
//         return applicationComponent;
//     }
// }
// 
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/di/modules/ApplicationModule.java
// @Module
// public class ApplicationModule {
//     private final Application application;
// 
//     public ApplicationModule(Application application) {
//         this.application = application;
//     }
// 
//     @Provides
//     @Singleton
//     Application provideApplication() {
//         return application;
//     }
// 
//     @Provides
//     @Singleton
//     InteractorExecutor provideThreadsPoolExecutor(ThreadsPoolExecutor executor) {
//         return executor;
//     }
// 
//     @Provides
//     @Singleton
//     MainThread providePostExecutionThread(MainThreadImpl mainThread) {
//         return mainThread;
//     }
// 
//     @Provides
//     @Singleton
//     Context provideApplicationContext() {
//         return application.getApplicationContext();
//     }
// }
// 
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/di/modules/RepositoryModule.java
// @Module
// public class RepositoryModule {
//     @Provides
//     @Singleton
//     DataRepository provideRepository(JSONRepositoryImpl repository) {
//         return repository;
//     }
// 
//     @Provides
//     @Singleton
//     JSONDataSource provideJSONDataSource(JSONDataSourceImpl dataSource) {
//         return dataSource;
//     }
// 
//     @Provides
//     @Singleton
//     JSONOperations provideJSONOperations(JSONOperationsImpl jsonOperations) {
//         return jsonOperations;
//     }
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/InteractorExecutor.java
// public interface InteractorExecutor {
//     void run(Interactor interactor) throws CustomException;
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/MainThread.java
// public interface MainThread {
//     void post(final Runnable runnable);
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/repository/DataRepository.java
// public interface DataRepository<R, T> {
// 
//     /**
//      * to get Rates List
//      **/
//     List<R> getRatesList(String path) throws CustomException;
// 
//     /**
//      * to get Transactions list
//      **/
//     List<T> getTransactionsList(String path) throws CustomException;
// 
//     /**
//      * to get Transactions per product's SKU
//      **/
//     List<T> getTransactionsPerSku(String mPathTransactions, String mSku);
// 
//     /**
//      * to save Transactions indexed per product's SKU
//      **/
//     boolean saveTransactions(Map<String, List<T>> map);
// }


import android.app.Application;
import android.content.Context;
import com.raulh82vlc.TransactionsViewer.TransactionsViewerApp;
import com.raulh82vlc.TransactionsViewer.di.modules.ApplicationModule;
import com.raulh82vlc.TransactionsViewer.di.modules.RepositoryModule;
import com.raulh82vlc.TransactionsViewer.domain.executors.InteractorExecutor;
import com.raulh82vlc.TransactionsViewer.domain.executors.MainThread;
import com.raulh82vlc.TransactionsViewer.domain.repository.DataRepository;
import javax.inject.Singleton;
import dagger.Component;
/*
 * Copyright (C) 2017 Raul Hernandez Lopez @raulh82vlc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.raulh82vlc.TransactionsViewer.di.components;





/**
 * ApplicationComponent is the top level component for this architecture.
 * It provides generic dependencies such as
 * {@link MainThread} or {@link InteractorExecutor}
 * and makes them available to sub-components and other external dependant classes.
 * <p/>
 * Scope {@link Singleton} is used to limit dependency instances across whole execution.
 *
 * @author Raul Hernandez Lopez
 */
@Singleton
@Component(
        modules = {
                ApplicationModule.class,
                RepositoryModule.class
        })
public interface ApplicationComponent {

    /**
     * Injections for the dependencies
     */
    void inject(TransactionsViewerApp app);

    void inject(Context context);

    /**
     * Used in child components
     */
    Application application();

    /**
     * Background processes executor (interactors use this)
     */
    InteractorExecutor threadExecutor();

    /**
     * Direct contact to UI thread
     */
    MainThread mainThread();

    /**
     * Direct contact to repo
     */
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/TransactionsViewerApp.java
// public class TransactionsViewerApp extends Application {
// 
//     private ApplicationComponent applicationComponent;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         applicationComponent = DaggerApplicationComponent.builder()
//                 .applicationModule(new ApplicationModule(this))
//                 .build();
//     }
// 
//     public ApplicationComponent component() {
//         return applicationComponent;
//     }
// }
// 
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/di/modules/ApplicationModule.java
// @Module
// public class ApplicationModule {
//     private final Application application;
// 
//     public ApplicationModule(Application application) {
//         this.application = application;
//     }
// 
//     @Provides
//     @Singleton
//     Application provideApplication() {
//         return application;
//     }
// 
//     @Provides
//     @Singleton
//     InteractorExecutor provideThreadsPoolExecutor(ThreadsPoolExecutor executor) {
//         return executor;
//     }
// 
//     @Provides
//     @Singleton
//     MainThread providePostExecutionThread(MainThreadImpl mainThread) {
//         return mainThread;
//     }
// 
//     @Provides
//     @Singleton
//     Context provideApplicationContext() {
//         return application.getApplicationContext();
//     }
// }
// 
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/di/modules/RepositoryModule.java
// @Module
// public class RepositoryModule {
//     @Provides
//     @Singleton
//     DataRepository provideRepository(JSONRepositoryImpl repository) {
//         return repository;
//     }
// 
//     @Provides
//     @Singleton
//     JSONDataSource provideJSONDataSource(JSONDataSourceImpl dataSource) {
//         return dataSource;
//     }
// 
//     @Provides
//     @Singleton
//     JSONOperations provideJSONOperations(JSONOperationsImpl jsonOperations) {
//         return jsonOperations;
//     }
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/InteractorExecutor.java
// public interface InteractorExecutor {
//     void run(Interactor interactor) throws CustomException;
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/MainThread.java
// public interface MainThread {
//     void post(final Runnable runnable);
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/repository/DataRepository.java
// public interface DataRepository<R, T> {
// 
//     /**
//      * to get Rates List
//      **/
//     List<R> getRatesList(String path) throws CustomException;
// 
//     /**
//      * to get Transactions list
//      **/
//     List<T> getTransactionsList(String path) throws CustomException;
// 
//     /**
//      * to get Transactions per product's SKU
//      **/
//     List<T> getTransactionsPerSku(String mPathTransactions, String mSku);
// 
//     /**
//      * to save Transactions indexed per product's SKU
//      **/
//     boolean saveTransactions(Map<String, List<T>> map);
// }


// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/di/components/ApplicationComponent.java
import android.app.Application;
import android.content.Context;
import com.raulh82vlc.TransactionsViewer.TransactionsViewerApp;
import com.raulh82vlc.TransactionsViewer.di.modules.ApplicationModule;
import com.raulh82vlc.TransactionsViewer.di.modules.RepositoryModule;
import com.raulh82vlc.TransactionsViewer.domain.executors.InteractorExecutor;
import com.raulh82vlc.TransactionsViewer.domain.executors.MainThread;
import com.raulh82vlc.TransactionsViewer.domain.repository.DataRepository;
import javax.inject.Singleton;
import dagger.Component;

/*
 * Copyright (C) 2017 Raul Hernandez Lopez @raulh82vlc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.raulh82vlc.TransactionsViewer.di.components;





/**
 * ApplicationComponent is the top level component for this architecture.
 * It provides generic dependencies such as
 * {@link MainThread} or {@link InteractorExecutor}
 * and makes them available to sub-components and other external dependant classes.
 * <p/>
 * Scope {@link Singleton} is used to limit dependency instances across whole execution.
 *
 * @author Raul Hernandez Lopez
 */
@Singleton
@Component(
        modules = {
                ApplicationModule.class,
                RepositoryModule.class
        })
public interface ApplicationComponent {

    /**
     * Injections for the dependencies
     */
    void inject(TransactionsViewerApp app);

    void inject(Context context);

    /**
     * Used in child components
     */
    Application application();

    /**
     * Background processes executor (interactors use this)
     */
    InteractorExecutor threadExecutor();

    /**
     * Direct contact to UI thread
     */
    MainThread mainThread();

    /**
     * Direct contact to repo
     */
    DataRepository dataRepo();