-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created structure that reads data from csv file, inside created proce… #946
base: master
Are you sure you want to change the base?
Conversation
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
String inputFile = "src/main/resources/input.csv"; | ||
String outputFile = "src/main/resources/output.csv"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make these constants
for (String line : inputLines) { | ||
line = line.trim(); | ||
String[] transaction = line.split("\\s*,\\s*"); | ||
fruitService.processTransaction(transaction); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (String line : inputLines) { | |
line = line.trim(); | |
String[] transaction = line.split("\\s*,\\s*"); | |
fruitService.processTransaction(transaction); | |
} | |
List<FruitTransaction> transactions = parseServise.parseTransactions(inputLines ); | |
fruitService.processTransaction(transactions); |
String[] transaction = line.split("\\s*,\\s*"); | ||
fruitService.processTransaction(transaction); | ||
} | ||
List<String> report = generateReport(storage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List<String> report = generateReport(storage); | |
List<String> report = reportService.generateReport(); |
|
||
public class Storage { | ||
private static Storage instance; | ||
private final Map<String, FruitTransaction> fruitInventory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private final Map<String, FruitTransaction> fruitInventory; | |
private final Map<String, Integer> fruitInventory; |
We are keeping Fruits on the storage - not FruitTransactions
public class FruitTransaction { | ||
private int quantity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public interface FruitService { | ||
void processTransaction(String[] transaction); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public interface FruitService { | |
void processTransaction(String[] transaction); | |
public interface FruitService { | |
void processTransactions(List<FruitTransaction> transactions); |
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file
…ss classes that can do supply, purchase & return, then creates a report and write it in output csv file