Skip to content

@mbanq/core-sdk-js v0.50.0


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

Function: ApproveLoan() ​

ApproveLoan(loanIdForApprove, data): Command<{ data: { approvedOnDate: string; dateFormat: string; disbursementData?: object[]; expectedDisbursementDate?: string; locale: string; note?: string; }; loanIdForApprove: number; }, { changes: { approvedOnDate: string; dateFormat: string; expectedDisbursementDate?: string | number[]; loanTermFrequencyType?: { code: string; id: number; value: string; }; locale: string; note?: string; status: { active?: boolean; closed?: boolean; closedObligationsMet?: boolean; closedRescheduled?: boolean; closedWrittenOff?: boolean; code: string; id: number; overpaid?: boolean; pendingApproval?: boolean; value: string; waitingForDisbursal?: boolean; }; value?: string; }; clientId: number; loanId: number; officeId: number; resourceId: number; }>

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

Approves a loan application with specified disbursement details.

Parameters ​

loanIdForApprove ​

number

The ID of the loan to approve

data ​

approvedOnDate ​

string = ...

dateFormat ​

string = ...

disbursementData? ​

object[] = ...

expectedDisbursementDate? ​

string = ...

locale ​

string = ...

note? ​

string = ...

Returns ​

Command<{ data: { approvedOnDate: string; dateFormat: string; disbursementData?: object[]; expectedDisbursementDate?: string; locale: string; note?: string; }; loanIdForApprove: number; }, { changes: { approvedOnDate: string; dateFormat: string; expectedDisbursementDate?: string | number[]; loanTermFrequencyType?: { code: string; id: number; value: string; }; locale: string; note?: string; status: { active?: boolean; closed?: boolean; closedObligationsMet?: boolean; closedRescheduled?: boolean; closedWrittenOff?: boolean; code: string; id: number; overpaid?: boolean; pendingApproval?: boolean; value: string; waitingForDisbursal?: boolean; }; value?: string; }; clientId: number; loanId: number; officeId: number; resourceId: number; }>

A Command that when executed returns the loan approval response with status changes

Example ​

typescript
const approveLoanCmd = ApproveLoan(16, {
  locale: "en",
  dateFormat: "dd MMMM yyyy",
  approvedOnDate: "23 July 2023",
  note: "close note",
  expectedDisbursementDate: "23 July 2023",
  disbursementData: [
    {
      expectedDisbursementDate: "23 July 2023",
      principal: 2000
    }
  ]
});
const result = await approveLoanCmd.execute(config);
console.log(result.loanId); // 17
console.log(result.changes.status.value); // "Approved"

Released under the MIT License.