{
 "openapi": "3.1.0",
 "info": {
  "title": "Leave Balances (HRMS)",
  "version": "20261030b",
  "description": "Everything earned, less what has been taken and what is asked for but not yet decided."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "leave-balances": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Employee id",
      "readOnly": true
     },
     "leave_type_id": {
      "type": "string",
      "format": "uuid",
      "description": "Leave type id",
      "readOnly": true
     },
     "leave_year": {
      "type": "integer",
      "description": "Leave year",
      "readOnly": true
     },
     "employee_no": {
      "type": "string",
      "description": "Employee no",
      "readOnly": true
     },
     "employee_name": {
      "type": "string",
      "description": "Employee name",
      "readOnly": true
     },
     "leave_code": {
      "type": "string",
      "description": "Leave code",
      "readOnly": true
     },
     "leave_name": {
      "type": "string",
      "description": "Leave name",
      "readOnly": true
     },
     "category": {
      "type": "string",
      "description": "Category",
      "readOnly": true
     },
     "unit": {
      "type": "string",
      "description": "Unit",
      "readOnly": true
     },
     "accrual_method": {
      "type": "string",
      "description": "Accrual method",
      "readOnly": true
     },
     "max_carryover": {
      "type": "string",
      "format": "decimal",
      "description": "Max carryover",
      "readOnly": true
     },
     "max_balance": {
      "type": "string",
      "format": "decimal",
      "description": "Max balance",
      "readOnly": true
     },
     "opening_balance": {
      "type": "string",
      "format": "decimal",
      "description": "Opening balance",
      "readOnly": true
     },
     "carried_over": {
      "type": "string",
      "format": "decimal",
      "description": "Carried over",
      "readOnly": true
     },
     "accrued": {
      "type": "string",
      "format": "decimal",
      "description": "Accrued",
      "readOnly": true
     },
     "adjusted": {
      "type": "string",
      "format": "decimal",
      "description": "Adjusted",
      "readOnly": true
     },
     "taken": {
      "type": "string",
      "format": "decimal",
      "description": "Taken",
      "readOnly": true
     },
     "pending": {
      "type": "string",
      "format": "decimal",
      "description": "Pending",
      "readOnly": true
     },
     "forfeited": {
      "type": "string",
      "format": "decimal",
      "description": "Forfeited",
      "readOnly": true
     },
     "available": {
      "type": "string",
      "format": "decimal",
      "description": "Available",
      "readOnly": true
     },
     "standing": {
      "type": "string",
      "description": "Standing",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/hrms/leave-balances": {
   "get": {
    "summary": "list leave-balances",
    "operationId": "list_leave_balances_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post leave balances",
    "operationId": "action_leave_balances_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/leave-balances/{id}": {
   "get": {
    "summary": "get leave-balances",
    "operationId": "get_leave_balances_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "Put leave balances",
    "operationId": "action_leave_balances_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete leave balances",
    "operationId": "action_leave_balances_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/leave-balances/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_leave_balances_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}