Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions assignment/wms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
import add_items
import process_order

COMMANDS = "add/order/exit"

def wms():
print("Welcome to the Warehouse Management System")
print("Your warehosue is now managed!")
command = input("Enter a command: ")

if command == "add":
print("Adding new items")
with open("items.json", "w") as file:
items = json.read(file)
add_items.add_items(items)
elif command == "order":
print("Placing a new order")
order = get_order()
process_order.process_order(order)
elif command == "exit":
exit()
while True:
command = input("Enter a command:" + COMMANDS + "\n")
match command:
case "add":
print("Adding new items")
with open("items.json", "w") as file:
items = json.read(file)
add_items.add_items(items)
case "order":
print("Placing a new order")
order = get_order()
process_order.process_order(order)
case "exit":
exit()


if __name__ == "__main__":
Expand Down