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

import de.srsoftware.tools.Pair;
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
import de.srsoftware.umbrella.core.model.Document;
import de.srsoftware.umbrella.core.model.Type;
import de.srsoftware.umbrella.documents.model.*;
import java.util.*;

public interface DocumentDb {
	Long dropPosition(long documentId, long pos) throws UmbrellaException;

	/**
	 * Tries to delete the document belonging to the given id
	 * @param docId the internal id of the document
	 * @return the human readable number of the document, if the query succeeded
	 */
	String deleteDoc(Long docId) throws UmbrellaException;

	public Map<Long, Map<Long, String>> docReferencedByTimes(Set<Long> timeIds) throws UmbrellaException;

	Map<Long, Document> find(Collection<Long> companyIds, List<String> keys, boolean fulltext);

	Long getCustomerPrice(long company, String id, String itemCode) throws UmbrellaException;

	CustomerSettings getCustomerSettings(long companyId, Type docType, String customerId) throws UmbrellaException;

	Type getType(int typeId) throws UmbrellaException;

		Map<Long, Document> listDocs(long companyId) throws UmbrellaException;

	HashMap<Integer, Type> listTypes() throws UmbrellaException;

	Document loadDoc(long docId) throws UmbrellaException;

	String nextDocId(String language, long companyId, Type type);

	Document save(Document document) throws UmbrellaException;

	CustomerSettings save(CustomerSettings settings,Document doc) throws UmbrellaException;

	CustomerSettings save(long companyId, Type docType, String customerId, CustomerSettings settings) throws UmbrellaException;

	Pair<Integer> switchPositions(long docId, Pair<Integer> longPair) throws UmbrellaException;
}
