COOPENOMICS  v1
Кооперативная Экономика
table_loan_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
9namespace Loan {
10
11using namespace eosio;
12
13struct [[eosio::table, eosio::contract(LOAN)]] debt {
14 uint64_t id;
17 checksum256 debt_hash;
18 asset amount;
19 time_point_sec created_at;
20 time_point_sec repaid_at;
21
22 uint64_t primary_key() const { return id; }
23 uint64_t by_username() const { return username.value; }
24 checksum256 by_debt_hash() const { return debt_hash; }
25 uint64_t by_created() const { return created_at.sec_since_epoch(); }
26 uint64_t by_repaid() const { return repaid_at.sec_since_epoch(); }
27};
28
29typedef multi_index<
30 "debts"_n, debt,
31 indexed_by<"byusername"_n, const_mem_fun<debt, uint64_t, &debt::by_username>>,
32 indexed_by<"bydebthash"_n, const_mem_fun<debt, checksum256, &debt::by_debt_hash>>,
33 indexed_by<"bycreated"_n, const_mem_fun<debt, uint64_t, &debt::by_created>>,
34 indexed_by<"byrepaid"_n, const_mem_fun<debt, uint64_t, &debt::by_repaid>>>
36
37} // namespace Loan
contract
Definition: eosio.msig_tests.cpp:977
Definition: loan.hpp:21
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<"bycreated"_n, const_mem_fun< debt, uint64_t, &debt::by_created > >, indexed_by<"byrepaid"_n, const_mem_fun< debt, uint64_t, &debt::by_repaid > > > debts_index
Definition: table_loan_debts.hpp:35
Definition: eosio.msig.hpp:34
Definition: table_loan_debts.hpp:13
checksum256 debt_hash
Definition: table_loan_debts.hpp:17
asset amount
Definition: table_loan_debts.hpp:18
name coopname
Definition: table_loan_debts.hpp:15
uint64_t by_username() const
Definition: table_loan_debts.hpp:23
uint64_t by_created() const
Definition: table_loan_debts.hpp:25
checksum256 by_debt_hash() const
Definition: table_loan_debts.hpp:24
time_point_sec repaid_at
Definition: table_loan_debts.hpp:20
uint64_t primary_key() const
Definition: table_loan_debts.hpp:22
name username
Definition: table_loan_debts.hpp:16
time_point_sec created_at
Definition: table_loan_debts.hpp:19
uint64_t by_repaid() const
Definition: table_loan_debts.hpp:26
uint64_t id
Definition: table_loan_debts.hpp:14
Definition: table_capital_debts.hpp:12