#pragma once #include "webapi/controllers/BaseController.h" #include "application/commands/AddItem.h" #include "application/queries/ListItems.h" #include "application/queries/GetItem.h" #include "application/commands/DeleteItem.h" #include "application/interfaces/IAuthService.h" #include "infrastructure/helpers/JsonItem.h" #include namespace nxl::autostore::webapi { class StoreController : public BaseController { public: struct Context { application::AddItem addItemUc; application::ListItems listItemsUc; application::GetItem getItemUc; application::DeleteItem deleteItemUc; application::IAuthService& authService; }; StoreController(Context&& context); protected: std::vector getRoutes() const override; private: void addItem(const httplib::Request& req, httplib::Response& res); void listItems(const httplib::Request& req, httplib::Response& res); void getItem(const httplib::Request& req, httplib::Response& res); void deleteItem(const httplib::Request& req, httplib::Response& res); void assertUserId(std::optional userId) const; }; } // namespace nxl::autostore::webapi