package com.diegocayo.organizame.domain.usecase

import com.diegocayo.organizame.domain.model.User
import com.diegocayo.organizame.domain.repository.UserRepository
import com.diegocayo.organizame.domain.utils.DispatcherProvider
import com.diegocayo.organizame.domain.utils.FlowUseCase
import kotlinx.coroutines.flow.flow
import javax.inject.Inject

class GetUserUseCase @Inject constructor(
    private val repository: UserRepository,
    dispatcherProvider: DispatcherProvider
) : FlowUseCase<Unit, User?>(dispatcherProvider) {

    override fun prepareFlow(input: Unit) = flow {
        val user = repository.getUser()
        emit(user)
    }
} 