/* © SRSoftware 2025 */
package de.srsoftware.umbrella.task;


import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
import de.srsoftware.umbrella.core.model.Permission;
import de.srsoftware.umbrella.core.model.Task;
import de.srsoftware.umbrella.core.model.UmbrellaUser;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface TaskDb {

	void delete(Task task) throws UmbrellaException;
	void dropMember(long projectId, long userId);
	Map<Long, Task> find(long userId, List<String> keys, boolean fulltext);
	Map<Long, Permission> getMembers(Task task);
	Map<Long, Task> listChildrenOf(Long parentTaskId, UmbrellaUser user, boolean showClosed);
	Map<Long, Task> listProjectTasks(Long projectId, Long parentTaskId, boolean noIndex) throws UmbrellaException;
	Map<Long, Task> listRootTasks(Long projectId, UmbrellaUser user, boolean showClosed);
	Map<Long, Task> listTasks(Collection<Long> projectIds) throws UmbrellaException;

	List<Task> listUserTasks(long userId, Long limit, long offset, boolean showClosed);

	Task load(long taskId) throws UmbrellaException;
	Map<Long, Task> load(Collection<Long> taskIds) throws UmbrellaException;

	Task save(Task task);

	void setMember(long taskId, long userId, Permission permission);
}
