Coverage Summary for Class: HomeInteractorImpl (com.stslex93.notes.feature.home.domain.interactor)

Class Method, % Branch, % Line, % Instruction, %
HomeInteractorImpl 0% (0/3) 0% (0/8) 0% (0/29)
HomeInteractorImpl$searchNotes$$inlined$map$1 0% (0/2)
HomeInteractorImpl$searchNotes$$inlined$map$1$2 0% (0/1)
HomeInteractorImpl$searchNotes$$inlined$map$1$2$1
HomeInteractorImpl$searchNotes$1$1 0% (0/1) 0% (0/6) 0% (0/29)
Total 0% (0/7) 0% (0/14) 0% (0/58)


 package com.stslex93.notes.feature.home.domain.interactor
 
 import androidx.paging.PagingData
 import androidx.paging.map
 import com.stslex93.notes.core.label.repository.LabelRepository
 import com.stslex93.notes.core.notes.repository.NoteRepository
 import com.stslex93.notes.feature.home.domain.model.NoteDomain
 import com.stslex93.notes.feature.home.domain.model.toDomain
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.flowOn
 import kotlinx.coroutines.flow.map
 import javax.inject.Inject
 
 class HomeInteractorImpl @Inject constructor(
     private val noteRepository: NoteRepository,
     private val labelRepository: LabelRepository
 ) : HomeInteractor {
 
     override fun searchNotes(query: String): Flow<PagingData<NoteDomain>> =
         noteRepository
             .searchNotes(query)
             .map { pagingData ->
                 pagingData.map { noteDataModel ->
                     val labels = labelRepository
                         .getAllLabels(noteDataModel.labelUuids)
                         .map {
                             it.toDomain()
                         }
                         .toSet()
                     noteDataModel.toDomain(labels)
                 }
             }
             .flowOn(Dispatchers.IO)
 
     override suspend fun deleteNotes(noteIds: List<Int>) {
         noteRepository.deleteNotesById(noteIds)
     }
 }