4#include "../core/ram_payer.hpp"
5#include <eosio/eosio.hpp>
7#include "../consts.hpp"
25 auto st = stat.find(coopname.value);
27 uint64_t new_count = 0;
29 if (st == stat.end()) {
31 stat.emplace(
RamPayer::of(stat, coopname), [&](
auto &s) {
32 s.coopname = coopname;
36 new_count = st->count + 1;
37 stat.modify(st,
RamPayer::of(stat, coopname), [&](
auto &s) { s.count += 1; });
45 auto st = stat.find(coopname.value);
46 uint64_t new_count = 0;
48 eosio::check(st != stat.end(),
"Нет кооперативных участков");
49 eosio::check(st->count > 0,
"Системная ошибка");
51 new_count = st->count - 1;
53 stat.modify(st,
RamPayer::of(stat, coopname), [&](
auto &s) { s.count -= 1; });
static constexpr eosio::name _branch
Definition: consts.hpp:181
contract
Definition: eosio.msig_tests.cpp:977
eosio::name of(const Table &table, eosio::name coopname)
Definition: ram_payer.hpp:78
Definition: eosio.msig.hpp:34
Definition: table_branch_branchstat.hpp:14
uint64_t count
Definition: table_branch_branchstat.hpp:16
uint64_t primary_key() const
Definition: table_branch_branchstat.hpp:18
eosio::name coopname
Definition: table_branch_branchstat.hpp:15
eosio::multi_index<"branchstat"_n, branchstat > branchstat_index
Definition: table_branch_branchstat.hpp:21
uint64_t add_branch_count(eosio::name coopname)
Definition: table_branch_branchstat.hpp:23
RAM_PAYER_CLASS(branchstat, contract)
uint64_t sub_branch_count(eosio::name coopname)
Definition: table_branch_branchstat.hpp:43