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​
| Parameter | Type | Required | Description |
|---|---|---|---|
loanRequestId | long | Yes | ID of the loan application |
comment | string | No | Notes from the relationship manager |
Validations​
- Loan must be in
NotInitiatedstate — returns an error if already submitted or approved - Caller must have
RELATIONSHIP_MANAGERrole with branch access
Process​
- Validates loan state is
NotInitiated - Checks for an active workflow
UserTask— signals it if found - Records
"Approval Process Started"in approval history - Sets
ApprovalState→PendingApproval - 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