21 #include "core/audit/UpdateEvent_odb.h" 35 ASSERT_LOG(database,
"Database cannot be null.");
36 ASSERT_LOG(target_update,
"Target update must be non null.");
37 ASSERT_LOG(target_update->id(),
"Target update must be already persisted.");
38 ASSERT_LOG(parent,
"Parent must be non null.");
39 ASSERT_LOG(parent->id(),
"Parent must be already persisted.");
45 audit->target(target_update);
46 database->persist(audit);
48 audit->set_parent(parent);
49 database->update(audit);
79 ss <<
"Update " <<
target_id() <<
" has been created.";
83 ss <<
"Update " <<
target_id() <<
" has been acknowledged.";
87 ss <<
"Update " <<
target_id() <<
" has been cancelled.";
This is the header file for a generated source file, GitSHA1.cpp.
std::shared_ptr< Update > UpdatePtr
An optional transaction is an object that behave like an odb::transaction if there is no currently ac...
std::shared_ptr< IUpdate > IUpdatePtr
std::string generate_description() const override
Generate a description for this event.
std::shared_ptr< AuditEntry > AuditEntryPtr
static std::shared_ptr< UpdateEvent > create_empty()
update::UpdateLWPtr target_
#define ASSERT_LOG(cond, msg)
void target(update::IUpdatePtr u) override
Set the update that is targeted by the event.
std::shared_ptr< UpdateEvent > UpdateEventPtr
update::UpdateId target_id() const override
Retrieve the user_id that was targeted by this event.
static std::shared_ptr< UpdateEvent > create(const DBPtr &database, update::IUpdatePtr target_update, AuditEntryPtr parent)
std::shared_ptr< odb::database > DBPtr
std::enable_if_t< is_shared_ptr_v< Out >, Out > assert_cast(const std::shared_ptr< In > &in)
void database(DBPtr db)
Set the database pointer.