13 #include <boost/uuid/uuid_io.hpp>
20 , _account_svc(services.account_service())
21 , _post_budget_svc(services.post_budget_service())
22 , _banner_budget_svc(services.banner_budget_service())
23 , _dprops_svc(services.dynamic_global_property_service())
33 FC_ASSERT(
owner.balance >= op.
balance,
"Insufficient funds.",
34 (
"owner.balance",
owner.balance)(
"balance", op.
balance));
39 FC_ASSERT(op.
start <= op.
deadline,
"Deadline time must be greater or equal than start time");
40 FC_ASSERT(op.
start > _dprops_svc.
head_block_time(),
"Start time must be greater than head block time");
45 create_budget(_post_budget_svc, op,
owner.name);
47 case budget_type::banner:
48 create_budget(_banner_budget_svc, op,
owner.name);
53 template <budget_type budget_type_v>
58 using namespace boost::uuids;
60 FC_ASSERT(!budget_svc.
is_exists(op.
uuid),
"Budget with uuid ${1} already exists", (
"1", to_string(op.
uuid)));
create_budget_evaluator(data_service_factory_i &services)
void do_apply(const operation_type &op)
#define SCORUM_BUDGETS_LIMIT_PER_OWNER
fc::fixed_string_16 account_name_type
virtual const account_object & get_account(const account_name_type &) const =0
virtual void check_account_existence(const account_name_type &, const optional< const char * > &context_type_name=optional< const char * >()) const =0
virtual budgets_type get_budgets() const =0
virtual bool is_exists(const uuid_type &uuid) const =0
virtual const adv_budget_object< budget_type_v > & create_budget(const uuid_type &uuid, const account_name_type &owner, const asset &balance, fc::time_point_sec start, fc::time_point_sec end, const std::string &json_metadata)=0
virtual fc::time_point_sec head_block_time() const =0
Creates advertising budget.
std::string json_metadata
fc::time_point_sec deadline