added some more entities for work demo
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef TASK_HPP
|
||||
#define TASK_HPP
|
||||
|
||||
#include "TaskState.hpp"
|
||||
|
||||
#include "../core/Model.hpp"
|
||||
#include "../core/Types.hpp"
|
||||
|
||||
#include "matador/object/object_ptr.hpp"
|
||||
|
||||
#include "matador/utils/base_class.hpp"
|
||||
|
||||
namespace work::models::jobs {
|
||||
struct Task : core::Model {
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::string job_name;
|
||||
TaskState state;
|
||||
matador::object::object_ptr<Payload> payload;
|
||||
JobMode job_mode;
|
||||
core::timestamp start_delay;
|
||||
core::timestamp interval;
|
||||
unsigned long long user_session_id;
|
||||
|
||||
template<typename Operator>
|
||||
void process( Operator& op ) {
|
||||
namespace field = matador::access;
|
||||
field::process( op, *matador::base_class<Model>( this ) );
|
||||
field::attribute( op, "name", name, 511 );
|
||||
field::attribute( op, "description", description, 511 );
|
||||
field::attribute( op, "job_name", job_name, 511 );
|
||||
field::attribute( op, "state", state );
|
||||
field::belongs_to( op, "payload", payload, matador::utils::default_foreign_attributes );
|
||||
field::attribute( op, "job_mode", job_mode );
|
||||
field::attribute( op, "start_delay", start_delay );
|
||||
field::attribute( op, "interval", interval );
|
||||
field::attribute( op, "user_session_id", user_session_id );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //TASK_HPP
|
||||
Reference in New Issue
Block a user