package com.pixelized.biblib.module

import com.pixelized.biblib.network.factory.BookFactory
import com.pixelized.biblib.network.factory.GenreFactory
import com.pixelized.biblib.network.factory.SeriesFactory
import com.pixelized.biblib.network.factory.UserFactory
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import java.text.DateFormat
import java.util.*

@Module
@InstallIn(SingletonComponent::class)
class FactoryModule {

    @Provides
    fun provideBookFactory(
        parser: DateFormat,
    ): BookFactory {
        return BookFactory(
            parser = parser
        )
    }

    @Provides
    fun provideGenreFactory(): GenreFactory {
        return GenreFactory()
    }

    @Provides
    fun provideSeriesFactory(): SeriesFactory {
        return SeriesFactory()
    }

    @Provides
    fun provideUserFactory(
        parser: DateFormat,
    ): UserFactory {
        return UserFactory(
            parser = parser,
        )
    }
}