COOPENOMICS  v1
Кооперативная Экономика
table_edubridge_rids.hpp
См. документацию.
1#pragma once
2
3#include <eosio/asset.hpp>
4#include <eosio/crypto.hpp>
5#include <eosio/eosio.hpp>
6#include <eosio/time.hpp>
7#include <eosio/binary_extension.hpp>
8
9#include "../consts.hpp"
10#include "../core/ram_payer.hpp"
11
12namespace Edubridge {
13
14using namespace eosio;
15
44 uint32_t number = 0;
45 uint32_t minutes = 0;
46 eosio::asset cost;
47 eosio::asset charge;
48 bool unwound = false;
49
50 EOSLIB_SERIALIZE(edu_rid_lesson, (number)(minutes)(cost)(charge)(unwound))
51};
52
53struct [[eosio::table, eosio::contract(EDUBRIDGE)]] edu_rid {
54 uint64_t id;
55 checksum256 rid_hash;
56 eosio::name username;
57 uint64_t assignment_id;
58 eosio::asset amount;
59 eosio::name rid_type;
60 checksum256 statement_hash;
61 checksum256 storage_act_hash;
62 eosio::time_point_sec hold_until;
63 eosio::time_point_sec created_at;
64 uint64_t course_id;
65 // Добавлено в ХВОСТ и обёрнуто в binary_extension: записи, принятые до
66 // появления поля, читаются как прежде (у них возврата оплаты нет).
67 eosio::binary_extension<edu_rid_lesson> lesson;
68
69 uint64_t primary_key() const { return id; }
70 checksum256 by_hash() const { return rid_hash; }
71 uint64_t by_username() const { return username.value; }
72};
73
74typedef eosio::multi_index<
75 "edurids"_n, edu_rid,
76 eosio::indexed_by<"byhash"_n, eosio::const_mem_fun<edu_rid, checksum256, &edu_rid::by_hash>>,
77 eosio::indexed_by<"byusername"_n, eosio::const_mem_fun<edu_rid, uint64_t, &edu_rid::by_username>>>
79
80} // namespace Edubridge
81
82// Плательщик за оперативную память строк таблицы — правило в lib/core/ram_payer.hpp.
contract
Definition: eosio.msig_tests.cpp:977
Definition: economy.hpp:25
eosio::multi_index< "edurids"_n, edu_rid, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< edu_rid, checksum256, &edu_rid::by_hash > >, eosio::indexed_by<"byusername"_n, eosio::const_mem_fun< edu_rid, uint64_t, &edu_rid::by_username > > > edu_rids_index
Definition: table_edubridge_rids.hpp:78
Definition: eosio.msig.hpp:34
Материалы преподавателя по занятию — анкер процесса p.edu.rid от приёма на ответственное хранение до ...
Definition: table_edubridge_rids.hpp:43
eosio::asset charge
взнос преподавателя с одной подписки (курс с расчётом за каждого участника)
Definition: table_edubridge_rids.hpp:47
bool unwound
оплата ученикам возвращена (refundlesson уже прошёл)
Definition: table_edubridge_rids.hpp:48
uint32_t minutes
минуты занятия
Definition: table_edubridge_rids.hpp:45
uint32_t number
номер занятия в программе группы
Definition: table_edubridge_rids.hpp:44
eosio::asset cost
оплата занятия одним участником по окну расписания
Definition: table_edubridge_rids.hpp:46
Definition: table_edubridge_rids.hpp:53
eosio::name username
пайщик-преподаватель
Definition: table_edubridge_rids.hpp:56
eosio::name rid_type
вид РИД (методика, курс, материалы и т.п.; словарь ведёт приложение)
Definition: table_edubridge_rids.hpp:59
eosio::asset amount
оценка РИД — сумма паевого взноса
Definition: table_edubridge_rids.hpp:58
uint64_t id
внутренний ID
Definition: table_edubridge_rids.hpp:54
uint64_t by_username() const
Definition: table_edubridge_rids.hpp:71
eosio::time_point_sec created_at
приём материалов на хранение
Definition: table_edubridge_rids.hpp:63
uint64_t course_id
курс (off-chain id приложения), из резерва которого оплачивается результат; тот же,...
Definition: table_edubridge_rids.hpp:64
eosio::binary_extension< edu_rid_lesson > lesson
занятие одиночной передачи материалов; у пакета гарантийного срока пусто
Definition: table_edubridge_rids.hpp:67
checksum256 rid_hash
process_hash для p.edu.rid
Definition: table_edubridge_rids.hpp:55
checksum256 statement_hash
hash Заявления о паевом взносе РИД; пустой, пока идёт гарантийный срок
Definition: table_edubridge_rids.hpp:60
checksum256 storage_act_hash
hash Акта передачи материалов на ответственное хранение (3012)
Definition: table_edubridge_rids.hpp:61
eosio::time_point_sec hold_until
до какой даты материалы числятся на ответственном хранении (гарантийный срок курса)
Definition: table_edubridge_rids.hpp:62
uint64_t primary_key() const
Definition: table_edubridge_rids.hpp:69
uint64_t assignment_id
задание/курс приложения, к которому относится РИД (off-chain id)
Definition: table_edubridge_rids.hpp:57
checksum256 by_hash() const
Definition: table_edubridge_rids.hpp:70
Definition: table_registrator_orgs.hpp:17
RAM_PAYER_CLASS(Edubridge::edu_rid, cooperative)