Skip to main content

InitiateApproveLoanRequestCommand

Overview​

Submits a loan application into the approval workflow. Transitions the loan from NotInitiated to PendingApproval state and notifies the first approver (Branch Manager).

Authorization​

Caller must have the RELATIONSHIP_MANAGER role and branch access to the loan.

Command Structure​

{
"cmd": "InitiateApproveLoanRequestCommand",
"data": "{\"loanRequestId\":110,\"comment\":\"All documents verified, submitting for approval\"}"
}

Parameters​

ParameterTypeRequiredDescription
loanRequestIdlongYesID of the loan application
commentstringNoNotes from the relationship manager

Validations​

  • Loan must be in NotInitiated state — returns an error if already submitted or approved
  • Caller must have RELATIONSHIP_MANAGER role with branch access

Process​

  1. Validates loan state is NotInitiated
  2. Checks for an active workflow UserTask — signals it if found
  3. Records "Approval Process Started" in approval history
  4. Sets ApprovalState → PendingApproval
  5. Sends email notification to Branch Manager role

Response​

{
"ok": true,
"statusCode": "00",
"message": "Loan request submitted for approval.",
"outData": {
"LoanRequestId": 110,
"comment": "All documents verified, submitting for approval"
}
}

Approval Flow​

InitiateApproveLoanRequestCommand
↓ (NotInitiated → PendingApproval)
ApproveLoanRequestCommand (Branch Manager)
↓
ApproveLoanRequestCommand (Area Manager)
↓
... (hierarchy continues)
↓
SendLoanOfferCommand → DisburseLoanRequestCommand