-
Notifications
You must be signed in to change notification settings - Fork 19
[GOV-75] #160
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
Open
Anover000
wants to merge
16
commits into
openMF:master
Choose a base branch
from
Anover000:abhich
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[GOV-75] #160
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ebe2f98
Changing account lookup bpmn to lion
apurbraj e3e2f19
Fix splitting
apurbraj 161794a
checkstyle fix
apurbraj d5f89c8
BatchId in transfers table logic updtae
33d24a2
Added dockerfile, and rmeoved commented code
be2cbac
Fixed spotless issues
fc0dac0
BatchId in transfers table logic updtae
88200c0
Fixed spotless issues
9cef49f
yaml file configiration changes
c6351e1
Updated service url
b2bfb5c
updatetd csv schema
8c9f5af
deleted csv fies
34c168b
checkstyle changes
55aec6d
Init sub-batch fix
691b782
raw body fix
Anover000 f12220b
Delete c20db108-f2fe-4151-a526-b353cee18e41_bulk_payment.csv
abhinavm117 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,4 @@ FROM openjdk:17 | |
| EXPOSE 5000 | ||
|
|
||
| COPY build/libs/*.jar . | ||
| CMD java -jar *.jar | ||
| CMD java -jar *.jar | ||
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
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
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
66 changes: 66 additions & 0 deletions
66
src/main/java/org/mifos/processor/bulk/utility/TransactionParser.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| package org.mifos.processor.bulk.utility; | ||
|
|
||
| import org.mifos.processor.bulk.schema.Transaction; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| public final class TransactionParser { | ||
|
|
||
| private static final Logger logger = LoggerFactory.getLogger(TransactionParser.class); | ||
|
|
||
| private TransactionParser() { | ||
| throw new IllegalStateException("Utility class"); | ||
| } | ||
|
|
||
| public static Transaction parseLineToTransaction(String line) { | ||
| try { | ||
| String[] parts = line.split(",", -1); | ||
| Transaction transaction = new Transaction(); | ||
|
|
||
| if (parts.length > 0 && !parts[0].isEmpty()) { | ||
| transaction.setId(Integer.parseInt(parts[0])); | ||
| } | ||
| if (parts.length > 1) { | ||
| transaction.setRequestId(parts[1]); | ||
| } | ||
| if (parts.length > 2) { | ||
| transaction.setPaymentMode(parts[2]); | ||
| } | ||
| if (parts.length > 4) { | ||
| transaction.setPayerIdentifierType(parts[3]); | ||
| } | ||
| if (parts.length > 5) { | ||
| transaction.setPayerIdentifier(parts[4]); | ||
| } | ||
| if (parts.length > 6) { | ||
| transaction.setPayeeIdentifierType(parts[5]); | ||
| } | ||
| if (parts.length > 7) { | ||
| transaction.setPayeeIdentifier(parts[6]); | ||
| } | ||
| if (parts.length > 8) { | ||
| transaction.setAmount(parts[7]); | ||
| } | ||
| if (parts.length > 9) { | ||
| transaction.setCurrency(parts[8]); | ||
| } | ||
| if (parts.length > 10) { | ||
| transaction.setNote(parts[9]); | ||
| } | ||
| if (parts.length > 11) { | ||
| transaction.setProgramShortCode(parts[10]); | ||
| } | ||
| if (parts.length > 12) { | ||
| transaction.setCycle(parts[11]); | ||
| } | ||
| if (parts.length > 13) { | ||
| transaction.setPayeeDfspId(parts[12]); | ||
| } | ||
|
|
||
| return transaction; | ||
| } catch (Exception e) { | ||
| logger.error("Error parsing line to Transaction object: {}", line, e); | ||
| return null; | ||
| } | ||
| } | ||
| } |
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
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
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
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
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.
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.
Why the writer close is removed?
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.
Since, I have used writer with try-with resource statement it automatically closes writer irrespectve of whether writing occurs or an exception is thrown.