COOPENOMICS  v1
Кооперативная Экономика
table_marketplace_payouts.hpp
См. документацию.
1#pragma once
2
3#include "../core/ram_payer.hpp"
4#include <eosio/asset.hpp>
5#include <eosio/crypto.hpp>
6#include <eosio/eosio.hpp>
7#include <eosio/time.hpp>
8
9#include "../consts.hpp"
10
11using eosio::checksum256;
12
28namespace PayoutStatus {
29 inline constexpr eosio::name OPEN = "open"_n;
30 inline constexpr eosio::name SENT = "sent"_n;
31 inline constexpr eosio::name PAID = "paid"_n;
32 inline constexpr eosio::name DECLINED = "declined"_n;
33}
34
55struct [[eosio::table, eosio::contract(MARKETPLACE)]] payout {
56 uint64_t id;
57 checksum256 hash;
58 eosio::name offerer;
59 eosio::name status;
60 eosio::asset amount;
61 eosio::asset withheld;
62 uint32_t orders = 0;
63 eosio::time_point_sec created_at;
64 std::string decline_reason;
65
66 uint64_t primary_key() const { return id; }
67 checksum256 by_hash() const { return hash; }
68 uint64_t by_offerer() const { return offerer.value; }
69};
70
71typedef eosio::multi_index<
72 "payouts"_n, payout,
73 eosio::indexed_by<"byhash"_n, eosio::const_mem_fun<payout, checksum256, &payout::by_hash>>,
74 eosio::indexed_by<"byofferer"_n, eosio::const_mem_fun<payout, uint64_t, &payout::by_offerer>>>
76
77// Плательщик за оперативную память строк таблицы — правило в lib/core/ram_payer.hpp:
78// пакет выплаты — бизнес-процесс кооператива, платит кооператив.
contract
Definition: eosio.msig_tests.cpp:977
Состояния пакета выплаты поставщику.
Definition: table_marketplace_payouts.hpp:28
constexpr eosio::name DECLINED
Definition: table_marketplace_payouts.hpp:32
constexpr eosio::name PAID
Definition: table_marketplace_payouts.hpp:31
constexpr eosio::name SENT
Definition: table_marketplace_payouts.hpp:30
constexpr eosio::name OPEN
Definition: table_marketplace_payouts.hpp:29
Definition: eosio.msig.hpp:34
Definition: table_registrator_orgs.hpp:17
Пакет выплаты поставщику (решение владельца 19.11.2026).
Definition: table_marketplace_payouts.hpp:55
eosio::name offerer
поставщик — получатель выплаты
Definition: table_marketplace_payouts.hpp:58
eosio::name status
состояние (namespace PayoutStatus)
Definition: table_marketplace_payouts.hpp:59
uint64_t primary_key() const
Definition: table_marketplace_payouts.hpp:66
uint64_t by_offerer() const
Definition: table_marketplace_payouts.hpp:68
eosio::asset amount
сумма перевода: Σ(принятая стоимость − удержание) по заказам пакета
Definition: table_marketplace_payouts.hpp:60
eosio::asset withheld
удержано в счёт признанного гарантийного долга по заказам пакета
Definition: table_marketplace_payouts.hpp:61
uint64_t id
суррогатный ключ (scope coopname)
Definition: table_marketplace_payouts.hpp:56
checksum256 hash
хэш пакета — outcome_hash исходящего платежа в gateway
Definition: table_marketplace_payouts.hpp:57
std::string decline_reason
причина отказа кассира (только для declined)
Definition: table_marketplace_payouts.hpp:64
checksum256 by_hash() const
Definition: table_marketplace_payouts.hpp:67
eosio::time_point_sec created_at
время первого addpayout
Definition: table_marketplace_payouts.hpp:63
eosio::multi_index< "payouts"_n, payout, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< payout, checksum256, &payout::by_hash > >, eosio::indexed_by<"byofferer"_n, eosio::const_mem_fun< payout, uint64_t, &payout::by_offerer > > > payouts_index
Definition: table_marketplace_payouts.hpp:75
RAM_PAYER_CLASS(payout, cooperative)