Considering that scenario, build a script, implementing the seller's ranking logic, where the user, from the terminal, inputs a Sale item and the output is printed as an updated list of all sales registered, sorted by sellers with the highest to lowest amount sold.
You will need those tools to run the code:
This exercise was developed with 5 sellers pre-registered in the database, you will need their names to make sales:
- cloud strife
- lara croft
- mario
- link
- donkey kong
$env:DB_USER = "root"
$env:DB_PASSWORD = "mysecurepass"
$env:DB_HOST = "localhost"
$env:DB_NAME = "mydb"
export DB_USER=root
export DB_PASSWORD=mysecurepass
export DB_HOST=localhost
export DB_NAME=mydb
docker-compose up -d
pip3 install -r sales_manager/requirements.txt
python3 .\sales_manager\app.py
python3 -m pytest
├───database
├───sales_manager
│ ├───tests
│ ├───app.py
│ ├───helpers.py
│ ├───models.py
│ └───settings.py
└───docker-compose.yaml
database/*- Volume folder with all persisent data from db on container.docker-compose.yaml- File to setup MySQL database.sales_manager/tests/*- All tests for the applicationsales_manager/app.py- Entrypoint for the applicationsales_manager/helpers.py- Classes and functions provided to applicationsales_manager/models.py- A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you’re storing. Generally, each model maps to a single database table.sales_manager/settings.py- All settings from enviroment variables