COOPENOMICS  v1
Кооперативная Экономика
table_branch_trustreqs.hpp
См. документацию.
1#pragma once
2
3#include <eosio/eosio.hpp>
4
5#include "../consts.hpp"
6#include "document_core.hpp"
7
21struct [[eosio::table, eosio::contract(BRANCH)]] trustreq {
22 uint64_t id;
23 eosio::checksum256 hash;
24 eosio::name coopname;
25 eosio::name braname;
26 eosio::name username;
29
30 uint64_t primary_key() const { return id; }
31 eosio::checksum256 by_hash() const { return hash; }
32};
33
34typedef eosio::multi_index<
35 "trustreqs"_n, trustreq,
36 eosio::indexed_by<"byhash"_n, eosio::const_mem_fun<trustreq, eosio::checksum256, &trustreq::by_hash>>>
38
39inline trustreq get_trustreq_or_fail(eosio::name coopname, eosio::checksum256 hash) {
40 trustreq_index trustreqs(_branch, coopname.value);
41 auto idx = trustreqs.get_index<"byhash"_n>();
42 auto itr = idx.find(hash);
43 eosio::check(itr != idx.end(), "Заявка доверенного не найдена");
44 return *itr;
45}
static constexpr eosio::name _branch
Definition: consts.hpp:176
contract
Definition: eosio.msig_tests.cpp:977
Definition: eosio.msig.hpp:34
Definition: document_core.hpp:27
Definition: table_branch_trustreqs.hpp:21
document2 application
Договор о полной материальной ответственности доверенного лица (подписан заявителем)
Definition: table_branch_trustreqs.hpp:27
eosio::name username
Заявитель
Definition: table_branch_trustreqs.hpp:26
uint64_t id
Идентификатор заявки
Definition: table_branch_trustreqs.hpp:22
document2 authority
Доверенность доверенному лицу/оператору участка (подписана заявителем, ждёт встречной подписи председ...
Definition: table_branch_trustreqs.hpp:28
eosio::name coopname
Имя кооператива
Definition: table_branch_trustreqs.hpp:24
eosio::checksum256 hash
Внешний идентификатор заявки
Definition: table_branch_trustreqs.hpp:23
uint64_t primary_key() const
Definition: table_branch_trustreqs.hpp:30
eosio::name braname
Кооперативный участок
Definition: table_branch_trustreqs.hpp:25
eosio::checksum256 by_hash() const
Definition: table_branch_trustreqs.hpp:31
eosio::multi_index< "trustreqs"_n, trustreq, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< trustreq, eosio::checksum256, &trustreq::by_hash > > > trustreq_index
Definition: table_branch_trustreqs.hpp:37
trustreq get_trustreq_or_fail(eosio::name coopname, eosio::checksum256 hash)
Definition: table_branch_trustreqs.hpp:39