with Ada.Text_IO;
with Stock;

procedure Main is
   Items : Stock.Shelf := [10, 20, 30];
   Accepted : Boolean;
begin
   Stock.Restock (Items, Position => 0, Amount => 6);
   Stock.Reserve (Items, Position => 1, Amount => 5, Accepted => Accepted);
   pragma Assert (Accepted);
   pragma Assert (Stock.Total (Items) = 61);
   Stock.Reserve (Items, Position => 2, Amount => 99, Accepted => Accepted);
   pragma Assert (not Accepted);
   pragma Assert (Stock.Total (Items) = 61);
   Ada.Text_IO.Put_Line ("total:" & Natural'Image (Stock.Total (Items)));
   if Accepted then
      Ada.Text_IO.Put_Line ("last request: accepted");
   else
      Ada.Text_IO.Put_Line ("last request: declined");
   end if;
   for I in Stock.Bin loop
      Ada.Text_IO.Put_Line ("bin" & Natural'Image (I) & " :" & Stock.Quantity'Image (Items(I)));
   end loop;
end Main;
