Skip to content

Gh756_SeriesImportDao_setSeriesIdAndChangeStatus_replace_arguments_by_dto_object #1006

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

Conversation

KrivenkoAlexander
Copy link
Contributor

Addressed to #756

@mystamps-bot
Copy link

1 Warning
⚠️ danger check: branch Gh756_SeriesImportDao_setSeriesIdAndChangeStatus_replace_arguments_by_dto_object does not comply with our best practices. Branch name should use the following scheme: ghXXX_meaningful-name where XXX is an issue number. Next time, please, use this scheme :)

Generated by 🚫 Danger

@codecov
Copy link

codecov bot commented Feb 16, 2019

Codecov Report

Merging #1006 into master will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #1006      +/-   ##
===========================================
+ Coverage     79.93%     80%   +0.06%     
- Complexity      488     489       +1     
===========================================
  Files            35      35              
  Lines          1465    1465              
  Branches        188     188              
===========================================
+ Hits           1171    1172       +1     
  Misses          277     277              
+ Partials         17      16       -1
Impacted Files Coverage Δ Complexity Δ
...ture/series/importing/SeriesImportServiceImpl.java 97.89% <ø> (+1.05%) 31 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b23d67...fa8ecc3. Read the comment docs.

@codecov
Copy link

codecov bot commented Feb 16, 2019

Codecov Report

Merging #1006 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1006      +/-   ##
============================================
+ Coverage     79.93%   80.01%   +0.08%     
- Complexity      488      489       +1     
============================================
  Files            35       35              
  Lines          1465     1466       +1     
  Branches        188      188              
============================================
+ Hits           1171     1173       +2     
  Misses          277      277              
+ Partials         17       16       -1
Impacted Files Coverage Δ Complexity Δ
...ture/series/importing/SeriesImportServiceImpl.java 97.91% <100%> (+1.07%) 31 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b23d67...4a08dd1. Read the comment docs.

Copy link
Owner

@php-coder php-coder left a comment

Choose a reason for hiding this comment

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

Thank you!

LGTM overall but I left a couple comments anyway.

@@ -97,26 +96,21 @@ public Integer add(ImportSeriesDbDto importRequest) {

// @todo #735 SeriesImportDao.setSeriesIdAndChangeStatus(): replace arguments by dto object
Copy link
Owner

Choose a reason for hiding this comment

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

We need to remove this comment altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

return true
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Please, remove trailing spaces/tabs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

SeriesImportRequestStatus.IMPORT_SUCCEEDED,
{ Date updatedAt ->
assert DateUtils.roughlyEqual(updatedAt, new Date())
{ UpdateImportRequestStatusDbDto request ->
Copy link
Owner

Choose a reason for hiding this comment

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

Let's rename it to status (for consistency with the tests for changeStatus()).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -98,7 +97,6 @@ public Integer addSeries(
AddSeriesSalesDto saleDto,
Integer requestId,
Integer userId) {

Copy link
Owner

Choose a reason for hiding this comment

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

Please, don't change anything that isn't related to the issue. The commit should be focused only on a single change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was reverted back . Sorry, it is my mad :(

@@ -25,7 +25,6 @@
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;

Copy link
Owner

Choose a reason for hiding this comment

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

I'm surprised that checkstyle doesn't complain about this change... How about reverting it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am surprised too .Because i remember that i had to change such order in previous PRs

SeriesImportRequestStatus.PARSING_SUCCEEDED,
SeriesImportRequestStatus.IMPORT_SUCCEEDED,
now
new UpdateImportRequestStatusDbDto(
Copy link
Owner

Choose a reason for hiding this comment

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

It's better to follow the same approach everywhere. See how we have done the same in the changeStatus():

		UpdateImportRequestStatusDbDto status =
			new UpdateImportRequestStatusDbDto(requestId, now, oldStatus, newStatus);

Let's do the same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done . I explicit created the status variable and added it to the method call.

Date updatedAt) {

public void setSeriesIdAndChangeStatus(Integer seriesId,
UpdateImportRequestStatusDbDto requestStatus) {
Copy link
Owner

Choose a reason for hiding this comment

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

We don't format methods like that. See how the arguments wrapped in other places and follow the style.

Another option (if the line just a little long or you need to have everything in one like to improve readability) -- add a special comment and suppress checkstyle complains.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I used suppress annotation for "linelength" module

@@ -37,7 +37,6 @@
import ru.mystamps.web.feature.series.sale.SeriesSalesService;
import ru.mystamps.web.support.spring.security.HasAuthority;
import ru.mystamps.web.util.CatalogUtils;

Copy link
Owner

Choose a reason for hiding this comment

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

Please, revert this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

… made and the refactoring for codestyle was made here either
@KrivenkoAlexander KrivenkoAlexander force-pushed the Gh756_SeriesImportDao_setSeriesIdAndChangeStatus_replace_arguments_by_dto_object branch from fa8ecc3 to 4a08dd1 Compare February 17, 2019 18:44
@php-coder
Copy link
Owner

Merged in 86042dc commit.

@php-coder
Copy link
Owner

@KrivenkoAlexander Thank you for the contribution! 👍

@KrivenkoAlexander KrivenkoAlexander deleted the Gh756_SeriesImportDao_setSeriesIdAndChangeStatus_replace_arguments_by_dto_object branch February 18, 2019 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants