public class LoansService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CENTRE_ID |
static java.lang.String |
SCHEDULE |
Constructor and Description |
---|
LoansService(MambuAPIService mambuAPIService)
Create a new loan service
|
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
addSettlementAccount(java.lang.String loanAccountKey,
java.lang.String savingsAccountKey)
Updates or links a settlement account with a loan account.
|
com.mambu.loans.shared.model.LoanTransaction |
applyFeeToLoanAccount(java.lang.String accountId,
java.util.List<com.mambu.loans.shared.model.CustomPredefinedFee> fees,
java.lang.Integer repaymentNumber,
java.lang.String notes)
Apply Predefined Fee to a loan account
|
com.mambu.loans.shared.model.LoanTransaction |
applyFeeToLoanAccount(java.lang.String accountId,
java.lang.String amount,
java.lang.String repaymentNumber,
java.lang.String notes)
Apply FEE to a loan account
|
com.mambu.loans.shared.model.LoanTransaction |
applyInterestToLoanAccount(java.lang.String accountId,
java.util.Date date,
java.lang.String notes)
Apply Interest to a loan account on a given date
|
com.mambu.loans.shared.model.LoanAccount |
approveLoanAccount(java.lang.String accountId,
java.lang.String notes)
Approve a loan account if the user has permission to approve loans, the maximum exposure is not exceeded for the
client, the account was in Pending Approval state and if the number of loans is not exceeded
|
com.mambu.loans.shared.model.LoanAccount |
closeLoanAccount(java.lang.String accountId,
APIData.CLOSER_TYPE closerType,
java.lang.String notes)
Close Loan account specifying the type of closer (withdraw, reject or close)
|
com.mambu.loans.shared.model.LoanAccount |
closeLoanAccount(java.lang.String accountId,
java.lang.String notes)
Close loan account with all obligations met
|
com.mambu.loans.shared.model.LoanAccount |
createLoanAccount(com.mambu.loans.shared.model.LoanAccount loanAccount)
Create new LoanAccount using LoanAccount object.
|
boolean |
deleteLoanAccount(java.lang.String accountId)
Delete Loan Account by its Id
|
java.lang.Boolean |
deleteSettlementAccount(java.lang.String loanAccountKey,
java.lang.String savingAccountKey)
Deletes the link between the loan account and saving account (known as settlement account)
Call: DELETE /api/loans/{LOAN_KEY}/settlementAccounts/{SAVINGS_KEY}
Sample call: DELETE /api/loans/STLACC_7832648/settlementAccounts/8a80866357976c62015798e0b60e00d0
Sample response: {"returnCode":0,"returnStatus":"SUCCESS"}
Available since Mambu 4.4
|
com.mambu.loans.shared.model.LoanTransaction |
disburseLoanAccount(java.lang.String accountId,
com.mambu.core.shared.model.Money amount,
com.mambu.loans.shared.model.DisbursementDetails disbursementDetails,
java.util.List<com.mambu.core.shared.model.CustomFieldValue> customInformation,
java.lang.String notes)
Disburse loan account using JSON disburse API request specifying disbursement details and transaction custom
information.
|
com.mambu.loans.shared.model.LoanTransaction |
disburseLoanAccount(java.lang.String accountId,
com.mambu.core.shared.model.Money amount,
com.mambu.loans.shared.model.DisbursementDetails disbursementDetails,
java.lang.String notes)
Convenience method to Disburse loan account using JSON Transaction and specifying Disbursement Details.
|
com.mambu.loans.shared.model.LoanTransaction |
executeJSONTransactionRequest(java.lang.String accountId,
com.mambu.loans.shared.model.LoanTransactionType transactionType,
com.mambu.api.server.handler.loan.model.JSONTransactionRequest transactionRequest)
Convenience method to execute Loan Account transaction by providing JSONTransactionRequest
|
com.mambu.loans.shared.model.LoanAccount |
getLoanAccount(java.lang.String accountId)
Get a loan account with full details by its id
|
com.mambu.loans.shared.model.LoanAccount |
getLoanAccountDetails(java.lang.String accountId)
Get a loan account with Details by its id
|
java.util.List<com.mambu.loans.shared.model.LoanAccount> |
getLoanAccounts(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Get loan accounts by specifying filter constraints
|
java.util.List<com.mambu.loans.shared.model.LoanAccount> |
getLoanAccountsByBranchCentreOfficerState(java.lang.String branchId,
java.lang.String centreId,
java.lang.String creditOfficerUserName,
java.lang.String accountState,
java.lang.String offset,
java.lang.String limit)
Get the loan accounts by branch id, centreId, credit officer, accountState
|
java.util.List<com.mambu.loans.shared.model.LoanAccount> |
getLoanAccountsByBranchOfficerState(java.lang.String branchId,
java.lang.String creditOfficerUserName,
java.lang.String accountState,
java.lang.String offset,
java.lang.String limit)
Get loan accounts by branch id, credit officer, accountState.
|
java.util.List<com.mambu.loans.shared.model.LoanAccount> |
getLoanAccountsForClient(java.lang.String clientId)
Get all the loan accounts for a given client
|
java.util.List<com.mambu.loans.shared.model.LoanAccount> |
getLoanAccountsForGroup(java.lang.String groupId)
Get all the loan accounts for a given group
|
java.util.List<com.mambu.loans.shared.model.LoanTransaction> |
getLoanAccountTransactions(java.lang.String accountId,
java.lang.String offset,
java.lang.String limit)
Get loan account Transactions by Loan id and offset and limit
|
com.mambu.api.server.handler.loan.model.JSONLoanAccountResponse |
getLoanAccountWithSettlementAccounts(java.lang.String accountId)
Get full loan account details, including settlement accounts
|
com.mambu.loans.shared.model.LoanProduct |
getLoanProduct(java.lang.String productId)
Get a Loan Product by Product id
|
java.util.List<com.mambu.loans.shared.model.LoanProduct> |
getLoanProducts(java.lang.String offset,
java.lang.String limit)
Get a list of Loan Products
|
java.util.List<com.mambu.loans.shared.model.Repayment> |
getLoanProductSchedule(java.lang.String productId,
com.mambu.loans.shared.model.LoanAccount account)
Get repayment schedule preview for a Loan Product
|
java.util.List<com.mambu.loans.shared.model.Repayment> |
getLoanProductSchedule(java.lang.String productId,
com.mambu.loans.shared.model.LoanAccount account,
ScheduleQueryParams queryParams)
Get repayment schedule preview for a Loan Product
|
java.util.List<com.mambu.loans.shared.model.LoanTransaction> |
getLoanTransactions(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Deprecated.
|
java.util.List<com.mambu.loans.shared.model.LoanTransaction> |
getLoanTransactionsWithBasicDetails(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Get loan transactions by specifying filter constraints with basic details level (no custom fields)
|
java.util.List<com.mambu.loans.shared.model.LoanTransaction> |
getLoanTransactionsWithFullDetails(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Get loan transactions by specifying filter constraints (including custom fields)
|
java.util.List<com.mambu.loans.shared.model.LoanTransaction> |
lockLoanAccount(java.lang.String accountId,
java.lang.String notes)
Lock loan account
|
com.mambu.loans.shared.model.LoanTransaction |
makeLoanRepayment(java.lang.String accountId,
com.mambu.core.shared.model.Money amount,
java.util.Date date,
com.mambu.accounts.shared.model.TransactionDetails transactionDetails,
java.util.List<com.mambu.core.shared.model.CustomFieldValue> customInformation,
java.lang.String notes)
Make Repayment for a loan account.
|
boolean |
patchLoanAccount(com.mambu.loans.shared.model.LoanAccount loan)
Update loan terms for an existent LoanAccount This API allows updating LoanAccount terms only.
|
com.mambu.loans.shared.model.LoanTransaction |
postInterestRateChange(java.lang.String accountId,
com.mambu.api.server.handler.loan.model.JSONTransactionRequest transactionRequest)
Convenience method for updating/changing the interest rate on a loan account.
|
com.mambu.loans.shared.model.LoanAccount |
postLoanAccountRestructureAction(java.lang.String accountId,
com.mambu.api.server.handler.loan.model.JSONRestructureEntity restructureEntity)
POST action for loan account.
|
com.mambu.loans.shared.model.LoanTransaction |
postPaymentMade(java.lang.String accountId,
com.mambu.api.server.handler.loan.model.JSONTransactionRequest transactionRequest)
Convenience method for posting a payment made transaction on a loan account.
|
com.mambu.loans.shared.model.LoanAccount |
refinanceLoanAccount(java.lang.String accountId,
com.mambu.loans.shared.model.LoanAccount loanAccount,
java.util.List<com.mambu.core.shared.model.CustomFieldValue> customFieldValues,
com.mambu.api.server.handler.loan.model.RestructureDetails restructureDetails)
Convenience method to Refinance loan account
|
com.mambu.loans.shared.model.LoanAccount |
rejectLoanAccount(java.lang.String accountId,
java.lang.String notes)
Reject a loan account if the user has permission to reject loan accounts.
|
com.mambu.loans.shared.model.LoanAccount |
requestApprovalLoanAccount(java.lang.String accountId,
java.lang.String notes)
Request Approval for a loan account to transition an account from a Partial Application state to a Pending
Approval state
|
com.mambu.loans.shared.model.LoanAccount |
rescheduleLoanAccount(java.lang.String accountId,
com.mambu.loans.shared.model.LoanAccount loanAccount,
java.util.List<com.mambu.core.shared.model.CustomFieldValue> customFieldValues,
com.mambu.api.server.handler.loan.model.RestructureDetails restructureDetails)
Convenience method to Reschedule loan account
|
com.mambu.loans.shared.model.LoanTransaction |
reverseLoanTransaction(com.mambu.loans.shared.model.LoanTransaction originalTransaction,
java.lang.String notes)
Convenience method to Reverse loan transaction by providing the original loan transaction
|
com.mambu.loans.shared.model.LoanTransaction |
reverseLoanTransaction(java.lang.String accountId,
com.mambu.loans.shared.model.LoanTransactionType originalTransactionType,
java.lang.String originalTransactionId,
java.lang.String notes)
Reverse loans transactions for a loan account
|
com.mambu.loans.shared.model.LoanAccount |
undoApproveLoanAccount(java.lang.String accountId,
java.lang.String notes)
Undo Approve for a loan account
|
com.mambu.loans.shared.model.LoanAccount |
undoCloseLoanAccount(com.mambu.loans.shared.model.LoanAccount loanAccount,
java.lang.String notes)
Undo Close Loan account.
|
com.mambu.loans.shared.model.LoanTransaction |
undoDisburseLoanAccount(java.lang.String accountId,
java.lang.String notes)
Undo Disburse for a loan account.
|
java.util.List<com.mambu.loans.shared.model.LoanTransaction> |
unlockLoanAccount(java.lang.String accountId,
java.lang.String notes)
Unlock loan account
|
com.mambu.loans.shared.model.LoanAccount |
updateLoanAccount(com.mambu.loans.shared.model.LoanAccount loanAccount)
Update an existent LoanAccount using LoanAccount object and sending it as a JSON API.
|
com.mambu.loans.shared.model.LoanAccount |
updateLoanAccountFunds(java.lang.String accountId,
java.util.List<com.mambu.accountsecurity.shared.model.InvestorFund> funds)
Update funds for an existent Loan Account
|
com.mambu.loans.shared.model.LoanAccount |
updateLoanAccountGuarantees(java.lang.String accountId,
java.util.List<com.mambu.accountsecurity.shared.model.Guaranty> guarantees)
Update guarantees for an existent Loan Account
|
com.mambu.loans.shared.model.LoanAccount |
updateLoanAccountTranches(java.lang.String accountId,
java.util.List<com.mambu.loans.shared.model.LoanTranche> tranches)
Update tranches for an existent LoanAccount
|
com.mambu.loans.shared.model.LoanAccount |
withdrawLoanAccount(java.lang.String accountId,
java.lang.String notes)
Withdraw (close) loan account if the user has permission to withdraw loan accounts.
|
com.mambu.loans.shared.model.LoanTransaction |
writeOffLoanAccount(java.lang.String accountId,
java.lang.String notes)
Write of loan account
|
public static final java.lang.String CENTRE_ID
public static final java.lang.String SCHEDULE
@Inject public LoansService(MambuAPIService mambuAPIService)
mambuAPIService
- the service responsible with the connection to the serverpublic com.mambu.loans.shared.model.LoanAccount getLoanAccount(java.lang.String accountId) throws MambuApiException
accountId
- the id of the accountMambuApiException
public com.mambu.api.server.handler.loan.model.JSONLoanAccountResponse getLoanAccountWithSettlementAccounts(java.lang.String accountId) throws MambuApiException
accountId
- the id or encoded key of a loan account. Must not be nullMambuApiException
public java.util.List<com.mambu.loans.shared.model.LoanAccount> getLoanAccountsForClient(java.lang.String clientId) throws MambuApiException
clientId
- the id of the clientMambuApiException
public java.util.List<com.mambu.loans.shared.model.LoanAccount> getLoanAccountsForGroup(java.lang.String groupId) throws MambuApiException
groupId
- the id of the groupMambuApiException
public com.mambu.loans.shared.model.LoanAccount approveLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the id of the accountnotes
- transaction notesMambuApiException
public com.mambu.loans.shared.model.LoanAccount requestApprovalLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the encoded key or id of the account. Must not be nullnotes
- transaction notesMambuApiException
public com.mambu.loans.shared.model.LoanAccount undoApproveLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the id of the accountnotes
- transaction notesMambuApiException
public java.util.List<com.mambu.loans.shared.model.LoanTransaction> lockLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the id of the accountnotes
- transaction notesMambuApiException
public java.util.List<com.mambu.loans.shared.model.LoanTransaction> unlockLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the id of the accountnotes
- transaction notesMambuApiException
public com.mambu.loans.shared.model.LoanTransaction writeOffLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the encoded key or id of the account. Must not be nullnotes
- transaction notesMambuApiException
public boolean deleteLoanAccount(java.lang.String accountId) throws MambuApiException
accountId
- MambuApiException
public com.mambu.loans.shared.model.LoanAccount rejectLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the id of the account. Mandatorynotes
- the reason why the account was rejectMambuApiException
public com.mambu.loans.shared.model.LoanAccount withdrawLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the id of the account. Mandatorynotes
- the reason why the account was withdrawnMambuApiException
public com.mambu.loans.shared.model.LoanAccount closeLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- the id of the account. Must not be nulnotes
- the reason why the account is closedMambuApiException
public com.mambu.loans.shared.model.LoanAccount closeLoanAccount(java.lang.String accountId, APIData.CLOSER_TYPE closerType, java.lang.String notes) throws MambuApiException
accountId
- the id of the account to close. MandatorycloserType
- type of closer (withdraw or reject). Mandatorynotes
- closer reason notesMambuApiException
public com.mambu.loans.shared.model.LoanAccount undoCloseLoanAccount(com.mambu.loans.shared.model.LoanAccount loanAccount, java.lang.String notes) throws MambuApiException
loanAccount
- closed loan account. Must not be null and must be in one of the supported closed states.notes
- undo closer reason notesMambuApiException
public com.mambu.loans.shared.model.LoanTransaction disburseLoanAccount(java.lang.String accountId, com.mambu.core.shared.model.Money amount, com.mambu.loans.shared.model.DisbursementDetails disbursementDetails, java.lang.String notes) throws MambuApiException
accountId
- loan account id or encoded key. Must not be nullamount
- disbursement amount.disbursementDetails
- disbursement details for the loan account containing optional transaction custom fieldsnotes
- transaction notesMambuApiException
public com.mambu.loans.shared.model.LoanTransaction disburseLoanAccount(java.lang.String accountId, com.mambu.core.shared.model.Money amount, com.mambu.loans.shared.model.DisbursementDetails disbursementDetails, java.util.List<com.mambu.core.shared.model.CustomFieldValue> customInformation, java.lang.String notes) throws MambuApiException
accountId
- loan account id or encoded key. Must not be nullamount
- disbursement amount.disbursementDetails
- disbursement details for the loan accountcustomInformation
- transaction custom fieldsnotes
- transaction notesMambuApiException
public com.mambu.loans.shared.model.LoanTransaction undoDisburseLoanAccount(java.lang.String accountId, java.lang.String notes) throws MambuApiException
accountId
- account encoded key or id. Must not be nullnotes
- transaction notesMambuApiException
public com.mambu.loans.shared.model.LoanAccount postLoanAccountRestructureAction(java.lang.String accountId, com.mambu.api.server.handler.loan.model.JSONRestructureEntity restructureEntity) throws MambuApiException
accountId
- the encoded key or id of the original loan account. Must not be nullrestructureEntity
- restructure entity containing the action, loan account and restructure details. Must not be null. Loan
account must not be null. Action must not be nullMambuApiException
public com.mambu.loans.shared.model.LoanAccount rescheduleLoanAccount(java.lang.String accountId, com.mambu.loans.shared.model.LoanAccount loanAccount, java.util.List<com.mambu.core.shared.model.CustomFieldValue> customFieldValues, com.mambu.api.server.handler.loan.model.RestructureDetails restructureDetails) throws MambuApiException
accountId
- the encoded key or id of the original loan account. Must not be nullloanAccount
- loan account with new details. Must not be null.customFieldValues
- optional custom field values. Allowed are any of the original account custom fields, regardless of the
new product and any new custom fields applicable to the new productrestructureDetails
- optional restructure detailsMambuApiException
public com.mambu.loans.shared.model.LoanAccount refinanceLoanAccount(java.lang.String accountId, com.mambu.loans.shared.model.LoanAccount loanAccount, java.util.List<com.mambu.core.shared.model.CustomFieldValue> customFieldValues, com.mambu.api.server.handler.loan.model.RestructureDetails restructureDetails) throws MambuApiException
accountId
- the encoded key or id of the original loan account. Must not be nullloanAccount
- loan account with new details. Must not be nullcustomFieldValues
- optional custom field values. Allowed are any of the original account custom fields, regardless of the
new product and any new custom fields applicable to the new productrestructureDetails
- mandatory restructure details. Must not be nullMambuApiException
public com.mambu.loans.shared.model.LoanAccount getLoanAccountDetails(java.lang.String accountId) throws MambuApiException
accountId
- the id of the accountMambuApiException
public com.mambu.loans.shared.model.LoanAccount createLoanAccount(com.mambu.loans.shared.model.LoanAccount loanAccount) throws MambuApiException
loanAccount
- LoanAccount object. LoanAccount encodedKey must be null for account creationMambuApiException
java.lang.IllegalArgumentException
public com.mambu.loans.shared.model.LoanAccount updateLoanAccount(com.mambu.loans.shared.model.LoanAccount loanAccount) throws MambuApiException
loanAccount
- LoanAccount object containing LoanAccount. LoanAccount encodedKey or id must be NOT null for account
updateMambuApiException
java.lang.IllegalArgumentException
public boolean patchLoanAccount(com.mambu.loans.shared.model.LoanAccount loan) throws MambuApiException
loan
- LoanAccount object. Either LoanAccount encoded key or its ID must be NOT null for updating account
Note that only some loan terms can be updated. See MBU-7758 for details.
Loan Account fields available for patching are: loanAmount, interestRate. interestSpread,
repaymentInstallments, repaymentPeriodCount, repaymentPeriodUnit, expectedDisbursementDate,
firstRepaymentDate, gracePeriod, principalRepaymentInterval, penaltyRate, periodicPaymentMambuApiException
java.lang.IllegalArgumentException
public com.mambu.loans.shared.model.LoanAccount updateLoanAccountTranches(java.lang.String accountId, java.util.List<com.mambu.loans.shared.model.LoanTranche> tranches) throws MambuApiException
accountId
- the encoded key or id of the loan account. Must not be null.tranches
- tranches for a loan account. Must not be null. Existent tranches with a valid "encodedKey" field will
be updated. Tranches with null "encodedKey" are treated as new tranches and will be created. Tranches
that are not specified in the call will be deleted. Already disbursed tranches cannot be changed or
deleted, they can be omitted when updating tranches.MambuApiException
java.lang.IllegalArgumentException
public com.mambu.loans.shared.model.LoanAccount updateLoanAccountFunds(java.lang.String accountId, java.util.List<com.mambu.accountsecurity.shared.model.InvestorFund> funds) throws MambuApiException
accountId
- the encoded key or id of the loan account. Account must not yet be disbursed. Must not be null.funds
- funds to be updated. Must not be nullMambuApiException
java.lang.IllegalArgumentException
public com.mambu.loans.shared.model.LoanAccount updateLoanAccountGuarantees(java.lang.String accountId, java.util.List<com.mambu.accountsecurity.shared.model.Guaranty> guarantees) throws MambuApiException
accountId
- the encoded key or id of the loan account. Must not be null.guarantees
- guarantees to be updated. Must not be null. The guarantees that have encodedKey will be edited. If the
encodedKey is not present, a new guaranty will be created. Existing guarantees that are not specified
in the update call will be deletedMambuApiException
java.lang.IllegalArgumentException
public java.util.List<com.mambu.loans.shared.model.LoanTransaction> getLoanAccountTransactions(java.lang.String accountId, java.lang.String offset, java.lang.String limit) throws MambuApiException
accountId
- the id of the account offset - first transaction number limit - last transaction number Note: if
offset and limit both equal null, all transactions are returned (Note: transaction are sorted by date)offset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
@Deprecated public java.util.List<com.mambu.loans.shared.model.LoanTransaction> getLoanTransactions(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
filterConstraints
- filter constraints. Must not be nulloffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
- in case something failed during transaction fetchingpublic java.util.List<com.mambu.loans.shared.model.LoanTransaction> getLoanTransactionsWithFullDetails(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
filterConstraints
- filter constraints. Must not be nulloffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
- in case something failed during transaction fetchingpublic java.util.List<com.mambu.loans.shared.model.LoanTransaction> getLoanTransactionsWithBasicDetails(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
filterConstraints
- filter constraints. Must not be nulloffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
- in case something failed during transaction fetchingpublic com.mambu.loans.shared.model.LoanTransaction makeLoanRepayment(java.lang.String accountId, com.mambu.core.shared.model.Money amount, java.util.Date date, com.mambu.accounts.shared.model.TransactionDetails transactionDetails, java.util.List<com.mambu.core.shared.model.CustomFieldValue> customInformation, java.lang.String notes) throws MambuApiException
accountId
- account ID or encoded key. Must not be nullamount
- transaction amountdate
- transaction datecustomInformation
- transaction custom fieldsnotes
- transaction notestransactionDetails
- transaction details, including transaction channel and channel fieldsMambuApiException
public com.mambu.loans.shared.model.LoanTransaction applyFeeToLoanAccount(java.lang.String accountId, java.lang.String amount, java.lang.String repaymentNumber, java.lang.String notes) throws MambuApiException
accountId
- the id or encoded key of the accountamount
- transaction amountrepaymentNumber
- repayment numbernotes
- notesMambuApiException
public com.mambu.loans.shared.model.LoanTransaction applyFeeToLoanAccount(java.lang.String accountId, java.util.List<com.mambu.loans.shared.model.CustomPredefinedFee> fees, java.lang.Integer repaymentNumber, java.lang.String notes) throws MambuApiException
accountId
- account id or encoded key. Must not be nullfees
- fees. Only Manual Predefined Fees are currently supported. Must not be null. Must contain exactly one
fee.
Note: Once MBU-12865 is implemented this method will support both predefined fees and arbitrary fees
and the (@link #applyFeeToLoanAccount(String, String, String, String)} method used only for arbitrary
fees can be deprecatedrepaymentNumber
- repayment number. Can be specified only for fixed loansnotes
- notesMambuApiException
public com.mambu.loans.shared.model.LoanTransaction executeJSONTransactionRequest(java.lang.String accountId, com.mambu.loans.shared.model.LoanTransactionType transactionType, com.mambu.api.server.handler.loan.model.JSONTransactionRequest transactionRequest) throws MambuApiException
accountId
- account id or encoded key. Must not be nulltransactionType
- loan transaction type. Must not be null. Supported types are: DISBURSMENT, FEE, REPAYMENT and
INTEREST_RATE_CHANGEDtransactionRequest
- JSON transaction requestMambuApiException
public com.mambu.loans.shared.model.LoanTransaction postInterestRateChange(java.lang.String accountId, com.mambu.api.server.handler.loan.model.JSONTransactionRequest transactionRequest) throws MambuApiException
accountId
- the id of the account.transactionRequest
- JSON transaction requestMambuApiException
public com.mambu.loans.shared.model.LoanTransaction postPaymentMade(java.lang.String accountId, com.mambu.api.server.handler.loan.model.JSONTransactionRequest transactionRequest) throws MambuApiException
accountId
- the id of the account.transactionRequest
- JSON transaction requestMambuApiException
public com.mambu.loans.shared.model.LoanTransaction applyInterestToLoanAccount(java.lang.String accountId, java.util.Date date, java.lang.String notes) throws MambuApiException
accountId
- the id of the account. Mandatorydate
- date. Mandatory.notes
- notesMambuApiException
public java.util.List<com.mambu.loans.shared.model.LoanAccount> getLoanAccountsByBranchCentreOfficerState(java.lang.String branchId, java.lang.String centreId, java.lang.String creditOfficerUserName, java.lang.String accountState, java.lang.String offset, java.lang.String limit) throws MambuApiException
branchId
- branchID The ID of the branch to which the loan accounts are assigned tocentreId
- The ID of the centre to which the loan accounts are assigned to. If both branchId and centreId are
provided then this centre must be assigned to the branchIdcreditOfficerUserName
- The username of the credit officer to whom the loans are assigned toaccountState
- The desired state of the accounts to filter on (eg: APPROVED)offset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
public java.util.List<com.mambu.loans.shared.model.LoanAccount> getLoanAccountsByBranchOfficerState(java.lang.String branchId, java.lang.String creditOfficerUserName, java.lang.String accountState, java.lang.String offset, java.lang.String limit) throws MambuApiException
branchId
- branchID The ID of the branch to which the loan accounts are assigned tocreditOfficerUserName
- The username of the credit officer to whom the loans are assigned toaccountState
- The desired state of the accounts to filter on (eg: APPROVED)offset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
public java.util.List<com.mambu.loans.shared.model.LoanAccount> getLoanAccounts(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
filterConstraints
- filter constraints. Must not be nulloffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
public java.util.List<com.mambu.loans.shared.model.LoanProduct> getLoanProducts(java.lang.String offset, java.lang.String limit) throws MambuApiException
offset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
public com.mambu.loans.shared.model.LoanProduct getLoanProduct(java.lang.String productId) throws MambuApiException
productId
- the id of the loan productMambuApiException
public java.util.List<com.mambu.loans.shared.model.Repayment> getLoanProductSchedule(java.lang.String productId, com.mambu.loans.shared.model.LoanAccount account) throws MambuApiException
productId
- the id of the loan product. Must not be null.account
- loan account containing parameters for determining loan schedule
Only the following loan account parameters are currently supported: loanAmount (mandatory),
anticipatedDisbursement, firstRepaymentDate, interestRate, repaymentInstallments, gracePeriod,
repaymentPeriodUnit, repaymentPeriodCount, principalRepaymentInterval, fixedDaysOfMonth
Loan repayment schedule preview is not available for Revolving Credit products. See MBU-10545
See MBU-6789, MBU-7676 and MBU-10802 for more detailsMambuApiException
public java.util.List<com.mambu.loans.shared.model.Repayment> getLoanProductSchedule(java.lang.String productId, com.mambu.loans.shared.model.LoanAccount account, ScheduleQueryParams queryParams) throws MambuApiException
productId
- the id of the loan product. Must not be null.account
- loan account containing parameters for determining loan schedule
Only the following loan account parameters are currently supported: loanAmount (mandatory),
anticipatedDisbursement, firstRepaymentDate, interestRate, repaymentInstallments, gracePeriod,
repaymentPeriodUnit, repaymentPeriodCount, principalRepaymentInterval, fixedDaysOfMonthqueryParams
- some extra schedule parameters to be used with for preview i.e periodicPayment, organizationCommissionMambuApiException
- in case something goes wrong while obtaining the previewpublic com.mambu.loans.shared.model.LoanTransaction reverseLoanTransaction(java.lang.String accountId, com.mambu.loans.shared.model.LoanTransactionType originalTransactionType, java.lang.String originalTransactionId, java.lang.String notes) throws MambuApiException
accountId
- the id or encoded key of the loan account. MandatoryoriginalTransactionType
- Original transaction type to be reversed. The following transaction types can be currently reversed:
PENALTY_APPLIED (in 3.13), REPAYMENT, INTEREST_APPLIED, FEE (since 4.2). Must not be null.originalTransactionId
- the id or the encodedKey of the transaction to be reversed. Must not be null.notes
- transaction notesMambuApiException
public com.mambu.loans.shared.model.LoanTransaction reverseLoanTransaction(com.mambu.loans.shared.model.LoanTransaction originalTransaction, java.lang.String notes) throws MambuApiException
originalTransaction
- The following loan transactions types currently can be reversed: PENALTY_APPLIED, REPAYMENT, FEE,
INTEREST_APPLIED. Mandatory.notes
- transaction notesMambuApiException
public java.lang.Boolean addSettlementAccount(java.lang.String loanAccountKey, java.lang.String savingsAccountKey) throws MambuApiException
loanAccountKey
- A string key representing the ID or the encoding key of the loan account. Must NOT be NULL.savingsAccountKey
- A string key representing the ID or the encoding key of the saving account Must NOT be NULL.MambuApiException
public java.lang.Boolean deleteSettlementAccount(java.lang.String loanAccountKey, java.lang.String savingAccountKey) throws MambuApiException
loanAccountKey
- A string key representing the ID or the encoding key of the loan account. Must NOT be NULL.savingAccountKey
- A string key representing the ID or the encoding key of the saving account. Must NOT be NULL.MambuApiException