from stock import Shelf, reserve, restock, total


def main() -> None:
    items = Shelf([10, 20, 30])
    restock(items, position=0, amount=6)
    accepted: bool = reserve(items, 1, 5)
    assert accepted
    assert total(items) == 61
    last_accepted: bool = reserve(items, 2, 99)
    assert not last_accepted
    assert total(items) == 61
    print("total:", total(items))
    if last_accepted:
        print("last request: accepted")
    else:
        print("last request: declined")
    for i in range(3):
        print("bin", i, ":", items[i])


if __name__ == "__main__":
    main()
