26#include <commons/audit_record.hpp>
27#include <commons/identity.hpp>
28#include <commons/json/audit_record.hpp>
48 using base_t::operator=;
50 static constexpr std::string_view kind_id =
"audit_record";
52 [[nodiscard]] std::string
to_string()
const override {
53 return this->
value.identity ? comms::to_string(*this->
value.identity) : std::string{
"—"};
60 static cell_type_descriptor_t descriptor() {
61 static const auto d = std::make_shared<SimpleCellTypeDescriptor<AuditRecordCell>>(
62 DisplayInfo{.name =
"AuditRecord",
63 .description =
"Audit-trail entry (who did what, when, from where)"});
80 using base_t::operator=;
82 static constexpr std::string_view kind_id =
"audit_records";
84 [[nodiscard]] std::string
to_string()
const override {
85 return "[" + std::to_string(this->
value.size()) +
" audit records]";
92 static cell_type_descriptor_t descriptor() {
93 static const auto d = std::make_shared<SimpleCellTypeDescriptor<AuditRecordsCell>>(
94 DisplayInfo{.name =
"AuditRecords",
95 .description =
"Capped, insertion-ordered log of audit records"});
114 :
public BaseCell<ChangeAuditRecordCell<P>, comms::ChangeAuditRecord<typename P::storage_t>> {
118 using element_type = P;
120 using base_t::base_t;
121 using base_t::operator=;
123 static constexpr std::string_view kind_id =
prefixed_id_v<
"change_audit_record:", P::kind_id>;
126 return this->
value.identity ? comms::to_string(*this->
value.identity) : std::string{
"—"};
133 static cell_type_descriptor_t descriptor() {
134 static const auto d = std::make_shared<SimpleCellTypeDescriptor<ChangeAuditRecordCell>>(
135 DisplayInfo{.name =
"ChangeAuditRecord",
136 .description = std::string(
"Audit-trail change entry (before/after ") +
137 std::string(P::kind_id) +
")"});
153 :
public BaseCell<ChangeAuditRecordsCell<P>, comms::ChangeAuditRecords<typename P::storage_t>> {
158 using element_type = P;
160 using base_t::base_t;
161 using base_t::operator=;
163 static constexpr std::string_view kind_id =
prefixed_id_v<
"change_audit_records:", P::kind_id>;
166 return "[" + std::to_string(this->
value.size()) +
" change audit records]";
173 static cell_type_descriptor_t descriptor() {
174 static const auto d =
175 std::make_shared<SimpleCellTypeDescriptor<ChangeAuditRecordsCell>>(DisplayInfo{
176 .name =
"ChangeAuditRecords",
177 .description = std::string(
"Capped log of change audit records (before/after ") +
178 std::string(P::kind_id) +
")"});
Core ICell interface, cell_t handle, BaseCell CRTP base, and CellLike concept.
std::shared_ptr< ICell > cell_t
Shared handle to any ICell-derived value — the canonical cell pointer.
Definition cell.h:68
Cell wrapping comms::AuditRecord.
Definition audit.h:43
std::string to_string() const override
Render the cell's value as a compact human-readable string.
Definition audit.h:52
Cell wrapping comms::AuditRecords (= comms::AuditLog<comms::AuditRecord>).
Definition audit.h:75
std::string to_string() const override
Render the cell's value as a compact human-readable string.
Definition audit.h:84
Cell wrapping comms::ChangeAuditRecord<typename P::storage_t>, the before/after change refinement of ...
Definition audit.h:114
std::string to_string() const override
Render the cell's value as a compact human-readable string.
Definition audit.h:125
Cell wrapping comms::ChangeAuditRecords<typename P::storage_t> (= comms::AuditLog<comms::ChangeAuditR...
Definition audit.h:153
std::string to_string() const override
Render the cell's value as a compact human-readable string.
Definition audit.h:165
Runtime catalog of cell-type descriptors, keyed by wire kind id.
Definition registry.h:115
The shared vocabulary aliases re-exported from commons and the compile-time kind-id machinery.
constexpr std::string_view prefixed_id_v
Convenience alias yielding the joined std::string_view.
Definition common.h:175
The default_cell_for<T> trait that drives FieldsBuilder field-type inference.
#define PARCEL_DEFAULT_CELL(CellT)
Register a cell type as the default wrapper for its payload type.
Definition defaults.h:269
Runtime cell-type descriptors and the schema-graph mix-ins (IHasFields, ISubTypes).
nlohmann::json typedef shared across cell types.
nlohmann::json json_t
Project-wide alias for nlohmann::json.
Definition json.h:19
CRTP base providing default to_json / clone / kind plumbing on top of a storage type.
Definition cell.h:343
static cell_t from_json_strict(json_t const &j)
Strict shorthand for the recurring cell_from_json + make_shared.
Definition cell.h:571
comms::AuditRecord value
Held value of the cell.
Definition cell.h:348