4#include "../core/ram_payer.hpp"
7#include <eosio/asset.hpp>
8#include <eosio/binary_extension.hpp>
9#include <eosio/eosio.hpp>
11#include "../consts.hpp"
26 bool is_initial =
true;
27 bool is_minimum =
true;
30 eosio::binary_extension<eosio::name>
type;
31 eosio::binary_extension<eosio::name>
braname;
38 uint64_t
bylastpay()
const {
return last_min_pay.sec_since_epoch(); }
42 bool is_active()
const {
return status ==
"accepted"_n; }
44 uint64_t
by_braname()
const {
return braname.has_value() ? braname->value : 0; }
47typedef eosio::multi_index<
49 eosio::indexed_by<
"bylastpay"_n, eosio::const_mem_fun<participant, uint64_t, &participant::bylastpay>>,
50 eosio::indexed_by<
"createdat"_n, eosio::const_mem_fun<participant, uint64_t, &participant::by_created_at>>,
51 eosio::indexed_by<
"bybranch"_n, eosio::const_mem_fun<participant, uint64_t, &participant::by_braname>>>
59 auto it = participants.find(username.value);
60 if (it == participants.end() || !it->braname.has_value())
return std::nullopt;
61 const eosio::name braname = it->braname.value();
62 if (braname == eosio::name{})
return std::nullopt;
static constexpr eosio::name _soviet
Definition: consts.hpp:177
contract
Definition: eosio.msig_tests.cpp:977
Definition: eosio.msig.hpp:34
Definition: table_soviet_participants.hpp:18
eosio::binary_extension< eosio::name > braname
Definition: table_soviet_participants.hpp:31
uint64_t bylastpay() const
Definition: table_soviet_participants.hpp:38
uint64_t by_braname() const
Definition: table_soviet_participants.hpp:44
eosio::name username
Definition: table_soviet_participants.hpp:19
eosio::binary_extension< eosio::name > type
Definition: table_soviet_participants.hpp:30
eosio::binary_extension< eosio::asset > minimum_amount
Definition: table_soviet_participants.hpp:34
eosio::time_point_sec created_at
Definition: table_soviet_participants.hpp:20
eosio::name status
Definition: table_soviet_participants.hpp:24
uint64_t primary_key() const
Definition: table_soviet_participants.hpp:36
eosio::time_point_sec last_update
Definition: table_soviet_participants.hpp:21
eosio::binary_extension< eosio::asset > initial_amount
Definition: table_soviet_participants.hpp:33
eosio::time_point_sec last_min_pay
Definition: table_soviet_participants.hpp:22
uint64_t by_created_at() const
Definition: table_soviet_participants.hpp:40
bool is_active() const
Definition: table_soviet_participants.hpp:42
RAM_PAYER_CLASS(participant, contract)
std::optional< eosio::name > get_participant_branch(eosio::name coopname, eosio::name username)
Definition: table_soviet_participants.hpp:57
eosio::multi_index< "participants"_n, participant, eosio::indexed_by<"bylastpay"_n, eosio::const_mem_fun< participant, uint64_t, &participant::bylastpay > >, eosio::indexed_by<"createdat"_n, eosio::const_mem_fun< participant, uint64_t, &participant::by_created_at > >, eosio::indexed_by<"bybranch"_n, eosio::const_mem_fun< participant, uint64_t, &participant::by_braname > > > participants_index
Definition: table_soviet_participants.hpp:52