package it.integry.integrywmsnative.core.data_store.db.respository_new.data_source;

import java.util.List;
import java.util.concurrent.ExecutorService;

import javax.inject.Inject;
import javax.inject.Singleton;

import io.reactivex.rxjava3.core.Flowable;
import it.integry.integrywmsnative.core.data_store.db.dao.InventarioDao;
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;

@Singleton
public class InventarioLocalDataSource extends _BaseRoomDataSource<InventarioRoomDTO, InventarioDao> {

    @Inject
    public InventarioLocalDataSource(ExecutorService executorService, InventarioDao entityDao) {
        super(executorService, entityDao, InventarioRoomDTO.TABLE_NAME);
    }

    @Override
    public List<InventarioRoomDTO> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
        return entityDao
                .selectAll(onlyToBeSync);
    }

    @Override
    public Flowable<List<InventarioRoomDTO>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
        return entityDao
                .selectAllFlowable(onlyToBeSync);
    }
}
