curl -X GET "https://api.companyflow.com/employees/987e6543-e21b-12d3-a456-426614174000/leave-balances?year=2025" \ -H "Authorization: Bearer YOUR_TOKEN"
{ "success": true, "data": [ { "id": "bal-001-uuid", "employee_id": "987e6543-e21b-12d3-a456-426614174000", "leave_type_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "year": 2025, "total_days": 22, "used_days": 5, "pending_days": 1.5, "available_days": 15.5, "carried_forward_days": 2, "leave_type": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Annual Leave", "code": "AL", "color_code": "#3B82F6" }, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-03-03T10:30:00Z" }, { "id": "bal-002-uuid", "employee_id": "987e6543-e21b-12d3-a456-426614174000", "leave_type_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "year": 2025, "total_days": 10, "used_days": 2, "pending_days": 0, "available_days": 8, "carried_forward_days": 0, "leave_type": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "name": "Sick Leave", "code": "SL", "color_code": "#EF4444" }, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-02-15T14:20:00Z" } ] }
Get all leave balances for a specific employee
"987e6543-e21b-12d3-a456-426614174000"
2025
Show LeaveBalance properties
Show LeaveType properties
available_days = total_days - used_days - pending_days
total_days