Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ public boolean isDebitEntry() {
return JournalEntryType.DEBIT.getValue().equals(this.type);
}

public boolean isCreditEntry() {
return JournalEntryType.CREDIT.getValue().equals(this.type);
}

public void setReversalJournalEntry(final JournalEntry reversalJournalEntry) {
this.reversalJournalEntry = reversalJournalEntry;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
"string"
]
},
{
"default": null,
"name": "transferExternalGroupId",
"type": [
"null",
"string"
]
},
{
"default": null,
"name": "submittedDate",
Expand Down
4 changes: 2 additions & 2 deletions fineract-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ compileJava.doLast {
javaexec {
description = 'Performs EclipseLink static weaving of entity classes'
def target = source
mainClass = 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
args '-persistenceinfo', source, '-classpath', sourceSets.main.runtimeClasspath, source, target
main = 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
args '-persistenceinfo', source, source, target
classpath sourceSets.main.runtimeClasspath
}
delete {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3661,6 +3661,14 @@ public CommandWrapperBuilder updateExternalAssetOwnerLoanProductAttribute(final
return this;
}

public CommandWrapperBuilder intermediarySaleLoanToExternalAssetOwner(final Long loanId) {
this.actionName = "INTERMEDIARYSALE";
this.entityName = "LOAN";
this.loanId = loanId;
this.href = "/external-asset-owners/transfers/loans/" + loanId;
return this;
}

public CommandWrapperBuilder saleLoanToExternalAssetOwner(final Long loanId) {
this.actionName = "SALE";
this.entityName = "LOAN";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ public class CommandProcessingResultBuilder {
private Long productId;
private boolean rollbackTransaction = false;
private ExternalId entityExternalId = ExternalId.empty();

private ExternalId subEntityExternalId = ExternalId.empty();

private ExternalId loanExternalId = ExternalId.empty();

public CommandProcessingResult build() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@

public enum AssetExternalizationErrorMessage {

LOAN_NOT_ACTIVE("Loan is not in active status"), ASSET_OWNED_CANNOT_BE_SOLD(
"This loan cannot be sold, because it is owned by an external asset owner"), ASSET_NOT_OWNED_CANNOT_BE_BOUGHT(
"This loan cannot be bought back, it is not owned by an external asset owner"), BUYBACK_ALREADY_IN_PROGRESS_CANNOT_BE_BOUGHT(
"This loan cannot be bought back, external asset owner buyback transfer is already in progress"), ALREADY_PENDING(
"External asset owner transfer is already in PENDING state for this loan"), SETTLEMENT_DATE_IN_THE_PAST(
"Settlement date cannot be in the past"), INVALID_REQUEST(
"The request was invalid. This typically will happen due to validation errors which are provided.");
LOAN_NOT_ACTIVE("Loan is not in active status"), //
ASSET_OWNED_CANNOT_BE_SOLD("This loan cannot be sold, because it is owned by an external asset owner"), //
ASSET_NOT_OWNED_CANNOT_BE_BOUGHT("This loan cannot be bought back, it is not owned by an external asset owner"), //
BUYBACK_ALREADY_IN_PROGRESS_CANNOT_BE_BOUGHT(
"This loan cannot be bought back, external asset owner buyback transfer is already in progress"), //
ALREADY_PENDING("External asset owner transfer is already in PENDING state for this loan"), //
SETTLEMENT_DATE_IN_THE_PAST("Settlement date cannot be in the past"), //
LOAN_OVERPAID_INVALID("Loan status OVERPAID is not valid for transfer."), //
LOAN_CLOSED_OBLIGATIONS_MET_INVALID("Loan status CLOSED_OBLIGATIONS_MET is not valid for transfer."), //
LOAN_SUBMITTED_AND_PENDING_APPROVAL_INVALID("Loan status SUBMITTED_AND_PENDING_APPROVAL is not valid for transfer."), //
LOAN_APPROVED_INVALID("Loan status APPROVED is not valid for transfer."), //
INVALID_REQUEST("The request was invalid. This typically will happen due to validation errors which are provided."); //

public final String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Feature: Asset Externalization
When Admin sets the business date to "10 May 2023"
And Customer makes "AUTOPAY" repayment on "10 May 2023" with 1000 EUR transaction amount
Then Loan status will be "CLOSED_OBLIGATIONS_MET"
Then Asset externalization transaction with the following data results a 403 error and "LOAN_NOT_ACTIVE" error message
Then Asset externalization transaction with the following data results a 403 error and "LOAN_CLOSED_OBLIGATIONS_MET_INVALID" error message
| Transaction type | settlementDate | purchasePriceRatio |
| sale | 2023-05-21 | 1 |

Expand All @@ -276,7 +276,7 @@ Feature: Asset Externalization
When Admin sets the business date to "10 May 2023"
And Customer makes "AUTOPAY" repayment on "10 May 2023" with 1200 EUR transaction amount
Then Loan status will be "OVERPAID"
Then Asset externalization transaction with the following data results a 403 error and "LOAN_NOT_ACTIVE" error message
Then Asset externalization transaction with the following data results a 403 error and "LOAN_OVERPAID_INVALID" error message
| Transaction type | settlementDate | purchasePriceRatio |
| sale | 2023-05-21 | 1 |

Expand Down Expand Up @@ -396,7 +396,7 @@ Feature: Asset Externalization
When Admin creates a client with random data
When Admin creates a new default Loan with date: "1 May 2023"
Then Loan status will be "SUBMITTED_AND_PENDING_APPROVAL"
Then Asset externalization transaction with the following data results a 403 error and "LOAN_NOT_ACTIVE" error message
Then Asset externalization transaction with the following data results a 403 error and "LOAN_SUBMITTED_AND_PENDING_APPROVAL_INVALID" error message
| Transaction type | settlementDate | purchasePriceRatio |
| sale | 2023-05-30 | 1 |

Expand All @@ -407,7 +407,7 @@ Feature: Asset Externalization
When Admin creates a new default Loan with date: "1 May 2023"
And Admin successfully approves the loan on "1 May 2023" with "1000" amount and expected disbursement date on "1 May 2023"
Then Loan status will be "APPROVED"
Then Asset externalization transaction with the following data results a 403 error and "LOAN_NOT_ACTIVE" error message
Then Asset externalization transaction with the following data results a 403 error and "LOAN_APPROVED_INVALID" error message
| Transaction type | settlementDate | purchasePriceRatio |
| sale | 2023-05-30 | 1 |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ private String getResultByTransferId(Long id, String command) {
private String getResult(Long loanId, String apiRequestBodyAsJson, String commandParam) {
final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson);
CommandWrapper commandRequest = null;
if (CommandParameterUtil.is(commandParam, "sale")) {
if (CommandParameterUtil.is(commandParam, "intermediarySale")) {
commandRequest = builder.intermediarySaleLoanToExternalAssetOwner(loanId).build();
} else if (CommandParameterUtil.is(commandParam, "sale")) {
commandRequest = builder.saleLoanToExternalAssetOwner(loanId).build();
} else if (CommandParameterUtil.is(commandParam, "buyback")) {
commandRequest = builder.buybackLoanToExternalAssetOwner(loanId).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ private GetExternalTransferLoan() {}
@Schema(example = "e1156fbe-38bb-42f8-b491-fca02075f40e")
public String transferExternalId;

@Schema(example = "e1156fbe-38bb-42f8-b491-fca02075f40e")
public String transferExternalGroupId;

@Schema(example = "1")
public String purchasePriceRatio;

Expand Down Expand Up @@ -101,6 +104,9 @@ private PostInitiateTransferRequest() {}
@Schema(example = "36efeb06-d835-48a1-99eb-09bd1d348c1e")
public String transferExternalId;

@Schema(example = "e1156fbe-38bb-42f8-b491-fca02075f40e")
public String transferExternalGroupId;

@Schema(example = "1.2345678")
public String purchasePriceRatio;

Expand Down
Loading
Loading