COOPENOMICS  v1
Кооперативная Экономика
table_draft_drafts.hpp
См. документацию.
1#pragma once
2
3
4#include "../core/ram_payer.hpp"
5#include <eosio/contract.hpp>
6#include <eosio/crypto.hpp>
7#include <eosio/eosio.hpp>
8#include <eosio/system.hpp>
9
10#include "../consts.hpp"
11#include "../core/utils.hpp"
12#include "document_core.hpp"
13
20struct [[eosio::table, eosio::contract(DRAFT)]] onedraft {
21 uint64_t registry_id;
22 uint64_t version;
24 std::string title;
25 std::string description;
26 std::string context;
27 std::string model;
28
29 uint64_t primary_key() const { return registry_id; }
30};
31
32typedef eosio::multi_index<"drafts"_n, onedraft> drafts_index;
33
34onedraft get_scoped_draft_by_registry_or_fail(eosio::name scope, uint64_t draft_id) {
35 drafts_index drafts(_draft, scope.value);
36 auto draft = drafts.find(draft_id);
37
38 eosio::check(draft != drafts.end(), "Шаблон документа не найден");
39
40 return *draft;
41}
42
43// Плательщик за оперативную память строк таблицы — правило в lib/core/ram_payer.hpp.
Константы контракта шаблонов документов
Definition: draft.hpp:45
static constexpr eosio::name _draft
Definition: consts.hpp:175
contract
Definition: eosio.msig_tests.cpp:977
Definition: eosio.msig.hpp:34
Definition: table_draft_drafts.hpp:20
std::string context
Definition: table_draft_drafts.hpp:26
uint64_t registry_id
Definition: table_draft_drafts.hpp:21
std::string model
Definition: table_draft_drafts.hpp:27
uint64_t version
Definition: table_draft_drafts.hpp:22
uint64_t default_translation_id
Definition: table_draft_drafts.hpp:23
std::string description
Definition: table_draft_drafts.hpp:25
std::string title
Definition: table_draft_drafts.hpp:24
uint64_t primary_key() const
Definition: table_draft_drafts.hpp:29
eosio::multi_index<"drafts"_n, onedraft > drafts_index
Definition: table_draft_drafts.hpp:32
RAM_PAYER_CLASS(onedraft, system)
onedraft get_scoped_draft_by_registry_or_fail(eosio::name scope, uint64_t draft_id)
Definition: table_draft_drafts.hpp:34