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

306 : Product Catalogue #313

Closed
wants to merge 15 commits into from
Closed

Conversation

rehammuzzamil
Copy link
Contributor

@coveralls
Copy link

coveralls commented Sep 1, 2020

Pull Request Test Coverage Report for Build 2989

  • 223 of 448 (49.78%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 45.494%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/org/opensrp/util/ProductType.java 7 8 87.5%
src/main/java/org/opensrp/domain/ProductCatalogue.java 11 14 78.57%
src/main/java/org/opensrp/service/ProductCatalogueService.java 30 43 69.77%
src/main/java/org/opensrp/repository/postgres/handler/ProductCatalogueTypeHandler.java 15 34 44.12%
src/main/java/org/opensrp/repository/postgres/ProductCatalogueRepositoryImpl.java 82 102 80.39%
src/main/java/org/opensrp/domain/postgres/ProductCatalogueExample.java 56 225 24.89%
Totals Coverage Status
Change from base Build 2960: 0.1%
Covered Lines: 8935
Relevant Lines: 19640

💛 - Coveralls

@rehammuzzamil
Copy link
Contributor Author

There is an issue with the PUT end-point. As per the business, the image can also be updated in an edit-mode. Therefore, we need to provide support for the update of both JSON payload and Multipart file in an edit. To make it work, I tried with @RequestPart but it did not work. The problem is PUT request represents a single resource. But multi parts means multiple resources in a single body. Therefore, it throws an exception Unable to process parts as no multi-part configuration has been provided.
The solution could be to implement a customized MultipartResolver class and override the existing default multipart resolver in an XML configuration to allow a multipart request for both POST and PUT end-point.
Please provide your feedback @dubdabasoduba. Thanks!


ProductCatalogueExample productCatalogueExample = new ProductCatalogueExample();
productCatalogueExample.createCriteria().andUniqueIdEqualTo(uniqueId);
// int rowsAffected = customProductCatalogueMapper.deleteByExample(productCatalogueExample);
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this unused piece of code

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

@dubdabasoduba
Copy link
Member

There is an issue with the PUT end-point. As per the business, the image can also be updated in an edit-mode. Therefore, we need to provide support for the update of both JSON payload and Multipart file in an edit. To make it work, I tried with @RequestPart but it did not work. The problem is PUT request represents a single resource. But multi parts means multiple resources in a single body. Therefore, it throws an exception Unable to process parts as no multi-part configuration has been provided.
The solution could be to implement a customized MultipartResolver class and override the existing default multipart resolver in an XML configuration to allow a multipart request for both POST and PUT end-point.
Please provide your feedback @dubdabasoduba. Thanks!

@rehammuzzamil I agree. I also found the same method after doing some research. So let's work with this solution.

@rehammuzzamil
Copy link
Contributor Author

As discussed with @dubdabasoduba , closing this PR.

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