FINERACT-2778: Allow teller and vault financial activity mappings to be updated - #6311
Open
oluexpert99 wants to merge 1 commit into
Open
FINERACT-2778: Allow teller and vault financial activity mappings to be updated#6311oluexpert99 wants to merge 1 commit into
oluexpert99 wants to merge 1 commit into
Conversation
…be updated
FinancialActivityAccountDataValidator validates the same parameter against two
hand-written lists. validateForCreate accepts all seven FinancialActivity
constants; validateForUpdate accepted five, omitting CASH_AT_MAINVAULT (101)
and CASH_AT_TELLER (102). The platform will therefore create a teller or vault
mapping and then refuse every attempt to change it:
PUT /financialactivityaccounts/{id} {"financialActivityId":102,...}
400 validation.msg.financialactivityaccount.financialActivityId
.is.not.one.of.expected.enumerations
must be one of [ 100, 200, 300, 103, 201 ]
Both halves write the same column, and the teller module resolves the mapping
through findByFinancialActivityTypeWithNotFoundDetection whichever route
created it, so the two lists have no reason to differ.
These are the GL accounts the cashier module posts cash against. A deployment
that maps them wrongly, which is easy since they are set once at configuration
time, has every teller and vault movement landing on the wrong account and no
supported way to correct it. The remaining options are to delete the mapping
and create a replacement, discarding the row and its identity, or to update the
database directly, bypassing validation and the audit trail.
FinancialActivityAccountsTest exercised the update path only with
LIABILITY_TRANSFER, and its negative case used activity id 232, which is not in
the enum at all. A value that is in the enum, is accepted by create and is
refused by update fell between the two cases. The test now creates a
CASH_AT_TELLER mapping and updates it.
Signed-off-by: oluexpert99 <farooq@techservicehub.io>
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.
FinancialActivityAccountDataValidator validates the same parameter against two
hand-written lists. validateForCreate accepts all seven FinancialActivity
constants; validateForUpdate accepted five, omitting CASH_AT_MAINVAULT (101)
and CASH_AT_TELLER (102). The platform will therefore create a teller or vault
mapping and then refuse every attempt to change it:
Both halves write the same column, and the teller module resolves the mapping
through findByFinancialActivityTypeWithNotFoundDetection whichever route
created it, so the two lists have no reason to differ.
These are the GL accounts the cashier module posts cash against. A deployment
that maps them wrongly, which is easy since they are set once at configuration
time, has every teller and vault movement landing on the wrong account and no
supported way to correct it. The remaining options are to delete the mapping
and create a replacement, discarding the row and its identity, or to update the
database directly, bypassing validation and the audit trail.
FinancialActivityAccountsTest exercised the update path only with
LIABILITY_TRANSFER, and its negative case used activity id 232, which is not in
the enum at all. A value that is in the enum, is accepted by create and is
refused by update fell between the two cases. The test now creates a
CASH_AT_TELLER mapping and updates it.
Description
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.