package cz.senslog.analytics.repository;

import cz.senslog.analytics.domain.*;
import cz.senslog.analytics.utils.Tuple;
import io.vertx.core.Future;

import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

public interface AnalyticsRepository {

    Future<Long> updateLastTimestamp(long unitSensorId, OffsetDateTime timestamp);
    Future<Integer> saveStatisticRecord(StatisticRecord record);
    Future<List<Sensor>> loadAllSensors();
    Future<List<Threshold>> loadThresholdsForSensor();
    Future<List<Tuple<Long, AnalyticGroup>>> loadAllAnalyticGroupsWithDatasource();

    Future<Map<Long, AnalyticGroup>> loadGroupsByCollectorType(CollectorType type);

    Future<List<Threshold>> loadGroupThresholds(CollectorType type);
}
