3#include "../core/ram_payer.hpp"
4#include <eosio/asset.hpp>
5#include <eosio/binary_extension.hpp>
6#include <eosio/crypto.hpp>
7#include <eosio/eosio.hpp>
8#include <eosio/time.hpp>
10#include "../consts.hpp"
11#include "../core/utils.hpp"
43static constexpr uint64_t
SCALE = 1'000'000'000'000ULL;
48 static constexpr eosio::name
ACTIVE =
"active"_n;
49 static constexpr eosio::name
DONE =
"done"_n;
52namespace PropertyStatus {
53 static constexpr eosio::name
CREATED =
"created"_n;
54 static constexpr eosio::name
APPROVED =
"approved"_n;
55 static constexpr eosio::name
AUTHORIZED =
"authorized"_n;
56 static constexpr eosio::name
ACT1 =
"act1"_n;
82 uint64_t
by_branch()
const {
return braname.value; }
85typedef eosio::multi_index<
87 eosio::indexed_by<
"byuserbr"_n, eosio::const_mem_fun<mkt_invagreement, uint128_t, &mkt_invagreement::by_user_branch>>,
88 eosio::indexed_by<
"bybranch"_n, eosio::const_mem_fun<mkt_invagreement, uint64_t, &mkt_invagreement::by_branch>>
119 uint128_t s_join = 0;
121 uint64_t join_seq = 0;
152 int64_t returned_fixed = 0;
153 uint64_t acc_join = 0;
154 uint64_t acc_done = 0;
155 uint64_t join_seq = 0;
164 uint64_t
by_user()
const {
return username.value; }
167 int64_t
units()
const {
return used_money.amount +
property.amount; }
170 int64_t
unused()
const {
return money.amount - used_money.amount; }
175 const bool in_queue = unused() > 0;
185typedef eosio::multi_index<
187 eosio::indexed_by<
"bybranch"_n, eosio::const_mem_fun<mkt_investor, uint64_t, &mkt_investor::by_branch>>,
188 eosio::indexed_by<
"byuser"_n, eosio::const_mem_fun<mkt_investor, uint64_t, &mkt_investor::by_user>>,
189 eosio::indexed_by<
"bybruser"_n, eosio::const_mem_fun<mkt_investor, uint128_t, &mkt_investor::by_branch_user>>,
190 eosio::indexed_by<
"byunused"_n, eosio::const_mem_fun<mkt_investor, uint128_t, &mkt_investor::by_unused>>,
191 eosio::indexed_by<
"bydone"_n, eosio::const_mem_fun<mkt_investor, uint128_t, &mkt_investor::by_done>>
223 uint64_t
by_user()
const {
return username.value; }
226typedef eosio::multi_index<
228 eosio::indexed_by<
"byhash"_n, eosio::const_mem_fun<mkt_invprop, checksum256, &mkt_invprop::by_hash>>,
229 eosio::indexed_by<
"bybranch"_n, eosio::const_mem_fun<mkt_invprop, uint64_t, &mkt_invprop::by_branch>>,
230 eosio::indexed_by<
"byuser"_n, eosio::const_mem_fun<mkt_invprop, uint64_t, &mkt_invprop::by_user>>
contract
Definition: eosio.msig_tests.cpp:977
static constexpr eosio::name ACT1
акт подписан вносящим
Definition: table_marketplace_invest.hpp:56
static constexpr eosio::name AUTHORIZED
совет принял решение о приёме
Definition: table_marketplace_invest.hpp:55
static constexpr eosio::name CREATED
заявление подано
Definition: table_marketplace_invest.hpp:53
static constexpr eosio::name APPROVED
председатель участка одобрил, вопрос на повестке совета
Definition: table_marketplace_invest.hpp:54
static constexpr eosio::name DONE
использованное возвращено, неиспользованное доступно к заявлению
Definition: table_marketplace_invest.hpp:49
static constexpr eosio::name ACTIVE
паевой взнос возвращается из экономии участка
Definition: table_marketplace_invest.hpp:48
Definition: invest.hpp:23
static constexpr uint64_t SCALE
Точность счётчика возврата: возвращено на единицу базы × SCALE.
Definition: table_marketplace_invest.hpp:43
static constexpr uint64_t OUT_OF_RANGE
Ключ индекса для строк вне выборки (нет неиспользованных денег / вне базы).
Definition: table_marketplace_invest.hpp:45
Definition: eosio.msig.hpp:34
Definition: document_core.hpp:27
Договор об участии в хозяйственной деятельности кооперативного участка (registry 1118)....
Definition: table_marketplace_invest.hpp:72
uint128_t by_user_branch() const
Пайщик и участок — один договор на пару.
Definition: table_marketplace_invest.hpp:81
uint64_t by_branch() const
Definition: table_marketplace_invest.hpp:82
eosio::name braname
кооперативный участок договора
Definition: table_marketplace_invest.hpp:75
document2 agreement
подписанный договор
Definition: table_marketplace_invest.hpp:77
eosio::name username
пайщик
Definition: table_marketplace_invest.hpp:74
eosio::time_point_sec signed_at
время подписи
Definition: table_marketplace_invest.hpp:76
uint64_t primary_key() const
Definition: table_marketplace_invest.hpp:79
uint64_t id
первичный ключ
Definition: table_marketplace_invest.hpp:73
Паевые взносы инициаторов одного кооперативного участка и счётчик возврата (CRPS)....
Definition: table_marketplace_invest.hpp:108
eosio::binary_extension< int64_t > base_money
Definition: table_marketplace_invest.hpp:126
eosio::asset reserved
выделено в пул под расходы и помощь и ещё не израсходовано
Definition: table_marketplace_invest.hpp:113
eosio::asset unused_total
деньги инициаторов, ещё не израсходованные из пула и не забранные заявлением
Definition: table_marketplace_invest.hpp:112
eosio::asset surplus_total
переплата на границе завершения возврата, переданная на w.brn.common
Definition: table_marketplace_invest.hpp:116
eosio::name braname
кооперативный участок (первичный ключ)
Definition: table_marketplace_invest.hpp:109
eosio::asset money_total
внесено деньгами по строкам инициаторов участка (за вычетом забранного неиспользованного)
Definition: table_marketplace_invest.hpp:110
int64_t base_money_or_zero() const
Definition: table_marketplace_invest.hpp:129
eosio::asset property_total
внесено имуществом по цене приёма
Definition: table_marketplace_invest.hpp:111
eosio::asset repaid_total
возмещено из экономии участка на w.mkt.repay всего
Definition: table_marketplace_invest.hpp:115
uint64_t primary_key() const
Definition: table_marketplace_invest.hpp:128
eosio::asset spent_total
оплачено из пула всего
Definition: table_marketplace_invest.hpp:114
Инициатор кооперативного участка: одна строка на пару «участок — пайщик».
Definition: table_marketplace_invest.hpp:143
uint64_t by_branch() const
Definition: table_marketplace_invest.hpp:163
eosio::asset used_money
из денег израсходовано пулом участка
Definition: table_marketplace_invest.hpp:150
eosio::asset money
внесено деньгами (за вычетом забранного неиспользованного)
Definition: table_marketplace_invest.hpp:148
eosio::time_point_sec joined_at
Definition: table_marketplace_invest.hpp:156
eosio::asset claimed
забрано из возвращённого заявлениями (без неиспользованного)
Definition: table_marketplace_invest.hpp:151
eosio::name braname
кооперативный участок
Definition: table_marketplace_invest.hpp:145
uint128_t by_branch_user() const
Definition: table_marketplace_invest.hpp:165
uint128_t by_unused() const
Definition: table_marketplace_invest.hpp:174
eosio::name status
active | done (done с нулевым остатком — возмещено полностью)
Definition: table_marketplace_invest.hpp:147
eosio::asset property
внесено имуществом по цене приёма
Definition: table_marketplace_invest.hpp:149
uint64_t primary_key() const
Definition: table_marketplace_invest.hpp:162
uint64_t by_user() const
Definition: table_marketplace_invest.hpp:164
eosio::binary_extension< eosio::asset > money_in
Definition: table_marketplace_invest.hpp:160
int64_t units() const
Definition: table_marketplace_invest.hpp:167
eosio::name username
пайщик-инициатор
Definition: table_marketplace_invest.hpp:146
int64_t unused() const
Definition: table_marketplace_invest.hpp:170
uint128_t by_done() const
Очередь завершения: активные в базе по счётчику полного возврата.
Definition: table_marketplace_invest.hpp:179
uint64_t id
суррогатный ключ
Definition: table_marketplace_invest.hpp:144
eosio::asset money_in_or_current() const
Внесено деньгами всего; у строки прежней сборки — текущий остаток денег.
Definition: table_marketplace_invest.hpp:169
Заявление инициатора о паевом взносе имуществом в кооперативный участок (registry 1120) до второй под...
Definition: table_marketplace_invest.hpp:206
eosio::name username
вносящий пайщик
Definition: table_marketplace_invest.hpp:210
document2 approved_statement
то же заявление с подписью председателя участка
Definition: table_marketplace_invest.hpp:215
document2 act
акт приёма-передачи 1122
Definition: table_marketplace_invest.hpp:217
uint64_t by_user() const
Definition: table_marketplace_invest.hpp:223
std::string description
наименование, описание, количество
Definition: table_marketplace_invest.hpp:213
eosio::asset amount
цена приёма, названная вносящим
Definition: table_marketplace_invest.hpp:212
eosio::name status
created | approved | authorized | act1
Definition: table_marketplace_invest.hpp:211
uint64_t primary_key() const
Definition: table_marketplace_invest.hpp:220
uint64_t by_branch() const
Definition: table_marketplace_invest.hpp:222
eosio::time_point_sec created_at
время подачи
Definition: table_marketplace_invest.hpp:218
checksum256 by_hash() const
Definition: table_marketplace_invest.hpp:221
checksum256 hash
хэш паевого взноса имуществом (процесс p.mkt.invest)
Definition: table_marketplace_invest.hpp:208
document2 decision
протокол решения совета 1121
Definition: table_marketplace_invest.hpp:216
eosio::name braname
кооперативный участок
Definition: table_marketplace_invest.hpp:209
uint64_t id
суррогатный ключ
Definition: table_marketplace_invest.hpp:207
document2 statement
заявление 1120, подпись вносящего
Definition: table_marketplace_invest.hpp:214
eosio::multi_index<"invbranches"_n, mkt_invbranch > mkt_invbranches_index
Definition: table_marketplace_invest.hpp:132
RAM_PAYER_CLASS(mkt_invagreement, contract)
eosio::multi_index< "invprops"_n, mkt_invprop, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< mkt_invprop, checksum256, &mkt_invprop::by_hash > >, eosio::indexed_by<"bybranch"_n, eosio::const_mem_fun< mkt_invprop, uint64_t, &mkt_invprop::by_branch > >, eosio::indexed_by<"byuser"_n, eosio::const_mem_fun< mkt_invprop, uint64_t, &mkt_invprop::by_user > > > mkt_invprops_index
Definition: table_marketplace_invest.hpp:231
eosio::multi_index< "invagrbranch"_n, mkt_invagreement, eosio::indexed_by<"byuserbr"_n, eosio::const_mem_fun< mkt_invagreement, uint128_t, &mkt_invagreement::by_user_branch > >, eosio::indexed_by<"bybranch"_n, eosio::const_mem_fun< mkt_invagreement, uint64_t, &mkt_invagreement::by_branch > > > mkt_invagreements_index
Definition: table_marketplace_invest.hpp:89
eosio::multi_index< "investors"_n, mkt_investor, eosio::indexed_by<"bybranch"_n, eosio::const_mem_fun< mkt_investor, uint64_t, &mkt_investor::by_branch > >, eosio::indexed_by<"byuser"_n, eosio::const_mem_fun< mkt_investor, uint64_t, &mkt_investor::by_user > >, eosio::indexed_by<"bybruser"_n, eosio::const_mem_fun< mkt_investor, uint128_t, &mkt_investor::by_branch_user > >, eosio::indexed_by<"byunused"_n, eosio::const_mem_fun< mkt_investor, uint128_t, &mkt_investor::by_unused > >, eosio::indexed_by<"bydone"_n, eosio::const_mem_fun< mkt_investor, uint128_t, &mkt_investor::by_done > > > mkt_investors_index
Definition: table_marketplace_invest.hpp:192
static uint128_t combine_ids(const uint64_t &x, const uint64_t &y)
Definition: utils.hpp:7