Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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 @@ -1711,7 +1711,7 @@ public void addDisbursementDetailToLoan(String expectedDisbursementDate, Double

GetLoansLoanIdResponse loanDetails = ok(
() -> fineractClient.loans().retrieveOneLoan(loanId, Map.of("staffInSelectedOfficeOnly", "false", "associations", "all")));
Set<GetLoansLoanIdDisbursementDetails> disbursementDetailsList = loanDetails.getDisbursementDetails();
List<GetLoansLoanIdDisbursementDetails> disbursementDetailsList = loanDetails.getDisbursementDetails();

List<DisbursementDetail> disbursementData = new ArrayList<>();

Expand Down Expand Up @@ -1751,7 +1751,7 @@ public void loanTrancheDetailsTabCheck(DataTable table) {

GetLoansLoanIdResponse loanDetailsResponse = ok(
() -> fineractClient.loans().retrieveOneLoan(loanId, Map.of("staffInSelectedOfficeOnly", "false", "associations", "all")));
Set<GetLoansLoanIdDisbursementDetails> disbursementDetails = loanDetailsResponse.getDisbursementDetails();
List<GetLoansLoanIdDisbursementDetails> disbursementDetails = loanDetailsResponse.getDisbursementDetails();
List<List<String>> data = table.asLists();
for (int i = 1; i < data.size(); i++) {
List<String> expectedValues = data.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
package org.apache.fineract.portfolio.loanaccount.api;

import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
Expand All @@ -32,6 +34,59 @@ private LoanScheduleApiResourceSwagger() {}
public static final class PostLoansLoanIdScheduleRequest {

private PostLoansLoanIdScheduleRequest() {}

@Schema(description = "The installment changes to apply to the repayment schedule")
public static final class PostLoansLoanIdScheduleExceptions {

private PostLoansLoanIdScheduleExceptions() {}

@Schema(description = "Installments whose due date, principal or instalment amount changes")
public List<PostLoansLoanIdScheduleModifiedInstallment> modifiedinstallments;
@Schema(description = "Installments added to the schedule")
public List<PostLoansLoanIdScheduleNewInstallment> newinstallments;
@Schema(description = "Installments removed from the schedule")
public List<PostLoansLoanIdScheduleDeletedInstallment> deletedinstallments;
}

static final class PostLoansLoanIdScheduleModifiedInstallment {

private PostLoansLoanIdScheduleModifiedInstallment() {}

@Schema(example = "20 November 2011")
public String dueDate;
@Schema(example = "25 November 2011")
public String modifiedDueDate;
@Schema(example = "5000")
public BigDecimal principal;
@Schema(example = "30000")
public BigDecimal installmentAmount;
}

static final class PostLoansLoanIdScheduleNewInstallment {

private PostLoansLoanIdScheduleNewInstallment() {}

@Schema(example = "31 October 2011")
public String dueDate;
@Schema(example = "5000")
public BigDecimal principal;
@Schema(example = "5000")
public BigDecimal installmentAmount;
}

static final class PostLoansLoanIdScheduleDeletedInstallment {

private PostLoansLoanIdScheduleDeletedInstallment() {}

@Schema(example = "20 December 2011")
public String dueDate;
}

@Schema(example = "en")
public String locale;
@Schema(example = "dd MMMM yyyy")
public String dateFormat;
public PostLoansLoanIdScheduleExceptions exceptions;
}

@Schema(description = "PostLoansLoanIdScheduleResponse")
Expand All @@ -47,8 +102,35 @@ private PostLoanChanges() {}
public List<Long> removedEntityIds;
}

@Schema(description = "A period of the schedule the calculateLoanSchedule command returns")
static final class PostLoansLoanIdSchedulePeriod {

private PostLoansLoanIdSchedulePeriod() {}

@Schema(example = "1")
public Integer period;
@Schema(example = "[2011, 10, 20]")
public LocalDate dueDate;
@Schema(example = "[2011, 9, 20]")
public LocalDate fromDate;
@Schema(example = "34675.47")
public BigDecimal principalDue;
@Schema(example = "34675.47")
public BigDecimal principalOriginalDue;
@Schema(example = "1972.60")
public BigDecimal interestOriginalDue;
@Schema(example = "36648.07")
public BigDecimal totalOriginalDueForPeriod;
@Schema(example = "36648.07")
public BigDecimal totalDueForPeriod;
@Schema(example = "36648.07")
public BigDecimal totalOutstandingForPeriod;
}

@Schema(example = "1")
public Long loanId;
public PostLoanChanges changes;
@Schema(description = "Returned by the calculateLoanSchedule command: the schedule the variations produce")
public List<PostLoansLoanIdSchedulePeriod> periods;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.fineract.portfolio.loanaccount.api;

import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -135,6 +136,23 @@ private GetPaymentTypeOptions() {}
public LocalDate nextInstallmentDueDate;
@Schema(example = "[2009, 8, 1]")
public LocalDate calculatedStartDate;
@Schema(description = "Disburse template only: the repayment schedule installments the disbursement will produce")
public List<GetLoansLoanIdRepaymentScheduleInstallment> loanRepaymentScheduleInstallments;

@Schema(description = "A repayment schedule installment of a loan transaction template")
static final class GetLoansLoanIdRepaymentScheduleInstallment {

private GetLoansLoanIdRepaymentScheduleInstallment() {}

@Schema(example = "1")
public Long id;
@Schema(example = "1")
public Integer installmentId;
@Schema(example = "[2012, 5, 4]")
public LocalDate date;
@Schema(example = "1600.00")
public BigDecimal amount;
}
}

public static final class GetLoanCurrency {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ private PostLoanProductsRequest() {}
public Boolean isLinkedToFloatingInterestRates;
@Schema(example = "false")
public Boolean allowVariableInstallments;
@Schema(example = "0", description = "Minimum days between two installments of a variable installment loan")
public Integer minimumGap;
@Schema(example = "90", description = "Maximum days between two installments of a variable installment loan")
public Integer maximumGap;
@Schema(example = "false", description = "Force the actual disbursement date to match the expected disbursement date")
public Boolean syncExpectedWithDisbursementDate;
@Schema(example = "50", description = "Percentage of the loan that guarantors must cover")
public BigDecimal mandatoryGuarantee;
@Schema(example = "20", description = "Minimum percentage of the guarantee an external guarantor must provide")
public BigDecimal minimumGuaranteeFromGuarantor;
@Schema(example = "20", description = "Minimum percentage of the guarantee the borrower must provide from own funds")
public BigDecimal minimumGuaranteeFromOwnFunds;
@Schema(example = "30")
public Integer minimumDaysBetweenDisbursalAndFirstRepayment;
@Schema(example = "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public class LoanDisbursementDetailApiResource {
@Path("{disbursementId}")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanDisbursementDetailApiResourceSwagger.PutLoansLoanIdDisbursementsDisbursementIdRequest.class)))
public CommandProcessingResult updateDisbursementDate(@PathParam("loanId") final Long loanId,
@PathParam("disbursementId") final Long disbursementId, final String apiRequestBodyAsJson) {
@PathParam("disbursementId") final Long disbursementId, @Parameter(hidden = true) final String apiRequestBodyAsJson) {

final CommandWrapper commandRequest = new CommandWrapperBuilder().updateDisbusementDate(loanId, disbursementId)
.withJson(apiRequestBodyAsJson).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ public final class LoanDisbursementDetailApiResourceSwagger {

private LoanDisbursementDetailApiResourceSwagger() {}

@Schema(description = "PutLoansLoanIdDisbursementsDisbursementIdRequest")
public static final class PutLoansLoanIdDisbursementsDisbursementIdRequest {

private PutLoansLoanIdDisbursementsDisbursementIdRequest() {}

@Schema(example = "dd MMMM yyyy")
public String dateFormat;
@Schema(example = "en")
public String locale;
@Schema(example = "5000")
public BigDecimal approvedLoanAmount;
@Schema(example = "01 March 2014")
public String expectedDisbursementDate;
@Schema(example = "01 March 2014", description = "The new expected disbursement date of the tranche")
public String updatedExpectedDisbursementDate;
@Schema(example = "900", description = "The new principal of the tranche")
public BigDecimal updatedPrincipal;
}

@Schema(description = "PostAddAndDeleteDisbursementDetailRequest")
public static final class PostAddAndDeleteDisbursementDetailRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1256,8 +1256,8 @@ private GetLoansLoanIdOriginatorData() {}
public GetLoansLoanIdRepaymentSchedule repaymentSchedule;
@Schema(description = "Set of GetLoansLoanIdTransactions")
public List<GetLoansLoanIdTransactions> transactions;
@Schema(description = "Set of GetLoansLoanIdDisbursementDetails")
public Set<GetLoansLoanIdDisbursementDetails> disbursementDetails;
@Schema(description = "List of GetLoansLoanIdDisbursementDetails")
public List<GetLoansLoanIdDisbursementDetails> disbursementDetails;
@Schema(example = "false", description = "Allow full term length for each tranche disbursement")
public Boolean allowFullTermForTranche;
@Schema(description = "Delinquent data")
Expand Down Expand Up @@ -1823,6 +1823,23 @@ private PostLoansLoanIdDisbursementData() {}
public BigDecimal principal;
}

@Schema(description = "Post dated check backing one repayment installment")
static final class PostLoansLoanIdPostDatedCheckData {

private PostLoansLoanIdPostDatedCheckData() {}

@Schema(example = "1")
public Integer installmentId;
@Schema(example = "AMANA BANK")
public String name;
@Schema(example = "1600.00")
public BigDecimal amount;
@Schema(example = "900400500621")
public Long accountNo;
@Schema(example = "123456789")
public Long checkNo;
}

@Schema(description = "Originator data for loan disbursement request")
public static final class PostLoansLoanIdOriginatorData {

Expand Down Expand Up @@ -1895,6 +1912,8 @@ private PostLoansLoanIdGlimApprovalData() {}
public String withdrawnOnDate;
@Schema(description = "List of PostLoansLoanIdDisbursementData")
public List<PostLoansLoanIdDisbursementData> disbursementData;
@Schema(description = "Disburse only: the post dated checks backing the repayment schedule")
public List<PostLoansLoanIdPostDatedCheckData> postDatedChecks;
@Schema(example = "500.00")
public BigDecimal fixedEmiAmount;
@Schema(example = "28 July 2022")
Expand Down Expand Up @@ -1959,6 +1978,8 @@ private PostLoansLoanIdChanges() {}
public String note;
@Schema(description = "PostLoansLoanIdStatus")
public PostLoansLoanIdStatus status;
@Schema(example = "1000.00", description = "Undo last disbursal only: the tranche amount that was rolled back")
public BigDecimal disbursedAmount;
}

@Schema(example = "2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public String getPostDatedChecks(@PathParam("loanId") @Parameter(description = "
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Get Post Dated Check", description = "Get Post Dated Check")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PostDatedChecksApiResourceSwagger.GetPostDatedChecks.class)))) })
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PostDatedChecksApiResourceSwagger.GetPostDatedChecks.class))) })
public String getPostDatedCheck(@PathParam("installmentId") @Parameter(description = "installmentId") final Integer installmentId,
@PathParam("loanId") @Parameter(description = "loanId") final Long loanId) {
this.context.authenticatedUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ private PostSavingsAccountsRequest() {}

@Schema(example = "1")
public Long clientId;
@Schema(example = "1", description = "Mandatory for a group savings account, in place of clientId")
public Long groupId;
@Schema(example = "1")
public Long productId;
@Schema(example = "en")
Expand Down
Loading
Loading