package com.atlassian.stash.internal.build.dao;

import com.atlassian.bitbucket.build.BuildState;
import com.atlassian.bitbucket.build.BuildStatus;
import com.atlassian.bitbucket.build.BuildStatusSetRequest;
import com.atlassian.bitbucket.util.Page;
import com.atlassian.bitbucket.util.PageRequest;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Map;

public interface BuildStatusDao {

    BuildStatus set(@Nonnull BuildStatusSetRequest request);

    @Nonnull
    Page<AoBuildStatus> findAll(@Nonnull String commitId, @Nonnull PageRequest pageRequest);

    @Nonnull
    Map<BuildState, Integer> countByState(@Nonnull String commitId);

    @Nonnull
    Map<String, Map<BuildState, Integer>> countByState(@Nonnull Collection<String> commitIds);
}
