Add user entity

This commit is contained in:
Andrew nuark G 2020-12-15 17:07:03 +07:00
parent 4f1b0346c6
commit 8f71fb50a3
3 changed files with 54 additions and 0 deletions

31
entities/user_entity.h Normal file
View file

@ -0,0 +1,31 @@
#ifndef USER_ENTITY_H
#define USER_ENTITY_H
#include <QString>
#include <QCryptographicHash>
enum class UserRole {
ADMINISTRATOR, DISPATCHER, SKIPPER
};
class user_entity
{
private:
unsigned long long _id;
QString _login;
UserRole _role;
QByteArray _pwd_hash;
public:
user_entity() = default;
user_entity(const QString &login, const QString &password, UserRole role);
unsigned long long id();
const QString login();
UserRole role();
bool verify_password(const QString &password);
};
#endif // USER_ENTITY_H