/* © SRSoftware 2025 */
package de.srsoftware.umbrella.core.api;

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

public interface TagService {
	void deleteEntity(String module, long taskId);

	void deleteEntity(String module, long urlId, long userId);

	Map<String, List<Long>> getTagUses(UmbrellaUser user, String tag);

	Collection<String> getTags(String module, long entityId, UmbrellaUser user) throws UmbrellaException;

	/**
	 * Loads the tags for all the entities denominated by the collection <em>entityIds</em>.
	 * @param module the realm the entities belong to
	 * @param entityIds the set of entities of the respective realm
	 * @param user the user, for whom the tags shall be loaded
	 * @return a map from entity ids to assigned tags
	 * @throws UmbrellaException
	 */
	Map<Long, ? extends Collection<String>> getTags(String module, Collection<Long> entityIds, UmbrellaUser user) throws UmbrellaException;

	void save(String module, long entityId, Collection<Long> userIds, Collection<String> tags);

	String save(String module, long entityId, Collection<Long> userIds, String tag);

	Collection<String> search(String key, UmbrellaUser user);

	void updateId(String module, Object oldId, Object newId);
}
