COOPENOMICS  v1
Кооперативная Экономика
table_capital_debts.hpp
См. документацию.
1#pragma once
2
3
4#include "../core/ram_payer.hpp"
5#include <eosio/asset.hpp>
6#include <eosio/crypto.hpp>
7#include <eosio/eosio.hpp>
8
9#include "../consts.hpp"
10#include "document_core.hpp"
11
12using namespace eosio;
13
14struct [[eosio::table, eosio::contract(CAPITAL)]] debt {
15 uint64_t id;
16 eosio::name coopname;
17 eosio::name username;
18 eosio::name status = "created"_n;
19 checksum256 debt_hash;
20 checksum256 project_hash;
21 time_point_sec repaid_at;
22 asset amount;
26 std::string memo;
27
28 uint64_t primary_key() const { return id; }
29
30 uint64_t by_username() const { return username.value; }
31 checksum256 by_debt_hash() const { return debt_hash; }
32 checksum256 by_project_hash() const { return project_hash; }
33};
34
35typedef eosio::multi_index<
36 "debts"_n, debt,
37 indexed_by<"byusername"_n, const_mem_fun<debt, uint64_t, &debt::by_username>>,
38 indexed_by<"bydebthash"_n, const_mem_fun<debt, checksum256, &debt::by_debt_hash>>,
39 indexed_by<"byprojhash"_n, const_mem_fun<debt, checksum256, &debt::by_project_hash>>>
41
42// Плательщик за оперативную память строк таблицы — правило в lib/core/ram_payer.hpp.
contract
Definition: eosio.msig_tests.cpp:977
Definition: eosio.msig.hpp:34
Definition: table_registrator_orgs.hpp:17
Definition: table_capital_debts.hpp:14
checksum256 by_project_hash() const
Definition: table_capital_debts.hpp:32
uint64_t by_username() const
Definition: table_capital_debts.hpp:30
eosio::name coopname
Definition: table_capital_debts.hpp:16
time_point_sec repaid_at
Definition: table_capital_debts.hpp:21
checksum256 project_hash
Definition: table_capital_debts.hpp:20
uint64_t id
Definition: table_capital_debts.hpp:15
std::string memo
Definition: table_capital_debts.hpp:26
document2 approved_statement
Definition: table_capital_debts.hpp:24
checksum256 by_debt_hash() const
Definition: table_capital_debts.hpp:31
eosio::name username
Definition: table_capital_debts.hpp:17
document2 statement
Definition: table_capital_debts.hpp:23
uint64_t primary_key() const
Definition: table_capital_debts.hpp:28
asset amount
Definition: table_capital_debts.hpp:22
document2 authorization
Definition: table_capital_debts.hpp:25
checksum256 debt_hash
Definition: table_capital_debts.hpp:19
Definition: document_core.hpp:27
RAM_PAYER_CLASS(debt, cooperative)
eosio::multi_index< "debts"_n, debt, indexed_by<"byusername"_n, const_mem_fun< debt, uint64_t, &debt::by_username > >, indexed_by<"bydebthash"_n, const_mem_fun< debt, checksum256, &debt::by_debt_hash > >, indexed_by<"byprojhash"_n, const_mem_fun< debt, checksum256, &debt::by_project_hash > > > debts_index
Definition: table_capital_debts.hpp:40