mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-03 02:04:54 +00:00
docs: hpp,dbal,cpp (3 files)
This commit is contained in:
@@ -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
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user