COOPENOMICS  v1
Кооперативная Экономика
table_soviet_programs.hpp
См. документацию.
1#pragma once
2
3#include <eosio/asset.hpp>
4#include <eosio/binary_extension.hpp>
5#include <eosio/eosio.hpp>
6#include <string>
7
8#include "../consts.hpp"
9
15struct [[eosio::table, eosio::contract(SOVIET)]] program {
16 uint64_t id;
17 uint64_t draft_id;
18 eosio::name program_type;
19
20 eosio::name coopname;
22 std::string title;
23 std::string announce;
24 std::string description;
25 std::string preview;
26 std::string images;
27 std::string meta;
28
29 eosio::name calculation_type;
32
33 eosio::time_point_sec start_at;
34 eosio::time_point_sec expired_at;
35
36 eosio::binary_extension<eosio::asset> available;
37 eosio::binary_extension<eosio::asset> spendeded;
38 eosio::binary_extension<eosio::asset> blocked;
39
40 eosio::binary_extension<bool> is_can_coop_spend_share_contributions;
41
42 eosio::binary_extension<eosio::asset> share_contributions;
43 eosio::binary_extension<eosio::asset> membership_contributions;
44
45 uint64_t primary_key() const { return id; }
46 uint64_t by_program_type() const { return program_type.value; }
47 uint64_t by_draft() const { return draft_id; }
48};
49
50typedef eosio::multi_index<
51 "programs"_n, program,
52 eosio::indexed_by<"programtype"_n, eosio::const_mem_fun<program, uint64_t, &program::by_program_type>>,
53 eosio::indexed_by<"bydraft"_n, eosio::const_mem_fun<program, uint64_t, &program::by_draft>>>
contract
Definition: eosio.msig_tests.cpp:977
Definition: eosio.msig.hpp:34
Definition: table_soviet_programs.hpp:15
eosio::binary_extension< eosio::asset > spendeded
Definition: table_soviet_programs.hpp:37
std::string preview
Definition: table_soviet_programs.hpp:25
eosio::binary_extension< eosio::asset > membership_contributions
Definition: table_soviet_programs.hpp:43
eosio::asset fixed_membership_contribution
Definition: table_soviet_programs.hpp:31
eosio::name coopname
Definition: table_soviet_programs.hpp:20
eosio::binary_extension< eosio::asset > share_contributions
Definition: table_soviet_programs.hpp:42
eosio::name program_type
Definition: table_soviet_programs.hpp:18
eosio::time_point_sec start_at
Definition: table_soviet_programs.hpp:33
uint64_t by_program_type() const
Definition: table_soviet_programs.hpp:46
bool is_active
Definition: table_soviet_programs.hpp:21
std::string title
Definition: table_soviet_programs.hpp:22
std::string meta
Definition: table_soviet_programs.hpp:27
eosio::binary_extension< eosio::asset > available
Definition: table_soviet_programs.hpp:36
std::string description
Definition: table_soviet_programs.hpp:24
uint64_t by_draft() const
Definition: table_soviet_programs.hpp:47
uint64_t draft_id
Definition: table_soviet_programs.hpp:17
eosio::time_point_sec expired_at
Definition: table_soviet_programs.hpp:34
uint64_t id
Definition: table_soviet_programs.hpp:16
std::string announce
Definition: table_soviet_programs.hpp:23
uint64_t primary_key() const
Definition: table_soviet_programs.hpp:45
eosio::binary_extension< bool > is_can_coop_spend_share_contributions
Definition: table_soviet_programs.hpp:40
eosio::binary_extension< eosio::asset > blocked
Definition: table_soviet_programs.hpp:38
uint64_t membership_percent_fee
Definition: table_soviet_programs.hpp:30
std::string images
Definition: table_soviet_programs.hpp:26
eosio::name calculation_type
Definition: table_soviet_programs.hpp:29
eosio::multi_index< "programs"_n, program, eosio::indexed_by<"programtype"_n, eosio::const_mem_fun< program, uint64_t, &program::by_program_type > >, eosio::indexed_by<"bydraft"_n, eosio::const_mem_fun< program, uint64_t, &program::by_draft > > > programs_index
Definition: table_soviet_programs.hpp:54