BackslashWelsh opened a new pull request, #3823: URL: https://github.com/apache/fineract/pull/3823
## Description Initial PR on [FINERACT-2021](https://issues.apache.org/jira/browse/FINERACT-2021) Migrated Fund resource. #### Type-safe - Each endpoint in Fund receives and returns a specific class instead of json. - To keep the type-safe request until it reaches the target service, I added classes that mirror JsonCommand/Wrapper functionality but instead of json and JsonElement have the type-safe request. - For this reason, I had to duplicate some services so that they could use these new classes. - However, some of the classes that I duplicated, such as SynchronousCommandProcessingService have a lot of code that relies on JsonCommand/Wrapper. I didn't want to completely rewrite it and create even more duplicate classes just for the sake of it. That's why the new classes that mirror JsonCommand/Wrapper temporarily have JsonCommand/Wrapper inside. I can rewrite all the other classes completely in future PRs. However, the end classes like FundWritePlatformService only use my new class. #### Errors - All MVC errors are managed by SpringErrorHandler. To map to the correct response, it uses the existing jakarta ExceptionMapper and findMostSpecificExceptionHandler method. It also handles UnsupportedParameter errors that are thrown by Jackson failOnUnknownProperties(true). - I migrated from manual validation to Spring's. To make the validation error response exactly as it was, I created ValidationErrorConverter to correctly map the message and the messageCode. #### Features - I migrated the partial parameter response (JacksonPartialResponseFilter). - I didn't implement the prettyPrint flag. Currently the response is always pretty printed. - The partial resource update looks a bit strange as it uses Optional, but I haven't found another way to implement it. #### MVC - To run the server in MVC mode, you need to add the "mvc" profile. - Any bean classes I added or duplicated will only be initialized if the application has the "mvc" profile. - To route requests to MVC, I created MvcRoutingFilter. If Spring can handle the request, it routes it to the Spring dispatcher. #### Tests - The integration tests will work in MVC if you run the cargo with the "mvc" profile. ## Checklist Please make sure these boxes are checked before submitting your pull request - thanks! - [x] Write the commit message as per https://github.com/apache/fineract/#pull-requests - [x] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers. - [x] Create/update unit or integration tests for verifying the changes made. - [x] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions. - [x] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes - [x] Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.) FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
