Skip to content

Commit

Permalink
Release/1.0.14 prepare (#195)
Browse files Browse the repository at this point in the history
Merge the latest changes from Dev into UAT

FBR-309
FBR-308
FBR-306
FBR-305
FBR-304
FBR-303
FBR-302
FBR-290
FBR-289
FBR-287
FBR-286
FBR-285
FBR-284
FBR-283
FBR-282
FBR-116
FBR-115
FBR-18

* FBR-302 implemented bank feature (#153)

* FBR-302 implemented bank feature

* formatted code

* FBR-303 implemented bank acocunts feature

* FBR-18: Hard Policy Checklist (#150)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Add expiry of prequalifications

* FBR-306: Create new tables to store checks (#162)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Add link of group to prequalification

* FBR-309 fixed penalty charge during loan simulation

* Add link of group to prequalification

* FBR-304: Implement Bank Cheques (#167)

* FBR-304: Implement Bank Cheques

* FBR-304: Implement Bank Cheques
  • Loading branch information
leonardohildt authored Sep 25, 2023
1 parent bb17a49 commit 51595d5
Show file tree
Hide file tree
Showing 145 changed files with 7,548 additions and 525 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.fineract.commands.domain.CommandWrapper;
import org.apache.fineract.infrastructure.accountnumberformat.service.AccountNumberFormatConstants;
import org.apache.fineract.organisation.bankcheque.api.BankChequeApiConstants;
import org.apache.fineract.portfolio.client.api.ClientApiConstants;
import org.apache.fineract.portfolio.paymenttype.api.PaymentTypeApiResourceConstants;
import org.apache.fineract.portfolio.savings.DepositsApiConstants;
Expand Down Expand Up @@ -3772,4 +3773,116 @@ public CommandWrapperBuilder rejectRestructureCreditsRequest(String restructureC
this.href = "/restructurecredits/" + clientId;
return this;
}

public CommandWrapperBuilder createBank() {
this.actionName = "CREATE";
this.entityName = "BANK";
this.entityId = null;
this.href = "/banks";
return this;
}

public CommandWrapperBuilder updateBank(final Long bankId) {
this.actionName = "UPDATE";
this.entityName = "BANK";
this.entityId = bankId;
this.href = "/banks/" + bankId;
return this;
}

public CommandWrapperBuilder deleteBank(final Long bankId) {
this.actionName = "DELETE";
this.entityName = "BANK";
this.entityId = bankId;
this.href = "/banks/" + bankId;
return this;
}

public CommandWrapperBuilder createBankAccount() {
this.actionName = "CREATE";
this.entityName = "BANKACCOUNT";
this.entityId = null;
this.href = "/bankaccounts";
return this;
}

public CommandWrapperBuilder updateBankAccount(final Long bankAccountId) {
this.actionName = "UPDATE";
this.entityName = "BANKACCOUNT";
this.entityId = bankAccountId;
this.href = "/bankaccounts/" + bankAccountId;
return this;
}

public CommandWrapperBuilder deleteBankAccount(final Long bankAccountId) {
this.actionName = "DELETE";
this.entityName = "BANKACCOUNT";
this.entityId = bankAccountId;
this.href = "/bankaccounts/" + bankAccountId;
return this;
}

public CommandWrapperBuilder createChequeBatch() {
this.entityName = BankChequeApiConstants.BANK_CHECK_RESOURCE_NAME;
this.actionName = BankChequeApiConstants.CHECK_ACTION_CREATE;
this.entityId = null;
this.href = "/bankcheques";
return this;
}

public CommandWrapperBuilder reassignCheque(final Long chequeId) {
this.entityName = BankChequeApiConstants.BANK_CHECK_RESOURCE_NAME;
this.actionName = BankChequeApiConstants.CHECK_ACTION_REASSIGN;
this.entityId = chequeId;
this.href = "/bankcheques";
return this;
}

public CommandWrapperBuilder authorizedChequeReassignment(final Long chequeId) {
this.entityName = BankChequeApiConstants.BANK_CHECK_RESOURCE_NAME;
this.actionName = BankChequeApiConstants.CHECK_ACTION_AUTHORIZEREASSIGN;
this.entityId = chequeId;
this.href = "/bankcheques";
return this;
}

public CommandWrapperBuilder voidCheque(final Long chequeId) {
this.entityName = BankChequeApiConstants.BANK_CHECK_RESOURCE_NAME;
this.actionName = BankChequeApiConstants.CHECK_ACTION_VOID;
this.entityId = chequeId;
this.href = "/bankcheques";
return this;
}

public CommandWrapperBuilder authorizeChequeVoidance(final Long chequeId) {
this.entityName = BankChequeApiConstants.BANK_CHECK_RESOURCE_NAME;
this.actionName = BankChequeApiConstants.CHECK_ACTION_AUTHORIZEVOID;
this.entityId = chequeId;
this.href = "/bankcheques";
return this;
}

public CommandWrapperBuilder updateChequeBatch(Long batchId) {
this.entityName = BankChequeApiConstants.BANK_CHECK_RESOURCE_NAME;
this.actionName = BankChequeApiConstants.CHECK_ACTION_UPDATE;
this.entityId = batchId;
this.href = "/bankcheques/" + batchId;
return this;
}

public CommandWrapperBuilder deleteChequeBatch(Long batchId) {
this.entityName = BankChequeApiConstants.BANK_CHECK_RESOURCE_NAME;
this.actionName = BankChequeApiConstants.CHECK_ACTION_DELETE;
this.entityId = batchId;
this.href = "/bankcheques/" + batchId;
return this;
}

public CommandWrapperBuilder bureauValidationProcessing(Long prequalificationId) {
this.actionName = "VALIDATE";
this.entityName = "BUREAU";
this.entityId = prequalificationId;
this.href = "/prequalification/checklist/" + prequalificationId;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,17 @@ public Optional<LocalDateTime> getLastModifiedDate() {
public void setLastModifiedDate(final LocalDateTime lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}

public void stampAudit(final Long currentUserId, final LocalDateTime currentDateTime) {
if (currentUserId != null && currentDateTime != null) {
if (this.createdBy == null) {
this.createdBy = currentUserId;
}
if (this.createdDate == null) {
this.createdDate = currentDateTime;
}
this.lastModifiedBy = currentUserId;
this.lastModifiedDate = currentDateTime;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public final class SearchParameters {
private final String groupName;
private final String centerName;

private final String accountNumber;
private final String bankName;
private final String bankCode;
private final String chequeNo;
private final Long batchId;
private final Long chequeId;

public static SearchParameters from(final String sqlSearch, final Long officeId, final String externalId, final String name,
final String hierarchy) {
final Long staffId = null;
Expand Down Expand Up @@ -109,6 +116,23 @@ public static SearchParameters forPrequalification(final String displayName, fin
sortOrder, staffId, accountNo, loanId, savingsId, null, false, null, type, null, null, null);
}

public static SearchParameters forBankCheques(final String chequeNo, final Long batchId, final Long chequeId, final String status,
final Integer offset, final Integer limit, final String orderBy, final String sortOrder) {
final Integer maxLimitAllowed = getCheckedLimit(limit);
final String accountNo = null;
final String name = null;
final String hierarchy = null;
final String externalId = null;
final Long staffId = null;
final Long loanId = null;
final Long savingsId = null;
final Long officeId = null;
final boolean isSelfUser = false;
final boolean orphansOnly = false;
return new SearchParameters(officeId, externalId, name, hierarchy, null, null, offset, maxLimitAllowed, orderBy, sortOrder, staffId,
accountNo, loanId, savingsId, orphansOnly, isSelfUser, chequeNo, status, batchId, chequeId);
}

public static SearchParameters forGroups(final Long officeId, final Long staffId, final String externalId, final String name,
final String hierarchy, final Integer offset, final Integer limit, final String orderBy, final String sortOrder,
final Boolean orphansOnly) {
Expand All @@ -118,9 +142,13 @@ public static SearchParameters forGroups(final Long officeId, final Long staffId
final Long loanId = null;
final Long savingsId = null;
final boolean isSelfUser = false;
final String chequeNo = null;
final Long batchId = null;
final Long chequeId = null;
final String status = null;

return new SearchParameters(officeId, externalId, name, hierarchy, null, null, offset, maxLimitAllowed, orderBy, sortOrder, staffId,
accountNo, loanId, savingsId, orphansOnly, isSelfUser);
accountNo, loanId, savingsId, orphansOnly, isSelfUser, chequeNo, status, batchId, chequeId);
}

public static SearchParameters forOffices(final String orderBy, final String sortOrder) {
Expand Down Expand Up @@ -275,6 +303,32 @@ public static SearchParameters forEmailCampaign(final String sqlSearch, final In
staffId, accountNo, loanId, savingsId, orphansOnly, isSelfUser);
}

public static SearchParameters forBanks(final Integer offset, final Integer limit, final String orderBy, final String sortOrder,
String searchText) {

final Integer maxLimitAllowed = getCheckedLimit(limit);
final Long staffId = null;
final String accountNo = null;
final Long loanId = null;
final Long savingsId = null;

return new SearchParameters(searchText, null, null, null, null, null, null, null, offset, maxLimitAllowed, orderBy, sortOrder,
staffId, accountNo, loanId, savingsId, null, false, null);
}

public static SearchParameters forBankAccounts(final Integer offset, final Integer limit, final String orderBy, final String sortOrder,
String searchText, final String accountNumber, final String bankName, final String bankCode) {

final Integer maxLimitAllowed = getCheckedLimit(limit);
final Long staffId = null;
final String accountNo = null;
final Long loanId = null;
final Long savingsId = null;

return new SearchParameters(searchText, null, null, null, null, null, null, null, offset, maxLimitAllowed, orderBy, sortOrder,
staffId, accountNo, loanId, savingsId, null, false, null, accountNumber, bankName, bankCode);
}

private SearchParameters(final String sqlSearch, final Long officeId, final String externalId, final String name,
final String hierarchy, final String firstname, final String lastname, final Integer offset, final Integer limit,
final String orderBy, final String sortOrder, final Long staffId, final String accountNo, final Long loanId,
Expand Down Expand Up @@ -305,7 +359,12 @@ private SearchParameters(final String sqlSearch, final Long officeId, final Stri
this.type = null;
this.groupName = null;
this.centerName = null;

this.accountNumber = null;
this.bankName = null;
this.bankCode = null;
this.chequeNo = null;
this.batchId = null;
this.chequeId = null;
}

private SearchParameters(final String sqlSearch, final Long officeId, final String externalId, final String name,
Expand Down Expand Up @@ -338,7 +397,51 @@ private SearchParameters(final String sqlSearch, final Long officeId, final Stri
this.type = null;
this.groupName = null;
this.centerName = null;
this.accountNumber = null;
this.bankName = null;
this.bankCode = null;
this.chequeNo = null;
this.batchId = null;
this.chequeId = null;
}

private SearchParameters(final String sqlSearch, final Long officeId, final String externalId, final String name,
final String hierarchy, final String firstname, final String lastname, final String status, final Integer offset,
final Integer limit, final String orderBy, final String sortOrder, final Long staffId, final String accountNo,
final Long loanId, final Long savingsId, final Boolean orphansOnly, boolean isSelfUser, final String dpiNumber,
final String accountNumber, final String bankName, final String bankCode) {
this.sqlSearch = sqlSearch;
this.officeId = officeId;
this.externalId = externalId;
this.name = name;
this.hierarchy = hierarchy;
this.firstname = firstname;
this.lastname = lastname;
this.offset = offset;
this.limit = limit;
this.orderBy = orderBy;
this.sortOrder = sortOrder;
this.staffId = staffId;
this.accountNo = accountNo;
this.loanId = loanId;
this.savingsId = savingsId;
this.orphansOnly = orphansOnly;
this.currencyCode = null;
this.provisioningEntryId = null;
this.productId = null;
this.categoryId = null;
this.isSelfUser = isSelfUser;
this.status = status;
this.dpiNumber = dpiNumber;
this.type = null;
this.groupName = null;
this.centerName = null;
this.accountNumber = accountNumber;
this.bankName = bankName;
this.bankCode = bankCode;
this.chequeNo = null;
this.batchId = null;
this.chequeId = null;
}

private SearchParameters(final String sqlSearch, final Long officeId, final String externalId, final String name,
Expand Down Expand Up @@ -372,13 +475,19 @@ private SearchParameters(final String sqlSearch, final Long officeId, final Stri
this.type = type;
this.groupName = groupName;
this.centerName = centerName;

this.accountNumber = null;
this.bankName = null;
this.bankCode = null;
this.chequeNo = null;
this.batchId = null;
this.chequeId = null;
}

private SearchParameters(final Long officeId, final String externalId, final String name, final String hierarchy,
final String firstname, final String lastname, final Integer offset, final Integer limit, final String orderBy,
final String sortOrder, final Long staffId, final String accountNo, final Long loanId, final Long savingsId,
final Boolean orphansOnly, boolean isSelfUser) {
final Boolean orphansOnly, boolean isSelfUser, final String chequeNo, final String status, final Long batchId,
final Long chequeId) {
this.sqlSearch = null;
this.officeId = officeId;
this.externalId = externalId;
Expand All @@ -400,11 +509,17 @@ private SearchParameters(final Long officeId, final String externalId, final Str
this.productId = null;
this.categoryId = null;
this.isSelfUser = isSelfUser;
this.status = null;
this.status = status;
this.dpiNumber = null;
this.type = null;
this.groupName = null;
this.centerName = null;
this.accountNumber = null;
this.bankName = null;
this.bankCode = null;
this.chequeNo = chequeNo;
this.batchId = batchId;
this.chequeId = chequeId;
}

private SearchParameters(final Long provisioningEntryId, final Long officeId, final Long productId, final Long categoryId,
Expand Down Expand Up @@ -435,7 +550,12 @@ private SearchParameters(final Long provisioningEntryId, final Long officeId, fi
this.type = null;
this.groupName = null;
this.centerName = null;

this.accountNumber = null;
this.bankName = null;
this.bankCode = null;
this.chequeNo = null;
this.batchId = null;
this.chequeId = null;
}

public SearchParameters(final String sqlSearch, final Long officeId, final String externalId, final String name, final String hierarchy,
Expand Down Expand Up @@ -468,7 +588,12 @@ public SearchParameters(final String sqlSearch, final Long officeId, final Strin
this.type = null;
this.groupName = null;
this.centerName = null;

this.accountNumber = null;
this.bankName = null;
this.bankCode = null;
this.chequeNo = null;
this.batchId = null;
this.chequeId = null;
}

public boolean isOrderByRequested() {
Expand Down Expand Up @@ -646,6 +771,30 @@ public boolean isSelfUser() {
return this.isSelfUser;
}

public String getAccountNumber() {
return accountNumber;
}

public String getBankName() {
return bankName;
}

public String getBankCode() {
return bankCode;
}

public String getChequeNo() {
return chequeNo;
}

public Long getBatchId() {
return batchId;
}

public Long getChequeId() {
return chequeId;
}

/**
* creates an instance of the SearchParameters from a request for the report mailing job run history
*
Expand Down
Loading

0 comments on commit 51595d5

Please sign in to comment.