

package org.hisp.dhis.android.core.dataset.internal;

import org.hisp.dhis.android.core.arch.call.factories.internal.QueryCall;
import org.hisp.dhis.android.core.arch.call.factories.internal.UidsCallFactory;
import org.hisp.dhis.android.core.dataset.DataSet;
import org.hisp.dhis.android.core.dataset.DataSetCompleteRegistration;
import org.hisp.dhis.android.core.dataset.DataSetModule;

import dagger.Module;
import dagger.Provides;
import dagger.Reusable;
import retrofit2.Retrofit;

@Module(includes = {
        DataInputPeriodEntityDIModule.class,
        DataSetElementEntityDIModule.class,
        DataSetCompulsoryDataElementOperandEntityDIModule.class,
        DataSetEntityDIModule.class,
        DataSetCompleteRegistrationEntityDIModule.class,
        DataSetInstanceEntityDIModule.class,
        DataSetOrganisationUnitLinkEntityDIModule.class,
        SectionEntityDIModule.class,
        SectionIndicatorEntityDIModule.class,
        SectionDataElementEntityDIModule.class,
        SectionGreyedFieldsEntityDIModule.class
})
public final class DataSetPackageDIModule {

    @Provides
    @Reusable
    QueryCall<DataSetCompleteRegistration, DataSetCompleteRegistrationQuery>
    dataSetCompleteRegistrationCallFactory(DataSetCompleteRegistrationCall impl) {
        return impl;
    }

    @Provides
    @Reusable
    UidsCallFactory<DataSet> dataSetEndpointCallFactory(DataSetEndpointCallFactory impl) {
        return impl;
    }

    @Provides
    @Reusable
    DataSetService dataSetService(Retrofit retrofit) {
        return retrofit.create(DataSetService.class);
    }

    @Provides
    @Reusable
    DataSetCompleteRegistrationService dataSetCompleteRegistrationService(Retrofit retrofit) {
        return retrofit.create(DataSetCompleteRegistrationService.class);
    }

    @Provides
    @Reusable
    DataSetModule module(DataSetModuleImpl impl) {
        return impl;
    }
}