Case-insensitive SKU matching for incoming deliveries

C++ · C++ · beginner · modification

Some suppliers send their delivery files with lowercase SKUs, and `stockctl receive` has been listing every one of those lines as unknown. This PR makes SKU matching case-insensitive. The comparison lives in a new `same_sku` function declared in `restock.hpp`, an ASCII-only upper-casing compare that does not depend on the locale. `apply_delivery` in `restock.cpp` now uses it while looking up each line's item, with the `find_if` and its lambda replaced by a plain loop. `tests/restock_test.cpp` is new: it covers `same_sku` on matching and non-matching pairs and runs `apply_delivery` on a small delivery that mixes a lowercase, an unknown and an exact SKU.

C++20, built with CMake by Apple clang 17 locally and GCC 13 in CI, with `-Wall -Wextra -Wconversion -Werror`; standard library only. The CMake files are unchanged: they build every `src/**/*.cpp` into the library and every `tests/*_test.cpp` together with `tests/check_main.cpp` into the test binary that CI runs. `stockctl` is a single-threaded command-line tool run by the warehouse team. Existing and unchanged: `inventory::StockItem { std::string sku; std::string name; std::int64_t on_hand; }` in `src/inventory/stock.hpp`; `load_stock` reads at most 20,000 items whose SKUs are unique and stored uppercase; `parse_delivery_csv` trims every field and rejects a file with more than 500 lines, a SKU that is not 1 to 32 characters of ASCII letters, digits and `-`, or a quantity outside 1 to 100,000. `on_hand` stays between 0 and 1,000,000,000 before a delivery, so the sums fit in `std::int64_t`. `receive` prints the report and then calls `save_stock(stock)`. Tests use the repo's tiny helper `tests/check.hpp` (`TEST(name)`, `CHECK(expr)`, `CHECK_EQ(a, b)`), and `tests/check_main.cpp` runs every registered test.

Requirements

Files touched

Review this PR

C++ practice