Skip to content
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

implemented salary info method #1255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mhvaleria
Copy link

No description provided.

Copy link

@olekskov olekskov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, just some style comments

LocalDate localDateFrom = LocalDate.parse(dateFrom, formatter);
LocalDate localDateTo = LocalDate.parse(dateTo, formatter);
for (String name : names) {
result.append("\n");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use operating system independent symbol for new line

Suggested change
result.append("\n");
result.append(System.lineSeparator());

Comment on lines 27 to 30
if ((entryDate.isEqual(localDateFrom)
|| entryDate.isAfter(localDateFrom))
&& (entryDate.isEqual(localDateTo)
|| entryDate.isBefore(localDateTo))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use !entryDate.isAfter() and !entryDate.isBefore() to simlify expression by omitting isEqual conditions

* Integer.parseInt(elements[INCOME_PER_HOURS_INDEX]);
}
}
result.append(name).append(SEPARATOR)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move here append from line 22 to have all of them in one place

private static final String HEADER = "Report for period ";
private static final String SEPARATOR = " - ";
private static final String DATA_SEPARATOR = " ";
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatter is also not going to be changed

Suggested change
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");

@mhvaleria mhvaleria requested a review from olekskov April 4, 2024 15:15
Copy link

@okuzan okuzan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

result.append(System.lineSeparator())
.append(name).append(SEPARATOR)
.append(moneyEarned);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants