package de.effigenix.domain.inventory;

import de.effigenix.shared.common.RepositoryError;
import de.effigenix.shared.common.Result;

import java.util.List;
import java.util.Optional;

public interface StorageLocationRepository {

    Result<RepositoryError, Optional<StorageLocation>> findById(StorageLocationId id);

    Result<RepositoryError, List<StorageLocation>> findAll();

    Result<RepositoryError, List<StorageLocation>> findByStorageType(StorageType storageType);

    Result<RepositoryError, List<StorageLocation>> findActive();

    Result<RepositoryError, Boolean> existsByName(StorageLocationName name);

    Result<RepositoryError, Boolean> existsByNameAndIdNot(StorageLocationName name, StorageLocationId id);

    Result<RepositoryError, Void> save(StorageLocation location);
}
