COOPENOMICS  v1
Кооперативная Экономика
table_loan_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
11namespace Loan {
12
13using namespace eosio;
14
15struct [[eosio::table, eosio::contract(LOAN)]] debt {
16 uint64_t id;
19 checksum256 debt_hash;
20 asset amount;
21 time_point_sec created_at;
22 time_point_sec repaid_at;
23
24 uint64_t primary_key() const { return id; }
25 uint64_t by_username() const { return username.value; }
26 checksum256 by_debt_hash() const { return debt_hash; }
27 uint64_t by_created() const { return created_at.sec_since_epoch(); }
28 uint64_t by_repaid() const { return repaid_at.sec_since_epoch(); }
29};
30
31typedef multi_index<
32 "debts"_n, debt,
33 indexed_by<"byusername"_n, const_mem_fun<debt, uint64_t, &debt::by_username>>,
34 indexed_by<"bydebthash"_n, const_mem_fun<debt, checksum256, &debt::by_debt_hash>>,
35 indexed_by<"bycreated"_n, const_mem_fun<debt, uint64_t, &debt::by_created>>,
36 indexed_by<"byrepaid"_n, const_mem_fun<debt, uint64_t, &debt::by_repaid>>>
38
39} // namespace Loan
40
41// Плательщик за оперативную память строк таблицы — правило в lib/core/ram_payer.hpp.
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:37
Definition: eosio.msig.hpp:34
Definition: table_loan_debts.hpp:15
checksum256 debt_hash
Definition: table_loan_debts.hpp:19
asset amount
Definition: table_loan_debts.hpp:20
name coopname
Definition: table_loan_debts.hpp:17
uint64_t by_username() const
Definition: table_loan_debts.hpp:25
uint64_t by_created() const
Definition: table_loan_debts.hpp:27
checksum256 by_debt_hash() const
Definition: table_loan_debts.hpp:26
time_point_sec repaid_at
Definition: table_loan_debts.hpp:22
uint64_t primary_key() const
Definition: table_loan_debts.hpp:24
name username
Definition: table_loan_debts.hpp:18
time_point_sec created_at
Definition: table_loan_debts.hpp:21
uint64_t by_repaid() const
Definition: table_loan_debts.hpp:28
uint64_t id
Definition: table_loan_debts.hpp:16
Definition: table_registrator_orgs.hpp:17
Definition: table_capital_debts.hpp:14
RAM_PAYER_CLASS(Loan::debt, cooperative)