zimpler.candystore
An assignment which written as a CLI application in Golang for Zimpler interview process.
Getting Started
This repository includes an software development assignment to extract the top customers, and their favourite snacks.
Installation
To install the project, run the following command;
$ git clone https://github.com/bozd4g-interview/zimpler.candystore.git
To download dependencies, run the following command;
$ go mod download
You can use your own files to calculate the top customers, and their favourite snacks.
To calculate the top customers from a file as an example, run the following command;
$ go build -o candy
$ ./candy file --path ./test/data/data-with-comma.csv --separator comma --has-header
Flags Usage
Candy command flags are as follows;
Candy is a tool to find top customers and their favourite snacks
Usage:
candy [command]
Available Commands:
file File is a sub command to find top customers and their favourite snacks from a file
help Help about any command
Flags:
-h, --help help for candy
Use "candy [command] --help" for more information about a command.
The file command of candy has the following flags;
File should include 3 columns: Name, Candy, Eaten
Output will create in dist folder
Usage:
candy file [flags]
Flags:
--has-header if the file has a header
-h, --help help for file
-o, --output string path of the output file (default "./dist")
-p, --path string path of the file
-s, --separator string separator of the columns [tab | comma] (default "tab")
Addition
I decided to use a cli application to extract the top customers, and their favourite snacks from a data file. I could use a scraper to collect data from the website, but I decided to use a data file. This way is so easier to test. But I can easily implement a scraper in the future if I want because I used SOLID principles.
Author
Furkan Bozdag ([email protected]), December 2021