#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 "../model/hedera/TransactionBody.h" #include "Poco/SharedPtr.h" #include "TableControllerBase.h" #include "CryptoKey.h" namespace controller { class HederaAccount : public TableControllerBase, public NotificationList { public: ~HederaAccount(); static Poco::AutoPtr create(int user_id, int account_hedera_id, int account_key_id, Poco::UInt64 balance = 0, ServerConfig::HederaNetworkType type = ServerConfig::HEDERA_MAINNET); static std::vector> load(const std::string& fieldName, int fieldValue); static Poco::AutoPtr load(int id); static Poco::AutoPtr load(Poco::AutoPtr hederaId); static std::vector> listAll(); //! \brief for picking a account for paying transaction, mostly consensusSendMessage static Poco::AutoPtr pick(ServerConfig::HederaNetworkType networkType, bool encrypted = false, int user_id = 0); inline bool deleteFromDB() { return mDBModel->deleteFromDB(); } std::string toShortSelectOptionName(); inline Poco::AutoPtr getModel() { return _getModel(); } inline const model::table::HederaAccount* getModel() const { return _getModel(); } inline void setHederaId(Poco::AutoPtr hederaId) { mHederaID = hederaId; } Poco::AutoPtr getHederaId(); Poco::AutoPtr getCryptoKey() const; bool hederaAccountGetBalance(Poco::AutoPtr user); bool hederaAccountCreate(int autoRenewPeriodSeconds, double initialBalance); bool changeEncryption(Poco::AutoPtr user); //! \brief create Transaction body with this hedera account as operator std::unique_ptr createTransactionBody(); protected: HederaAccount(model::table::HederaAccount* dbModel); Poco::AutoPtr mHederaID; }; } #endif //GRADIDO_LOGIN_SERVER_CONTROLLER_HEDERA_ACCOUNT_INCLUDE