4#define AUTH_SIGNATURE eosio::name coopname, checksum256 request_hash, document2 authorization
53 uint64_t
by_type()
const {
return type.value; }
57typedef eosio::multi_index<
58 "segments"_n, segment,
59 eosio::indexed_by<
"byrequest"_n, eosio::const_mem_fun<segment, uint64_t, &segment::by_request>>,
60 eosio::indexed_by<
"bytype"_n, eosio::const_mem_fun<segment, uint64_t, &segment::by_type>>,
61 eosio::indexed_by<
"bystatus"_n, eosio::const_mem_fun<segment, uint64_t, &segment::by_status>>
98 checksum256
by_hash()
const {
return hash; }
99 uint64_t
by_coop()
const {
return coopname.value; }
100 uint64_t
by_driver()
const {
return driver_username.value; }
101 uint64_t
by_source()
const {
return source_braname.value; }
104 uint64_t
by_created()
const {
return created_at.sec_since_epoch(); }
107typedef eosio::multi_index<
108 "shipments"_n, shipment,
109 eosio::indexed_by<
"byhash"_n, eosio::const_mem_fun<shipment, checksum256, &shipment::by_hash>>,
110 eosio::indexed_by<
"bycoop"_n, eosio::const_mem_fun<shipment, uint64_t, &shipment::by_coop>>,
111 eosio::indexed_by<
"bydriver"_n, eosio::const_mem_fun<shipment, uint64_t, &shipment::by_driver>>,
112 eosio::indexed_by<
"bysource"_n, eosio::const_mem_fun<shipment, uint64_t, &shipment::by_source>>,
113 eosio::indexed_by<
"bydest"_n, eosio::const_mem_fun<shipment, uint64_t, &shipment::by_destination>>,
114 eosio::indexed_by<
"bystatus"_n, eosio::const_mem_fun<shipment, uint64_t, &shipment::by_status>>,
115 eosio::indexed_by<
"bycreated"_n, eosio::const_mem_fun<shipment, uint64_t, &shipment::by_created>>
157 bool is_warranty_return =
false;
172 uint64_t
by_coop()
const {
return coopname.value;}
174 uint64_t
by_type()
const {
return type.value; }
178 uint64_t
by_created()
const {
return created_at.sec_since_epoch();}
179 uint64_t
by_completed()
const {
return completed_at.sec_since_epoch();}
180 uint64_t
by_declined()
const {
return declined_at.sec_since_epoch();}
181 uint64_t
by_canceled()
const {
return canceled_at.sec_since_epoch();}
186 return is_warranty_return ? product_contributor : money_contributor;
190 return is_warranty_return ? money_contributor : product_contributor;
195 return get_money_contributor();
199 return get_product_contributor();
210 return money_contributor;
218 return product_contributor;
222typedef eosio::multi_index<
223 "requests"_n, request,
224 eosio::indexed_by<
"bycoop"_n, eosio::const_mem_fun<request, uint64_t, &request::by_coop>>,
225 eosio::indexed_by<
"bystatus"_n, eosio::const_mem_fun<request, uint64_t, &request::by_status>>,
226 eosio::indexed_by<
"bytype"_n, eosio::const_mem_fun<request, uint64_t, &request::by_type>>,
227 eosio::indexed_by<
"byhash"_n, eosio::const_mem_fun<request, checksum256, &request::by_hash>>,
228 eosio::indexed_by<
"byusername"_n, eosio::const_mem_fun<request, uint64_t, &request::by_username>>,
229 eosio::indexed_by<
"bycreated"_n, eosio::const_mem_fun<request, uint64_t, &request::by_created>>,
230 eosio::indexed_by<
"bycompleted"_n, eosio::const_mem_fun<request, uint64_t, &request::by_completed>>,
231 eosio::indexed_by<
"bydeclined"_n, eosio::const_mem_fun<request, uint64_t, &request::by_declined>>,
232 eosio::indexed_by<
"bycanceled"_n, eosio::const_mem_fun<request, uint64_t, &request::by_canceled>>,
233 eosio::indexed_by<
"bywarrantyid"_n, eosio::const_mem_fun<request, uint64_t, &request::by_warranty_id>>
252 auto idx = requests.get_index<
"byhash"_n>();
253 auto req = idx.find(request_hash);
255 if (req != idx.end()) {
264 auto idx = shipments.get_index<
"byhash"_n>();
265 auto ship = idx.find(shipment_hash);
267 if (ship != idx.end()) {
275 eosio::check(request_opt.has_value(), error_msg);
281 eosio::check(shipment_opt.has_value(), error_msg);
282 return *shipment_opt;
288namespace DocumentNames {
313 static constexpr const name
WDISPUTE =
"wdispute"_n;
static constexpr eosio::name _marketplace
Definition: consts.hpp:155
contract
Definition: eosio.msig_tests.cpp:977
static constexpr const name SHIPMENT_ARRIVE_ACT
Definition: shared_marketplace.hpp:309
static constexpr const name SHIPMENT_ACT
Definition: shared_marketplace.hpp:303
static constexpr const name CONTRIB_STMT
Definition: shared_marketplace.hpp:292
static constexpr const name RETURN_STMT
Definition: shared_marketplace.hpp:289
static constexpr const name WACCEPT_ACT
Definition: shared_marketplace.hpp:318
static constexpr const name SHIPMENT_RECV_ACT
Definition: shared_marketplace.hpp:310
static constexpr const name SUPPLY_ACT_CONF
Definition: shared_marketplace.hpp:302
static constexpr const name SHIPMENT_LOADING_ACT
Definition: shared_marketplace.hpp:308
static constexpr const name RECEIVE_ACT_CONF
Definition: shared_marketplace.hpp:296
static constexpr const name CONVERT_FROM
Definition: shared_marketplace.hpp:290
static constexpr const name WDISPUTE
Definition: shared_marketplace.hpp:313
static constexpr const name SHIPMENT_SEND_ACT
Definition: shared_marketplace.hpp:307
static constexpr const name WRETURN_ACT
Definition: shared_marketplace.hpp:316
static constexpr const name TRANSPORT2
Definition: shared_marketplace.hpp:298
static constexpr const name CONVERT_TO
Definition: shared_marketplace.hpp:291
static constexpr const name TRANSPORT4
Definition: shared_marketplace.hpp:300
static constexpr const name TRANSPORT3
Definition: shared_marketplace.hpp:299
static constexpr const name RETURN_AUTH
Definition: shared_marketplace.hpp:294
static constexpr const name WSUPPLY_AUTH
Definition: shared_marketplace.hpp:315
static constexpr const name CONTRIB_AUTH
Definition: shared_marketplace.hpp:293
static constexpr const name TRANSPORT1
Definition: shared_marketplace.hpp:297
static constexpr const name DELIVERY_ACT
Definition: shared_marketplace.hpp:304
static constexpr const name WRETURN_AUTH
Definition: shared_marketplace.hpp:314
static constexpr const name SUPPLY_ACT
Definition: shared_marketplace.hpp:301
static constexpr const name WOFFER_ACT
Definition: shared_marketplace.hpp:317
static constexpr const name RECEIVE_ACT
Definition: shared_marketplace.hpp:295
Definition: shared_marketplace.hpp:9
static std::optional< request > get_request_by_hash(eosio::name coopname, checksum256 request_hash)
Definition: shared_marketplace.hpp:250
eosio::multi_index< "segments"_n, segment, eosio::indexed_by<"byrequest"_n, eosio::const_mem_fun< segment, uint64_t, &segment::by_request > >, eosio::indexed_by<"bytype"_n, eosio::const_mem_fun< segment, uint64_t, &segment::by_type > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< segment, uint64_t, &segment::by_status > > > segments_index
Definition: shared_marketplace.hpp:62
eosio::multi_index< "shipments"_n, shipment, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< shipment, checksum256, &shipment::by_hash > >, eosio::indexed_by<"bycoop"_n, eosio::const_mem_fun< shipment, uint64_t, &shipment::by_coop > >, eosio::indexed_by<"bydriver"_n, eosio::const_mem_fun< shipment, uint64_t, &shipment::by_driver > >, eosio::indexed_by<"bysource"_n, eosio::const_mem_fun< shipment, uint64_t, &shipment::by_source > >, eosio::indexed_by<"bydest"_n, eosio::const_mem_fun< shipment, uint64_t, &shipment::by_destination > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< shipment, uint64_t, &shipment::by_status > >, eosio::indexed_by<"bycreated"_n, eosio::const_mem_fun< shipment, uint64_t, &shipment::by_created > > > shipments_index
Definition: shared_marketplace.hpp:116
static request get_request_by_hash_or_fail(eosio::name coopname, checksum256 request_hash, const std::string &error_msg="Заявка не найдена по хэшу")
Definition: shared_marketplace.hpp:273
eosio::multi_index< "requests"_n, request, eosio::indexed_by<"bycoop"_n, eosio::const_mem_fun< request, uint64_t, &request::by_coop > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< request, uint64_t, &request::by_status > >, eosio::indexed_by<"bytype"_n, eosio::const_mem_fun< request, uint64_t, &request::by_type > >, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< request, checksum256, &request::by_hash > >, eosio::indexed_by<"byusername"_n, eosio::const_mem_fun< request, uint64_t, &request::by_username > >, eosio::indexed_by<"bycreated"_n, eosio::const_mem_fun< request, uint64_t, &request::by_created > >, eosio::indexed_by<"bycompleted"_n, eosio::const_mem_fun< request, uint64_t, &request::by_completed > >, eosio::indexed_by<"bydeclined"_n, eosio::const_mem_fun< request, uint64_t, &request::by_declined > >, eosio::indexed_by<"bycanceled"_n, eosio::const_mem_fun< request, uint64_t, &request::by_canceled > >, eosio::indexed_by<"bywarrantyid"_n, eosio::const_mem_fun< request, uint64_t, &request::by_warranty_id > > > requests_index
Definition: shared_marketplace.hpp:234
static const std::set< eosio::name > marketplace_callback_actions
Definition: shared_marketplace.hpp:236
static std::optional< shipment > get_shipment_by_hash(eosio::name coopname, checksum256 shipment_hash)
Definition: shared_marketplace.hpp:262
eosio::name get_valid_marketplace_action(const eosio::name &action)
Definition: shared_marketplace.hpp:244
static shipment get_shipment_by_hash_or_fail(eosio::name coopname, checksum256 shipment_hash, const std::string &error_msg="Перевозка не найдена по хэшу")
Definition: shared_marketplace.hpp:279
Definition: eosio.msig.hpp:34
action(permission_level{ _gateway, "active"_n}, _gateway, "adduser"_n, std::make_tuple(coopname, deposit->username, to_spread, to_circulation, eosio::current_time_point(), true)).send()
#define AUTH_SIGNATURE
Definition: shared_marketplace.hpp:4
void(AUTH_SIGNATURE) auth_interface
Definition: shared_marketplace.hpp:6
Таблица обменов для контракта "marketplace".
Definition: shared_marketplace.hpp:123
uint64_t id
Definition: shared_marketplace.hpp:124
checksum256 by_hash() const
Definition: shared_marketplace.hpp:175
uint64_t units
Definition: shared_marketplace.hpp:142
eosio::name coopname
Definition: shared_marketplace.hpp:126
uint64_t by_type() const
Definition: shared_marketplace.hpp:174
eosio::name status
Definition: shared_marketplace.hpp:128
uint64_t product_lifecycle_secs
Definition: shared_marketplace.hpp:150
uint64_t by_created() const
Definition: shared_marketplace.hpp:178
eosio::name type
Definition: shared_marketplace.hpp:127
eosio::asset unit_cost
Definition: shared_marketplace.hpp:137
eosio::time_point_sec declined_at
Definition: shared_marketplace.hpp:166
eosio::name get_defective_supplier() const
Получить поставщика брака в гарантийном возврате Это тот, кто изначально поставил товар и теперь по...
Definition: shared_marketplace.hpp:217
eosio::time_point_sec supplied_at
Definition: shared_marketplace.hpp:162
eosio::name supplier_braname
Definition: shared_marketplace.hpp:135
uint64_t by_canceled() const
Definition: shared_marketplace.hpp:181
eosio::time_point_sec canceled_at
Definition: shared_marketplace.hpp:168
eosio::time_point_sec disputed_at
Definition: shared_marketplace.hpp:167
eosio::name product_contributor
Definition: shared_marketplace.hpp:146
eosio::name warehouse
Definition: shared_marketplace.hpp:131
eosio::name token_contract
Definition: shared_marketplace.hpp:132
checksum256 hash
Definition: shared_marketplace.hpp:125
uint64_t by_status() const
Definition: shared_marketplace.hpp:173
uint64_t by_completed() const
Definition: shared_marketplace.hpp:179
eosio::time_point_sec deadline_for_receipt
Definition: shared_marketplace.hpp:155
eosio::asset total_cost
Definition: shared_marketplace.hpp:140
eosio::time_point_sec completed_at
Definition: shared_marketplace.hpp:165
eosio::name braname
Definition: shared_marketplace.hpp:130
eosio::name get_money_contributor() const
Definition: shared_marketplace.hpp:185
std::string meta
Definition: shared_marketplace.hpp:143
uint64_t warranty_period_secs
Definition: shared_marketplace.hpp:151
eosio::asset base_cost
Definition: shared_marketplace.hpp:138
eosio::name get_supplier() const
Definition: shared_marketplace.hpp:198
uint64_t warranty_return_id
Definition: shared_marketplace.hpp:158
eosio::name get_payer() const
Definition: shared_marketplace.hpp:194
eosio::name receiver_braname
Definition: shared_marketplace.hpp:134
eosio::time_point_sec delivered_at
Definition: shared_marketplace.hpp:163
eosio::name username
Definition: shared_marketplace.hpp:129
eosio::name money_contributor
Definition: shared_marketplace.hpp:145
uint64_t by_warranty_id() const
Definition: shared_marketplace.hpp:182
eosio::name get_product_contributor() const
Definition: shared_marketplace.hpp:189
std::vector< Document::named_document > documents
Definition: shared_marketplace.hpp:148
uint64_t by_declined() const
Definition: shared_marketplace.hpp:180
eosio::asset cancellation_fee_amount
Definition: shared_marketplace.hpp:152
eosio::name get_product_backer() const
Получить пайщика, который возвращает товар в гарантийном возврате Это тот, кто изначально получил тов...
Definition: shared_marketplace.hpp:209
eosio::time_point_sec received_at
Definition: shared_marketplace.hpp:164
uint64_t primary_key() const
Definition: shared_marketplace.hpp:171
uint64_t by_coop() const
Definition: shared_marketplace.hpp:172
eosio::asset membership_fee_amount
Definition: shared_marketplace.hpp:139
eosio::time_point_sec created_at
Definition: shared_marketplace.hpp:160
eosio::time_point_sec accepted_at
Definition: shared_marketplace.hpp:161
eosio::time_point_sec warranty_delay_until
Definition: shared_marketplace.hpp:154
uint64_t by_username() const
Definition: shared_marketplace.hpp:176
Сегмент поставки - унифицированная структура для работы с документами
Definition: shared_marketplace.hpp:23
document2 authorization
Definition: shared_marketplace.hpp:32
eosio::name username
Definition: shared_marketplace.hpp:44
uint64_t decision_id
Definition: shared_marketplace.hpp:31
uint64_t request_id
Definition: shared_marketplace.hpp:25
uint64_t id
Definition: shared_marketplace.hpp:24
document2 transport_act_3
Definition: shared_marketplace.hpp:40
document2 act2
Definition: shared_marketplace.hpp:34
document2 convert_in
Definition: shared_marketplace.hpp:29
document2 convert_out
Definition: shared_marketplace.hpp:35
document2 statement
Definition: shared_marketplace.hpp:30
eosio::time_point_sec created_at
Definition: shared_marketplace.hpp:48
uint64_t by_request() const
Definition: shared_marketplace.hpp:52
eosio::name coopactor
Definition: shared_marketplace.hpp:43
document2 transport_act_2
Definition: shared_marketplace.hpp:39
document2 transport_act_4
Definition: shared_marketplace.hpp:41
eosio::time_point_sec updated_at
Definition: shared_marketplace.hpp:49
eosio::name type
Definition: shared_marketplace.hpp:26
eosio::name status
Definition: shared_marketplace.hpp:27
document2 act1
Definition: shared_marketplace.hpp:33
document2 transport_act_1
Definition: shared_marketplace.hpp:38
eosio::name receive_from_driver_coopactor
Definition: shared_marketplace.hpp:46
uint64_t primary_key() const
Definition: shared_marketplace.hpp:51
uint64_t by_type() const
Definition: shared_marketplace.hpp:53
eosio::name driver_username
Definition: shared_marketplace.hpp:45
uint64_t by_status() const
Definition: shared_marketplace.hpp:54
Перевозка имущества - объединение нескольких заявок в одну транспортную накладную
Definition: shared_marketplace.hpp:79
eosio::name driver_username
Definition: shared_marketplace.hpp:83
std::vector< checksum256 > request_hashes
Definition: shared_marketplace.hpp:88
eosio::name source_braname
Definition: shared_marketplace.hpp:84
eosio::name coopname
Definition: shared_marketplace.hpp:82
eosio::name destination_braname
Definition: shared_marketplace.hpp:85
uint64_t by_source() const
Definition: shared_marketplace.hpp:101
checksum256 hash
Definition: shared_marketplace.hpp:81
uint64_t by_destination() const
Definition: shared_marketplace.hpp:102
eosio::time_point_sec loaded_at
Definition: shared_marketplace.hpp:93
uint64_t by_status() const
Definition: shared_marketplace.hpp:103
uint64_t by_created() const
Definition: shared_marketplace.hpp:104
uint64_t by_driver() const
Definition: shared_marketplace.hpp:100
uint64_t id
Definition: shared_marketplace.hpp:80
eosio::name status
Definition: shared_marketplace.hpp:86
uint64_t primary_key() const
Definition: shared_marketplace.hpp:97
uint64_t by_coop() const
Definition: shared_marketplace.hpp:99
std::vector< Document::named_document > documents
Definition: shared_marketplace.hpp:90
eosio::time_point_sec delivered_at
Definition: shared_marketplace.hpp:94
checksum256 by_hash() const
Definition: shared_marketplace.hpp:98
eosio::time_point_sec created_at
Definition: shared_marketplace.hpp:92
eosio::time_point_sec completed_at
Definition: shared_marketplace.hpp:95
Definition: drafts.hpp:28