Inventory system#
Fig. 22 Digital inventory themed version of Fig. 18 from Spare Parts Inventory Assistant by ChatGPT#
After implementing Spare parts inventory assistant, you want to create an inventory system, which has the following features:
customers can place orders
for simplicity, you have a predefined set of queued orders
the system can track your revenue
you can process orders one by one by clicking a button
clicking a button merely transfers an order from the queue to a list of processed orders
after processing an order, your revenue is automatically updated.
your program keeps the number or weight of items in your inventory
after an order has been processed, you update your stock.
you have both countable and non-countable bulk items in your inventory. Bulk items are counted in kilograms
Your goal is to create a simple inventory system program with GUI like in the demo video below.
It must have the following classes along with their data fields and methods:
Item: a general itemNamePricePerUnit
BulkItem: a bulk item sold in e.g., kg, meterMeasurementUnit
UnitItem: item sold in countsWeight: weight of each item
Inventory: tracks items in the inventorystock: stores for each item its quantity in the inventoryLowStockItems(): gets a collection of low stock items, e.g., less than five
OrderLine: item with its quantity – a single line of anOrder.Item: ordered itemQuantity: quantity of the ordered item
Order: a buying request placed by a customerTime: exact time of an orderOrderLines: list of order lines – a list of items that a customer wants to buy with their quantityTotalPrice(): calculates the total price of the items
OrderBook: tracks orders and total revenueQueuedOrders: list of queued ordersProcessedOrders: list of processed ordersQueueOrder(Order): places an order inQueuedOrdersProcessNextOrder(): removes earliest queued order and places it into processed ordersTotalRevenue(): returns total revenue from processed orders
CustomerNameOrders: list of orders that the customer have placedCreateOrder(OrderBook, Order): Creates the given order in the given order book. Orders are initiated by a customer.
Choose reasonable datatypes for the data fields and method return values.
Your GUI must at least have these elements:
list of queued orders
list of processed orders
a process button that uses
ProcessNextOrder()a field that shows total revenue
Activity 34 (Visual relation between concepts)
This problem can be modeled using concepts that interact with each other. Use the following classes to draw a diagram that shows the relationships between concepts.
price per unit
item, bulk item
inventory
stock (e.g., we have three pens in stock)
order
order book
customer
Example:
graph LR
inventory -->|has many| item
item -->|has a| price_per_unit
bulk_item -->|is an| item
%%inventory -->|has a| stock
%%- price
%%- item, bulk item
%%- inventory
%%- stock (e.g., *we have three pens in stock*)
%%- order
%%- order book
%%- customer