diff --git a/dbal/cpp/src/entities/package/get_package.hpp b/dbal/cpp/src/entities/package/get_package.hpp index c2f7f64c8..ad1001957 100644 --- a/dbal/cpp/src/entities/package/get_package.hpp +++ b/dbal/cpp/src/entities/package/get_package.hpp @@ -1,6 +1,6 @@ /** * @file get_package.hpp - * @brief Get package by ID or package_id operations + * @brief Get package by ID or name+version key operations */ #ifndef DBAL_GET_PACKAGE_HPP #define DBAL_GET_PACKAGE_HPP @@ -20,28 +20,28 @@ inline Result get(InMemoryStore& store, const std::string& id) { if (id.empty()) { return Error::validationError("Package ID cannot be empty"); } - + auto it = store.packages.find(id); if (it == store.packages.end()) { return Error::notFound("Package not found: " + id); } - + return Result(it->second); } /** - * Get a package by package_id (snake_case identifier) + * Get a package by name+version key (name@version) */ -inline Result getByPackageId(InMemoryStore& store, const std::string& package_id) { - if (package_id.empty()) { - return Error::validationError("Package ID cannot be empty"); +inline Result getByPackageId(InMemoryStore& store, const std::string& package_key) { + if (package_key.empty()) { + return Error::validationError("Package key cannot be empty"); } - - auto it = store.package_ids.find(package_id); - if (it == store.package_ids.end()) { - return Error::notFound("Package not found: " + package_id); + + auto it = store.package_keys.find(package_key); + if (it == store.package_keys.end()) { + return Error::notFound("Package not found: " + package_key); } - + return get(store, it->second); }