Numedite Bazaar

The small, cloaked people known as the Numedites travel this way and that across the planes. Because their ways are spiritual in nature, they use their innate magic to facilitate distant trade at no cost to their clientele.

You have <%= current_char.vestige %> vestige.

Post Order

Sell orders can be posted with a caravan of numedites, offering items for vestige. Buy orders can also be posted, offering vestige for items.

<%= form_with url: bazaar_order_path, class: "my-4" do |f| %>
<%= f.label :item_id, "Item" %> <%= f.select :item_id, @items.map { |i| [i.name, i.id] } %>
<%= f.label :quantity, "Quantity" %> <%= f.number_field :quantity, required: true, min: 1, max: 2_000_000_000 %>
<%= f.label :price_each, "Price Each" %> <%= f.number_field :price_each, required: true, min: 1, max: 2_000_000_000 %>
<%= f.label :buy_order, "Post as buy order" %> <%= f.check_box :buy_order %>
<%= f.submit "Post Order" %>
<% end %>

Your Orders

<% @bazaar_orders.where(character: current_char).each do |bo| %> <% end %>
Item Quantity Type Price Each Cancel
<%= bo.item.name %> <%= bo.quantity %> <%= bo.buy_order? ? "Buy" : "Sell" %> <%= bo.price_each %> <%= button_to "Cancel", bazzar_cancel_offer_path(id: bo.id), method: :delete %>

Sell Orders

<% @bazaar_orders.where(buy_order: false).each do |bo| %> <% end %>
Item Quantity From Price Each Buy
<%= bo.item.name %> <%= bo.quantity %> <%= bo.character.name %> <%= bo.price_each %> <%= form_with url: bazzar_accept_offer_path(id: bo.id) do |f| %> <%= f.number_field :quantity, value: 1, min: 1, max: 2_000_000_000, required: true %> <%= f.submit "Buy" %> <% end %>

Buy Orders

<% @bazaar_orders.where(buy_order: true).each do |bo| %> <% end %>
Item Quantity From Price Each Sell
<%= bo.item.name %> <%= bo.quantity %> <%= bo.character.name %> <%= bo.price_each %> <%= form_with url: bazzar_accept_offer_path(id: bo.id) do |f| %> <%= f.number_field :quantity, value: 1, min: 1, max: 2_000_000_000, required: true %> <%= f.submit "Sell" %> <% end %>