package com.fastest.pass.login.di

import android.util.Log
import com.fastest.pass.login.data.remote.LoginApiService
import com.fastest.pass.login.data.repository.LoginRepositoryImpl
import com.fastest.pass.login.domain.repository.LoginRepository
import com.fastest.pass.login.domain.usecase.LoginUseCase
import com.fastest.pass.login.utils.LoginNavigation
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object LoginModule {

    @Provides
    @Singleton
    fun provideNavigation(): LoginNavigation {
        return LoginNavigation()
    }

    @Provides
    @Singleton
    fun provideLoginApiService(retrofit: Retrofit): LoginApiService {
        return retrofit.create(LoginApiService::class.java)
    }

    @Provides
    @Singleton
    fun provideLoginRepository(loginApiService: LoginApiService) : LoginRepository{
        Log.d("test_api_login", "provideLoginRepository() , LoginModule")
        return LoginRepositoryImpl(loginApiService)
    }


}