COOPENOMICS  v1
Кооперативная Экономика
registrator_account_access.hpp
См. документацию.
1#pragma once
2
3#include <eosio/eosio.hpp>
4
5#include "../consts.hpp"
7
8account get_account_or_fail(eosio::name username) {
10 auto account_row = accounts.find(username.value);
11 eosio::check(account_row != accounts.end(), "Аккаунт не найден");
12
13 return *account_row;
14}
15
16// Возврат аккаунта к состоянию «можно подать заявку заново»: снимаем карточку
17// участника (type) и сторейджи, которые проставил reguser. Сам аккаунт (username,
18// ключи) сохраняется — повторная подача идёт на том же аккаунте. Вызывается при
19// терминальном закрытии кандидата (отказ совета + возврат взноса): после этого
20// reguser снова проходит проверку type=="" и принимает новое заявление.
21inline void reset_account_card(eosio::name username) {
23 auto account_row = accounts.find(username.value);
24 if (account_row == accounts.end()) return;
25 accounts.modify(account_row, _registrator, [&](auto &a) {
26 a.type = ""_n;
27 a.storages.clear();
28 });
29}
static constexpr eosio::name _registrator
Definition: consts.hpp:173
account get_account_or_fail(eosio::name username)
Definition: registrator_account_access.hpp:8
void reset_account_card(eosio::name username)
Definition: registrator_account_access.hpp:21
Definition: table_registrator_accounts.hpp:14
eosio::multi_index< "accounts"_n, account, eosio::indexed_by<"byreferer"_n, eosio::const_mem_fun< account, uint64_t, &account::by_referer > >, eosio::indexed_by<"bytype"_n, eosio::const_mem_fun< account, uint64_t, &account::by_type > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< account, uint64_t, &account::by_status > >, eosio::indexed_by<"byregistr"_n, eosio::const_mem_fun< account, uint64_t, &account::by_registr > >, eosio::indexed_by<"byregistred"_n, eosio::const_mem_fun< account, uint64_t, &account::by_registered_at > >, eosio::indexed_by<"byverif"_n, eosio::const_mem_fun< account, uint64_t, &account::is_verified_index > > > accounts_index
Definition: table_registrator_accounts.hpp:68