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