{"openapi":"3.0.3","info":{"title":"SlashHR API","version":"1.0.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{}},"paths":{"/companyfiles/{tid}/upload":{"post":{"summary":"Upload file to tenant folder (multipart)","tags":["Uploads"],"description":"Field `file`. Optional `slug` query or `x-slug` header (default `value`). Requires JWT.","parameters":[{"schema":{"type":"string"},"in":"query","name":"slug","required":false},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"slug":{"type":"string"},"tid":{"type":"number"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/companyfiles/{tid}/upload-icon":{"post":{"summary":"Upload icon / asset (multipart)","tags":["Uploads"],"description":"Field `file`. Optional `value` query or `x-value` header for slug. Requires JWT.","parameters":[{"schema":{"type":"string"},"in":"query","name":"value","required":false},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"slug":{"type":"string"},"tid":{"type":"number"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/debug-uploads":{"get":{"summary":"Debug: list sample upload directory (dev)","tags":["Health"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"uploadsRoot":{"type":"string"},"testPathExists":{"type":"boolean"},"files":{"type":"array","items":{"type":"string"}}}}}}}}}},"/ping":{"get":{"summary":"Liveness ping","tags":["Health"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"timestamp":{"type":"string"},"uptime":{"type":"number"}}}}}}}}},"/checkout_employee/checkin":{"post":{"summary":"Perform employee check-in","tags":["Employee Attendance"],"description":"Creates a new attendance request/instance. Supports optional manual time entry, admin override, and flow selection.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tenantId","employeeId"],"properties":{"tenantId":{"type":"number"},"employeeId":{"type":"number"},"workstationId":{"type":"number","nullable":true},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true},"address":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"manualStart":{"type":"string","format":"date-time","nullable":true},"manualEnd":{"type":"string","format":"date-time","nullable":true},"flowId":{"type":"number","nullable":true},"createdBy":{"type":"number","nullable":true}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/checkout_employee/checkout":{"post":{"summary":"Perform employee checkout","tags":["Employee Attendance"],"description":"Updates the leave_request end_at time. Supports manual timestamp override.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tenantId","employeeId","requestId"],"properties":{"tenantId":{"type":"number"},"employeeId":{"type":"number"},"requestId":{"type":"number"},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true},"address":{"type":"string","nullable":true},"checkout_ts":{"type":"string","format":"date-time","nullable":true}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/checkout_employee/attendance/{requestId}":{"delete":{"summary":"Delete an attendance record","tags":["Employee Attendance"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"query","name":"employeeId","required":true},{"schema":{"type":"number"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule_employees/{tid}/{sid}/employees":{"get":{"summary":"List employees in a schedule","tags":["Schedule - Employees"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule_employees/{tid}/employees/noschedule":{"get":{"summary":"List available employees (no active schedule)","tags":["Schedule - Employees"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule_employees/{tid}/{sid}/employees/{eid}/add":{"post":{"summary":"Add employee to schedule","tags":["Schedule - Employees"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"employeeId":{"type":"integer","description":"ID of the user performing the action (for audit)"}}}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true},{"schema":{"type":"integer"},"in":"path","name":"eid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule_employees/{tid}/{sid}/employees/{eid}/remove":{"delete":{"summary":"Remove employee from schedule","tags":["Schedule - Employees"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true},{"schema":{"type":"integer"},"in":"path","name":"eid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule_employees/{tid}/employees/getall":{"get":{"summary":"List all active employees","tags":["Schedule - Employees"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule_employees/{tid}/employees/move":{"post":{"summary":"Move employee to a different schedule","tags":["Schedule - Employees"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["employeeId","newScheduleId"],"properties":{"employeeId":{"type":"integer","description":"The Employee ID to move"},"newScheduleId":{"type":"integer","description":"The Destination Schedule ID"}}}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/widgets/flow_requests/{tenantId}/{employeeId}":{"get":{"summary":"List pending actions with full employee metadata","tags":["Dashboard Widgets"],"parameters":[{"schema":{"type":"string","default":"pending"},"in":"query","name":"status","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":false},{"schema":{"type":"number"},"in":"query","name":"flowTypeId","required":false},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/widgets/attendance":{"get":{"summary":"Get daily employee attendance and workplace status (Range support)","tags":["Dashboard Widgets"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tenantId","required":true},{"schema":{"type":"number","nullable":true},"in":"query","name":"employeeId","required":false},{"schema":{"type":"string","format":"date","nullable":true},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date","nullable":true},"in":"query","name":"to","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/widgets/attendance/today/{employeeId}":{"get":{"summary":"Get today's real-time check-in status including policy tracking","tags":["Dashboard Widgets"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"data":{"type":"object","properties":{"record_date":{"type":"string"},"employee_id":{"type":"number"},"employee_name":{"type":"string"},"workplace_id":{"type":"number"},"workplace_name":{"type":"string"},"workplace_latitude":{"type":"string"},"workplace_longitude":{"type":"string"},"schedule_title":{"type":"string"},"period_kind":{"type":"string"},"is_working_day":{"type":"boolean"},"expected_start_time":{"type":"string"},"expected_end_time":{"type":"string"},"total_scheduled_hours":{"type":"object"},"actual_start_time":{"type":"string","nullable":true},"is_delayed":{"type":"boolean","nullable":true},"delay_duration":{"type":"object"},"actual_hours_worked":{"type":"object"},"checkin_data":{"type":"object","nullable":true},"request_id":{"type":"number","nullable":true},"instance_id":{"type":"number","nullable":true},"instance_status":{"type":"string"},"status_id":{"type":"number"},"status_name":{"type":"string"},"policy_tracking":{"type":"object"},"canCheckIn":{"type":"boolean"},"canCheckOut":{"type":"boolean"},"isCompleted":{"type":"boolean"}}}}}}}}}}},"/widgets/documentsupload/{tid}/list":{"get":{"summary":"List recent documents for the dashboard widget","tags":["Dashboard Widgets"],"parameters":[{"schema":{"type":"number","default":1},"in":"query","name":"page","required":false},{"schema":{"type":"number","default":10},"in":"query","name":"limit","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/widgets/leaves/soonest":{"get":{"summary":"Get soonest upcoming approved or pending leaves","tags":["Dashboard Widgets"],"parameters":[{"schema":{"type":"number","nullable":true},"in":"query","name":"tenantId","required":false},{"schema":{"type":"number","default":2},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"date","nullable":true},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date","nullable":true},"in":"query","name":"to","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/exportpdf_day/day/pdf":{"get":{"tags":["Docs"],"description":"Export Calendar as professional PDF grouped by DAY (no auth)","parameters":[{"schema":{"type":["string","number"]},"in":"query","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"query","name":"from","required":true,"description":"Start date (YYYY-MM-DD)"},{"schema":{"type":"string"},"in":"query","name":"to","required":true,"description":"End date (YYYY-MM-DD)"},{"schema":{"type":"string","enum":["Y","N","y","n","1","0","true","false","TRUE","FALSE"]},"in":"query","name":"includeInsights","required":false,"description":"Include insights (Birthday/Anniversary/Join/Exit). Y/N (default: Y)"},{"schema":{"type":"string","enum":["Y","N","y","n","1","0","true","false","TRUE","FALSE"]},"in":"query","name":"includeHolidays","required":false,"description":"Include workplace holidays. Y/N (default: Y)"},{"schema":{"type":"string","enum":["Y","N","y","n","1","0","true","false","TRUE","FALSE"]},"in":"query","name":"includeEmptyDays","required":false,"description":"Show empty days in report. Y/N (default: N)"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"in":"query","name":"workplaces","required":false,"description":"Filter by workplaces"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"in":"query","name":"teams","required":false,"description":"Filter by teams"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"in":"query","name":"departments","required":false,"description":"Filter by departments"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"in":"query","name":"legalEntities","required":false,"description":"Filter by legal entities"},{"schema":{"type":"string"},"in":"query","name":"qEmp","required":false,"description":"Employee name search"}],"responses":{"200":{"description":"PDF file","content":{"application/json":{"schema":{"description":"PDF file","type":"string","format":"binary"}}}}}}},"/exportpdf/teamview/pdf":{"get":{"tags":["Docs"],"description":"Export Team Calendar view as professional PDF (no auth)","parameters":[{"schema":{"type":["string","number"]},"in":"query","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"query","name":"from","required":true,"description":"Start date (YYYY-MM-DD)"},{"schema":{"type":"string"},"in":"query","name":"to","required":true,"description":"End date (YYYY-MM-DD)"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"in":"query","name":"workplaces","required":false,"description":"Filter by workplaces"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"in":"query","name":"teams","required":false,"description":"Filter by teams"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"in":"query","name":"departments","required":false,"description":"Filter by departments"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"in":"query","name":"legalEntities","required":false,"description":"Filter by legal entities"},{"schema":{"type":"string"},"in":"query","name":"qEmp","required":false,"description":"Employee name search"}],"responses":{"200":{"description":"PDF file","content":{"application/json":{"schema":{"description":"PDF file","type":"string","format":"binary"}}}}}}},"/letterresponse/{tid}/templates/{templateId}/requests":{"get":{"summary":"Get Requests by Template","tags":["Letter Requests"],"description":"Calls approval.fn_get_requests_by_template","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"templateId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/letterresponse/{tid}/requests/{requestId}/upload":{"post":{"summary":"Upload Letter & Approve Request","tags":["Letter Requests"],"description":"Uploads the generated PDF, updates status to Approved, and creates a Document Record.","parameters":[{"schema":{"type":"integer"},"in":"query","name":"folderId","required":true,"description":"Target Company Folder ID"},{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"generated_id":{"type":"integer"},"document_id":{"type":"integer"},"file_url":{"type":"string"},"status":{"type":"string"}}}}}}}}}}},"/letterresponse/{tid}/requests/{requestId}/reject":{"post":{"summary":"Reject a letter request","tags":["Letter Requests"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"integer"},"instance_id":{"type":"integer"},"status":{"type":"string"}}}}}}}}},"/employeecontract/{tid}/{employeeId}/contract-details":{"get":{"summary":"Get Employee Contract Details","tags":["Employee Contract"],"description":"Returns a JSON object containing personal info, contract dates, legal entity, manager info, and organizational hierarchy.","parameters":[{"schema":{"type":"string","example":"2"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"string","example":"437"},"in":"path","name":"employeeId","required":true,"description":"Target Employee ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"},"data":{"type":"object","additionalProperties":true,"description":"The JSON object returned by fn_get_employee_contract_details","example":{"employee_id":437,"firstname":"John","lastname":"Doe","legal_entity_name":"Acme Corp","manager_name":"Jane Smith"}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/feedback/{tid}/feedback":{"post":{"summary":"Create employee feedback","tags":["Employee Feedback"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["employeeId","createdBy","content"],"properties":{"employeeId":{"type":"number","example":300,"description":"Target employee (receives feedback)"},"createdBy":{"type":"number","example":266,"description":"Requester employee id (giver)"},"flowId":{"type":["number","null"],"example":null,"description":"Optional flow override"},"rate":{"type":["number","null"],"example":5,"description":"1..5"},"content":{"type":"string","example":"Great performance this month!"},"attachments":{"type":"array","items":{"type":"object","additionalProperties":true},"example":[{"type":"image","url":"/uploads/feedback/1.png","name":"1.png"}]}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/feedback/{tid}/feedback/{employeeId}":{"get":{"summary":"List feedback for one employee","tags":["Employee Feedback"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/feedback/{tid}/feedback/{requestId}":{"put":{"summary":"Update feedback","tags":["Employee Feedback"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["actorEmployeeId"],"properties":{"actorEmployeeId":{"type":"number","example":266},"rate":{"type":["number","null"],"example":4},"content":{"type":["string","null"],"example":"Updated text"},"attachments":{"type":["array","null"],"items":{"type":"object","additionalProperties":true},"example":[{"type":"document","url":"/uploads/feedback/a.pdf","name":"a.pdf"}]}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"delete":{"summary":"Delete feedback","tags":["Employee Feedback"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["actorEmployeeId"],"properties":{"actorEmployeeId":{"type":"number","example":266}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/helpcenter/{tid}/contact":{"post":{"summary":"Send help center contact email (mobile)","tags":["Help Center"],"description":"Authenticated employees submit a category + message; email is sent to HELP_CENTER_MAIL_TO.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["category","message"],"properties":{"category":{"type":"string","maxLength":200},"message":{"type":"string","maxLength":8000},"employeeId":{"type":"number","nullable":true},"platform":{"type":"string","maxLength":64,"nullable":true},"appVersion":{"type":"string","maxLength":64,"nullable":true}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employerequestupdate/{tid}/{employeeId}/request-update":{"post":{"summary":"Request Personal Info Update","tags":["Employee Update Requests"],"description":"Creates a pending request to update fields in tblemployee only.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["requesterId","flowId","changes"],"properties":{"requesterId":{"type":"number","description":"ID of the employee making the request (User or Admin)","example":437},"flowId":{"type":"number","description":"The Workflow ID (e.g. 302 for Personal, 303 for Professional)","example":302},"changes":{"type":"object","description":"JSON object containing fields to update","additionalProperties":true,"example":{"phonenumber":"+123456","city":"Beirut"}}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"instanceId":{"type":"string","description":"The ID of the created approval workflow instance"},"targetEmployeeId":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/employerequestupdate/{tid}/{employeeId}/request-professional-update":{"post":{"summary":"Request Professional Info Update","tags":["Employee Update Requests"],"description":"Creates a pending request to update fields in tblemployeeprofessional only.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["requesterId","flowId","changes"],"properties":{"requesterId":{"type":"number","description":"ID of the employee making the request (User or Admin)","example":437},"flowId":{"type":"number","description":"The Workflow ID (e.g. 302 for Personal, 303 for Professional)","example":302},"changes":{"type":"object","example":{"jobid":"50","departmentid":"12","company_car_model":"Tesla"}}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"instanceId":{"type":"string","description":"The ID of the created approval workflow instance"},"targetEmployeeId":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/employerequestupdate/{tid}/{employeeId}/request-full-update":{"post":{"summary":"Request Full Profile Update","tags":["Employee Update Requests"],"description":"Creates a pending request to update both Personal and Professional tables at once.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["requesterId","flowId","changes"],"properties":{"requesterId":{"type":"number","description":"ID of the employee making the request (User or Admin)","example":437},"flowId":{"type":"number","description":"The Workflow ID (e.g. 302 for Personal, 303 for Professional)","example":302},"changes":{"type":"object","example":{"city":"Beirut","jobid":"55","phonenumber":"+961..."}}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"instanceId":{"type":"string","description":"The ID of the created approval workflow instance"},"targetEmployeeId":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/public/gender/getall":{"get":{"summary":"Get all genders","tags":["Public - Gender"],"responses":{"200":{"description":"Default Response"}}}},"/public/gender/{id}/getone":{"get":{"summary":"Get one gender by id","tags":["Public - Gender"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/gender/create":{"post":{"summary":"Create gender","tags":["Public - Gender"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"code":{"type":"string"}},"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/public/gender/{id}/update":{"put":{"summary":"Update gender (partial)","tags":["Public - Gender"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"tid":{"type":"integer","minimum":1},"updatedby":{"type":"integer","minimum":1}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/gender/{id}/delete":{"delete":{"summary":"Delete gender (permanent)","tags":["Public - Gender"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/marital-status/getall":{"get":{"summary":"Get all marital statuses","tags":["Public - Marital Status"],"responses":{"200":{"description":"Default Response"}}}},"/public/marital-status/{id}/getone":{"get":{"summary":"Get one marital status by id","tags":["Public - Marital Status"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/marital-status/create":{"post":{"summary":"Create marital status","tags":["Public - Marital Status"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"code":{"type":"string"}},"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/public/marital-status/{id}/update":{"put":{"summary":"Update marital status (partial)","tags":["Public - Marital Status"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"tid":{"type":"integer","minimum":1},"updatedby":{"type":"integer","minimum":1}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/marital-status/{id}/delete":{"delete":{"summary":"Delete marital status (permanent)","tags":["Public - Marital Status"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/nationality/getall":{"get":{"summary":"Get all nationalities","tags":["Public - Nationality"],"responses":{"200":{"description":"Default Response"}}}},"/public/nationality/{id}/getone":{"get":{"summary":"Get one nationality by id","tags":["Public - Nationality"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/nationality/create":{"post":{"summary":"Create nationality","tags":["Public - Nationality"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"country_name":{"type":"string"}},"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/public/nationality/{id}/update":{"put":{"summary":"Update nationality (partial)","tags":["Public - Nationality"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"country_name":{"type":"string"},"tid":{"type":"integer","minimum":1},"updatedby":{"type":"integer","minimum":1}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/public/nationality/{id}/delete":{"delete":{"summary":"Delete nationality (permanent)","tags":["Public - Nationality"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/postcatch/{tid}/create":{"post":{"summary":"Create a post interaction (Save, Pin, Share, with optional text/file)","tags":["Newsfeed - Post Catch"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["postid"],"properties":{"postid":{"type":"integer","minimum":1},"catchtype":{"type":"string"},"pin":{"type":"boolean"},"save":{"type":"boolean"},"share":{"type":"boolean"},"title":{"type":"string"},"file":{"type":"string","description":"Path or URL to uploaded file"},"catchdetails":{"type":"object","additionalProperties":true},"employeeId":{"type":"integer"}},"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"201":{"description":"Interaction created","content":{"application/json":{"schema":{"description":"Interaction created","type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"userid":{"type":"integer"},"postid":{"type":"integer"},"pin":{"type":"boolean"},"save":{"type":"boolean"},"share":{"type":"boolean"},"title":{"type":"string"},"file":{"type":"string"},"catchtype":{"type":"string"},"created_at":{"type":"string"}}}}}}}}},"/postcatch/{tid}/{id}/delete":{"delete":{"summary":"Remove a post interaction (Unpin, Unsave, etc.)","tags":["Newsfeed - Post Catch"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"employeeId","required":false},{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"description":"Delete result","type":"object","properties":{"message":{"type":"string"},"id":{"type":"integer"},"tid":{"type":"integer"},"postid":{"type":"integer"}}}}}}}}},"/workstationHoliday/{tid}/holidays":{"get":{"summary":"Get holidays for all active workstations by tenant id.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"tid":{"type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"holidays":{"anyOf":[{"type":"object"},{"type":"array"},{"type":"string"},{"type":"null"}]}},"required":["id","title","holidays"]}}},"required":["ok","tid","data"]}}}}}}},"/resetpassword/password-reset/send-otp":{"post":{"summary":"Send password reset OTP to email (NO tid)","tags":["Password Reset"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"additionalProperties":false,"properties":{"email":{"type":"string","format":"email"}}}}},"required":true},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/resetpassword/password-reset/confirm":{"post":{"summary":"Reset password using email + OTP (NO tid)","tags":["Password Reset"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","code","newPassword"],"additionalProperties":false,"properties":{"email":{"type":"string","format":"email"},"code":{"type":"string","minLength":6,"maxLength":6},"newPassword":{"type":"string","minLength":12}}}}},"required":true},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/analytics/employees":{"get":{"tags":["Analytics"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["Active","Invited","Inactive"]},"in":"query","name":"status","required":false},{"schema":{"type":"number"},"in":"query","name":"department_id","required":false},{"schema":{"type":"number"},"in":"query","name":"team_id","required":false},{"schema":{"type":"number"},"in":"query","name":"workplace_id","required":false},{"schema":{"type":"number"},"in":"query","name":"job_id","required":false},{"schema":{"type":"number"},"in":"query","name":"contract_type_id","required":false},{"schema":{"type":"number"},"in":"query","name":"gender_id","required":false},{"schema":{"type":"number"},"in":"query","name":"legal_entity_id","required":false},{"schema":{"type":"number"},"in":"query","name":"manager_id","required":false},{"schema":{"type":"number"},"in":"query","name":"nationality_id","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"start_date","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"end_date","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string","nullable":true},"dob":{"type":"string","format":"date","nullable":true},"age":{"type":"number"},"dateofjoin":{"type":"string","format":"date","nullable":true},"endcontract":{"type":"string","format":"date","nullable":true},"job_title":{"type":"string","nullable":true},"department_title":{"type":"string","nullable":true},"team_title":{"type":"string","nullable":true},"contracttype_title":{"type":"string","nullable":true},"manager_id":{"type":"number","nullable":true},"manager_fullname":{"type":"string","nullable":true},"manager_profile":{"type":"string","nullable":true},"gender_title":{"type":"string","nullable":true},"workplace_title":{"type":"string","nullable":true},"legalentity_title":{"type":"string","nullable":true},"nationality_title":{"type":"string","nullable":true},"isactive":{"type":"boolean"}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/analytics/request-summary":{"get":{"tags":["Analytics"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"pending":{"type":"number"},"approved":{"type":"number"},"rejected":{"type":"number"}}}}}}}}},"/notifyall/{tid}/send":{"post":{"summary":"Send an email notification to all active employees","tags":["Notifications"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["subject","message"],"properties":{"subject":{"type":"string","description":"Email Subject"},"message":{"type":"string","description":"Email Body Content"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/import/structure/{tid}/{typeId}":{"post":{"summary":"Import structure from Excel or CSV","tags":["Organization - Import"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"legalentity","required":false},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/preferencesget/{tid}/{uid}":{"get":{"summary":"Get user preferences (read-only)","tags":["Preferences"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"uid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"tid":{"type":"number"},"language":{"type":"string"},"datenumberformat":{"type":"string"},"timeformat":{"type":"string"},"firstdayinweek":{"type":"string"},"twoFactorAuth":{"type":"boolean"}}}}}}}}},"/preferences/{tid}/{uid}":{"patch":{"summary":"Update user preferences (partial)","tags":["Preferences"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"language":{"type":"string"},"datenumberformat":{"type":"string"},"timeformat":{"type":"string"},"firstdayinweek":{"type":"string"},"twoFactorAuth":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"string"},"in":"path","name":"uid","required":true,"description":"User ID"}],"responses":{"200":{"description":"Default Response"}}}},"/preferences/password/{tid}/{uid}":{"post":{"summary":"Change user password (with old password verification)","tags":["Preferences"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["oldPassword","newPassword"],"properties":{"oldPassword":{"type":"string"},"newPassword":{"type":"string","minLength":12}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"uid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/preferences/password/email/{tid}/{uid}":{"post":{"summary":"Send password reset email with OTP using User ID (uid)","tags":["Preferences"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"uid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/preferences/password/reset-with-code":{"post":{"summary":"Reset password using email and OTP code","tags":["Preferences"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid","email","code","newPassword"],"properties":{"tid":{"type":"integer"},"email":{"type":"string","format":"email"},"code":{"type":"string","minLength":6,"maxLength":6},"newPassword":{"type":"string","minLength":12}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/preferences/pin/{tid}/{uid}":{"post":{"summary":"Set or update user's 4-digit PIN","tags":["Preferences"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"pin4":{"type":"string","minLength":4,"maxLength":4},"pin":{"type":"string","minLength":4,"maxLength":4}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"uid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/preferences/pin/check/{tid}/{uid}":{"post":{"summary":"Check user's 4-digit PIN","tags":["Preferences"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"pin4":{"type":"string","minLength":4,"maxLength":4},"pin":{"type":"string","minLength":4,"maxLength":4}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"uid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}}}},"/preferences/linked-email/{tid}/{uid}":{"get":{"summary":"Check linked Google/Microsoft status","tags":["Preferences"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"uid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"google_id":{"type":"string","nullable":true},"microsoft_id":{"type":"string","nullable":true}}}}}}}}},"/preferences/link-google/{tid}/{uid}":{"post":{"summary":"Link a Google Account","tags":["Preferences"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"Google Access Token"}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"uid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/preferences/link-microsoft/{tid}/{uid}":{"post":{"summary":"Link a Microsoft Account","tags":["Preferences"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"Microsoft Access Token"}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"uid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employeeget/{tid}/{id}/full-details":{"get":{"summary":"Get complete employee details including personal, professional, organization hierarchy & approvals","tags":["Employee"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Employee ID"}],"responses":{"200":{"description":"Full employee details","content":{"application/json":{"schema":{"description":"Full employee details","type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/employeeget/{tid}/user/{userId}/full-details":{"get":{"summary":"Get complete employee details by User ID (includes branding & role data)","tags":["Employee"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer"},"in":"path","name":"userId","required":true,"description":"User ID"}],"responses":{"200":{"description":"Full employee details resolved by user","content":{"application/json":{"schema":{"description":"Full employee details resolved by user","type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/employeemodal/{tid}/legal-entities":{"get":{"summary":"1. List active Legal Entities (TID required).","tags":["Employee Modal Data - Separate"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employeemodal/{tid}/{legalEntityId}/workplaces":{"get":{"summary":"2. List Workplaces and Managers by LEID.","tags":["Employee Modal Data - Separate"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"legalEntityId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employeemodal/{tid}/{countryId}/specifications":{"get":{"summary":"3. List Country Specific Details (Contract Types, etc.).","tags":["Employee Modal Data - Separate"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"countryId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employeemodal/{tid}/{legalEntityId}/structure":{"get":{"summary":"4. List full nested Organization Structure (Dept/Team/Job).","tags":["Employee Modal Data - Separate"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"legalEntityId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employeemodal/{tid}/settings-dropdowns":{"get":{"summary":"5. List Schedules, Policies, and Permissions.","tags":["Employee Modal Data - Separate"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timemanagement/{tid}/{employeeId}/report":{"get":{"summary":"Time-off report for one employee","tags":["Time Management"],"parameters":[{"schema":{"type":"string","example":"2026"},"in":"query","name":"year","required":false,"description":"Year (e.g. 2026)"},{"schema":{"type":"string","example":"1"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"string","example":"12"},"in":"path","name":"employeeId","required":true,"description":"Employee ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"tenant":{"type":"number"},"employeeId":{"type":"number"},"employee":{"type":"object","properties":{"id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":["null","string"]},"departmentid":{"type":["null","number"]},"department_title":{"type":["null","string"]},"jobid":{"type":["null","number"]},"job_title":{"type":["null","string"]},"workplaceid":{"type":["null","number"]},"workplace_title":{"type":["null","string"]},"teamid":{"type":["null","number"]},"team_title":{"type":["null","string"]},"legalentityid":{"type":["null","number"]},"legalentity_title":{"type":["null","string"]},"user_id":{"type":["null","number"]}}},"data":{"type":"array","items":{"type":"object","properties":{"allowance_id":{"type":"number"},"allowance_title":{"type":"string"},"policy_id":{"type":"number"},"policy_title":{"type":"string"},"acquired":{"type":"number"},"taken":{"type":"number"},"adjustment":{"type":"number"},"request":{"type":"number"},"cancellation":{"type":"number"},"balance":{"type":"number"}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/timemanagement/{tid}/report/all":{"get":{"summary":"Time-off report for ALL employees","tags":["Time Management"],"parameters":[{"schema":{"type":"string","example":"2026"},"in":"query","name":"year","required":false,"description":"Year (e.g. 2026)"},{"schema":{"type":"string","example":"1"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"tenant":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"employee_id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":["null","string"]},"departmentid":{"type":["null","number"]},"department_title":{"type":["null","string"]},"jobid":{"type":["null","number"]},"job_title":{"type":["null","string"]},"workplaceid":{"type":["null","number"]},"workplace_title":{"type":["null","string"]},"teamid":{"type":["null","number"]},"team_title":{"type":["null","string"]},"legalentityid":{"type":["null","number"]},"legalentity_title":{"type":["null","string"]},"user_id":{"type":["null","number"]},"allowance_id":{"type":"number"},"allowance_title":{"type":"string"},"policy_id":{"type":"number"},"policy_title":{"type":"string"},"acquired":{"type":"number"},"taken":{"type":"number"},"adjustment":{"type":"number"},"request":{"type":"number"},"cancellation":{"type":"number"},"balance":{"type":"number"}}}}}}}}}}}},"/timemanagement/{tid}/attendance":{"get":{"summary":"Attendance report for ALL employees","tags":["Time Management"],"parameters":[{"schema":{"type":"string","example":"2025-11-01"},"in":"query","name":"from","required":true,"description":"Start date (YYYY-MM-DD)"},{"schema":{"type":"string","example":"2025-11-30"},"in":"query","name":"to","required":true,"description":"End date (YYYY-MM-DD)"},{"schema":{"type":"string","example":"1"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"tenant":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"employee_id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":["null","string"]},"departmentid":{"type":["null","number"]},"department_title":{"type":["null","string"]},"jobid":{"type":["null","number"]},"job_title":{"type":["null","string"]},"workplaceid":{"type":["null","number"]},"workplace_title":{"type":["null","string"]},"teamid":{"type":["null","number"]},"team_title":{"type":["null","string"]},"legalentityid":{"type":["null","number"]},"legalentity_title":{"type":["null","string"]},"user_id":{"type":["null","number"]},"work_date":{"type":"string","format":"date"},"check_in":{"type":["null","string"],"format":"date-time"},"check_out":{"type":["null","string"],"format":"date-time"},"worked_hours":{"type":["null","number"]},"status":{"type":["null","string"]},"workstation_id":{"type":["null","number"]},"notes":{"type":["null","string"]},"description":{"type":["null","string"]},"request_id":{"type":["null","number"]}}}}}}}}}}}},"/timemanagement/{tid}/{employeeId}/attendance":{"get":{"summary":"Attendance report for one employee","tags":["Time Management"],"parameters":[{"schema":{"type":"string","example":"2025-11-01"},"in":"query","name":"from","required":true,"description":"Start date (YYYY-MM-DD)"},{"schema":{"type":"string","example":"2025-11-30"},"in":"query","name":"to","required":true,"description":"End date (YYYY-MM-DD)"},{"schema":{"type":"string","example":"1"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"string","example":"12"},"in":"path","name":"employeeId","required":true,"description":"Employee ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"tenant":{"type":"number"},"employeeId":{"type":"number"},"employee":{"type":"object","properties":{"id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":["null","string"]},"departmentid":{"type":["null","number"]},"department_title":{"type":["null","string"]},"jobid":{"type":["null","number"]},"job_title":{"type":["null","string"]},"workplaceid":{"type":["null","number"]},"workplace_title":{"type":["null","string"]},"teamid":{"type":["null","number"]},"team_title":{"type":["null","string"]},"legalentityid":{"type":["null","number"]},"legalentity_title":{"type":["null","string"]},"user_id":{"type":["null","number"]}}},"from":{"type":"string"},"to":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"employee_id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":["null","string"]},"departmentid":{"type":["null","number"]},"department_title":{"type":["null","string"]},"jobid":{"type":["null","number"]},"job_title":{"type":["null","string"]},"workplaceid":{"type":["null","number"]},"workplace_title":{"type":["null","string"]},"teamid":{"type":["null","number"]},"team_title":{"type":["null","string"]},"legalentityid":{"type":["null","number"]},"legalentity_title":{"type":["null","string"]},"user_id":{"type":["null","number"]},"work_date":{"type":"string","format":"date"},"check_in":{"type":["null","string"],"format":"date-time"},"check_out":{"type":["null","string"],"format":"date-time"},"worked_hours":{"type":["null","number"]},"status":{"type":["null","string"]},"workstation_id":{"type":["null","number"]},"notes":{"type":["null","string"]},"description":{"type":["null","string"]},"request_id":{"type":["null","number"]}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/timemanagement/{tid}/export/attendance":{"get":{"summary":"Export Attendance Sheet Data","tags":["Time Management"],"parameters":[{"schema":{"type":"string","example":"2025-01-01"},"in":"query","name":"from","required":true,"description":"Start date (YYYY-MM-DD)"},{"schema":{"type":"string","example":"2025-01-31"},"in":"query","name":"to","required":true,"description":"End date (YYYY-MM-DD)"},{"schema":{"type":"string","example":"123"},"in":"query","name":"employeeId","required":false,"description":"Optional Employee ID filter"},{"schema":{"type":"string","example":"1"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"tenant":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"employee_id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"department_title":{"type":["null","string"]},"job_title":{"type":["null","string"]},"workplace_title":{"type":["null","string"]},"team_title":{"type":["null","string"]},"user_id":{"type":["null","number"]},"record_date":{"type":"string","format":"date"},"schedule_title":{"type":["null","string"]},"period_kind":{"type":["null","string"]},"is_working_day":{"type":"boolean"},"expected_start_time":{"type":["null","string"]},"expected_end_time":{"type":["null","string"]},"total_scheduled_hours":{"type":["null","object","string"]},"actual_start_time":{"type":["null","string"]},"actual_end_time":{"type":["null","string"]},"is_delayed":{"type":["null","boolean"]},"delay_duration":{"type":["null","object","string"]},"actual_hours_worked":{"type":["null","object","string"]}}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/linkpreview":{"get":{"summary":"Open Graph / meta preview for a URL","tags":["Helpers"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"url","required":true,"description":"http(s) URL to fetch"}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"meta":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string"}}}}}}}}},"/mentions/{tid}/search":{"get":{"summary":"Search employees and teams for @mentions within a tenant.","tags":["Mentions"],"description":"Returns a unified list of employees (User ID) and teams (Team ID) matching the search query.","parameters":[{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Search text after \"@\", matches employee names, emails, or team titles"},{"schema":{"type":"number","default":10},"in":"query","name":"limit","required":false,"description":"Maximum number of results to return"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"limit":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"entity_type":{"type":"string","enum":["employee","team"]},"name":{"type":"string"},"detail":{"type":"string","nullable":true},"photo":{"type":"string"}}}}}}}}}}}},"/dashboard/{tid}/all":{"get":{"tags":["Employees - Birthdays"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/dashboard/{tid}/soonest":{"get":{"tags":["Employees - Birthdays"],"parameters":[{"schema":{"type":"integer","default":10},"in":"query","name":"limit","required":false},{"schema":{"type":"string","enum":["BIRTHDAY","ANNIVERSARY","NEW_JOINER","EXIT"]},"in":"query","name":"event","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"startDate","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"endDate","required":false},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/custom_newsfeed/post/{tid}/{post_id}":{"get":{"summary":"Fetch a single post reliably using the SQL function","tags":["Custom Newsfeed API"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"user_id","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"post_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"post":{"type":"object","properties":{"post_id":{"type":"number"},"author_id":{"type":"number"},"post_type":{"type":"string"},"created_at":{"type":"string"},"content":{"type":"string"},"author_firstname":{"type":"string"},"author_lastname":{"type":"string"},"author_photo":{"type":"string"},"scopes":{"type":"object","additionalProperties":true},"poll_data":{"type":"object","additionalProperties":true},"values_data":{"type":"object","additionalProperties":true},"mentions":{"type":"object","additionalProperties":true},"attachments":{"type":"object","additionalProperties":true},"all_comments":{"type":"object","additionalProperties":true},"all_reactions":{"type":"object","additionalProperties":true},"comment_count":{"type":"number"},"like_count":{"type":"number"},"love_count":{"type":"number"},"super_count":{"type":"number"},"celebrate_count":{"type":"number"},"goodluck_count":{"type":"number"},"is_pinned":{"type":"boolean"},"is_saved":{"type":"boolean"},"pin_id":{"type":["null","number"]},"save_id":{"type":["null","number"]}}}}}}}}}}},"/custom_newsfeed/post":{"post":{"summary":"Create any Post (Text, Value, Poll, Media) via one Multipart request.","tags":["Custom Newsfeed API"],"description":"\n      Accepts multipart/form-data.\n      Required: tid, author_user_id\n      Optional:\n      - content\n      - file (multi)\n      - poll_question, poll_options\n      - shoutouts\n      - tag_values\n      - location_checkin\n      - scope_le_ids / scope_ws_ids / scope_st_ids\n    ","responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"post_id":{"type":"number"},"media_urls":{"type":"array","items":{"type":"string"}},"post":{"type":"object","properties":{"post_id":{"type":"number"},"author_id":{"type":"number"},"post_type":{"type":"string"},"created_at":{"type":"string"},"content":{"type":"string"},"author_firstname":{"type":"string"},"author_lastname":{"type":"string"},"author_photo":{"type":"string"},"scopes":{"type":"object","additionalProperties":true},"poll_data":{"type":"object","additionalProperties":true},"values_data":{"type":"object","additionalProperties":true},"mentions":{"type":"object","additionalProperties":true},"attachments":{"type":"object","additionalProperties":true},"all_comments":{"type":"object","additionalProperties":true},"all_reactions":{"type":"object","additionalProperties":true},"comment_count":{"type":"number"},"like_count":{"type":"number"},"love_count":{"type":"number"},"super_count":{"type":"number"},"celebrate_count":{"type":"number"},"goodluck_count":{"type":"number"},"is_pinned":{"type":"boolean"},"is_saved":{"type":"boolean"},"pin_id":{"type":["null","number"]},"save_id":{"type":["null","number"]}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/custom_newsfeed/posts/media-test":{"post":{"summary":"Test upload connectivity only","tags":["Custom Newsfeed API"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}}}}},"/calendar":{"get":{"summary":"Get consolidated employee timeline (events + status details)","tags":["Calendar"],"description":"Returns calendar events including instance IDs for linking and full timestamps.","parameters":[{"schema":{"type":"integer"},"in":"query","name":"tenantId","required":true,"description":"The Tenant ID."},{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":true,"description":"Start Date (YYYY-MM-DD)"},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":true,"description":"End Date (YYYY-MM-DD)"}],"responses":{"200":{"description":"Default Response"}}}},"/letters/templates/upload":{"post":{"summary":"Upload template file (Docx/PDF)","tags":["Letters (Approval)"],"responses":{"200":{"description":"Default Response"}}}},"/letters/templates":{"get":{"summary":"List letter templates (tenant)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a letter template","tags":["Letters (Approval)"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid","title","file_url"],"properties":{"tid":{"type":"number"},"title":{"type":"string"},"file_url":{"type":"string"},"is_fillable":{"type":"boolean","default":true},"is_active":{"type":"boolean","default":true},"variables_json":{"type":"array","items":{"type":"object","additionalProperties":true},"default":[]},"template_details":{"type":"object","additionalProperties":true,"default":{}}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/letters/templates/{id}":{"get":{"summary":"Get one template (tenant-guarded)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Update a letter template (tenant-guarded)","tags":["Letters (Approval)"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid"],"properties":{"tid":{"type":"number"},"title":{"type":"string"},"file_url":{"type":"string"},"is_fillable":{"type":"boolean"},"is_active":{"type":"boolean"},"variables_json":{"type":"array","items":{"type":"object","additionalProperties":true}},"template_details":{"type":"object","additionalProperties":true}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a template (tenant-guarded)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/letters/variables":{"get":{"summary":"List letter variables (tenant)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a letter variable","tags":["Letters (Approval)"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid","name","token"],"properties":{"tid":{"type":"number"},"name":{"type":"string"},"section":{"type":"string","default":"General"},"entity":{"type":"string","default":"ALL"},"is_public":{"type":"boolean","default":true},"token":{"type":"string"}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/letters/variables/{id}":{"get":{"summary":"Get one variable (tenant-guarded)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Update a letter variable (tenant-guarded)","tags":["Letters (Approval)"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid"],"properties":{"tid":{"type":"number"},"name":{"type":"string"},"section":{"type":"string"},"entity":{"type":"string"},"is_public":{"type":"boolean"},"token":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a variable (tenant-guarded)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/letters/requests/submit":{"post":{"summary":"Submit a new letter request → creates approval.instance","tags":["Letters (Approval)"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid","employee_id","template_id"],"properties":{"tid":{"type":"number"},"employee_id":{"type":"number"},"template_id":{"type":"number"},"purpose":{"type":"string"},"extra_json":{"type":"object","additionalProperties":true},"flow_id":{"type":"number","nullable":true},"approvfor":{"type":"number","default":5}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/letters/requests/my":{"get":{"summary":"List my letter requests","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"query","name":"employee_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/letters/requests/{id}":{"get":{"summary":"Get a request by id (tenant-guarded)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update request (only pending)","tags":["Letters (Approval)"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid"],"properties":{"tid":{"type":"number"},"purpose":{"type":"string"},"extra_json":{"type":"object","additionalProperties":true},"otherdetails":{"type":"object","additionalProperties":true,"nullable":true}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Cancel request (only pending)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/letters/requests/{request_id}/generated":{"get":{"summary":"List generated files for a request (tenant-guarded)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"request_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/letters/generated/attach":{"post":{"summary":"Attach a generated file (version auto-increments)","tags":["Letters (Approval)"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["request_id","file_url"],"properties":{"request_id":{"type":"number"},"file_url":{"type":"string"}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/letters/generated/{id}":{"delete":{"summary":"Delete generated file (tenant-guarded via parent request)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/letters/instances/{instance_id}/approve":{"post":{"summary":"Admin approve a letter instance (updates instance + calls hook)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"instance_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/letters/instances/{instance_id}/reject":{"post":{"summary":"Admin reject a letter instance (updates instance + calls hook)","tags":["Letters (Approval)"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"instance_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/changestatus/approval/{tid}/change-status":{"post":{"summary":"Change approval status and log action with notification","tags":["change status"],"description":"Updates approval instance status, logs action, and sends notification to requester","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["admin_id","instance_id","new_status","decision"],"properties":{"admin_id":{"type":"integer","minimum":1},"instance_id":{"type":"integer","minimum":1},"new_status":{"type":"string","enum":["pending","approved","rejected","returned","cancelled"]},"decision":{"type":"string","enum":["approved","rejected","returned","pending"]},"comment":{"type":"string","maxLength":1000}},"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"instance_id":{"type":"integer"},"tenant_id":{"type":"integer"},"flowid":{"type":"integer"},"target_id":{"type":"integer"},"requested_by":{"type":"integer"},"instance_status":{"type":"string"},"current_level":{"type":"integer"},"autoapproved":{"type":"boolean"},"instance_created_at":{"type":"string","format":"date-time"},"instance_created_by":{"type":"integer"},"instance_updated_at":{"type":"string","format":"date-time"},"target_type":{"type":"string"},"flow_title":{"type":"string"},"flow_description":{"type":"string"},"flow_autoapprove":{"type":"boolean"},"flow_is_active":{"type":"boolean"},"flow_type_id":{"type":"integer"},"flow_is_default":{"type":"boolean"},"flow_category":{"type":"string"},"flow_created_at":{"type":"string","format":"date-time"},"flow_updated_at":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}}}}}}}}},"/changestatus/approval/{tid}/instance/{instance_id}":{"get":{"summary":"Get approval instance and flow details","tags":["Approval change status"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"instance_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/newsfeeds/posts":{"get":{"summary":"Get newsfeed timeline posts","tags":["Newsfeed View"],"description":"Returns posts visible to the user based on organizational scopes.","parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true,"description":"Tenant ID (Required)"},{"schema":{"type":"number"},"in":"query","name":"user_id","required":true,"description":"Viewing User ID (Required)"},{"schema":{"type":"number","default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"number","default":0},"in":"query","name":"offset","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"array","items":{"type":"object","properties":{"post_id":{"type":"number"},"author_id":{"type":"number"},"author_firstname":{"type":"string"},"author_lastname":{"type":"string"},"author_photo":{"type":"string"},"post_type":{"type":"string","enum":["post","poll","image","document"]},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"comment_count":{"type":"number"},"like_count":{"type":"number"},"love_count":{"type":"number"},"super_count":{"type":"number"},"celebrate_count":{"type":"number"},"goodluck_count":{"type":"number"},"is_pinned":{"type":"boolean"},"pin_id":{"type":["null","number"]},"is_saved":{"type":"boolean"},"save_id":{"type":["null","number"]},"all_comments":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"authorId":{"type":"number"},"authorName":{"type":"string"},"authorPhoto":{"type":"string"},"content":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"subCommentCount":{"type":"number"}},"required":["id","authorId","content"]}},"all_reactions":{"type":"object","additionalProperties":{"type":"object","properties":{"userId":{"type":"number"},"userName":{"type":"string"},"userPhoto":{"type":"string"},"reactionType":{"type":"string"},"reactedAt":{"type":"string","format":"date-time"}},"required":["userId","reactionType"]}},"poll_data":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"question":{"type":"string"},"durationHrs":{"type":"number"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"text":{"type":"string"},"count":{"type":"number"}}}},"userVotedOptionId":{"type":"number"}},"required":["id","question","options"]}},"attachments":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"type":{"type":"string"},"url":{"type":"string"},"thumbnail":{"type":"string"},"caption":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","url","type"]}},"scopes":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["type","id","name"]}},"mentions":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"photo":{"type":"string"},"positionRef":{"type":"string"}},"required":["type","id","name"]}},"values_data":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"title":{"type":"string"},"icon":{"type":"string"},"note":{"type":"string"}},"required":["id","title"]}}},"required":["post_id","author_id","post_type","created_at"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"has_more":{"type":"boolean"}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/newsfeeds/saved":{"get":{"summary":"Get user saved posts","tags":["Newsfeed View"],"description":"Returns only the posts that the user has marked as saved.","parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true,"description":"Tenant ID (Required)"},{"schema":{"type":"number"},"in":"query","name":"user_id","required":true,"description":"Viewing User ID (Required)"},{"schema":{"type":"number","default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"number","default":0},"in":"query","name":"offset","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"array","items":{"type":"object","properties":{"post_id":{"type":"number"},"author_id":{"type":"number"},"author_firstname":{"type":"string"},"author_lastname":{"type":"string"},"author_photo":{"type":"string"},"post_type":{"type":"string","enum":["post","poll","image","document"]},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"comment_count":{"type":"number"},"like_count":{"type":"number"},"love_count":{"type":"number"},"super_count":{"type":"number"},"celebrate_count":{"type":"number"},"goodluck_count":{"type":"number"},"is_pinned":{"type":"boolean"},"pin_id":{"type":["null","number"]},"is_saved":{"type":"boolean"},"save_id":{"type":["null","number"]},"all_comments":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"authorId":{"type":"number"},"authorName":{"type":"string"},"authorPhoto":{"type":"string"},"content":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"subCommentCount":{"type":"number"}},"required":["id","authorId","content"]}},"all_reactions":{"type":"object","additionalProperties":{"type":"object","properties":{"userId":{"type":"number"},"userName":{"type":"string"},"userPhoto":{"type":"string"},"reactionType":{"type":"string"},"reactedAt":{"type":"string","format":"date-time"}},"required":["userId","reactionType"]}},"poll_data":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"question":{"type":"string"},"durationHrs":{"type":"number"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"text":{"type":"string"},"count":{"type":"number"}}}},"userVotedOptionId":{"type":"number"}},"required":["id","question","options"]}},"attachments":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"type":{"type":"string"},"url":{"type":"string"},"thumbnail":{"type":"string"},"caption":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","url","type"]}},"scopes":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["type","id","name"]}},"mentions":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"photo":{"type":"string"},"positionRef":{"type":"string"}},"required":["type","id","name"]}},"values_data":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"title":{"type":"string"},"icon":{"type":"string"},"note":{"type":"string"}},"required":["id","title"]}}},"required":["post_id","author_id","post_type","created_at"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"has_more":{"type":"boolean"}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/newsfeeds/posts/{post_id}":{"get":{"summary":"Get a single post","tags":["Newsfeed View"],"description":"Returns a single post object if visible to the user.","parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true,"description":"Tenant ID (Required)"},{"schema":{"type":"number"},"in":"query","name":"user_id","required":true,"description":"Viewing User ID (Required)"},{"schema":{"type":"number"},"in":"path","name":"post_id","required":true,"description":"The ID of the post to retrieve"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"number"},"author_id":{"type":"number"},"author_firstname":{"type":"string"},"author_lastname":{"type":"string"},"author_photo":{"type":"string"},"post_type":{"type":"string","enum":["post","poll","image","document"]},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"comment_count":{"type":"number"},"like_count":{"type":"number"},"love_count":{"type":"number"},"super_count":{"type":"number"},"celebrate_count":{"type":"number"},"goodluck_count":{"type":"number"},"is_pinned":{"type":"boolean"},"pin_id":{"type":["null","number"]},"is_saved":{"type":"boolean"},"save_id":{"type":["null","number"]},"all_comments":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"authorId":{"type":"number"},"authorName":{"type":"string"},"authorPhoto":{"type":"string"},"content":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"subCommentCount":{"type":"number"}},"required":["id","authorId","content"]}},"all_reactions":{"type":"object","additionalProperties":{"type":"object","properties":{"userId":{"type":"number"},"userName":{"type":"string"},"userPhoto":{"type":"string"},"reactionType":{"type":"string"},"reactedAt":{"type":"string","format":"date-time"}},"required":["userId","reactionType"]}},"poll_data":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"question":{"type":"string"},"durationHrs":{"type":"number"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"text":{"type":"string"},"count":{"type":"number"}}}},"userVotedOptionId":{"type":"number"}},"required":["id","question","options"]}},"attachments":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"type":{"type":"string"},"url":{"type":"string"},"thumbnail":{"type":"string"},"caption":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","url","type"]}},"scopes":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["type","id","name"]}},"mentions":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"photo":{"type":"string"},"positionRef":{"type":"string"}},"required":["type","id","name"]}},"values_data":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"number"},"title":{"type":"string"},"icon":{"type":"string"},"note":{"type":"string"}},"required":["id","title"]}}},"required":["post_id","author_id","post_type","created_at"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/newsfeeds/scopes":{"get":{"summary":"Get all organizational scopes for a user","tags":["Newsfeed View"],"description":"Returns all scopes (employee, departments, teams, jobs, structures, workplaces, legal entities) for a user based on organizational context","parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true,"description":"Tenant ID (Required)"},{"schema":{"type":"number"},"in":"query","name":"user_id","required":true,"description":"User ID (Required)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string"},"id":{"type":"number"},"title":{"type":"string"}},"required":["scope_type","id","title"]}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/newsfeedspost/posts/{postId}/comments":{"post":{"summary":"Add a comment or reply to a Newsfeed Post.","tags":["Newsfeed Comments"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid","author_user_id","content"],"properties":{"tid":{"type":"number"},"author_user_id":{"type":"number"},"content":{"type":"string"},"parent_comment_id":{"type":["number","null"],"default":null}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"postId","required":true}],"security":[],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"post_id":{"type":"number"},"comment_id":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}},"get":{"summary":"GET /newsfeedspost/posts/:postId/comments","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"postId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/newsfeedspost/posts/{postId}/reaction":{"put":{"summary":"Insert or update a post reaction (like, love, etc.) for a user.","tags":["Newsfeed Reactions"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user_id","tid","reaction_type"],"properties":{"tid":{"type":"number"},"user_id":{"type":"number"},"reaction_type":{"type":"string","enum":["like","love","haha","super","myvote","goodluck","celebrate"]}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"postId","required":true}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}},"delete":{"summary":"Remove a reaction (unlike) for a user on a post.","tags":["Newsfeed Reactions"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"query","name":"user_id","required":true},{"schema":{"type":"number"},"in":"path","name":"postId","required":true}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"post_id":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}},"get":{"summary":"GET /newsfeedspost/posts/:postId/reaction","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"postId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/newsfeedspost/posts/{postId}/vote":{"put":{"summary":"Toggle a poll vote (Add if new, Remove if same option).","tags":["Newsfeed Polls"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user_id","tid","poll_option_id"],"properties":{"tid":{"type":"number"},"user_id":{"type":"number"},"poll_option_id":{"type":"number","description":"Index of the option. Sending the same ID again will remove the vote."}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"postId","required":true}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"action":{"type":"string","enum":["voted","removed"]},"post_id":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}},"delete":{"summary":"Remove any poll vote for a user on a post.","tags":["Newsfeed Polls"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"tid","required":true},{"schema":{"type":"number"},"in":"query","name":"user_id","required":true},{"schema":{"type":"number"},"in":"path","name":"postId","required":true}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"post_id":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}}},"/newsfeedspost/posts/{postId}":{"put":{"summary":"PUT /newsfeedspost/posts/:postId","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"postId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"DELETE /newsfeedspost/posts/:postId","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"postId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/newsfeedspost/comments/{commentId}":{"delete":{"summary":"DELETE /newsfeedspost/comments/:commentId","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"commentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/auth/login":{"post":{"summary":"Login with email and password","tags":["Auth"],"description":"Returns a JWT in `token` — paste that value into **Authorize** (not JWT_SECRET). If the account has no password yet, returns `requireOtp: true` and emails a code.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email","example":"user@company.com"},"password":{"type":"string","format":"password","description":"User password"}}}}},"required":true},"security":[],"responses":{"200":{"description":"JWT session or OTP required","content":{"application/json":{"schema":{"description":"JWT session or OTP required","type":"object","properties":{"token":{"type":"string","description":"JWT — copy for Swagger Authorize"},"user":{"type":"object","properties":{"id":{"type":"number"},"email":{"type":"string"},"tenantId":{"type":"number"}}},"requireOtp":{"type":"boolean"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/auth/request-login-code":{"post":{"summary":"Request email OTP for login","tags":["Auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","example":"user@company.com"}}}}},"required":true},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"hasPassword":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/auth/verify-login-code":{"post":{"summary":"Verify OTP and obtain JWT","tags":["Auth"],"description":"Returns `token` for Swagger **Authorize**.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","code"],"properties":{"email":{"type":"string","format":"email"},"code":{"type":"string","example":"123456","description":"6-digit code from email"}}}}},"required":true},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"number"},"email":{"type":"string"},"tenantId":{"type":"number"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/auth/google-login":{"post":{"summary":"Login with Google OAuth access token","tags":["Auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"Google OAuth access_token (from Google Sign-In), not SlashHR JWT"}}}}},"required":true},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"SlashHR JWT"},"user":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/auth/microsoft-login":{"post":{"summary":"Login with Microsoft OAuth access token","tags":["Auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"Microsoft Graph access_token, not SlashHR JWT"}}}}},"required":true},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"SlashHR JWT"},"user":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/auth/setup-password":{"post":{"summary":"Set password using email verification code","tags":["Auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","code","newPassword"],"properties":{"email":{"type":"string","format":"email"},"code":{"type":"string"},"newPassword":{"type":"string","format":"password"}}}}},"required":true},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"token":{"type":"string"},"tid":{"type":"number"},"eid":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/auth/session":{"get":{"summary":"Validate JWT session","tags":["Auth"],"description":"Send `Authorization: Bearer <token>` or use a session cookie.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"session":{"type":"object","properties":{"tid":{"type":"number"},"uid":{"type":"number"}}},"decoded":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string"}}}}}}}}},"/auth/logout":{"post":{"summary":"Logout (clears session cookie)","tags":["Auth"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}}}},"/employee/{tid}":{"get":{"summary":"Get all employees (basic list - using original model query)","tags":["My Update Employee"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"tid":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"workemail":{"type":"string"},"profile":{"type":"string"},"isactive":{"type":"boolean"},"age":{"type":"number","nullable":true},"assignments":{"type":"array"},"department":{"type":["null","object"]},"team":{"type":["null","object"]},"job":{"type":["null","object"]}}}}}}}}}},"/employee/{tid}/{employeeId}":{"get":{"summary":"Get full details for a specific employee including structure assignments","tags":["My Update Employee"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"tid":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"workemail":{"type":"string","format":"email"},"personalemail":{"type":"string","format":"email","nullable":true},"login":{"type":"string"},"isactive":{"type":"boolean"},"gender":{"type":"number","default":1},"nationality":{"type":"number","nullable":true},"dob":{"type":"string","format":"date","default":"1980-01-01"},"phonenumber":{"type":"string","nullable":true},"cin":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"profile":{"type":"string","default":"/images/noimguser.png"},"keybox":{"type":["null","string"]},"socioprofessionalcategoryid":{"type":"number","nullable":true},"workplaceid":{"type":"number","nullable":true},"languages":{"type":["null","object"]},"hobbies":{"type":["null","object"]},"skills":{"type":["null","object"]},"hskills":{"type":["null","object"]},"skilss":{"type":["null","object"]},"favoritemovie":{"type":["null","object"]},"favoritesport":{"type":["null","object"]},"whoiam":{"type":"string"},"whatido":{"type":"string"},"socialnetwork":{"type":["null","object"]},"emergencycontact":{"type":["null","object"]},"favoriteseason":{"type":"string"},"dreamholidaydestination":{"type":"string"},"childhooddream":{"type":"string"},"bank":{"type":["null","object"]},"drivinglicense":{"type":["null","object"]},"latestrefrencediploma":{"type":["null","object"]},"workinformation":{"type":["null","object"]},"legal_entity":{"type":["null","string"]},"job_title":{"type":["null","string"]},"team_name":{"type":["null","string"]},"department_name":{"type":["null","string"]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}},"put":{"summary":"Update an existing employee record (tblemployee)","tags":["My Update Employee"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"login":{"type":"string"},"workemail":{"type":"string","format":"email"},"personalemail":{"type":"string","format":"email","nullable":true},"isactive":{"type":"boolean"},"gender":{"type":"number"},"nationality":{"type":"number","nullable":true},"dob":{"type":"string","format":"date"},"phonenumber":{"type":"string","nullable":true},"cin":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"profile":{"type":"string","nullable":true},"keybox":{"type":["string","null"]},"languages":{"type":["object","null"]},"hobbies":{"type":["object","null"]},"skills":{"type":["object","null"]},"hskills":{"type":["object","null"]},"skilss":{"type":["object","null"]},"favoritemovie":{"type":["object","null"]},"favoritesport":{"type":["object","null"]},"whoiam":{"type":"string"},"whatido":{"type":"string"},"socialnetwork":{"type":["object","null"]},"emergencycontact":{"type":["object","null"]},"favoriteseason":{"type":"string"},"dreamholidaydestination":{"type":"string"},"childhooddream":{"type":"string"},"bank":{"type":["object","null"]},"drivinglicense":{"type":["object","null"]},"latestrefrencediploma":{"type":["object","null"]},"workinformation":{"type":["object","null"]},"socioprofessionalcategoryid":{"type":["number","null"]},"workplaceid":{"type":["number","null"]}},"additionalProperties":true}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"tid":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"workemail":{"type":"string","format":"email"},"personalemail":{"type":"string","format":"email","nullable":true},"login":{"type":"string"},"isactive":{"type":"boolean"},"gender":{"type":"number","default":1},"nationality":{"type":"number","nullable":true},"dob":{"type":"string","format":"date","default":"1980-01-01"},"phonenumber":{"type":"string","nullable":true},"cin":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"profile":{"type":"string","default":"/images/noimguser.png"},"keybox":{"type":["null","string"]},"socioprofessionalcategoryid":{"type":"number","nullable":true},"workplaceid":{"type":"number","nullable":true},"languages":{"type":["null","object"]},"hobbies":{"type":["null","object"]},"skills":{"type":["null","object"]},"hskills":{"type":["null","object"]},"skilss":{"type":["null","object"]},"favoritemovie":{"type":["null","object"]},"favoritesport":{"type":["null","object"]},"whoiam":{"type":"string"},"whatido":{"type":"string"},"socialnetwork":{"type":["null","object"]},"emergencycontact":{"type":["null","object"]},"favoriteseason":{"type":"string"},"dreamholidaydestination":{"type":"string"},"childhooddream":{"type":"string"},"bank":{"type":["null","object"]},"drivinglicense":{"type":["null","object"]},"latestrefrencediploma":{"type":["null","object"]},"workinformation":{"type":["null","object"]},"legal_entity":{"type":["null","string"]},"job_title":{"type":["null","string"]},"team_name":{"type":["null","string"]},"department_name":{"type":["null","string"]}}}}}},"304":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"detail":{"type":"string"}}}}}}}}},"/employee/{tid}/{employeeId}/photo":{"post":{"summary":"Upload a new profile picture for the employee","tags":["My Update Employee"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"employeeId":{"type":"number"},"profileUrl":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/flow_requests_employee/{tenantId}/{employeeId}":{"get":{"summary":"List approval instances where this employee is the target (target_id).","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"string","default":"all"},"in":"query","name":"status","required":false,"description":"Status filter: 'all', 'pending', 'approved', 'rejected', or combined 'approved,rejected'"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"to","required":false},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true,"description":"Employee ID that the request is ABOUT (approval.instance.target_id)"}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests_employee/{tenantId}/{employeeId}/full":{"get":{"summary":"Get full employee org/professional view merged from structure + professional tables.","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests_employee/{tenantId}/{employeeId}/leave-attendance":{"get":{"summary":"Get leave and attendance approval instances for an employee.","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"string","default":"all"},"in":"query","name":"status","required":false,"description":"Status filter: 'all', 'pending', 'approved', 'rejected'"},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true,"description":"Employee ID for leave and attendance records"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"instance_id":{"type":["integer","string"]},"tid":{"type":["integer","string"]},"flowid":{"type":["integer","string"]},"flow_type_id":{"type":["integer","string"]},"flow_type_title":{"type":["null","string"]},"target_type":{"type":["null","string"]},"target_id":{"type":["null","integer","string"]},"requested_by":{"type":["null","integer","string"]},"createdby":{"type":["null","integer","string"]},"instance_status":{"type":["null","string"]},"instance_created_at":{"type":["null","string"]},"requestor_summary_json":{"type":["null","object"],"additionalProperties":true},"current_instance_flow_details":{"type":["null","object"],"additionalProperties":true},"request_details_json":{"type":["null","object"],"additionalProperties":true},"suggestionapproval":{"type":["null","object"],"additionalProperties":true},"instancescomments":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}}}},"/flow_requests_employee/{tenantId}/{employeeId}/attendance-leave-summary":{"get":{"summary":"Get combined attendance and leave records summary for an employee.","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"string","format":"date"},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateTo","required":false},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests_employee/{tenantId}/{employeeId}/approval-flows":{"get":{"summary":"Get approval flows where employee is either directly assigned or via role.","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"roleId","required":true,"description":"Role ID to check for group-based approval flows"},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests_employee/{tenantId}/{employeeId}/is-approver":{"get":{"summary":"Check if employee or their role is an approver for a specific flow.","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"flowId","required":true,"description":"Flow ID to check against"},{"schema":{"type":"number"},"in":"query","name":"roleId","required":true,"description":"Role ID to check for group-based approval"},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests_employee/{tenantId}/{employeeId}/can-send-request":{"get":{"summary":"Check if employee can send requests for a specific flow.","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"flowId","required":true,"description":"Flow ID to check send request permission"},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests_employee/{tenantId}/{employeeId}/requestable-flows":{"get":{"summary":"Get all flows that employee can send requests for.","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests_employee/{tenantId}/{employeeId}/approval-status":{"get":{"summary":"Check if employee (requester) can approve target employee based on rank/level.","tags":["Flow Requests (Employee Target)"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"targetId","required":true,"description":"The Target Employee ID (Person being acted upon)"},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true,"description":"The Requester ID (You)"}],"responses":{"200":{"description":"Default Response"}}}},"/flow_type/{tid}/{employeeId}/types":{"get":{"summary":"List approval flow types and flows this employee can approve","tags":["Flow Types"],"description":"\n        Fetches all active approval flow types (flow_type)\n        and their active flows (flow)\n        for a given tenant (:tid) where the employee\n        is an approver, either directly (flow_level_entity.employeeid)\n        or via role/permission group (\"user\".tbluser.roleid).\n\n        Each row in \"data\" is one (flow_type, flow) pair.\n      ","parameters":[{"schema":{"type":"string"},"example":"1","in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"string"},"example":"12","in":"path","name":"employeeId","required":true,"description":"Employee ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"OK"},"tenant":{"type":"number","example":1},"employeeId":{"type":"number","example":12},"data":{"type":"array","items":{"type":"object","properties":{"flow_type_id":{"type":"number","example":3},"flow_type_title":{"type":"string","example":"Leave / Time Off Approval"},"flow_id":{"type":"number","example":7},"flow_title":{"type":"string","example":"Default Time off Approval"},"flow_category":{"type":"string","example":"regular"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Missing parameters"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Internal Server Error"}}}}}}}}},"/flow_requests/{tenantId}/submit":{"post":{"summary":"Submit a new request.","tags":["Flow Requests inbox"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/{employeeId}":{"get":{"summary":"List request instances with nested comments, suggestions, and full leave data.","tags":["Flow Requests inbox"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"instance_id":{"type":"number"},"instance_status":{"type":"string"},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"comment":{"type":"string"},"filesource":{"type":"string","nullable":true},"createdat":{"type":"string"},"employee_id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string"}}}},"suggestion_details":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string"}}},"full_leave_data":{"type":"object","additionalProperties":true,"nullable":true}}}}}}}}}},"/flow_requests/{tenantId}/instance/{instanceId}":{"get":{"summary":"Get details of a single request instance","tags":["Flow Requests inbox"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"employeeId","required":true},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/request/{instanceId}":{"delete":{"summary":"Delete a request (soft delete or cleanup)","tags":["Flow Requests inbox"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"employeeId","required":true},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update leave request details (Date, Reason, etc)","tags":["Flow Requests inbox"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["employeeId"],"properties":{"employeeId":{"type":"number"},"leaveTypeId":{"type":"number","nullable":true},"from":{"type":"string","format":"date-time","nullable":true},"to":{"type":"string","format":"date-time","nullable":true},"reason":{"type":"string","nullable":true}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/instance/{instanceId}/comment":{"post":{"summary":"Add a comment to discussion.","tags":["Flow Requests inbox"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/comment/{commentId}":{"delete":{"summary":"Delete a comment.","tags":["Flow Requests inbox"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"commentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/instance/{instanceId}/action":{"post":{"summary":"POST /flow_requests/:tenantId/instance/:instanceId/action","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/request/{requestId}/attachment":{"patch":{"summary":"PATCH /flow_requests/:tenantId/request/:requestId/attachment","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/workstation/{tenantId}/employees":{"get":{"summary":"GET /flow_requests/workstation/:tenantId/employees","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/workstation/{tenantId}/company":{"get":{"summary":"GET /flow_requests/workstation/:tenantId/company","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/workstation/{tenantId}/client":{"get":{"summary":"GET /flow_requests/workstation/:tenantId/client","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/allowance/{tenantId}":{"get":{"summary":"GET /flow_requests/allowance/:tenantId","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/employee/{employeeId}/time-policy":{"get":{"summary":"GET /flow_requests/:tenantId/employee/:employeeId/time-policy","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/flow/{flowId}/requestors":{"get":{"summary":"GET /flow_requests/:tenantId/flow/:flowId/requestors","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/flow_requests/{tenantId}/flows/scope":{"get":{"summary":"GET /flow_requests/:tenantId/flows/scope","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employeegetcontract/{tid}/contract/{employeeId}":{"get":{"summary":"Get core professional data for a single employee.","tags":["Professional Data"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"tid":{"type":"number"},"employee_id":{"type":"number"},"contracttypeid":{"type":"number","nullable":true},"educationlevelid":{"type":"number","nullable":true},"professionalcategoryid":{"type":"number","nullable":true},"workingtypeid":{"type":"number","nullable":true},"levelid":{"type":"number","nullable":true},"organizationtitlesid":{"type":"number","nullable":true},"jobdomainid":{"type":"number","nullable":true},"assetid":{"type":"number","nullable":true},"jobid":{"type":"number","nullable":true},"departmentid":{"type":"number","nullable":true},"teamid":{"type":"number","nullable":true},"roleid":{"type":"number","nullable":true},"scheduleid":{"type":"number","nullable":true},"countryid":{"type":"number","nullable":true},"dateofjoin":{"type":"string","format":"date","nullable":true},"endofperiod":{"type":"string","format":"date","nullable":true},"endcontract":{"type":"string","format":"date","nullable":true},"createdat":{"type":"string","format":"date-time"},"updatedat":{"type":"string","format":"date-time"},"updated_by":{"type":"number","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/employeeupdatescontract/{tid}/professional/pending":{"get":{"summary":"Get pending professional data update requests","tags":["Professional Data Updates Approval"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"employeeId","required":false},{"schema":{"type":"number","default":50},"in":"query","name":"limit","required":false},{"schema":{"type":"number","default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdatescontract/{tid}/professional/approve/{instance_id}":{"post":{"summary":"Approve professional data update request","tags":["Professional Data Updates Approval"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["approved_by"],"properties":{"approved_by":{"type":"number"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"instance_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdatescontract/{tid}/professional/reject/{instance_id}":{"post":{"summary":"Reject professional data update request","tags":["Professional Data Updates Approval"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["rejected_by","reason"],"properties":{"rejected_by":{"type":"number"},"reason":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"instance_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdatescontract/{tid}/professional/history/{employee_id}":{"get":{"summary":"Get professional data update history","tags":["Professional Data Updates Approval"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"employee_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdatescontract/{tid}/professional/request":{"post":{"summary":"Create professional data update request","tags":["Professional Data Updates Approval"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["employee_id","flow_id","requested_by","updated_data"],"properties":{"employee_id":{"type":"number"},"flow_id":{"type":"number"},"requested_by":{"type":"number"},"current_data":{"type":"object"},"updated_data":{"type":"object"},"comment":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdatescontract/{tid}/professional/employee/{employee_id}":{"get":{"summary":"Get employee professional data","tags":["Professional Data Updates Approval"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"employee_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdatescontract/{tid}/professional/reference-data":{"get":{"summary":"Get professional reference data (contract types, departments, etc.)","tags":["Professional Data Updates Approval"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeelist/all/{tid}":{"get":{"summary":"Get detailed list of employees with filters (Full SQL Return)","tags":["Employee Profile"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["Active","Invited","Inactive"]},"in":"query","name":"status","required":false},{"schema":{"type":"integer"},"in":"query","name":"employee_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"department_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"team_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"workplace_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"job_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"contract_type_id","required":false},{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"number"},"tid":{"type":"number"},"firstname":{"type":"string","nullable":true},"lastname":{"type":"string","nullable":true},"login":{"type":"string","nullable":true},"profile":{"type":"string","nullable":true},"workemail":{"type":"string","nullable":true},"personalemail":{"type":"string","nullable":true},"work_phonenumber":{"type":"string","nullable":true},"phonenumber":{"type":"string","nullable":true},"status":{"type":"string","enum":["Active","Inactive","Invited","Unknown"]},"isactive":{"type":"boolean"},"invited":{"type":"boolean"},"job_title":{"type":"string","nullable":true},"department_title":{"type":"string","nullable":true},"team_title":{"type":"string","nullable":true},"workplace_title":{"type":"string","nullable":true},"manager_id":{"type":"number","nullable":true},"createdat":{"type":"string","format":"date-time","nullable":true},"dateofjoin":{"type":"string","format":"date","nullable":true},"endcontract":{"type":"string","format":"date","nullable":true},"linked_user_data":{"type":"object","nullable":true},"assigned_approval_flows":{"type":"array","nullable":true},"skills":{"type":"object","nullable":true},"languages":{"type":"object","nullable":true}}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/employeelist/{tid}/profile/{employeeId}":{"get":{"summary":"Get full profile of a single employee","tags":["Employee Profile"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer"},"in":"path","name":"employeeId","required":true,"description":"Employee ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"number"},"firstname":{"type":"string","nullable":true},"lastname":{"type":"string","nullable":true},"profile":{"type":"string","nullable":true},"workemail":{"type":"string","nullable":true},"personalemail":{"type":"string","nullable":true},"phonenumber":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"gender":{"type":"number","nullable":true},"nationality":{"type":"number","nullable":true},"dob":{"type":"string","format":"date","nullable":true},"address":{"type":"string","nullable":true},"languages":{"type":"object","nullable":true,"additionalProperties":true},"skills":{"type":"object","nullable":true,"additionalProperties":true},"hobbies":{"type":"object","nullable":true,"additionalProperties":true},"socialnetwork":{"type":"object","nullable":true,"additionalProperties":true},"workinformation":{"type":"object","nullable":true,"additionalProperties":true},"bank":{"type":"object","nullable":true,"additionalProperties":true},"emergencycontact":{"type":"object","nullable":true,"additionalProperties":true}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/employeelist/toggle/{tid}/{employeeId}":{"post":{"summary":"Toggle employee status (Active <-> Inactive)","tags":["Employee Profile"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer"},"in":"path","name":"employeeId","required":true,"description":"Employee ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"employee_id":{"type":"number"},"is_active":{"type":"boolean"},"status":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/employeelist/alerts/{tid}":{"get":{"summary":"Get organization structure alerts","tags":["Employee Profile"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"missingRoleOrLevel":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"workemail":{"type":"string","nullable":true},"profile":{"type":"string","nullable":true},"roleid":{"type":"number","nullable":true},"levelid":{"type":"number","nullable":true},"dateofjoin":{"type":"string","format":"date","nullable":true},"endcontract":{"type":"string","format":"date","nullable":true},"issue_description":{"type":"string","nullable":true}}}},"wrongJobData":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"workemail":{"type":"string","nullable":true},"profile":{"type":"string","nullable":true},"roleid":{"type":"number","nullable":true},"levelid":{"type":"number","nullable":true},"dateofjoin":{"type":"string","format":"date","nullable":true},"endcontract":{"type":"string","format":"date","nullable":true},"issue_description":{"type":"string","nullable":true}}}},"missingReportingLine":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"workemail":{"type":"string","nullable":true},"profile":{"type":"string","nullable":true},"roleid":{"type":"number","nullable":true},"levelid":{"type":"number","nullable":true},"dateofjoin":{"type":"string","format":"date","nullable":true},"endcontract":{"type":"string","format":"date","nullable":true},"issue_description":{"type":"string","nullable":true}}}}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/employeelist/approvals/{tid}":{"get":{"summary":"Get employee list with Approvals, Schedules, and Time Off","tags":["Employee Profile"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"integer"},"in":"query","name":"employee_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"department_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"team_id","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"integer"},"in":"query","name":"workplace_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"job_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"contract_type_id","required":false},{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"email":{"type":"string","nullable":true},"profile_url":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"team":{"type":"string","nullable":true},"workplace":{"type":"object","nullable":true,"properties":{"id":{"type":"number","nullable":true},"title":{"type":"string","nullable":true}}},"schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"number","nullable":true},"title":{"type":"string","nullable":true}}},"time_off_policy":{"type":"object","nullable":true,"properties":{"id":{"type":"number","nullable":true},"title":{"type":"string","nullable":true}}},"approval_flows":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":true}}}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/employeelist/work-assignments/{tid}/{employeeId}":{"get":{"summary":"Get workplace, schedule, and approval flows for a single employee","tags":["Employee Profile"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer"},"in":"path","name":"employeeId","required":true,"description":"Employee ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"tid":{"type":"number"},"employeeId":{"type":"number"},"data":{"type":"object","properties":{"workplaceid":{"type":"number","nullable":true},"scheduleid":{"type":"number","nullable":true},"timeoffpolicyid":{"type":"number","nullable":true},"assigned_approval_flows":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":true}},"workplace_info":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"site":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"latitude":{"type":"string","nullable":true},"longitude":{"type":"string","nullable":true},"range":{"type":"string","nullable":true},"isMainOffice":{"type":"boolean"},"isClientPlace":{"type":"boolean"},"imgSrc":{"type":"string","nullable":true},"holidays":{"type":"object","nullable":true},"moreInfo":{"type":"object","nullable":true}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/user/toggle/{id}":{"post":{"summary":"Toggle user status (Active <-> Inactive)","tags":["User"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"User ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"user_id":{"type":"number"},"is_active":{"type":"boolean"},"status":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/employeenew/{tid}/full-creation":{"post":{"summary":"Create employee (full wizard)","tags":["Employee New"],"description":"Transactional create: personal → professional → flows → user link → optional welcome email. Requires JWT; `tid` must match token tenant.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["firstName","lastName","workEmail","legalEntity","workplace"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"workEmail":{"type":"string","format":"email"},"legalEntity":{"description":"Legal entity id","anyOf":[{"type":"integer"},{"type":"string"}]},"workplace":{"description":"Workplace id","anyOf":[{"type":"integer"},{"type":"string"}]},"login":{"type":"string","description":"Defaults to workEmail"},"personalEmail":{"type":"string"},"dateOfBirth":{"type":"string"},"gender":{"type":"integer"},"nationalId":{"type":"string"},"workPhone":{"type":"string"},"personalPhone":{"type":"string"},"managerId":{"type":"integer"},"proCategory":{"type":"string","description":"Resolved to socio + professional category ids"},"contractType":{"type":"string"},"workingType":{"type":"string"},"orgTitle":{"type":"string"},"level":{"type":"string"},"jobDomain":{"type":"string"},"dateOfJoining":{"type":"string"},"endProbation":{"type":"string"},"endContract":{"type":"string"},"jobId":{"type":"string"},"department":{"type":"integer"},"team":{"type":"integer"},"rolesPermissions":{"type":"integer"},"workingSchedule":{"type":"integer"},"timeOffPolicy":{"type":"integer"},"notifyEmployee":{"type":"boolean","description":"Send welcome email when true"}},"additionalProperties":true}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant id"}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"employeeId":{"type":"integer"},"userId":{"type":"integer"},"steps":{"type":"object","description":"Per-step status from the creation wizard","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}}},"/employeenew/{tid}/{id}/send-login-email":{"post":{"summary":"Resend welcome / login email","tags":["Employee New"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant id"},{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Employee id"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"email":{"type":"string","format":"email"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}}},"/employeenew/{tid}/{id}":{"get":{"summary":"Get employee by id","tags":["Employee New"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant id"},{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Employee id"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}},"put":{"summary":"Update employee (partial core fields)","tags":["Employee New"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Partial employee fields; see EmployeeDAO.updateEmployee"}}},"description":"Partial employee fields; see EmployeeDAO.updateEmployee"},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant id"},{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Employee id"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"employeeId":{"type":"integer"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}},"delete":{"summary":"Soft-delete employee","tags":["Employee New"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant id"},{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Employee id"}],"responses":{"204":{"description":"No content","content":{"application/json":{"schema":{"description":"No content"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}}},"/employeeupdates/{tid}/pending":{"get":{"summary":"Get pending employee update requests","tags":["Employee Updates Approval"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"employeeId","required":false},{"schema":{"type":"number","default":50},"in":"query","name":"limit","required":false},{"schema":{"type":"number","default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdates/{tid}/approve/{instance_id}":{"post":{"summary":"Approve employee update request","tags":["Employee Updates Approval"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["approved_by"],"properties":{"approved_by":{"type":"number"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"instance_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdates/{tid}/reject/{instance_id}":{"post":{"summary":"Reject employee update request","tags":["Employee Updates Approval"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["rejected_by","reason"],"properties":{"rejected_by":{"type":"number"},"reason":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"instance_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdates/{tid}/history/{employee_id}":{"get":{"summary":"Get employee update history","tags":["Employee Updates Approval"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"employee_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdates/{tid}/request":{"post":{"summary":"Create employee update request","tags":["Employee Updates Approval"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["employee_id","flow_id","requested_by","current_data","updated_data"],"properties":{"employee_id":{"type":"number"},"flow_id":{"type":"number"},"requested_by":{"type":"number"},"current_data":{"type":"object"},"updated_data":{"type":"object"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdates/{tid}/employee/{employee_id}/full":{"get":{"summary":"Get full employee data","tags":["Employee Updates Approval"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"employee_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/employeeupdates/{tid}/debug/employee/{employee_id}":{"get":{"summary":"GET /employeeupdates/:tid/debug/employee/:employee_id","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employee_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employeeupdates/{tid}/employees":{"get":{"summary":"Get all employees","tags":["Employee Updates Approval"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/documentsupload/{tid}/list":{"get":{"summary":"List uploaded documents with filters","tags":["Documents Upload"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"employeeId","required":false},{"schema":{"type":"number"},"in":"query","name":"employee_id","required":false},{"schema":{"type":"number"},"in":"query","name":"folderId","required":false},{"schema":{"type":"number"},"in":"query","name":"folder_id","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false},{"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"schema":{"type":"number"},"in":"query","name":"offset","required":false},{"schema":{"type":"number"},"in":"query","name":"page","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsupload/{tid}/upload":{"post":{"summary":"Upload a document & create approval instance. Stores file, creates document_record, instance, and document_instance.","tags":["Documents Upload"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"folder_id","required":true},{"schema":{"type":"number"},"in":"query","name":"employee_id","required":true},{"schema":{"type":"number"},"in":"query","name":"flow_id","required":true},{"schema":{"type":"string"},"in":"query","name":"note","required":false},{"schema":{"type":"string"},"in":"query","name":"expiration_date","required":false},{"schema":{"type":"string"},"in":"query","name":"published","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsupload/{tid}/document/{document_id}":{"get":{"summary":"Get uploaded document details + approval status","tags":["Documents Upload"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"document_id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update document metadata (note, move folder, expiration date, published status)","tags":["Documents Upload"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"},"folder_id":{"type":"number"},"employee_id":{"type":"number"},"expiration_date":{"type":"string"},"published":{"type":"boolean"},"override":{"type":"boolean","description":"true = admin move without checking employee permissions"}}}}}},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"document_id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Soft delete a document (set isactive=false)","tags":["Documents Upload"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"employeeId","required":false},{"schema":{"type":"number"},"in":"query","name":"folderId","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"document_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsupload/{tid}/document/{document_id}/stream":{"get":{"summary":"Stream document file for iframe embedding (proxies upstream URL)","tags":["Documents Upload"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"document_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsupload/{tid}/document/{document_id}/view":{"post":{"summary":"Increment the view counter for a specific document","tags":["Documents Upload"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"document_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsupload/{tid}/document/{document_id}/toggle-publish":{"patch":{"summary":"Toggle the published status (Visible/Hidden) of a document","tags":["Documents Upload"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"document_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsuploadrequest/{tid}/create":{"post":{"summary":"Create a new document request","tags":["Document Request"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsuploadrequest/{tid}/remind":{"post":{"summary":"Send reminder to employee to upload requested document","tags":["Document Request"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsuploadrequest/{tid}/submit":{"post":{"summary":"Employee submits the requested document file (upload)","tags":["Document Request"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentsuploadrequest/{tid}/document/{documentId}/full":{"get":{"summary":"Get full information about a single document record","tags":["Document Request"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"employee_id","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"documentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/notificationsRequest/{tid}/{userid}":{"get":{"tags":["Notifications"],"description":"List notifications for a user","parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"unread","required":false},{"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"schema":{"type":"number"},"in":"query","name":"offset","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"userid","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"tags":["Notifications"],"description":"Send notification to a specific user","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title","message"],"properties":{"title":{"type":"string"},"message":{"type":"string"},"relatedentitytype":{"type":"string"},"relatedentityid":{"type":"number"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"userid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/notificationsRequest/{tid}/{userid}/{notificationId}/read":{"put":{"tags":["Notifications"],"description":"Mark one notification as read","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"userid","required":true},{"schema":{"type":"number"},"in":"path","name":"notificationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/notificationsRequest/{tid}/{userid}/readall":{"put":{"tags":["Notifications"],"description":"Mark all notifications as read for this user","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"userid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderlight/{tid}/all":{"get":{"tags":["Document Management"],"description":"Get all document folders with nested files (supports filtering by mode and employee)","parameters":[{"schema":{"type":"integer"},"in":"query","name":"employee_id","required":false,"description":"The requesting Employee ID (optional)"},{"schema":{"type":"string","enum":["ispublic","iscompany","ispersonal","personal"]},"in":"query","name":"filter_mode","required":false,"description":"Filtering mode for folders"},{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderlight/{tid}/document/{docId}/details":{"get":{"tags":["Document Management"],"description":"Get full details of a specific document (including uploader and folder info)","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"docId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderlight/{tid}/document/{docId}":{"put":{"tags":["Document Management"],"description":"Update document filename and note, and log audit","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1},"note":{"type":"string"},"employeeId":{"type":"integer"}},"required":["filename"]}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"docId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Document Management"],"description":"Permanently delete a document and log audit","parameters":[{"schema":{"type":"integer"},"in":"query","name":"employeeId","required":true},{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"docId","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"tags":["Document Management"],"description":"Move a document to another folder and log audit","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"folder_id":{"type":"integer"},"employee_id":{"type":"integer"}},"required":["folder_id"]}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"docId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderlight/{tid}/document/{docId}/toggle-publish":{"patch":{"tags":["Document Management"],"description":"Toggle the published status of a document and log audit","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"docId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderlight/{tid}/folders/list-types":{"get":{"tags":["Document Management"],"description":"Get list of non-personal folders (Public & Company Structure) for dropdowns","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderlight/{tid}/folders/list-types-iscompany-ispersonal":{"get":{"tags":["Document Management"],"description":"Get folders filtered for Company and Personal structure with formatted display names","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderlight/{tid}/folders/filter-by-type":{"get":{"tags":["Document Management"],"description":"Get folders filtered by a specific type (iscompany, ispersonal, ispublic)","parameters":[{"schema":{"type":"string","enum":["iscompany","ispersonal","ispublic"]},"in":"query","name":"type","required":true,"description":"The folder type to filter by"},{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderpublic/{tid}/getall":{"get":{"summary":"Get all active document folders by tid","tags":["Document Folders"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderpublic/{tid}/{id}/getone":{"get":{"summary":"Get one document folder by tid & id","tags":["Document Folders"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderpublic/{tid}/create":{"post":{"summary":"Create a new document folder","tags":["Document Folders"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","minLength":1},"description":{"type":"string"},"icon":{"type":"string"},"parentid":{"type":"integer","minimum":1,"default":1},"ispersonal":{"type":"boolean","default":false},"ispublic":{"type":"boolean","default":true}},"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderpublic/{tid}/{id}/delete":{"delete":{"summary":"Soft delete a document folder (set archivedat = NOW())","tags":["Document Folders"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderpublic/{tid}/{id}/delete/public":{"delete":{"summary":"Soft delete a public document folder (sets ispublic = FALSE)","tags":["Document Folders"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderpublic/{tid}/{id}/restore":{"patch":{"summary":"Restore a deleted document folder (set archivedat = NULL)","tags":["Document Folders"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolderpublic/{tid}/{id}/update":{"put":{"summary":"Update a document folder (partial update)","tags":["Document Folders"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"description":{"type":"string"},"icon":{"type":"string"},"parentid":{"type":"integer","minimum":1},"ispersonal":{"type":"boolean"},"ispublic":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingemployee/{tid}/policies":{"get":{"tags":["Time Tracking Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"tags":["Time Tracking Management"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"workschedulesid":{"type":"integer","nullable":true},"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingemployee/{tid}/policy/{policyId}":{"get":{"tags":["Time Tracking Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"tags":["Time Tracking Management"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"title":{"type":"string"},"effectivedate":{"type":"string","nullable":true},"workschedulesid":{"type":"integer","nullable":true},"mobileclock":{"type":"boolean"},"usegeolocation":{"type":"boolean"},"entranceapp":{"type":"boolean"},"clockbyid":{"type":"boolean"},"tolerancetime":{"type":"boolean"},"tolerancetimeamount":{"type":"integer"},"tolerancetimeremindercount":{"type":"integer"},"tolerancetimereminderamount":{"type":"integer"},"restrictions":{"type":"boolean"},"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Time Tracking Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"employeeId"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingemployee/{tid}/policy/{policyId}/set-default":{"patch":{"tags":["Time Tracking Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"employeeId"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingemployee/{tid}/policy/{policyId}/duplicate":{"post":{"tags":["Time Tracking Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"employeeId"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingemployee/{tid}/schedules":{"get":{"tags":["Time Tracking Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingemployee/{tid}/policy/{policyId}/employee/{employeeId}":{"post":{"tags":["Time Tracking Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"createdby"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Time Tracking Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"updatedby"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingemployee/{tid}/employee/{employeeId}/move-policy":{"put":{"tags":["Time Tracking Management"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"old_timetracking_id":{"type":"integer"},"new_timetracking_id":{"type":"integer"},"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetracking_employees/{tid}/{pid}/employees":{"get":{"tags":["TimeTracking - Employees"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"pid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetracking_employees/{tid}/employees/noparam":{"get":{"tags":["TimeTracking - Employees"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetracking_employees/{tid}/{pid}/employees/{eid}/add":{"post":{"tags":["TimeTracking - Employees"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"pid","required":true},{"schema":{"type":"string"},"in":"path","name":"eid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetracking_employees/{tid}/{pid}/employees/{eid}/remove":{"delete":{"tags":["TimeTracking - Employees"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"pid","required":true},{"schema":{"type":"string"},"in":"path","name":"eid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetracking_employees/{tid}/employees/move":{"post":{"tags":["TimeTracking - Employees"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["employeeId","newPolicyId"],"properties":{"employeeId":{"type":"integer"},"newPolicyId":{"type":"integer"}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetracking_employees/{tid}/employees/getall":{"get":{"tags":["TimeTracking - Employees"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicyemployee/{tid}/policies":{"get":{"tags":["Time Off Policy Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicyemployee/{tid}/policy/{policyId}/employees":{"get":{"tags":["Time Off Policy Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicyemployee/{tid}/policy/{policyId}/employee/{employeeId}":{"post":{"tags":["Time Off Policy Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Time Off Policy Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicyemployee/{tid}/employee/{employeeId}/move-policy":{"put":{"tags":["Time Off Policy Employee Management"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"old_policy_id":{"type":"number"},"new_policy_id":{"type":"number"}},"required":["old_policy_id","new_policy_id"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workschedulemployeee/{tid}/schedules":{"get":{"tags":["Work Schedule Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workschedulemployeee/{tid}/schedule/{scheduleId}/employees":{"get":{"tags":["Work Schedule Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"scheduleId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workschedulemployeee/{tid}/schedule/{scheduleId}/employee/{employeeId}":{"post":{"tags":["Work Schedule Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"scheduleId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Work Schedule Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"scheduleId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workschedulemployeee/{tid}/employee/{employeeId}/move-schedule":{"put":{"tags":["Work Schedule Employee Management"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"old_schedule_id":{"type":"number"},"new_schedule_id":{"type":"number"}},"required":["old_schedule_id","new_schedule_id"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workschedulemployeee/{tid}/employee/{employeeId}/shift":{"get":{"summary":"Get shift details for an employee on a specific date","tags":["Work Schedule Employee Management"],"parameters":[{"schema":{"type":"string","format":"date"},"in":"query","name":"date","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workstationemployeee/{tid}/workstations":{"get":{"tags":["Workstation Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workstationemployeee/{tid}/workstation/{workstationId}/employees":{"get":{"tags":["Workstation Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"workstationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workstationemployeee/{tid}/workstation/{workstationId}/employee/{employeeId}":{"post":{"tags":["Workstation Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"workstationId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Workstation Employee Management"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"workstationId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workstationemployeee/{tid}/employee/{employeeId}/move":{"put":{"tags":["Workstation Employee Management"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"old_workstation_id":{"type":"number"},"new_workstation_id":{"type":"number"}},"required":["old_workstation_id","new_workstation_id"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workstationemployeee/{tid}/employee/{employeeId}/default":{"put":{"tags":["Workstation Employee Management"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_workstation_id":{"type":"number"}},"required":["new_workstation_id"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/permissionemployee/":{"get":{"tags":["Permission Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/permissionemployee/all":{"get":{"tags":["Permission Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/permissionemployee/employee":{"get":{"tags":["Permission Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"employeeid":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string"},"roleid":{"type":"integer","nullable":true},"isactive":{"type":"boolean"},"archivedat":{"type":"string","format":"date-time","nullable":true},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string","nullable":true},"user_id":{"type":"integer"},"department_title":{"type":"string","nullable":true},"team_title":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"workplace_title":{"type":"string","nullable":true},"legalentity_title":{"type":"string","nullable":true}}}}}}}}}},"/permissionemployee/users/{permissionId}":{"get":{"tags":["Permission Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"permissionId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/permissionemployee/employees/{permissionId}":{"get":{"tags":["Permission Management"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"permissionId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"employeeid":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string"},"roleid":{"type":"integer","nullable":true},"isactive":{"type":"boolean"},"archivedat":{"type":"string","format":"date-time","nullable":true},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string","nullable":true},"user_id":{"type":"integer"},"department_title":{"type":"string","nullable":true},"team_title":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"workplace_title":{"type":"string","nullable":true},"legalentity_title":{"type":"string","nullable":true}}}}}}}}}},"/permissionemployee/move-user":{"post":{"tags":["Permission Management"],"responses":{"200":{"description":"Default Response"}}}},"/permissionemployee/move-employee":{"post":{"tags":["Permission Management"],"responses":{"200":{"description":"Default Response"}}}},"/permissionemployee/remove-user":{"post":{"tags":["Permission Management"],"responses":{"200":{"description":"Default Response"}}}},"/permissionemployee/remove-employee":{"post":{"tags":["Permission Management"],"responses":{"200":{"description":"Default Response"}}}},"/approvalemployee/groupapprove/{tid}/flow/{flow_id}/employees":{"get":{"summary":"Get employees in a specific flow","tags":["TimeOff Group Approval"],"description":"Retrieve list of employees assigned to a specific approval flow","parameters":[{"schema":{"type":"string"},"in":"query","name":"flow_type","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"flow_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"profile":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"department":{"type":"string"},"team":{"type":"string"}}}},"count":{"type":"number"}}}}}}}},"post":{"summary":"Add employee to flow","tags":["TimeOff Group Approval"],"description":"Add an employee to a specific approval flow","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["employee_id"],"properties":{"employee_id":{"type":"number"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"flow_id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}}},"/approvalemployee/groupapprove/{tid}/flows":{"get":{"summary":"Get list of flows","tags":["TimeOff Group Approval"],"description":"Retrieve list of approval flows with optional filtering","parameters":[{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"schema":{"type":"string"},"in":"query","name":"category","required":false},{"schema":{"type":"number"},"in":"query","name":"exclude_flow_id","required":false},{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"title":{"type":"string"},"description":{"type":"string"},"autoapprove":{"type":"boolean"},"isactive":{"type":"boolean"},"createdat":{"type":"string"},"category":{"type":"string"},"approvfor":{"type":"number"},"employee_count":{"type":"number"}}}},"count":{"type":"number"}}}}}}}}},"/approvalemployee/groupapprove/{tid}/employees":{"get":{"summary":"Get all employees","tags":["TimeOff Group Approval"],"description":"Retrieve list of all active employees with department and team info","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"profile":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"department":{"type":"string"},"team":{"type":"string"},"workemail":{"type":"string"}}}},"count":{"type":"number"}}}}}}}}},"/approvalemployee/groupapprove/{tid}/flow/{flow_id}/employees/{employee_id}":{"delete":{"summary":"Remove employee from flow","tags":["TimeOff Group Approval"],"description":"Remove an employee from a specific approval flow","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"flow_id","required":true},{"schema":{"type":"number"},"in":"path","name":"employee_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}}}}}}}},"/approvalemployee/groupapprove/{tid}/flow/{flow_id}/employees/{employee_id}/move":{"put":{"summary":"Move employee to another flow","tags":["TimeOff Group Approval"],"description":"Move an employee from current flow to another flow","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["new_flow_id"],"properties":{"new_flow_id":{"type":"number"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"flow_id","required":true},{"schema":{"type":"number"},"in":"path","name":"employee_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}}}}}}}},"/requestleave/{tenantId}/submit":{"post":{"summary":"Submit new LR request","tags":["LeaveVisit"],"description":"Submits a leave or visit request. Includes support for approval suggestions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["employeeId","start_at","end_at","request_type"],"properties":{"employeeId":{"type":"number"},"workstationId":{"type":"number","nullable":true},"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"request_type":{"type":["number","string"],"description":"Policy ID or \"visit_client\""},"flowid":{"type":"number","nullable":true},"description":{"type":"string","nullable":true},"purpose":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"attachment_link":{"type":"string","nullable":true},"reason_allowance_id":{"type":"number","nullable":true},"createdBy":{"type":"number","nullable":true},"client_contact":{"type":"object","nullable":true},"travel":{"type":"object","nullable":true},"flags":{"type":"object","nullable":true},"approvalsuggestion":{"type":"number","nullable":true,"description":"ID of the suggested employee to approve this request"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"instanceId":{"type":"number"}}}}}}}}},"/requestleave/{tenantId}":{"get":{"summary":"List all Leave and Attendance requests with nested comments and suggestions","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"number"},"in":"query","name":"employeeId","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":false},{"schema":{"type":"string"},"in":"query","name":"requestType","required":false},{"schema":{"type":"number"},"in":"query","name":"workstationId","required":false},{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"instance_id":{"type":"number"},"status":{"type":"string"},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"comment":{"type":"string"},"filesource":{"type":"string","nullable":true},"createdat":{"type":"string"},"employee_id":{"type":"number"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string"}}}}}}}}}}}}},"/requestleave/{tenantId}/instance/{instanceId}":{"get":{"summary":"Get single LR request details by Instance ID","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/requestleave/{tenantId}/request/{requestId}/attachment":{"patch":{"tags":["LeaveVisit"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["attachment_link"],"properties":{"attachment_link":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/{tenantId}/instance/{instanceId}/action":{"post":{"tags":["LeaveVisit"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["approver_eid","decision"],"properties":{"approver_eid":{"type":"number"},"decision":{"type":"string","enum":["approved","rejected"]},"comment":{"type":"string","nullable":true}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/{tenantId}/request/{requestId}":{"delete":{"tags":["LeaveVisit"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/{tenantId}/employee/{employeeId}/time-policy":{"get":{"summary":"GET /requestleave/:tenantId/employee/:employeeId/time-policy","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/workstation/{tenantId}/employees":{"get":{"summary":"GET /requestleave/workstation/:tenantId/employees","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/workstation/{tenantId}/company":{"get":{"summary":"GET /requestleave/workstation/:tenantId/company","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/workstation/{tenantId}/client":{"get":{"summary":"GET /requestleave/workstation/:tenantId/client","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/allowance/{tenantId}":{"get":{"summary":"GET /requestleave/allowance/:tenantId","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/{tenantId}/flow/{flowId}/requestors":{"get":{"summary":"GET /requestleave/:tenantId/flow/:flowId/requestors","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"POST /requestleave/:tenantId/flow/:flowId/requestors","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/{tenantId}/flow/{flowId}/requestors/{employeeId}":{"delete":{"summary":"DELETE /requestleave/:tenantId/flow/:flowId/requestors/:employeeId","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/{tenantId}/flows/scope":{"get":{"summary":"GET /requestleave/:tenantId/flows/scope","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/requestleave/{tenantId}/instance/{instanceId}/comment":{"post":{"summary":"Add comment with optional file upload","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"instanceId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}}}}},"/requestleave/{tenantId}/comment/{commentId}":{"delete":{"summary":"Delete a comment by ID","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"number"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"number"},"in":"path","name":"commentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/allowance/{tid}":{"get":{"summary":"List time-off policy allowances for tenant","tags":["Allowances"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/allowance/report/{tid}/{employeeId}":{"get":{"summary":"Get employee time-off balances and allowance metadata","tags":["Allowances"],"description":"Returns a detailed breakdown of time-off balances, including total entitlement, taken days, pending requests, and UI metadata (icons, colors). Defaults to the current year.","parameters":[{"schema":{"type":"integer"},"in":"query","name":"year","required":false,"description":"The year for the report (defaults to current year)"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"balances":{"type":"object","properties":{"total_entitlement":{"type":"number"},"taken":{"type":"number"},"pending":{"type":"number"},"pending_cancellation":{"type":"number"},"remaining":{"type":"number"}}},"allowance":{"type":"object","properties":{"id":{"type":"number"},"policy_id":{"type":"number"},"title":{"type":"string"},"type":{"type":"string"},"set_in":{"type":"string","nullable":true},"display_days":{"type":"string","nullable":true},"base_value":{"type":"string","nullable":true},"base_type":{"type":"string","nullable":true},"bank_falls":{"type":"string","nullable":true},"prorated":{"type":"string","nullable":true},"max_days":{"type":"string","nullable":true},"min_days":{"type":"string","nullable":true},"accrued":{"type":"string","nullable":true},"when_used":{"type":"string","nullable":true},"negative_country":{"type":"string","nullable":true}}},"ui":{"type":"object","properties":{"absence_id":{"type":"number"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"icon_url":{"type":"string","nullable":true},"keybox":{"type":"array","items":{"type":"string"},"nullable":true},"visibility":{"type":"boolean","nullable":true},"allowance_rule":{"type":"boolean","nullable":true},"allows_half_day":{"type":"boolean","nullable":true},"min_limit":{"type":"number","nullable":true},"max_limit":{"type":"number","nullable":true},"can_employee_request":{"type":"boolean","nullable":true},"is_active":{"type":"boolean","nullable":true}}}}}}}}}}}},"/organizationtypes/all":{"get":{"tags":["Organization - Types"],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/structure/{tid}/{typeId}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/structure/create/{tid}/{typeId}/{title}":{"post":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true},{"schema":{"type":"string"},"in":"path","name":"title","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/structure/update/{id}/{tid}/{typeId}/{title}":{"put":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true},{"schema":{"type":"string"},"in":"path","name":"title","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/structure/delete/{id}/{tid}/{typeId}":{"delete":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/members/add/{structureId}/{employeeId}/{tid}/{typeId}":{"post":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/members/remove/{structureId}/{employeeId}/{tid}/{typeId}":{"delete":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/members/{structureId}/{tid}/{typeId}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/leader/set/{structureId}/{employeeId}/{tid}/{typeId}":{"post":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/leader/remove/{structureId}/{tid}/{typeId}":{"delete":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/details/{id}/{tid}/{typeId}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/employee/{employeeId}/{tid}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/employees/structure/{structureId}/{tid}/{typeId}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/gender-distribution/{structureId}/{tid}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/age-statistics/{structureId}/{tid}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/employees/search/{tid}/{searchTerm}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"searchTerm","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/analytics/structure/{structureId}/{tid}/{typeId}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"structureId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"typeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/chart/{tid}":{"get":{"tags":["Organization - Types"],"description":"Fetch organization chart with full employee details","parameters":[{"schema":{"type":"integer"},"in":"query","name":"structureId","required":false,"description":"Optional: Filter by structure"},{"schema":{"type":"integer"},"in":"query","name":"typeId","required":false,"description":"Optional: Filter by type"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/employee/manager/update/{employeeId}/{managerId}/{tid}":{"put":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true},{"schema":{"type":"string"},"in":"path","name":"managerId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/employee/full/{employeeId}/{tid}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/organizationtypes/employee/leaders/{employeeId}/{tid}":{"get":{"tags":["Organization - Types"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true},{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/country/{tid}/countries":{"get":{"summary":"List countries for tenant","tags":["Country"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"flagsrc":{"type":"string","nullable":true}},"required":["id","title"]}}}}}}}},"/country/{tid}/specific":{"get":{"summary":"List country-specific groups for tenant","tags":["Country"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"}},"required":["id","title"]}}}}}}}},"/country/{tid}/details":{"get":{"summary":"List details for a given country (cid) and specific category (csid)","tags":["Country"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"cid","required":true},{"schema":{"type":"integer","minimum":1},"in":"query","name":"csid","required":true},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"csid":{"type":"integer"},"cid":{"type":"integer"},"isactive":{"type":"boolean"}},"required":["id","title","csid","cid"]}}}}}}},"post":{"summary":"Create or update a specific detail for tenant","tags":["Country"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title","cid","csid"],"properties":{"id":{"type":"integer","description":"Existing detail id to update (omit to create)"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"cid":{"type":"integer","minimum":1,"description":"Country ID"},"csid":{"type":"integer","minimum":1,"description":"Specific group ID"},"isActive":{"type":"boolean"},"createdby":{"type":"integer","nullable":true,"description":"Employee ID creating record"},"updateby":{"type":"integer","nullable":true,"description":"Employee ID updating record"}}}}},"required":true},"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"csid":{"type":"integer"},"cid":{"type":"integer"},"isactive":{"type":"boolean"}},"required":["id","title","csid","cid"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/country/{tid}/specific/title/{title}":{"get":{"summary":"Get the Country Specific ID (CSID) by its title for a tenant","tags":["Country"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"title","required":true,"description":"Example: \"Contract type\", \"Leave reason\""}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"The CSID"}},"required":["id"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/country/{tid}/details/{id}/active":{"patch":{"summary":"Activate/Deactivate a specific detail","tags":["Country"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["isActive"],"properties":{"isActive":{"type":"boolean"},"updateby":{"type":"integer","nullable":true,"description":"Employee ID updating record"}}}}},"required":true},"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"isactive":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/country/{tid}/employees/enriched":{"get":{"summary":"List all employees with enriched status titles","tags":["Country"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"firstname":{"type":"string"},"lastname":{"type":"string"},"profile":{"type":"string","nullable":true},"departmentid":{"type":"integer","nullable":true},"department_title":{"type":"string","nullable":true},"jobid":{"type":"integer","nullable":true},"job_title":{"type":"string","nullable":true},"workplaceid":{"type":"integer","nullable":true},"workplace_title":{"type":"string","nullable":true},"teamid":{"type":"integer","nullable":true},"team_title":{"type":"string","nullable":true},"legalentityid":{"type":"integer","nullable":true},"legalentity_title":{"type":"string","nullable":true},"user_id":{"type":"integer","nullable":true}}}}}}}}}},"/country/{tid}/managers/{cid}":{"get":{"summary":"List all managers and directors for a specific country","tags":["Country"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"cid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"full_name":{"type":"string"},"work_email":{"type":"string","nullable":true},"category_title":{"type":"string"}}}}}}}}}},"/geofence/geofence":{"get":{"summary":"List geofences for tenant","tags":["Geofence"],"parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"isactive","required":false},{"schema":{"type":"string","enum":["required_checkin","advisory","restricted"]},"in":"query","name":"mode","required":false},{"schema":{"type":"string","enum":["circle","polygon"]},"in":"query","name":"kind","required":false}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create or update a geofence","tags":["Geofence"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title","kind","mode"],"properties":{"id":{"type":"integer"},"title":{"type":"string"},"kind":{"type":"string","enum":["circle","polygon"]},"mode":{"type":"string","enum":["required_checkin","advisory","restricted"]},"center_lon":{"type":"number"},"center_lat":{"type":"number"},"radius_m":{"type":"number"},"shape_geojson":{"type":"object","nullable":true},"required_accuracy_m":{"type":"number","nullable":true},"grace_period_s":{"type":"integer","nullable":true},"active_from":{"type":"string","format":"date-time","nullable":true},"active_to":{"type":"string","format":"date-time","nullable":true},"isactive":{"type":"boolean","nullable":true}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/geofence/geofence/workstation/{workstationId}":{"get":{"summary":"List geofences attached to a workstation","tags":["Geofence"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"workstationId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/geofence/geofence/{id}/active":{"patch":{"summary":"Activate/Deactivate a geofence","tags":["Geofence"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["isActive"],"properties":{"isActive":{"type":"boolean"}}}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/geofence/workstations/{id}/geofences":{"post":{"summary":"Link a geofence to a workstation","tags":["Geofence"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["geofenceId"],"properties":{"geofenceId":{"type":"integer","minimum":1},"isPrimary":{"type":"boolean","nullable":true}}}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/geofence/workstations/{id}/geofences/{geofenceId}":{"delete":{"summary":"Unlink a geofence from a workstation","tags":["Geofence"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"geofenceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/geofence/geofence/check":{"post":{"summary":"Check if a lon/lat is inside any active fence","tags":["Geofence"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["lon","lat"],"properties":{"lon":{"type":"number"},"lat":{"type":"number"},"workstationId":{"type":"integer","nullable":true}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/leaves/{tenantId}/submit":{"post":{"summary":"Submit new LR request","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/{tenantId}":{"get":{"summary":"List all LR requests by tenant with filters","tags":["LeaveVisit2"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/{tenantId}/instance/{instanceId}":{"get":{"summary":"Get single LR request details by Instance ID","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/{tenantId}/request/{requestId}/attachment":{"patch":{"summary":"Update attachment link for a LR request","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/{tenantId}/instance/{instanceId}/action":{"post":{"summary":"Approve or Reject a request instance","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/{tenantId}/request/{requestId}":{"delete":{"summary":"Delete a LR request by Request ID","tags":["LeaveVisit"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/{tenantId}/employee/{employeeId}/time-policy":{"get":{"summary":"Get employee time tracking policy and schedule","tags":["Helpers"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/workstation/{tenantId}/employees":{"get":{"summary":"Get minimum employee data for lookups","tags":["Workstation"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/workstation/{tenantId}/company":{"get":{"summary":"Get company (non-client) workstations","tags":["Workstation"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/workstation/{tenantId}/client":{"get":{"summary":"Get client workstations","tags":["Workstation"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/leaves/allowance/{tenantId}":{"get":{"summary":"Get time-off policy allowances","tags":["Workstation"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/company/organization/{tid}/{id}":{"get":{"summary":"Get organization by tid & id","tags":["Settings - Company"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Update core organization fields (partial allowed)","tags":["Settings - Company"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"employeeId":{"type":"integer","minimum":1},"title":{"type":["string","null"]},"industry":{"type":["string","null"]},"address":{"type":["string","null"]},"dateofincorporation":{"type":["string","null"]},"dateformat":{"type":["string","null"]},"language":{"type":["string","null"]},"phonenumber":{"type":["string","null"]}},"required":[]}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/company/organization/{tid}/{id}/branding":{"patch":{"summary":"Update branding fields (logo, documentlogo, primarycolor)","tags":["Settings - Company"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"employeeId":{"type":"integer","minimum":1},"logo":{"type":["string","null"]},"documentlogo":{"type":["string","null"]},"primarycolor":{"type":["string","null"]}},"required":[]}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/legalentity/{tid}/add":{"post":{"tags":["LegalEntity"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"title","required":true},{"schema":{"type":"string"},"in":"query","name":"createdby","required":true},{"schema":{"type":"string"},"in":"query","name":"oid","required":true},{"schema":{"type":"string"},"in":"query","name":"country","required":false},{"schema":{"type":"string"},"in":"query","name":"currency","required":false},{"schema":{"type":"string"},"in":"query","name":"description","required":false},{"schema":{"type":"string"},"in":"query","name":"taxid","required":false},{"schema":{"type":"string"},"in":"query","name":"vatnumber","required":false},{"schema":{"type":"string"},"in":"query","name":"registrationnumber","required":false},{"schema":{"type":"string"},"in":"query","name":"address","required":false},{"schema":{"type":"string"},"in":"query","name":"addressline2","required":false},{"schema":{"type":"string"},"in":"query","name":"city","required":false},{"schema":{"type":"string"},"in":"query","name":"postcode","required":false},{"schema":{"type":"string"},"in":"query","name":"phone","required":false},{"schema":{"type":"string"},"in":"query","name":"email","required":false},{"schema":{"type":"string"},"in":"query","name":"website","required":false},{"schema":{"type":"string"},"in":"query","name":"logourl","required":false},{"schema":{"type":"string"},"in":"query","name":"dateofincorporation","required":false},{"schema":{"type":"string"},"in":"query","name":"companyactivity","required":false},{"schema":{"type":"string"},"in":"query","name":"currentcorporate","required":false},{"schema":{"type":"string"},"in":"query","name":"legalform","required":false},{"schema":{"type":"string"},"in":"query","name":"sharecapital","required":false},{"schema":{"type":"string"},"in":"query","name":"repname","required":false},{"schema":{"type":"string"},"in":"query","name":"repposition","required":false},{"schema":{"type":"string"},"in":"query","name":"adminid","required":false},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/legalentity/{tid}/{id}":{"get":{"tags":["LegalEntity"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"tags":["LegalEntity"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"title","required":false},{"schema":{"type":"string"},"in":"query","name":"isactive","required":false},{"schema":{"type":"string"},"in":"query","name":"country","required":false},{"schema":{"type":"string"},"in":"query","name":"currency","required":false},{"schema":{"type":"string"},"in":"query","name":"taxid","required":false},{"schema":{"type":"string"},"in":"query","name":"isdefault","required":false},{"schema":{"type":"string"},"in":"query","name":"description","required":false},{"schema":{"type":"string"},"in":"query","name":"keybox","required":false},{"schema":{"type":"string"},"in":"query","name":"oid","required":false},{"schema":{"type":"string"},"in":"query","name":"vatnumber","required":false},{"schema":{"type":"string"},"in":"query","name":"registrationnumber","required":false},{"schema":{"type":"string"},"in":"query","name":"address","required":false},{"schema":{"type":"string"},"in":"query","name":"phone","required":false},{"schema":{"type":"string"},"in":"query","name":"email","required":false},{"schema":{"type":"string"},"in":"query","name":"website","required":false},{"schema":{"type":"string"},"in":"query","name":"logourl","required":false},{"schema":{"type":"string"},"in":"query","name":"dateofincorporation","required":false},{"schema":{"type":"string"},"in":"query","name":"companyactivity","required":false},{"schema":{"type":"string"},"in":"query","name":"currentcorporate","required":false},{"schema":{"type":"string"},"in":"query","name":"legalform","required":false},{"schema":{"type":"string"},"in":"query","name":"sharecapital","required":false},{"schema":{"type":"string"},"in":"query","name":"repname","required":false},{"schema":{"type":"string"},"in":"query","name":"repposition","required":false},{"schema":{"type":"string"},"in":"query","name":"addressline2","required":false},{"schema":{"type":"string"},"in":"query","name":"city","required":false},{"schema":{"type":"string"},"in":"query","name":"postcode","required":false},{"schema":{"type":"string"},"in":"query","name":"updatedby","required":false},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["LegalEntity"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/legalentity/{tid}/{id}/undo":{"post":{"tags":["LegalEntity"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/legalentity/{tid}/{id}/employees":{"get":{"tags":["LegalEntity"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/legalentity/{tid}/{id}/employees/full":{"get":{"tags":["LegalEntity"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true},{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/legalentity/{tid}/list":{"get":{"tags":["LegalEntity"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9]+$"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companyvalue/companyvalues/{tid}/getall":{"get":{"summary":"Get all active company values by tid","tags":["Settings - Company Values"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companyvalue/companyvalues/{tid}/{id}/getone":{"get":{"summary":"Get one company value by tid & id","tags":["Settings - Company Values"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companyvalue/companyvalues/{tid}/create":{"post":{"summary":"Create a new company value","tags":["Settings - Company Values"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"iconsrc":{"type":"string"},"employeeId":{"type":"integer"},"createdby":{"type":"integer"}},"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companyvalue/companyvalues/{tid}/{id}/delete":{"delete":{"summary":"Soft delete a company value (set archivedat = NOW())","tags":["Settings - Company Values"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companyvalue/companyvalues/{tid}/{id}/restore":{"patch":{"summary":"Restore (undo delete) a company value (set archivedat = NULL)","tags":["Settings - Company Values"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companyvalue/companyvalues/{tid}/{id}/update":{"put":{"summary":"Update a company value (partial: title, description, iconsrc)","tags":["Settings - Company Values"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"iconsrc":{"type":"string"},"employeeId":{"type":"integer"},"updatedby":{"type":"integer"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/herostatment/hero/{tid}":{"get":{"tags":["Settings - Company Hero Statment"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"tags":["Settings - Company Hero Statment"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/herostatment/hero/{tid}/upload/photo":{"post":{"tags":["Settings - Company Hero Statment"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/herostatment/hero/{tid}/upload/video":{"post":{"tags":["Settings - Company Hero Statment"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/herostatment/hero/{tid}/media":{"put":{"tags":["Settings - Company Hero Statment"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companybranding/{tid}/{id}/getone":{"get":{"tags":["Settings - Company Branding"],"description":"Get company branding (logo, documentlogo, primarycolor) by tid and id","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companybranding/{tid}/{id}/update":{"put":{"tags":["Settings - Company Branding"],"description":"Update company branding (primarycolor, and logo URLs if provided) by tid and id","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"logo":{"type":"string","nullable":true},"documentlogo":{"type":"string","nullable":true},"primarycolor":{"type":"string","nullable":true}}}}}},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companybranding/{tid}/{id}/upload/logo":{"post":{"tags":["Settings - Company Branding"],"description":"Upload the main company logo and save its URL to the organization record.","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companybranding/{tid}/{id}/upload/documentlogo":{"post":{"tags":["Settings - Company Branding"],"description":"Upload the document logo and save its URL to the organization record.","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badges/{tid}/getall":{"get":{"summary":"Get all active company badges by tid","tags":["Settings - Company Badges"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badges/{tid}/{id}/getone":{"get":{"summary":"Get one company badge by tid & id","tags":["Settings - Company Badges"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badges/{tid}/create":{"post":{"summary":"Create a new company badge","tags":["Settings - Company Badges"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title","points"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"iconsrc":{"type":"string"},"ruleid":{"type":"integer","minimum":1},"points":{"type":"integer","minimum":0},"employeeId":{"type":"integer","minimum":1}},"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badges/{tid}/{id}/delete":{"delete":{"summary":"Soft delete a company badge (set archivedat = NOW())","tags":["Settings - Company Badges"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badges/{tid}/{id}/restore":{"patch":{"summary":"Restore (undo delete) a company badge (set archivedat = NULL)","tags":["Settings - Company Badges"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badges/{tid}/{id}/update":{"put":{"summary":"Update a company badge (partial: title, description, iconsrc, ruleid, points)","tags":["Settings - Company Badges"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"iconsrc":{"type":"string"},"ruleid":{"type":"integer","minimum":1},"points":{"type":"integer","minimum":0},"employeeId":{"type":"integer","minimum":1}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badgerules/rules/{tid}/getall":{"get":{"summary":"Get all rules by tid","tags":["Settings - Rules"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badgerules/rules/{tid}/{id}/getone":{"get":{"summary":"Get one rule by tid & id","tags":["Settings - Rules"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badgerules/rules/{tid}/create":{"post":{"summary":"Create a new rule","tags":["Settings - Rules"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"value":{"type":"integer","minimum":0},"updatedby":{"type":"integer","minimum":1}},"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badgerules/rules/{tid}/{id}/update":{"put":{"summary":"Update a rule (partial: title, value, updatedby)","tags":["Settings - Rules"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":"integer","minimum":0},"updatedby":{"type":"integer","minimum":1}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/badgerules/rules/{tid}/{id}/delete":{"delete":{"summary":"Permanently delete a rule","tags":["Settings - Rules"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companylink/{tid}/getall":{"get":{"summary":"Get all company links by tid","tags":["Settings - Company Links"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"title":{"type":"string"},"Category":{"type":"string"},"linkurl":{"type":"string"},"createdby":{"type":["null","integer"]},"createdon":{"type":"string"},"updatedon":{"type":"string"}}}}}}}}}},"/companylink/{tid}/{id}/getone":{"get":{"summary":"Get one company link by tid & id","tags":["Settings - Company Links"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"title":{"type":"string"},"Category":{"type":"string"},"linkurl":{"type":"string"},"createdby":{"type":["null","integer"]},"createdon":{"type":"string"},"updatedon":{"type":"string"}}}}}}}}},"/companylink/{tid}/create":{"post":{"summary":"Create a new company link","tags":["Settings - Company Links"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title","Category","linkurl"],"properties":{"title":{"type":"string"},"Category":{"type":"string"},"linkurl":{"type":"string"},"employeeId":{"type":"integer","minimum":1}},"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"201":{"description":"Created link","content":{"application/json":{"schema":{"description":"Created link","type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"title":{"type":"string"},"Category":{"type":"string"},"linkurl":{"type":"string"},"createdby":{"type":["null","integer"]},"createdon":{"type":"string"},"updatedon":{"type":"string"}}}}}}}}},"/companylink/{tid}/{id}/delete":{"delete":{"summary":"Delete a company link (hard delete)","tags":["Settings - Company Links"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"employeeId","required":false},{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"description":"Delete result","type":"object","properties":{"message":{"type":"string"},"id":{"type":"integer"},"tid":{"type":"integer"}}}}}}}}},"/companylink/{tid}/{id}/update":{"put":{"summary":"Update a company link (partial: title, Category, linkurl, employeeId for audit)","tags":["Settings - Company Links"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"Category":{"type":"string"},"linkurl":{"type":"string"},"employeeId":{"type":"integer","minimum":1}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Updated link","content":{"application/json":{"schema":{"description":"Updated link","type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"title":{"type":"string"},"Category":{"type":"string"},"linkurl":{"type":"string"},"createdby":{"type":["null","integer"]},"createdon":{"type":"string"},"updatedon":{"type":"string"}}}}}}}}},"/documentfolder/{tid}/getall":{"get":{"summary":"Get active document folders by tid with optional filters","tags":["Document Folders"],"parameters":[{"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"string"}]},"in":"query","name":"parentid","required":false},{"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"string"}]},"in":"query","name":"createdby","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"in":"query","name":"ispersonal","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"in":"query","name":"ispublic","required":false},{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolder/{tid}/{id}/getone":{"get":{"summary":"Get one document folder by tid & id","tags":["Document Folders"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolder/{tid}/create":{"post":{"summary":"Create a new document folder","tags":["Document Folders"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"parentid":{"type":"integer","minimum":1},"ispersonal":{"type":"boolean"},"ispublic":{"type":"boolean"},"createdby":{"type":"integer","minimum":1}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolder/{tid}/{id}/delete":{"delete":{"summary":"Soft delete a document folder","tags":["Document Folders"],"parameters":[{"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"string"}]},"in":"query","name":"updatedby","required":false},{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolder/{tid}/{id}/restore":{"patch":{"summary":"Restore a deleted document folder","tags":["Document Folders"],"parameters":[{"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"string"}]},"in":"query","name":"updatedby","required":false},{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolder/{tid}/{id}/update":{"put":{"summary":"Update a document folder (partial update)","tags":["Document Folders"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"parentid":{"type":"integer","minimum":1},"ispersonal":{"type":"boolean"},"ispublic":{"type":"boolean"},"updatedby":{"type":"integer","minimum":1}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentfolder/{tid}/upload":{"post":{"summary":"Upload document and submit for approval","tags":["Documents Upload"],"parameters":[{"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"string"}]},"in":"query","name":"employee_id","required":true},{"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"string"}]},"in":"query","name":"folder_id","required":true},{"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"string"}]},"in":"query","name":"flow_id","required":true},{"schema":{"type":"string"},"in":"query","name":"note","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"integer"}]},"in":"query","name":"published","required":false},{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/permissions/{tid}/all":{"get":{"summary":"Get all permissions for a tenant with user counts.","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string","nullable":true},"ismobile":{"type":"boolean"},"isweb":{"type":"boolean"},"isactive":{"type":"boolean","nullable":true},"archivedat":{"type":"string","format":"time","nullable":true},"isdefault":{"type":"boolean"},"createdby":{"type":"integer","nullable":true},"updatedby":{"type":"integer","nullable":true},"updatedon":{"type":"string","format":"date-time","nullable":true},"employee_count":{"type":"integer"},"externaluser_count":{"type":"integer"}}}}}}}}}},"/permissions/{tid}":{"post":{"summary":"Create a new permission.","tags":["Permissions"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","minLength":1},"description":{"type":"string","nullable":true},"flagsrc":{"type":"string","nullable":true},"ismobile":{"type":"boolean","default":true},"isweb":{"type":"boolean","default":true}}}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string","nullable":true},"ismobile":{"type":"boolean"},"isweb":{"type":"boolean"},"isactive":{"type":"boolean","nullable":true},"archivedat":{"type":"string","format":"time","nullable":true},"isdefault":{"type":"boolean"},"createdby":{"type":"integer","nullable":true},"updatedby":{"type":"integer","nullable":true},"updatedon":{"type":"string","format":"date-time","nullable":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/permissions/{tid}/{id}":{"delete":{"summary":"Remove a permission (soft delete). Fails if last permission or users are assigned.","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Permission ID"}],"responses":{"204":{"description":"Successfully removed (archived).","content":{"application/json":{"schema":{"description":"Successfully removed (archived)."}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"put":{"summary":"Update an existing permission.","tags":["Permissions"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","nullable":true},"ismobile":{"type":"boolean","nullable":true},"isweb":{"type":"boolean","nullable":true}},"minProperties":1}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string","nullable":true},"ismobile":{"type":"boolean"},"isweb":{"type":"boolean"},"isactive":{"type":"boolean","nullable":true},"archivedat":{"type":"string","format":"time","nullable":true},"isdefault":{"type":"boolean"},"createdby":{"type":"integer","nullable":true},"updatedby":{"type":"integer","nullable":true},"updatedon":{"type":"string","format":"date-time","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/permissions/{tid}/{id}/inactivate":{"patch":{"summary":"Inactivate a permission (set isactive=false).","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"isactive":{"type":"boolean"},"updatedby":{"type":"integer","nullable":true},"updatedon":{"type":"string","format":"date-time","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/permissions/{tid}/{id}/activate":{"patch":{"summary":"Activate a permission (set isactive=true).","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"isactive":{"type":"boolean"},"updatedby":{"type":"integer","nullable":true},"updatedon":{"type":"string","format":"date-time","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/permissions/{tid}/{id}/restore":{"patch":{"summary":"Restore a soft-deleted permission (archivedat=NULL and isactive=true).","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"restored":{"type":"boolean"},"archivedat":{"type":"string","format":"time","nullable":true},"isactive":{"type":"boolean"},"updatedby":{"type":"integer","nullable":true},"updatedon":{"type":"string","format":"date-time","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/permissions/{tid}/{id}/duplicate":{"post":{"summary":"Duplicate an existing permission.","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string","nullable":true},"ismobile":{"type":"boolean"},"isweb":{"type":"boolean"},"isactive":{"type":"boolean","nullable":true},"archivedat":{"type":"string","format":"time","nullable":true},"isdefault":{"type":"boolean"},"createdby":{"type":"integer","nullable":true},"updatedby":{"type":"integer","nullable":true},"updatedon":{"type":"string","format":"date-time","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/permissions/{tid}/{id}/default":{"patch":{"summary":"Make a permission the default (updates title and sets isactive=true).","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string","nullable":true},"ismobile":{"type":"boolean"},"isweb":{"type":"boolean"},"isactive":{"type":"boolean","nullable":true},"archivedat":{"type":"string","format":"time","nullable":true},"isdefault":{"type":"boolean"},"createdby":{"type":"integer","nullable":true},"updatedby":{"type":"integer","nullable":true},"updatedon":{"type":"string","format":"date-time","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/permissions/{tid}/{id}/employees/in":{"get":{"summary":"Get all employees assigned to this permission.","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"type":"string"},"username":{"type":"string"}}}}}}}}}},"/permissions/{tid}/{id}/employees/out":{"get":{"summary":"Get all employees NOT assigned to this permission.","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"type":"string"},"username":{"type":"string"}}}}}}}}}},"/permissions/{tid}/{id}/employees/add":{"patch":{"summary":"Assign an employee to this permission.","tags":["Permissions"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["userid"],"properties":{"userid":{"type":"integer"}}}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userid":{"type":"integer"},"permissionid":{"type":"integer"},"assigned":{"type":"boolean"}}}}}}}}},"/permissions/{tid}/{id}/externalusers/in":{"get":{"summary":"Get all external users assigned to this permission.","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"type":"string"},"username":{"type":"string"}}}}}}}}}},"/permissions/{tid}/{id}/externalusers/out":{"get":{"summary":"Get all external users NOT assigned to this permission.","tags":["Permissions"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"type":"string"},"username":{"type":"string"}}}}}}}}}},"/permissions/{tid}/{id}/externalusers/add":{"patch":{"summary":"Assign an external user to this permission.","tags":["Permissions"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["userid"],"properties":{"userid":{"type":"integer"}}}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userid":{"type":"integer"},"permissionid":{"type":"integer"},"assigned":{"type":"boolean"}}}}}}}}},"/documentprofile/approvalgroups/{tid}/{id}":{"get":{"summary":"Get one approval group by tid and id","tags":["Approval Groups"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentprofile/approvalgroups/{tid}/{id}/update":{"put":{"summary":"Update title and/or description of an approval group","tags":["Approval Groups"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"autoapprove":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/documentprofile/approvalgroups/{tid}/addmember":{"post":{"summary":"Add an employee or permission group member to an approval group","tags":["Approval Groups"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["groupId","type"],"properties":{"groupId":{"type":"integer","minimum":1},"type":{"type":"string","enum":["employee","group"]},"employeeId":{"type":"integer","minimum":1},"firstName":{"type":"string","minLength":1},"lastName":{"type":"string","minLength":1},"permissionId":{"type":"integer","minimum":1},"permissionTitle":{"type":"string","minLength":1}}}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employies/ingroup/{tid}/{approvalGroupId}":{"get":{"tags":["Employees - Approval   "],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvalGroupId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employies/outgroup/{tid}/{approvalGroupId}":{"get":{"tags":["Employees - Approval   "],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvalGroupId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employies/add/{tid}/{approvalGroupId}/{employeeId}":{"post":{"tags":["Employees - Approval   "],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvalGroupId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employies/remove/{tid}/{approvalGroupId}/{employeeId}":{"delete":{"tags":["Employees - Approval   "],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvalGroupId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/employies/move/{tid}/{fromApprovalGroupId}/{toApprovalGroupId}/{employeeId}":{"post":{"tags":["Employees - Approval   "],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"fromApprovalGroupId","required":true},{"schema":{"type":"string"},"in":"path","name":"toApprovalGroupId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/externaluser/all":{"get":{"summary":"List all non-employee users (external/archived) for a tenant (tid).","tags":["ExternalUser"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"employeeid":{"type":"integer","nullable":true,"description":"Employee ID linked to this user"},"id":{"type":"integer"},"firstname":{"type":"string"},"lastname":{"type":"string"},"username":{"type":"string"},"email":{"type":"string"},"expirationdate":{"type":"string","format":"date","nullable":true},"roleid":{"type":"integer"},"lastauth":{"type":"string","format":"date","nullable":true},"ismobile":{"type":"boolean"},"isweb":{"type":"boolean"},"isactive":{"type":"boolean"},"archivedat":{"type":"string","format":"time","nullable":true}},"required":["id"]}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/externaluser/employee":{"get":{"summary":"List all users who are linked to an employee record.","tags":["ExternalUser"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"employeeid":{"type":"integer","nullable":true,"description":"Employee ID linked to this user"},"id":{"type":"integer"},"firstname":{"type":"string"},"lastname":{"type":"string"},"username":{"type":"string"},"email":{"type":"string"},"expirationdate":{"type":"string","format":"date","nullable":true},"roleid":{"type":"integer"},"lastauth":{"type":"string","format":"date","nullable":true},"ismobile":{"type":"boolean"},"isweb":{"type":"boolean"},"isactive":{"type":"boolean"},"archivedat":{"type":"string","format":"time","nullable":true}},"required":["id"]}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/externaluser/mobile":{"get":{"summary":"Deprecated: List mobile users.","tags":["ExternalUser"],"responses":{"200":{"description":"Default Response"}}}},"/externaluser/web":{"get":{"summary":"Deprecated: List web users.","tags":["ExternalUser"],"responses":{"200":{"description":"Default Response"}}}},"/externaluser/{id}":{"get":{"summary":"Get a specific user by id and tenant id (tid).","tags":["ExternalUser"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"firstname":{"type":"string"},"lastname":{"type":"string"},"username":{"type":"string"},"email":{"type":"string"},"expirationdate":{"type":"string","format":"date","nullable":true},"roleid":{"type":"integer"},"lastauth":{"type":"string","format":"date","nullable":true},"isactive":{"type":"boolean"},"archivedat":{"type":"string","format":"time","nullable":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"put":{"summary":"Update a user (External or Employee Status Change).","tags":["ExternalUser"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid"],"properties":{"tid":{"type":"integer","description":"Tenant ID"},"roleid":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string","format":"email"},"password_hash":{"type":"string","description":"Hashed password","nullable":true},"expirationdate":{"type":"string","format":"date","nullable":true},"isactive":{"type":"boolean","description":"Set to true/false (note: /inactivate endpoint is preferred for false)","nullable":true},"firstname":{"type":"string"},"lastname":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string"},"roleid":{"type":"integer"},"isactive":{"type":"boolean"}},"required":["id"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"delete":{"summary":"Hard-delete a non-employee user.","tags":["ExternalUser"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Successfully hard-deleted","content":{"application/json":{"schema":{"description":"Successfully hard-deleted"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/externaluser/{tid}/create":{"post":{"summary":"Create a new non-employee user (password auto-generated) for a specific tenant.","tags":["ExternalUser"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["roleid","username","email","firstname","lastname"],"properties":{"roleid":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string","format":"email"},"expirationdate":{"type":"string","format":"date","nullable":true},"firstname":{"type":"string"},"lastname":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string"},"roleid":{"type":"integer"},"isactive":{"type":"boolean"},"firstname":{"type":"string"},"lastname":{"type":"string"}},"required":["id","username","email","roleid","isactive","firstname","lastname"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/externaluser/{id}/inactivate":{"patch":{"summary":"Deprecated: Inactivate a user.","tags":["ExternalUser"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"isactive":{"type":"boolean"}},"required":["id","isactive"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/externaluser/{id}/restore":{"patch":{"summary":"Restore a soft-deleted non-employee user.","tags":["ExternalUser"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"restored":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/externaluser/permissions":{"get":{"summary":"List all permissions for a tenant (and optionally by id)","tags":["ExternalUser"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"tid","required":true},{"schema":{"type":"integer","minimum":1,"nullable":true},"in":"query","name":"id","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"ismobile":{"type":"boolean"},"isweb":{"type":"boolean"},"isactive":{"type":"boolean","nullable":true}},"required":["id"]}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/workstation/{tid}/company":{"get":{"summary":"Get all company workstations (non-client) and their active employee count and legal entity employee count.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/client":{"get":{"summary":"Get all client workstations.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/employees":{"get":{"summary":"Get all active employees for the tenant.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/legalentity/{id}":{"get":{"summary":"Get one legal entity by ID.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}":{"get":{"summary":"Get one workstation by Tenant ID and Workstation ID.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/employees":{"get":{"summary":"List active employees assigned to a specific workstation.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/legalentities/list":{"get":{"summary":"Get list of active legal entities for a tenant (for dropdowns).","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/update":{"put":{"summary":"Update one or more fields of a workstation.","tags":["Workstation"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"imgsrc":{"type":"string"},"legalentityid":{"type":["integer","string","null"]},"address":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"site":{"type":"string"},"managerid":{"type":["integer","string","null"]},"createdby":{"type":["integer","string","null"]},"ismainoffice":{"type":"boolean"},"isclientplace":{"type":"boolean"},"phonenumber":{"type":"string"},"zipcode":{"type":"string"},"Latitude":{"type":"string"},"Longitude":{"type":"string"},"range":{"type":"string"},"holidays":{"type":["object","array","null"]},"moreinfo":{"type":["object","null"]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/inactive":{"put":{"summary":"Set workstation to inactive (isactive=false).","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/active":{"put":{"summary":"Set workstation to active (isactive=true).","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/restore":{"put":{"summary":"Restore an archived workstation (alias for /active).","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/makemain":{"put":{"summary":"Set workstation as the main office (ismainoffice=true).","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/unmain":{"put":{"summary":"Unset workstation as the main office (ismainoffice=false).","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/":{"post":{"summary":"Create a new workplace (Company or Client site).","tags":["Workstation"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tid","title","address","city"],"properties":{"tid":{"type":"integer","minimum":1},"title":{"type":"string","minLength":1},"description":{"type":"string"},"imgsrc":{"type":"string"},"legalentityid":{"type":["integer","null"]},"address":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"state":{"type":"string"},"site":{"type":"string"},"managerid":{"type":["integer","null"]},"createdby":{"type":["integer","null"]},"ismainoffice":{"type":"boolean"},"isclientplace":{"type":"boolean"},"phonenumber":{"type":"string"},"zipcode":{"type":"string"},"Latitude":{"type":"string"},"Longitude":{"type":"string"},"range":{"type":"string"},"holidays":{"type":["object","array","null"]},"moreinfo":{"type":["object","null"]}},"additionalProperties":false}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/duplicate":{"post":{"summary":"Create a new workstation by duplicating an existing one.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/moveemployee/{oldId}/{newId}/{employeeId}":{"post":{"summary":"Move an employee from one workstation to another.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"oldId","required":true,"description":"Old Workstation ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"newId","required":true,"description":"New Workstation ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"employeeId","required":true,"description":"Employee ID to move"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/uploadimg":{"post":{"summary":"Upload an image and update the workstation imgsrc field.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/setformlink":{"post":{"summary":"Upload a file/link and update the workstation moreinfo (formlink) field.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/workstation/{tid}/{id}/delete":{"delete":{"summary":"Hard delete a workstation.","tags":["Workstation"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true,"description":"Tenant ID"},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true,"description":"Workstation ID"}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/getall":{"get":{"summary":"Get all schedules (with emp counts)","tags":["Schedule"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/getone":{"get":{"summary":"Get basic schedule info","tags":["Schedule"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/full":{"get":{"summary":"Get schedule with periods/days/intervals + employee count","tags":["Schedule"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/create":{"post":{"summary":"Create schedule","tags":["Schedule"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string"},"isdefault":{"type":"boolean"},"fromday":{"type":["string","null"]},"today":{"type":["string","null"]},"employeeId":{"type":"integer"}}}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/update":{"put":{"summary":"Update schedule header","tags":["Schedule"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"isdefault":{"type":"boolean"},"fromday":{"type":["string","null"]},"today":{"type":["string","null"]},"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/active":{"put":{"summary":"Set active/inactive","tags":["Schedule"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/delete":{"delete":{"summary":"Delete schedule (moves employees to default)","tags":["Schedule"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"employeeId"},{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/duplicate":{"post":{"summary":"Duplicate schedule and its periods","tags":["Schedule"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/employees":{"get":{"summary":"Get employees in specific schedule","tags":["Schedule - Employees"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/employees/noschedule":{"get":{"summary":"Get active employees with NO active schedule","tags":["Schedule - Employees"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/employees/{eid}/add":{"post":{"summary":"Assign employee to schedule","tags":["Schedule - Employees"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true},{"schema":{"type":"integer"},"in":"path","name":"eid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/employees/{eid}/remove":{"delete":{"summary":"Remove employee from schedule","tags":["Schedule - Employees"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true},{"schema":{"type":"integer"},"in":"path","name":"eid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/{sid}/periods/create":{"post":{"summary":"Create period (main or sub)","tags":["Schedule - Periods"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["startdate","enddate"],"properties":{"startdate":{"type":"string"},"enddate":{"type":"string"},"notes":{"type":"string"},"kind":{"type":"string"},"employeeId":{"type":"integer"}}}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"sid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/periods/{periodId}/update":{"put":{"summary":"Update period","tags":["Schedule - Periods"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string"},"startdate":{"type":"string"},"enddate":{"type":"string"},"kind":{"type":"string"},"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"periodId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/periods/{periodId}/delete":{"delete":{"summary":"Delete period (Main cannot be deleted)","tags":["Schedule - Periods"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"periodId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/periods/{periodId}/days/upsert":{"post":{"summary":"Upsert days and intervals","tags":["Schedule - Days"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["days"],"properties":{"days":{"type":"array"},"employeeId":{"type":"integer"}}}}},"required":true},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"periodId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/schedule/{tid}/days/{dayId}":{"get":{"summary":"Get day details","tags":["Schedule - Days"],"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"dayId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingpolicies/{tid}":{"get":{"summary":"Get all time tracking policies for a tenant","tags":["Time Tracking Policies"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a new time tracking policy","tags":["Time Tracking Policies"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"workschedulesid":{"type":"integer"},"employeeId":{"type":"integer"}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingpolicies/{tid}/{policyId}":{"get":{"summary":"Get full details for a specific time tracking policy","tags":["Time Tracking Policies"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Update all fields for a policy (partial update allowed via COALESCE)","tags":["Time Tracking Policies"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"effectivedate":{"type":"string","format":"date"},"workschedulesid":{"type":"integer"},"mobileclock":{"type":"boolean"},"usegeolocation":{"type":"boolean"},"entranceapp":{"type":"boolean"},"clockbyid":{"type":"boolean"},"restrictions":{"type":"string"},"tolerancetime":{"type":"string"},"tolerancetimeamount":{"type":"integer"},"tolerancetimeremindercount":{"type":"integer"},"tolerancetimereminderamount":{"type":"integer"},"employeeId":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Archive (soft delete) a time tracking policy","tags":["Time Tracking Policies"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"employeeId"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingpolicies/{tid}/{policyId}/duplicate":{"post":{"summary":"Duplicate an existing policy definition","tags":["Time Tracking Policies"],"parameters":[{"schema":{"type":"integer"},"in":"query","name":"employeeId"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingpolicies/{tid}/schedules":{"get":{"summary":"Get list of active work schedules for use in policies","tags":["Time Tracking Policies"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timetrackingpolicies/{tid}/{policyId}/delete":{"delete":{"summary":"DELETE /timetrackingpolicies/:tid/:policyId/delete","tags":["API"],"description":"Auto-generated. Add explicit `schema` on this route in source for parameters, body, and responses.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/notification/{tid}/{userid}/settings":{"get":{"summary":"Get all notification settings for a user, grouped by type.","tags":["User Notification Settings"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"userid","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Update all notification settings (global switch and item preferences).","tags":["User Notification Settings"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["disableAll","groups"],"properties":{"disableAll":{"type":"boolean","description":"Global switch to disable all notifications."},"groups":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","email","mobile"],"properties":{"id":{"type":"number","description":"Item ID from settings.tblnotificationitem."},"key":{"type":"string"},"email":{"type":"boolean"},"mobile":{"type":"boolean"}}}}}}}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"userid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/auditlog/{tid}/list":{"get":{"summary":"Get a paginated and filtered list of all audit log entries for a tenant.","tags":["Audit Log"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Search term for feature, subfeature, description, employee name, or metadata"},{"schema":{"type":"string"},"in":"query","name":"feature","required":false,"description":"Filter by specific feature (e.g., \"Employees\", \"Settings\")"},{"schema":{"type":"string"},"in":"query","name":"platform","required":false,"description":"Filter by platform (e.g., \"Web\", \"Mobile\", \"API\")"},{"schema":{"type":"number","default":50},"in":"query","name":"limit","required":false,"description":"Page size (number of rows per page)"},{"schema":{"type":"number","default":0},"in":"query","name":"offset","required":false,"description":"Offset for pagination (0-based)"},{"schema":{"type":"string"},"in":"path","name":"tid","required":true,"description":"Tenant ID"}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/gellallaprovallist":{"get":{"summary":"Get all active time-off policies by tid","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}":{"get":{"summary":"Alias — Get all active time-off policies by tid","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/{id}/getApprovalGroupById":{"get":{"summary":"Get one time-off policy by tid and id","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/createapproval":{"post":{"summary":"Create a new time-off policy","tags":["Timeoff Policy"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"description":{"type":["string","null"]},"keybox":{"type":["object","string","null"]},"isdefault":{"type":"boolean"}},"additionalProperties":false}}},"required":true},"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/{id}/deleteapproval":{"delete":{"summary":"Soft delete a time-off policy (isactive=false, archiveat=NOW())","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/{id}/incativeapproval":{"delete":{"summary":"Soft deactivate a time-off policy (alias for deleteapproval)","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/{id}/restoreapproval":{"patch":{"summary":"Restore an inactive time-off policy (isactive=true, archiveat=NULL)","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/{id}/activeapproval":{"patch":{"summary":"Reactivate a time-off policy (alias for restoreapproval)","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/{id}/dublicateapproval":{"post":{"summary":"Duplicate an existing time-off policy","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/{id}/makeautoapproval":{"patch":{"summary":"Mark policy as default (isdefault = TRUE)","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/timeoffpolicy/{tid}/{id}/unmakeautoapproval":{"patch":{"summary":"Unmark policy as default (isdefault = FALSE)","tags":["Timeoff Policy"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"path","name":"tid","required":true},{"schema":{"type":"integer","minimum":1},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/absence/{tid}":{"get":{"tags":["Settings - Absence Types"],"description":"List all Absence Types for a Tenant (Active & Archived)","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"tags":["Settings - Absence Types"],"description":"Create a new Absence Type","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/absence/{tid}/{absenceId}":{"get":{"tags":["Settings - Absence Types"],"description":"Get a single Absence Type by ID","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"absenceId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"tags":["Settings - Absence Types"],"description":"Update all information for an Absence Type","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string","nullable":true},"color":{"type":"string","default":"#2B6171"},"visibility":{"type":"boolean","default":true},"allowance":{"type":"boolean","default":false,"description":"Deduct from allowance"},"halveday":{"type":"boolean","default":false,"description":"Enable half-day absence"},"minimumdays":{"type":"number","default":0},"maximumdays":{"type":"number","default":365},"employeerequest":{"type":"boolean","default":true},"requiredattachment":{"type":"boolean","default":false,"description":"Requires supporting documents"},"iconurl":{"type":"string","nullable":true,"description":"Public URL to the icon image"}}}}}},"parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"absenceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/absence/{tid}/{absenceId}/upload/icon":{"post":{"tags":["Settings - Absence Types"],"description":"Upload an icon (JPG, PNG, SVG) and link it to the Absence Type","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"absenceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/absence/{tid}/{absenceId}/archive":{"delete":{"tags":["Settings - Absence Types"],"description":"Archive (soft-delete) an Absence Type","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"absenceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/absence/{tid}/{absenceId}/unarchive":{"post":{"tags":["Settings - Absence Types"],"description":"Restore (un-archive) an Absence Type","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"absenceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/absence/{tid}/{absenceId}/duplicate":{"post":{"tags":["Settings - Absence Types"],"description":"Duplicate an existing Absence Type","parameters":[{"schema":{"type":"number"},"in":"path","name":"tid","required":true},{"schema":{"type":"number"},"in":"path","name":"absenceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/list":{"get":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}":{"post":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}":{"get":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/inactive":{"patch":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/active":{"patch":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/restore":{"patch":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/duplicate":{"post":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/periods":{"get":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{blockedId}/periods/{id}":{"delete":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"blockedId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"blockedId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/teams/list":{"get":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/teams":{"post":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{blockedId}/teams/{blockedTeamId}":{"delete":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"blockedId","required":true},{"schema":{"type":"string"},"in":"path","name":"blockedTeamId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/departments/list":{"get":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/departments":{"post":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{blockedId}/departments/{blockedDeptId}":{"delete":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"blockedId","required":true},{"schema":{"type":"string"},"in":"path","name":"blockedDeptId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/workplaces/list":{"get":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{id}/workplaces":{"post":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/{blockedId}/workplaces/{blockedWorkplaceId}":{"delete":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"blockedId","required":true},{"schema":{"type":"string"},"in":"path","name":"blockedWorkplaceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/block/{tid}/absence/list":{"get":{"tags":["Time Off Blocked Periods"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/permisionpage/groups":{"get":{"tags":["Permissions pages"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array"}}}}}}},"/permisionpage/groupaction/{permissionId}":{"get":{"tags":["Permissions pages"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"permissionId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array"}}}}}}},"/permisionpage/grant":{"post":{"tags":["Permissions pages"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["permissionGroupActionId","permissionId"],"properties":{"permissionGroupActionId":{"type":"number","description":"ID of the tblpermissiongroupactions record"},"permissionId":{"type":"number","description":"ID of the tblpermissions record"}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"granted":{"type":"boolean"}}}}}}}}},"/permisionpage/revoke":{"delete":{"tags":["Permissions pages"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["permissionGroupActionId","permissionId"],"properties":{"permissionGroupActionId":{"type":"number","description":"ID of the tblpermissiongroupactions record"},"permissionId":{"type":"number","description":"ID of the tblpermissions record"}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"revoked":{"type":"boolean"}}}}}}}}},"/permisionpage/status/{tid}/{permissionId}":{"get":{"tags":["Permissions pages"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"permissionId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"isWeb":{"type":"boolean"},"isMobile":{"type":"boolean"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/policydetails/{tid}/absence":{"get":{"tags":["Time Off Policy"],"description":"Get list of all active absence types for a tenant.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"}},"required":["id","title"]}}}}}}}},"/policydetails/{tid}/{policyId}":{"get":{"tags":["Time Off Policy"],"description":"Get a single time off policy by ID.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"tags":["Time Off Policy"],"description":"Update the title and description of a time off policy.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}},"additionalProperties":true}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/policydetails/{tid}/{policyId}/allowance":{"get":{"tags":["Time Off Policy"],"description":"Get all allowances attached to a specific policy. Includes nested absence details when absencesid matches.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"policyId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"policyid":{"type":"integer"},"title":{"type":["null","string"]},"allowancetype":{"type":["null","string"]},"absencesid":{"type":["null","string"]},"allowancesetin":{"type":["null","string"]},"displaydays":{"type":["null","string"]},"basedaysvalue":{"type":["null","string"]},"basedaystype":{"type":["null","string"]},"bankfalls":{"type":["null","string"]},"prorated":{"type":["null","string"]},"maxdays":{"type":["null","string"]},"mindays":{"type":["null","string"]},"accured":{"type":["null","string"]},"whenused":{"type":["null","string"]},"negativecountry":{"type":["null","string"]},"createdat":{"type":["null","string"]},"createdby":{"type":"integer"},"absence":{"type":["null","object"],"properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"title":{"type":["null","string"]},"description":{"type":["null","string"]},"color":{"type":["null","string"]},"visibility":{"type":["null","boolean"]},"allowance":{"type":["null","boolean"]},"halveday":{"type":["null","boolean"]},"minimumdays":{"type":["null","integer"]},"maximumdays":{"type":["null","integer"]},"employeerequest":{"type":["null","boolean"]},"isactive":{"type":["null","boolean"]},"archivedat":{"type":["null","string"]},"createdat":{"type":["null","string"]},"updatedat":{"type":["null","string"]},"createdby":{"type":["null","integer"]},"keybox":{"type":"array","items":{"type":"string"}},"requiredattachment":{"type":["null","boolean"]},"iconurl":{"type":["null","string"]}},"additionalProperties":true}},"additionalProperties":true}}}}}}},"post":{"tags":["Time Off Policy"],"description":"Create a new allowance and attach it to the policy.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"allowancetype":{"type":"string"},"absencesid":{"type":"string"},"allowancesetin":{"type":"string"},"displaydays":{"type":"string"},"basedaysvalue":{"type":"string"},"basedaystype":{"type":"string"},"bankfalls":{"type":"string"},"prorated":{"type":"string"},"maxdays":{"type":"string"},"mindays":{"type":"string"},"accured":{"type":"string"},"whenused":{"type":"string"},"negativecountry":{"type":"string"}},"additionalProperties":true}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"policyId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"policyid":{"type":"integer"},"title":{"type":["null","string"]},"allowancetype":{"type":["null","string"]},"absencesid":{"type":["null","string"]},"allowancesetin":{"type":["null","string"]},"displaydays":{"type":["null","string"]},"basedaysvalue":{"type":["null","string"]},"basedaystype":{"type":["null","string"]},"bankfalls":{"type":["null","string"]},"prorated":{"type":["null","string"]},"maxdays":{"type":["null","string"]},"mindays":{"type":["null","string"]},"accured":{"type":["null","string"]},"whenused":{"type":["null","string"]},"negativecountry":{"type":["null","string"]},"createdat":{"type":["null","string"]},"createdby":{"type":"integer"},"absence":{"type":["null","object"],"properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"title":{"type":["null","string"]},"description":{"type":["null","string"]},"color":{"type":["null","string"]},"visibility":{"type":["null","boolean"]},"allowance":{"type":["null","boolean"]},"halveday":{"type":["null","boolean"]},"minimumdays":{"type":["null","integer"]},"maximumdays":{"type":["null","integer"]},"employeerequest":{"type":["null","boolean"]},"isactive":{"type":["null","boolean"]},"archivedat":{"type":["null","string"]},"createdat":{"type":["null","string"]},"updatedat":{"type":["null","string"]},"createdby":{"type":["null","integer"]},"keybox":{"type":"array","items":{"type":"string"}},"requiredattachment":{"type":["null","boolean"]},"iconurl":{"type":["null","string"]}},"additionalProperties":true}},"additionalProperties":true}}}}}}},"/policydetails/{tid}/{policyId}/allowance/{allowanceId}":{"get":{"tags":["Time Off Policy"],"description":"Get full information for a single allowance by ID. Includes nested absence details when absencesid matches.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"policyId","required":true},{"schema":{"type":"integer"},"in":"path","name":"allowanceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"policyid":{"type":"integer"},"title":{"type":["null","string"]},"allowancetype":{"type":["null","string"]},"absencesid":{"type":["null","string"]},"allowancesetin":{"type":["null","string"]},"displaydays":{"type":["null","string"]},"basedaysvalue":{"type":["null","string"]},"basedaystype":{"type":["null","string"]},"bankfalls":{"type":["null","string"]},"prorated":{"type":["null","string"]},"maxdays":{"type":["null","string"]},"mindays":{"type":["null","string"]},"accured":{"type":["null","string"]},"whenused":{"type":["null","string"]},"negativecountry":{"type":["null","string"]},"createdat":{"type":["null","string"]},"createdby":{"type":"integer"},"absence":{"type":["null","object"],"properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"title":{"type":["null","string"]},"description":{"type":["null","string"]},"color":{"type":["null","string"]},"visibility":{"type":["null","boolean"]},"allowance":{"type":["null","boolean"]},"halveday":{"type":["null","boolean"]},"minimumdays":{"type":["null","integer"]},"maximumdays":{"type":["null","integer"]},"employeerequest":{"type":["null","boolean"]},"isactive":{"type":["null","boolean"]},"archivedat":{"type":["null","string"]},"createdat":{"type":["null","string"]},"updatedat":{"type":["null","string"]},"createdby":{"type":["null","integer"]},"keybox":{"type":"array","items":{"type":"string"}},"requiredattachment":{"type":["null","boolean"]},"iconurl":{"type":["null","string"]}},"additionalProperties":true}},"additionalProperties":true}}}}}},"put":{"tags":["Time Off Policy"],"description":"Update full information for a single allowance.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"policyId","required":true},{"schema":{"type":"integer"},"in":"path","name":"allowanceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"policyid":{"type":"integer"},"title":{"type":["null","string"]},"allowancetype":{"type":["null","string"]},"absencesid":{"type":["null","string"]},"allowancesetin":{"type":["null","string"]},"displaydays":{"type":["null","string"]},"basedaysvalue":{"type":["null","string"]},"basedaystype":{"type":["null","string"]},"bankfalls":{"type":["null","string"]},"prorated":{"type":["null","string"]},"maxdays":{"type":["null","string"]},"mindays":{"type":["null","string"]},"accured":{"type":["null","string"]},"whenused":{"type":["null","string"]},"negativecountry":{"type":["null","string"]},"createdat":{"type":["null","string"]},"createdby":{"type":"integer"},"absence":{"type":["null","object"],"properties":{"id":{"type":"integer"},"tid":{"type":"integer"},"title":{"type":["null","string"]},"description":{"type":["null","string"]},"color":{"type":["null","string"]},"visibility":{"type":["null","boolean"]},"allowance":{"type":["null","boolean"]},"halveday":{"type":["null","boolean"]},"minimumdays":{"type":["null","integer"]},"maximumdays":{"type":["null","integer"]},"employeerequest":{"type":["null","boolean"]},"isactive":{"type":["null","boolean"]},"archivedat":{"type":["null","string"]},"createdat":{"type":["null","string"]},"updatedat":{"type":["null","string"]},"createdby":{"type":["null","integer"]},"keybox":{"type":"array","items":{"type":"string"}},"requiredattachment":{"type":["null","boolean"]},"iconurl":{"type":["null","string"]}},"additionalProperties":true}},"additionalProperties":true}}}}}},"delete":{"tags":["Time Off Policy"],"description":"Delete an allowance from a policy.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"tid","required":true},{"schema":{"type":"integer"},"in":"path","name":"policyId","required":true},{"schema":{"type":"integer"},"in":"path","name":"allowanceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"message":{"type":"string"}}}}}}}}},"/approval/flow/{tid}/{flowId}/{approvfor}":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{approvfor}/list":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{approvfor}/list-with-employees":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/create/{approvfor}":{"post":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{flowId}/{approvfor}/duplicate":{"post":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{approvfor}/reorder":{"put":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{approvfor}/{flowId}/active/{value}":{"put":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"value","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{approvfor}/{flowId}/autoapprove/{value}":{"put":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"value","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{approvfor}/{flowId}/default/{isdefault}":{"put":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"isdefault","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{approvfor}/statistics":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{approvfor}/search":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/instance/{tid}/{approvalfor}/list":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"approvalfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/instance/{tid}/{id}/{approvalfor}":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"approvalfor","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/instance/{tid}/{instanceId}":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/instance/{tid}/create":{"post":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/instance/{tid}/{instanceId}/status":{"put":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"instanceId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/entity/{tid}/{flowid}/list":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/entity/{tid}/{flowid}/levels/{level}/{kind}/{entityId}":{"post":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowid","required":true},{"schema":{"type":"string"},"in":"path","name":"level","required":true},{"schema":{"type":"string"},"in":"path","name":"kind","required":true},{"schema":{"type":"string"},"in":"path","name":"entityId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/entity/{tid}/add":{"post":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/entity/{tid}/bulk-add":{"post":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/entity/{tid}/{flowid}/levels/{level}":{"delete":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowid","required":true},{"schema":{"type":"string"},"in":"path","name":"level","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/entity/{tid}/delete/{entityId}":{"delete":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"entityId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{flowId}/scope/list":{"get":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{flowId}/scope/assign":{"post":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/approval/flow/{tid}/{flowId}/scope/{employeeId}":{"delete":{"tags":["Approval"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tid","required":true},{"schema":{"type":"string"},"in":"path","name":"flowId","required":true},{"schema":{"type":"string"},"in":"path","name":"employeeId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/companysettings/entities/get{tenantId}":{"get":{"summary":"List legal entities by tenant","tags":["Company"],"parameters":[{"schema":{"type":"integer"},"example":1,"in":"path","name":"tenantId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"string"},"employee_count":{"type":"integer"}},"required":["id","title","status","employee_count"]}}}}}}}},"/companysettings/entities/post{tenantId}":{"post":{"summary":"Create a new legal entity (title in body)","tags":["Company"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"My New Entity"},"country":{"type":"string","example":"Morocco"},"currency":{"type":"string","example":"MAD"}},"required":["title"]}}},"required":true},"parameters":[{"schema":{"type":"integer"},"example":1,"in":"path","name":"tenantId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"string"},"employee_count":{"type":"integer"},"country":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true}},"required":["id","title","status","employee_count"]}}}}}}},"/companysettings/entities/delete{tenantId}/{id}":{"delete":{"summary":"Delete a legal entity (only if employee_count=0)","tags":["Company"],"parameters":[{"schema":{"type":"integer"},"example":1,"in":"path","name":"tenantId","required":true},{"schema":{"type":"integer"},"example":12,"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deletedId":{"type":"integer"}},"required":["success","deletedId"]}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companysettings/entities/update{tenantId}/{id}":{"put":{"summary":"Update an existing legal entity","tags":["Company"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"Updated Entity Name"},"country":{"type":"string","example":"UAE"},"currency":{"type":"string","example":"AED"},"isactive":{"type":"boolean","example":true}}}}}},"parameters":[{"schema":{"type":"integer"},"example":1,"in":"path","name":"tenantId","required":true},{"schema":{"type":"integer"},"example":12,"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"string"},"employee_count":{"type":"integer"},"country":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true}},"required":["id","title","status","employee_count"]}}}}}}},"/companysettings/entities/{tenantId}/{id}/employees":{"get":{"summary":"List all employees for a legal entity with department and team","tags":["Company"],"parameters":[{"schema":{"type":"integer"},"example":1,"in":"path","name":"tenantId","required":true},{"schema":{"type":"integer"},"example":12,"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"employee_id":{"type":"integer"},"name":{"type":"string"},"department":{"type":"string","nullable":true},"team":{"type":"string","nullable":true}},"required":["employee_id","name"]}}}}}}}},"/superadmin/auth/login":{"post":{"summary":"Super-admin login (core.tblsuperuser)","tags":["Super Admin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string"}}}}},"required":true},"security":[],"responses":{"200":{"description":"Default Response"}}}},"/superadmin/auth/session":{"get":{"summary":"Validate super-admin JWT","tags":["Super Admin"],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/superadmin/auth/logout":{"post":{"summary":"Logout (clear cookie)","tags":["Super Admin"],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/superadmin/overview":{"get":{"summary":"Dashboard overview (counts + recent tenants)","tags":["Super Admin"],"responses":{"200":{"description":"Default Response"}}}},"/superadmin/subscription-plans":{"get":{"summary":"Active subscription plans","tags":["Super Admin"],"responses":{"200":{"description":"Default Response"}}}},"/superadmin/super-users":{"get":{"summary":"List tblsuperuser rows","tags":["Super Admin"],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create super-admin user","tags":["Super Admin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"username":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"description":{"type":"string"}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}}},"/superadmin/super-users/{id}":{"patch":{"summary":"Update super-admin user","tags":["Super Admin"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/superadmin/tenants":{"post":{"summary":"Create tenant (core.tbltenant)","tags":["Super Admin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"address":{"type":"string"},"contact_info":{"type":"string"},"industryid":{"type":"integer"},"phone":{"type":"string"},"languagecode":{"type":"string"},"dateformat":{"type":"string"},"numberformat":{"type":"string"},"website":{"type":"string"},"contactemail":{"type":"string"},"timezone":{"type":"string"},"startweekon":{"type":"string","enum":["monday","sunday"]}}}}},"required":true},"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List tenants (paginated, search)","tags":["Super Admin"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"q","required":false},{"schema":{"type":"integer","minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/superadmin/tenants/{id}/subscription":{"get":{"summary":"Latest subscription for tenant","tags":["Super Admin"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Create or update tenant subscription","tags":["Super Admin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["pid","seats"],"properties":{"pid":{"type":"integer"},"seats":{"type":"integer"},"billingperiod":{"type":"string"},"currencycode":{"type":"string"},"priceperemployee":{"type":"number"},"status":{"type":"string"},"autorenew":{"type":"boolean"},"notes":{"type":"string"},"description":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/superadmin/tenants/{id}":{"get":{"summary":"Get tenant by id","tags":["Super Admin"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update tenant","tags":["Super Admin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":"string"},"contact_info":{"type":"string"},"industryid":{"type":"integer"},"phone":{"type":"string"},"languagecode":{"type":"string"},"dateformat":{"type":"string"},"numberformat":{"type":"string"},"website":{"type":"string"},"contactemail":{"type":"string"},"timezone":{"type":"string"},"startweekon":{"type":"string","enum":["monday","sunday"]}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/Health":{"get":{"summary":"Service health + uploads root","tags":["Health"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"uptime":{"type":"number"},"uploadsRoot":{"type":"string"}}}}}}}}}},"servers":[{"url":"https://apirec.slashr.ma"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"API","description":"Routes without an explicit schema (auto-generated summary)"},{"name":"Auth","description":"Login, OTP, OAuth, session — use /auth/login for JWT"},{"name":"Docs","description":"PDF / export helpers"},{"name":"Health","description":"Liveness and diagnostics"},{"name":"Uploads","description":"Multipart file uploads at server root"},{"name":"Employee New","description":"Full employee creation wizard (employeenew)"},{"name":"Post","description":"CMS-style posts (if module mounted)"},{"name":"Password Reset","description":"Forgot-password OTP flow"},{"name":"Help Center","description":"Mobile help contact email"},{"name":"Allowances","description":"Time-off allowances"},{"name":"Catalog","description":"HR catalogs (jobs, departments, …)"},{"name":"Company","description":"Company / tenant settings"},{"name":"Approval","description":"Approval workflows and instances"},{"name":"Letters","description":"Letter requests and generated files"},{"name":"LeaveVisit","description":"Leave requests (legacy tag name)"},{"name":"LeaveVisit2","description":"Leave listing"},{"name":"Schedule","description":"Work schedules"},{"name":"Schedule - Employees","description":"Employee schedule assignments"},{"name":"TimeTracking - Employees","description":"Time tracking for employees"},{"name":"TimeTracking","description":"Time tracking policies and punches"},{"name":"Workstation","description":"Workstations and holidays"},{"name":"Geofence","description":"Geofence CRUD"},{"name":"Country","description":"Country reference data"},{"name":"Notification","description":"Notifications"},{"name":"Newsfeed - Post Catch","description":"Newsfeed ingestion"},{"name":"Settings - Company Values","description":"Company values"},{"name":"Settings - Company Badges","description":"Badges"},{"name":"Settings - Company Links","description":"Company links"},{"name":"Public - Gender","description":"Public gender lookup (no JWT)"},{"name":"Public - Marital Status","description":"Public marital status lookup"},{"name":"Public - Nationality","description":"Public nationality lookup"},{"name":"change status","description":"Status changes"},{"name":"Approval change status","description":"Approval-driven status"},{"name":"Helpers","description":"Misc helper endpoints"},{"name":"Preferences","description":"User preferences"},{"name":"Permissions","description":"Roles and page permissions"},{"name":"Super Admin","description":"Cross-tenant management (requires SUPERADMIN_EMAILS JWT)"}]}