-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FINERACT-2259: Manage external IDs-Savings #4623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
@Lymah123 Please run this before any commits: |
Ok. |
|
Hi @adamsaghy I've tried building it on my end, but some call sites require externalId implementations, which I'm currently working on. I'll push the updates once I've completed and tested the changes. I just thought of updating you on the progress. Thank you. |
7b48696 to
88db06f
Compare
Please make sure all new files has the apache license header! (you can copy from any existing file) |
88db06f to
fd5bdcc
Compare
@adamsaghy , I have worked on the files. |
|
you can see all the checks are red!
|
4f2ca61 to
459b798
Compare
|
Hi @adamsaghy, I have made some changes and tried building and testing locally, which was successful. |
|
@Lymah123 Please rebase your PR with the latest develop branch! Also make sure you have pushed all the changes. The above listed errors are compilation errors... |
|
Please, solve the conflict. |
e27a48a to
cca884d
Compare
|
I'm experiencing an unusual conflict situation with my PR. GitHub shows conflicts in three files: However, my local Git shows no conflicts:
What I've Tried
What approach would you recommend to resolve these "phantom" conflicts? |
|
There is no such things as phantom conflicts.. The recommended way is to rebase your feature branch. However what you have tried to do was to rebase the local develop branch, however if you didnt pulled the latest changes of develop branch from the remote, it will not do much things, so let me advise 2 options what you can do: Option 1:
Option 2:
|
ce44487 to
1223eae
Compare
|
The issue wasn't actually "phantom" conflicts , thanks for the correction, @adamsaghy
Why Local Git Showed No Conflicts when I run: These commands were comparing against my fork's The Real Issue: Steps I took to resolved it:
Key Takeaway My PR is ready for review @adamsaghy. Thanks! |
|
| AWS_EC2_METADATA_DISABLED=true | ||
| AWS_ENDPOINT_URL=http://localstack:4666 | ||
| #FINERACT_AWS_ENDPOINT=http://localstack:4666 | ||
| # AWS_ENDPOINT_URL is deprecated, use FINERACT_AWS_ENDPOINT instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of scope changes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for the previous PR I opened. I will delete the branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not reverted...
fineract-provider/build.gradle
Outdated
| } | ||
| } | ||
|
|
||
| compileJava.dependsOn(':fineract-core:compileJava') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I changed it so I can build locally on my end. I will remove it
| transferCode, null); | ||
| SavingsAccountTransaction holdTransaction = SavingsAccountTransaction.holdAmount(savingsAccount, savingsAccount.office(), | ||
| paymentDetail, transactionDate, Money.of(savingsAccount.getCurrency(), total), false); | ||
| paymentDetail, transactionDate, Money.of(savingsAccount.getCurrency(), total), false, ExternalId.empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check whether enable-auto-generated-external-id is true or false...
if it is true, we need to generate automatically external id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will work on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes were made...
| isRegularTransaction, fromSavingsAccount.isWithdrawalFeeApplicableForTransfer(), isInterestTransfer, isWithdrawBalance); | ||
| final SavingsAccountTransaction withdrawal = this.savingsAccountDomainService.handleWithdrawal(fromSavingsAccount, fmt, | ||
| transactionDate, transactionAmount, paymentDetail, transactionBooleanValues, backdatedTxnsAllowedTill); | ||
| transactionDate, transactionAmount, paymentDetail, transactionBooleanValues, backdatedTxnsAllowedTill, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check whether enable-auto-generated-external-id is true or false...
if it is true, we need to generate automatically external id.
Example:
if (externalId.isEmpty() && TemporaryConfigurationServiceContainer.isExternalIdAutoGenerationEnabled()) {
externalId = ExternalId.generate();
}
org.apache.fineract.portfolio.loanaccount.service.LoanAssemblerImpl#updateFrom, line 537
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes...
| final Money transactionAmountMoney = Money.of(getCurrency(), this.accountTermAndPreClosure.depositAmount()); | ||
| final SavingsAccountTransaction transaction = SavingsAccountTransaction.deposit(null, office(), null, | ||
| this.accountSubmittedOrActivationDate(), transactionAmountMoney, refNo); | ||
| this.accountSubmittedOrActivationDate(), transactionAmountMoney, refNo, ExternalId.empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check whether enable-auto-generated-external-id is true or false...
if it is true, we need to generate automatically external id.
| } | ||
| final SavingsAccountTransaction transaction = SavingsAccountTransaction.deposit(null, office(), null, dueDate, | ||
| installment.getDepositAmountOutstanding(getCurrency()), refNo); | ||
| installment.getDepositAmountOutstanding(getCurrency()), refNo, ExternalId.empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check whether enable-auto-generated-external-id is true or false...
if it is true, we need to generate automatically external id.
gradlew.original
Outdated
| @@ -0,0 +1,249 @@ | |||
| #!/bin/sh | |||
|
|
|||
| # | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For local build, I will remove it.
adamsaghy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my review and failing tests!
I have, and I will work on the requested changes. |
|
This pull request seems to be stale. Are you still planning to work on it? We will automatically close it in 30 days. |
|
I am still working on it. I wasn't available for some times. |
1223eae to
c565dd9
Compare
| String transferCode = request.getTransferCode(); | ||
|
|
||
| // Check if auto-generation of external ID is enabled | ||
| final boolean isAutoGeneratedExternalIdEnabled = this.configurationDomainService.isExternalIdAutoGenerationEnabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an IF-ELSE would be nicer here...
| * Returns an appropriate ExternalId based on configuration settings. If auto-generation is enabled and the provided | ||
| * externalId is empty, generates a new one. | ||
| */ | ||
| private ExternalId getExternalId(ExternalId externalId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont need this... a simple IF-ELSE would be enought to either generate a new or return empty...
No need for this, use ExternalIdFactory
| * Returns an appropriate ExternalId based on configuration settings. If auto-generation is enabled and the provided | ||
| * externalId is empty, generate a new one. | ||
| */ | ||
| public ExternalId getExternalId(ExternalId externalId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this, use ExternalIdFactory
| * Returns an appropriate ExternalId based on configuration settings. If auto-generation is enabled and provided | ||
| * externalId is empty, generate a new one. | ||
| */ | ||
| public ExternalId getExternalId(ExternalId externalId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this, use ExternalIdFactory
|
|
||
| public transient ConfigurationDomainService configurationDomainService; | ||
|
|
||
| public ExternalId getExternalId(ExternalId externalId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this, use ExternalIdFactory
| boolean backdatedTxnsAllowedTill) { | ||
| final SavingsAccountTransaction chargeTransaction = SavingsAccountTransaction.waiver(this, office(), | ||
| DateUtils.getBusinessLocalDate(), transactionAmount); | ||
| DateUtils.getBusinessLocalDate(), transactionAmount, null, ExternalId.empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite to get the external id as parameter
|
@Lymah123 You need to rewrite the whole PR:
|
alright @adamsaghy |
|
Hi @adamsaghy, I have gone through all the feedback. I will work on the requested changes. Thanks. |
|
Additional issues:
|
@adamsaghy are these additional issues to work on regards this PR? |
|
This pull request seems to be stale. Are you still planning to work on it? We will automatically close it in 30 days. |
|
@Lymah123 are you still working on this PR? |
@adamsaghy, I need a response to this, please. Thanks! |
|
This pull request seems to be stale. Are you still planning to work on it? We will automatically close it in 30 days. |
Description
Introduction
Transactions may change due to correction. Correction can be done by reverting a transaction. This can lead to removing and adding transactions back to an account. It results new ID distribution from the transaction sequence. External systems may not want to follow up on these changes but rather access transactions as they are at their end state. In order to be able to direct client immediately to the right record an additional identifier is to be used.
Supporting externalId is a long time wanted functionality with two major benefits:
Requirements
🟩 Supporting external id for identifying and fetching some if the entities in Fineract
🟩 API enhancement to support targeting by external id
✅ External id can be provided in API request
🟩 Extend API response with external id
🟩 Support external id auto generation (configurable)
External identifier
Database
External identifier field to be stored in the loan table
type: String
indexing: true
Configuration
Enable to auto generate external id (if not provided).
By default it should be disabled.
This configuration already exists!
Goal
This story is focusing to introduce external ids for savings accounts and transactions!