Skip to content

jvc9109/vending-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vending Machine

💻 Vending Machine PoC as a DDD and CQRS php project.

Instructions

You will need Docker and docker compose installed. If you are a user of mac m1, don't worry, the docker compose file is addapted to this architecture. To have the enviroment running do:

  1. make start: will build all what is necessary for you. Just keep the port 3306 free and open
  2. make deps: will install all the vendors dependencies
  3. make test: will execute the unit tests of teh project
  4. make init-db: will setup the db for the first operations.

Usage:

To use the machine you can either exec the symfony console as `php app/apps/vending/backend/bin/console vending:machine:use` or log into the docker container and exec `vending vending:machine:use`

Vending Machine instructions:

Normal operation:

As a user you can perform different actions with the vending machine. Each action should be execute one by one.

Actions:

1. Insert Coins: insert `1.00` as 1 unit coin, `0.25`, `0.10` or `0.05` to increase your available money. No other coins are valid. After each coin hit *enter*. Example: `1.00`.
  1. RETURN-COINS: type this command and hit enter. You will get your money back.

  2. GET-XXXX: use your current money to purchase the item from the command. Valid items are: WATER, JUICE, SODA.
    Example: GET-WATER.

  3. exit: Type this command to leave.

Service mode:

If you type `SERVICE` you will enter the service mode. The operation actions are:
  1. SET-COINS: Set the amount of coins of a given value. Example: SET-COINS, 1.00, 400 Will set 400 units of 1.00 coin.

  2. SET-XXXX: Set the current item stock.
    Example: SET-WATER, 300 will set water stock to 300 units

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages