adjust work project to the current codebase

This commit is contained in:
2026-01-07 09:09:44 +01:00
parent dfd31cdf35
commit 41f6c9f516
14 changed files with 73 additions and 79 deletions
+6 -6
View File
@@ -6,26 +6,26 @@
#include "User.hpp"
#include "../core/Model.hpp"
#include "../core/Types.hpp"
#include "matador/object/object_ptr.hpp"
#include "matador/utils/base_class.hpp"
#include "matador/utils/foreign_attributes.hpp"
namespace work::models::admin {
struct UserSession : core::Model {
matador::object::object_ptr<User> user;
matador::object::object_ptr<User> client;
matador::object::object_ptr<Scenario> scenario;
matador::object::object_ptr<CollectionCenter> collection_center;
core::timestamp offline_since;
matador::utils::timestamp offline_since;
template<typename Operator>
void process( Operator& op ) {
namespace field = matador::access;
field::process( op, *matador::base_class<Model>( this ) );
field::belongs_to( op, "user", user, matador::utils::default_foreign_attributes );
field::belongs_to( op, "scenario", scenario, matador::utils::default_foreign_attributes );
field::belongs_to( op, "collection_center", collection_center, matador::utils::default_foreign_attributes );
field::belongs_to( op, "client", client, matador::utils::CascadeAllFetchLazy );
field::belongs_to( op, "scenario", scenario, matador::utils::CascadeAllFetchLazy );
field::belongs_to( op, "collection_center", collection_center, matador::utils::CascadeAllFetchLazy );
field::attribute( op, "offline_since", offline_since );
}
};