#ifndef USER_HPP #define USER_HPP #include "LockType.hpp" #include "../core/Model.hpp" #include "../core/Types.hpp" #include "matador/object/object_ptr.hpp" #include "matador/utils/base_class.hpp" #include "matador/utils/types.hpp" namespace work::models::admin { struct UserDirectory; struct User : core::Model { std::string name; matador::utils::blob symbol; std::string salt; std::string password; LockType lock_type{LockType::NoLock}; core::timestamp locked_at; std::string lock_reason; std::string role; matador::object::object_ptr user_directory; template void process( Operator& op ) { namespace field = matador::access; field::process( op, *matador::base_class( this ) ); field::attribute( op, "name", name, 511 ); field::attribute( op, "symbol", symbol ); field::attribute( op, "salt", salt, 511 ); field::attribute( op, "password", password, 511 ); field::attribute( op, "lock_type", lock_type ); field::attribute( op, "locked_at", locked_at ); field::attribute( op, "lock_reason", lock_reason, 511 ); field::attribute( op, "role", role, 63 ); field::belongs_to( op, "user_directory", user_directory, matador::utils::default_foreign_attributes ); } }; } #endif //USER_HPP