docs: hpp,dbal,cpp (3 files)

This commit is contained in:
2025-12-26 01:28:10 +00:00
parent 5105feb24d
commit 0310c0e860
3 changed files with 39 additions and 0 deletions
@@ -0,0 +1,37 @@
/**
* @file get_page_by_slug.hpp
* @brief Get page by slug operation
*/
#ifndef DBAL_GET_PAGE_BY_SLUG_HPP
#define DBAL_GET_PAGE_BY_SLUG_HPP
#include "dbal/types.hpp"
#include "dbal/errors.hpp"
#include "../../store/in_memory_store.hpp"
#include "get_page.hpp"
namespace dbal {
namespace entities {
namespace page {
/**
* Get a page by slug
*/
inline Result<PageView> getBySlug(InMemoryStore& store, const std::string& slug) {
if (slug.empty()) {
return Error::validationError("Slug cannot be empty");
}
auto it = store.page_slugs.find(slug);
if (it == store.page_slugs.end()) {
return Error::notFound("Page not found with slug: " + slug);
}
return get(store, it->second);
}
} // namespace page
} // namespace entities
} // namespace dbal
#endif
+1
View File
@@ -7,6 +7,7 @@
#include "create_page.hpp"
#include "get_page.hpp"
#include "get_page_by_slug.hpp"
#include "update_page.hpp"
#include "delete_page.hpp"
#include "list_pages.hpp"
+1
View File
@@ -28,6 +28,7 @@ Visit `/levels` to step through each tier. The page renders a grid of cards, hig
## Tooling
- Run `tsx tools/list-permissions.ts` to dump the level definitions and capabilities into the console. This script ensures workflows or automation agents always align with the same data that powers the UI.
- Run `tsx tools/levels-csv-export.ts` to emit the permission catalog as comma-separated values for spreadsheets and data pipelines.
- The CLI at `packages/codegen_studio/static_content/cli/main.cpp --levels` also prints this list so legacy tooling and C++ guardians share the same glossary.
## Testing