FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization#6090
FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization#6090DhroovSankla wants to merge 10 commits into
Conversation
|
@adamsaghy Looking forward your review! |
Aman-Mittal
left a comment
There was a problem hiding this comment.
Blocking this PR due to compliance concerns.
|
Pls refer to https://www.apache.org/legal/resolved.html for more info |
…nize resource mapping contract
…th JAXB marshalling
|
|
Hi @adamsaghy, The codebase pipeline metrics are looking great—84/85 checks are completely green, and all quality gates (Spotless & SpotBugs) are fully satisfied. The single remaining failing check is Since this modernization lets the native JAX-RS/JAXB framework handle the content negotiation and serialization natively without breaking the end payload format, this is an intentional contract update. Please let me know if we are good to bypass or override this check to get this merged! |
|
@DhroovSankla Would you mind to write an integration or E2E test case which ensures the proper XML document is created before and after this PR (you might need to run manually the written test before and after the changes to ensure same outcome!) |
…r Mix XBRL report serialization
…-safe serialization
@adamsaghy Updated the PR history to resolve the upstream merge conflicts in |
Description
This PR addresses technical debt within the fineract-mix module by replacing manual XML string concatenation and heavyweight DOM manipulation with a native, type-safe JAX-RS and JAXB serialization workflow.
Previously, the module manually assembled XBRL reports into raw string text blocks, placing a heavy maintenance and memory overhead on the streaming pipeline. This refactoring introduces a structured domain DTO graph that allows the underlying JAX-RS framework to handle content negotiation, marshalling, and streaming natively.
Note: During the review of the initial type-safety changes, a discussion was raised regarding the historical relevance and potential deprecation of the MIX XBRL standards. As noted by the maintainers, module removal is a project-wide decision requiring a Fineract DEV mailing list proposal. Because deprecation and code debt mitigation are independent concerns, this PR proceeds with cleaning up the existing codebase architecture as an immediate optimization.
Changes Left for Review
fineract-mix/build.gradle: Addedjakarta.xml.bind:jakarta.xml.bind-apidependency to expose native JAXB annotation support to the sub-module.MixReportXBRLDocument.java: Created a brand-new, structured JAXB schema object model graph utilizing framework decorators (@XmlRootElement,@XmlElement, nested context/unit DTO definitions) to serve as a clean blueprint for report serialization.MixReportXBRLBuilder.java: ImplementedbuildDocumentGraph(), migrating the transformation logic from legacy string operations to clean, object-oriented graph hydration. Included standard W3C elements processing for dynamic context mappings.MixReportApiResource.java: Modernized theretrieveXBRLReportendpoint signature to return the type-safeMixReportXBRLDocumentDTO instead of a raw string, delegating streaming and content serialization directly to the framework.Context & Lifecycle Management
Jira Ticket: https://issues.apache.org/jira/browse/FINERACT-2670
Code Style: Validated and formatted locally using ./gradlew :fineract-mix:spotlessApply.
Compilation Check: Verified clean build execution via ./gradlew :fineract-mix:compileJava.
Checklist
My code follows the code style of this project (Spotless verification passed successfully).
All new and existing tests pass locally.
I have performed a self-review of my own code.