This repository consists in a project of console application developed in Java for the challenge: Shopee Case as part of the admission process for a junior developer at Shopee Developer Team Product BR.
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.
- A Sale item must have at least the following attributes: (Seller Name, Customer Name, Date of Sale, Sale Item Name, Sale Value)
- Five Sellers should be registered and no Sale Item can be registered with a different seller name other than the five available.
- Script must run in the terminal only
Following the case specifications, the project consists of a console application with data input from Stdin and output to Stdout. Developed using the Java language with OpenJdk 11 and Intellij Idea IDE, and also Maven as a dependency and build management tool.
See instructions to run this project in Local Execution via source code and Ide, Local Execution via source code and jar file and also the dockerized way.
First, you must have the following tools on your local machine:
- Jdk 11: I recommend use AdoptOpenJdk. See here to install
- Maven: I reccomend use the latest version. See here to install
- Java IDE: I recommend use the Intellij Idea. See here to install
➡️ First, download the project using the command:
git clone [email protected]:ldsleticia/Shopee-Case.git
➡️ And now, import the project in your java IDE, and run the Main.java file, like this:
If you prefer execute this project via command line, after download and inside the project directory, run the following commands to build by Maven and execute the jar file:
maven clean install
cd target
java -jar shopee-case-1.0-SNAPSHOT.jar
You can get the project image and see the execution instructions at: https://hub.docker.com/repository/docker/ldsleticia/shopee-case
Or execute the following command in your terminal, to get the image and run in the interactive terminal (:heavy_exclamation_mark: the docker needs to run interactively):
docker run -it ldsleticia/shopee-case:latest