Skip to main content

Evaluate Auto Approval API

Overview

Evaluates a proposed booking total amount against an employee's assigned Employee Band auto-approval limit. Returns whether the booking is auto-approved or requires manager approval.

  • Endpoint: /api/bands/evaluate-auto-approval
  • Method: POST
  • Access: Corporate Admin / Manager / Booking Engine

Request Body Schema

FieldTypeRequiredDescription
userIdString (UUID)YesEmployee user ID
amountNumberYesProposed booking total fare amount

Request Body Example

{
"userId": "u9876543-21ba-fedc-3210-9876543210fe",
"amount": 6500.00
}

Success Response (Auto-Approved)

{
"success": true,
"message": "Auto approval evaluated successfully",
"data": {
"userId": "u9876543-21ba-fedc-3210-9876543210fe",
"userName": "Vikram Singh",
"bandId": "b1234567-89ab-cdef-0123-456789abcdef",
"bandName": "Band 1",
"autoApprovalLimit": 7000,
"bookingAmount": 6500,
"autoApproved": true,
"requiresApproval": false
}
}

Success Response (Requires Approval)

{
"success": true,
"message": "Auto approval evaluated successfully",
"data": {
"userId": "u9876543-21ba-fedc-3210-9876543210fe",
"userName": "Vikram Singh",
"bandId": "b1234567-89ab-cdef-0123-456789abcdef",
"bandName": "Band 1",
"autoApprovalLimit": 7000,
"bookingAmount": 9500,
"autoApproved": false,
"requiresApproval": true
}
}

Database Impact

  • Tables: users, employee_bands
  • Operations: SELECT user details with band limit evaluation.