35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
#ifndef USER_SESSION_HPP
|
|
#define USER_SESSION_HPP
|
|
|
|
#include "CollectionCenter.hpp"
|
|
#include "Scenario.hpp"
|
|
#include "User.hpp"
|
|
|
|
#include "../core/Model.hpp"
|
|
#include "../core/Types.hpp"
|
|
|
|
#include "matador/object/object_ptr.hpp""
|
|
|
|
#include "matador/utils/base_class.hpp"
|
|
|
|
namespace work::models::admin {
|
|
struct UserSession : core::Model {
|
|
matador::object::object_ptr<User> user;
|
|
matador::object::object_ptr<Scenario> scenario;
|
|
matador::object::object_ptr<CollectionCenter> collection_center;
|
|
core::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::attribute( op, "offline_since", offline_since );
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //USER_SESSION_HPP
|