Skip to content

@mbanq/core-sdk-js v0.50.0


@mbanq/core-sdk-js / commands / DisburseLoanToLinkedAccount

Function: DisburseLoanToLinkedAccount()

DisburseLoanToLinkedAccount(loanId, data): Command<{ data: { actualDisbursementDate: string; dateFormat: string; locale: string; note?: string; transactionAmount: number; }; loanId: number; }, { changes: { actualDisbursementDate: string; dateFormat: string; locale: string; status: { active?: boolean; closed?: boolean; closedObligationsMet?: boolean; closedRescheduled?: boolean; closedWrittenOff?: boolean; code: string; id: number; overpaid?: boolean; pendingApproval?: boolean; value: string; waitingForDisbursal?: boolean; }; }; clientId: number; loanId: number; officeId: number; resourceId: number; }>

Defined in: src/commands/rest/loan.ts:263

Disburses a loan to a linked savings account.

Parameters

loanId

number

The ID of the loan to disburse

data

actualDisbursementDate

string = ...

dateFormat

string = ...

locale

string = ...

note?

string = ...

transactionAmount

number = ...

Returns

Command<{ data: { actualDisbursementDate: string; dateFormat: string; locale: string; note?: string; transactionAmount: number; }; loanId: number; }, { changes: { actualDisbursementDate: string; dateFormat: string; locale: string; status: { active?: boolean; closed?: boolean; closedObligationsMet?: boolean; closedRescheduled?: boolean; closedWrittenOff?: boolean; code: string; id: number; overpaid?: boolean; pendingApproval?: boolean; value: string; waitingForDisbursal?: boolean; }; }; clientId: number; loanId: number; officeId: number; resourceId: number; }>

A Command that when executed returns the disbursement response with status changes

Example

typescript
const disburseLoanCmd = DisburseLoanToLinkedAccount(507, {
  locale: "en",
  dateFormat: "dd MMMM yyyy",
  transactionAmount: 1000,
  actualDisbursementDate: "28 March 2024",
  note: "Disbursing loan to linked account"
});
const result = await disburseLoanCmd.execute(config);
console.log(result.changes.status.value); // "Active"

Released under the MIT License.