Manages a typical inventory using a ledger. It's CLI-based toy app to solve the interview problem, not based on real-world models/use-cases.
High level view of the models used:
User <- Customer
<- Employee
Item <- SKU <- ProductGroup
Order -<> Items, User, Net, Gross
Ledger -<> Order, Item, Credit, Debit, Balance
- Replenish an item in Inventory
- Place an order by an User for a list of Items
- Summary of sales so far today
- Summary of inventory
- Discounts are at both user level(mock users created with different types of discount) and at item/SKU/Product Group levels
- More tests
- Handling concurrency better: how do you handle multiple checkouts happening at different registers?
- More realistic models and usecases. Eg. "Silly things" like taxes are not considered in this toy model
- Caching/faster retrieval for sales and inventory summary
- Better error handling
- Install golang(version > 1.8.1) and set GOPATH. For eg.
$HOME/gopath
. - Clone this repo into a folder and add that folder to your
GOPATH
. Eg.export GOPATH=$HOME/gopath:$HOME/src/toy-store
cd toy-store/src
and rungo run main.go
.
- Run
go test -cover ./...