FINERACT-2723: Rename ambiguous domain-enum getters in StandingInstructionData - #6199
Open
Samer-Melhem-FOO wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
StandingInstructionDatadeclares several fields of typeEnumOptionData(fromAccountType,toAccountType,transferType,instructionType,recurrenceType,recurrenceFrequency). The class also declares same-named getter methods that return a different, internal domain-enum type instead, e.g.:This is confusing to read and maintain: a field and its same-named "getter" disagree on type. No behavior or API change:
StandingInstructionApiResourceserializes this class viaDefaultToApiJsonSerializer, which is Gson-based and reads the raw field directly regardless of these methods, so today's JSON output is unaffected either way — but the naming collision is still a latent correctness hazard (e.g. for anyone who later touches serialization, or adds a getter-based tool/library) worth removing.Change: rename the six domain-enum helper methods to a distinct
*Enumsuffix (getFromAccountTypeEnum(),getToAccountTypeEnum(),getTransferTypeEnum(),getInstructionTypeEnum(),getRecurrenceTypeEnum(),getRecurrenceFrequencyEnum()) so they no longer shadow the field name, and add an explicit getter on each underlying field for consistency with the rest of the class. Internal callers (StandingInstructionApiResource,ExecuteStandingInstructionsTasklet) are updated to use the renamed methods, with added null-safety intoTransferType()since the domain-enum helper can returnnullwhen the underlyingEnumOptionDatafield isnull.JIRA: https://issues.apache.org/jira/browse/FINERACT-2723
Checklist
Note: pure internal rename with no behavior change, so no new test coverage was added; existing Standing Instruction tests continue to pass unmodified. No API documentation update needed since there is no API response change.