This code is result of performing test task.
Create a vending machine in the Scala language.
The vending machine can take any currency you wish, and can sell any products you wish.
The vending machine can either take the form of an API or a UI (you do not have to implement both). The vending machine should respond to basic commands, such as pay
and select_products
Your primary objectives:
- Represent a basic data model that underlays the functionality.
- Prototype (quickly) a simple UI or API endpoints that allows the user to interact with the machine.
- Create at least one action in the UI/API that behaves the way the user would expect.
- Choose whatever language you wish. Some options you might consider: Ruby, GoLang, Python, Scala, Erlang, Haskell, Javascript, Elm, Purescript, and Clojure.
- Do NOT use a full-stack framework such as rails, django, or play. You can use specific components of frameworks, however. (Ex: ActiveRecord)
Things you don't need:
- Both an API Backend and working UI. (Feel free to build only one. API endpoints or UI flow.)
- Persistence. (You can persist in-memory for now.)
- Full implementation of the machine. (One or two actions is enough.)
- Unit tests. (Really. We won't judge you.)