The Pharmacy POS System Backend is the server-side component of our comprehensive pharmacy management software. It is developed using Spring Boot, Java, Spring Security ,and Microservices Architecture
Apache License 2.0
5
stars
3
forks
source link
Refactor Item Details Endpoints and Clean Code #101
Pull Request: Refactor Item Details Endpoints and Clean Code
Title
Refactor Item Details Endpoints and Clean Code
Description
This pull request refactors the /get-item-all-details-by-id/{id} and /get-item-details-by-id/{id} endpoints to provide consistent response structures and includes various code cleanups to remove duplication and enhance maintainability.
Ensured no StackOverflowError occurs in the entity toString methods due to circular references.
100 #97
Checklist
[x] Refactored endpoint methods to provide consistent responses.
[x] Removed code duplication and improved maintainability.
[x] Updated and verified unit tests.
[x] Tested endpoints manually and using Postman.
Conclusion
This pull request refactors the item details endpoints to ensure consistent response structures and includes various code cleanups for better maintainability. Please review the changes and provide feedback or approval for merging.
Best regards,
Pramitha Jayasooriya
Backend Developer at LifePill
https://pramithamj.me
Pull Request: Refactor Item Details Endpoints and Clean Code
Title
Refactor Item Details Endpoints and Clean Code
Description
This pull request refactors the
/get-item-all-details-by-id/{id}
and/get-item-details-by-id/{id}
endpoints to provide consistent response structures and includes various code cleanups to remove duplication and enhance maintainability.Changes Made
Endpoint Changes:
Refactor
/get-item-all-details-by-id/{id}
Endpoint:itemGetAllResponseDTO
wrapper.itemCategoryDTO
,supplierDTO
, andsupplierCompanyDTO
.Refactor
/get-item-details-by-id/{id}
Endpoint:itemGetAllResponseDTO
wrapper.itemCategoryDTO
.Code Cleanups:
Example Changes in Code:
Controller Methods:
Sample Responses:
/get-item-all-details-by-id/{id}
Response:/get-item-details-by-id/{id}
Response:Impact Analysis
Affected Files
ItemController.java
(Refactored endpoints)ItemService.java
(Modified service methods)ItemGetAllResponseDTO.java
(DTO used in response)Test Plan
Unit Tests:
itemGetAllResponseDTO
and other nested DTOs are correctly populated.API Tests:
Manual Testing:
Automate testing:
qodana Results
LifePill Pos System backend qodana Report
Related Issues
StackOverflowError
occurs in the entitytoString
methods due to circular references.100 #97
Checklist
Conclusion
This pull request refactors the item details endpoints to ensure consistent response structures and includes various code cleanups for better maintainability. Please review the changes and provide feedback or approval for merging.
Best regards,
Pramitha Jayasooriya Backend Developer at LifePill https://pramithamj.me