#ifndef GRADIDO_LOGIN_SERVER_CONTROLLER_HEDERA_ACCOUNT_INCLUDE #define GRADIDO_LOGIN_SERVER_CONTROLLER_HEDERA_ACCOUNT_INCLUDE #include "HederaId.h" #include "User.h" #include "../model/table/HederaAccount.h" #include "Poco/SharedPtr.h" #include "TableControllerBase.h" namespace controller { class HederaAccount : public TableControllerBase { public: ~HederaAccount(); static Poco::AutoPtr create(int user_id, int account_hedera_id, int account_key_id, Poco::UInt64 balance = 0, model::table::HederaNetworkType type = model::table::HEDERA_MAINNET); static std::vector> load(const std::string& fieldName, int fieldValue); static std::vector> listAll(); inline bool deleteFromDB() { return mDBModel->deleteFromDB(); } inline Poco::AutoPtr getModel() { return _getModel(); } inline void setHederaId(Poco::AutoPtr hederaId) { mHederaID = hederaId; } inline Poco::AutoPtr getHederaId() { return mHederaID; } bool updateBalanceFromHedera(Poco::AutoPtr user); protected: HederaAccount(model::table::HederaAccount* dbModel); Poco::AutoPtr mHederaID; }; } #endif //GRADIDO_LOGIN_SERVER_CONTROLLER_HEDERA_ACCOUNT_INCLUDE