{"openapi":"3.1.0","info":{"title":"TravelHub Lite API","description":"Corporate Travel Expenses and Per Diem Control System – MVP","version":"0.1.0"},"paths":{"/auth/login":{"post":{"tags":["Authentication"],"summary":"User login","description":"Authenticates with email and password. Returns access token (30 min) and refresh token (7 days). Logs the attempt in login_attempts (ISO 27001). Locks the account after 5 failed attempts.","operationId":"auth_login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/refresh":{"post":{"tags":["Authentication"],"summary":"Refresh access token","description":"Uses the refresh token to obtain a new access token. The used refresh token is invalidated (rotation). A new refresh token is issued.","operationId":"auth_refresh_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"tags":["Authentication"],"summary":"Logout","description":"Invalidates the active refresh token. The access token expires naturally.","operationId":"auth_logout_auth_logout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Auth Logout Auth Logout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/forgot-password":{"post":{"tags":["Authentication"],"summary":"Request password reset","description":"Sends a password reset email if the email exists. Returns the same response regardless of email existence (anti-enumeration, ISO 27001). Token expires in 1 hour. Single-use. Previous active tokens are invalidated.","operationId":"auth_forgot_password_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password":{"post":{"tags":["Authentication"],"summary":"Reset password using token","description":"Resets the user password using a valid reset token. Token must be unused and not expired (1 hour validity). Records the new password hash in password_history (ISO 27001).","operationId":"auth_reset_password_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config/ui":{"get":{"tags":["Configuration"],"summary":"UI configuration","description":"Returns the active language and available languages. Public endpoint — no authentication required. Used by Web, iOS and Android on app startup.","operationId":"get_ui_config_config_ui_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Ui Config Config Ui Get"}}}}}}},"/users":{"get":{"tags":["Users"],"summary":"List users","description":"Returns paginated list of users for the authenticated admin's company.","operationId":"list_users_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by status: 1=active, 0=inactive","title":"Is Active"},"description":"Filter by status: 1=active, 0=inactive"},{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by role name: supervisor, admin, employee","title":"Role"},"description":"Filter by role name: supervisor, admin, employee"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Users"],"summary":"Create user","description":"Creates a new user with role assignments. Admin only.","operationId":"create_new_user_users_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me":{"get":{"tags":["Users"],"summary":"Get current user","description":"Returns the profile of the currently authenticated user.","operationId":"get_me_users_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/search":{"get":{"tags":["Users"],"summary":"Search users by name or email","description":"PR-002: on-behalf traveler lookup. Min 2 chars. Max 10 results.","operationId":"search_users_endpoint_users_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100,"title":"Q"}},{"name":"active","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active"}},{"name":"cost_center_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"}},{"name":"exclude_self","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Exclude Self"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}":{"get":{"tags":["Users"],"summary":"Get user by ID","description":"Returns a specific user. Admin only. Must belong to the same company.","operationId":"get_user_users__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Users"],"summary":"Update user","description":"Updates user fields. Only provided fields are modified. Admin only.","operationId":"update_existing_user_users__user_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Users"],"summary":"Deactivate user","description":"Soft delete — sets is_active=0. Admin only. Cannot deactivate yourself.","operationId":"deactivate_existing_user_users__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/roles":{"get":{"tags":["Roles"],"summary":"List roles","description":"Active roles that can be assigned to users of the admin's company. Admin only.","operationId":"list_roles_roles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RoleBasic"},"type":"array","title":"Response List Roles Roles Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/{user_id}/supervisor":{"post":{"tags":["Supervisors"],"summary":"Assign supervisor","description":"Assigns a supervisor to an employee. Closes the previous active assignment if one exists. Supervisor must have role 'supervisor' or 'admin'. Admin only.","operationId":"assign_user_supervisor_users__user_id__supervisor_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupervisorAssign"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupervisorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Supervisors"],"summary":"Get active supervisor","description":"Returns the currently active supervisor for a user. Admin only.","operationId":"get_user_supervisor_users__user_id__supervisor_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupervisorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Supervisors"],"summary":"Remove supervisor","description":"Closes the active supervisor assignment. Soft close — sets effective_to = today. Admin only.","operationId":"remove_user_supervisor_users__user_id__supervisor_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cost-centers":{"get":{"tags":["Cost Centers"],"summary":"List cost centers","description":"Returns paginated list of cost centers for the authenticated admin's company.","operationId":"list_cost_centers_cost_centers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by status: 1=active, 0=inactive","title":"Is Active"},"description":"Filter by status: 1=active, 0=inactive"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Cost Centers"],"summary":"Create cost center","description":"Creates a new cost center. Code is immutable after creation. Admin only.","operationId":"create_new_cost_center_cost_centers_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cost-centers/{cost_center_id}":{"get":{"tags":["Cost Centers"],"summary":"Get cost center by ID","description":"Returns a specific cost center. Admin only. Must belong to the same company.","operationId":"get_cost_center_cost_centers__cost_center_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cost_center_id","in":"path","required":true,"schema":{"type":"integer","title":"Cost Center Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Cost Centers"],"summary":"Update cost center","description":"Updates cost center fields. Code is immutable. Admin only.","operationId":"update_existing_cost_center_cost_centers__cost_center_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cost_center_id","in":"path","required":true,"schema":{"type":"integer","title":"Cost Center Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostCenterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Cost Centers"],"summary":"Deactivate cost center","description":"Soft delete — sets is_active=0. Fails if active users are assigned. Admin only.","operationId":"deactivate_existing_cost_center_cost_centers__cost_center_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cost_center_id","in":"path","required":true,"schema":{"type":"integer","title":"Cost Center Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cost-centers/{cost_center_id}/users/{user_id}":{"post":{"tags":["Cost Centers"],"summary":"Assign user to cost center","description":"Assigns a user to a cost center. Both must belong to the same company. Admin only.","operationId":"assign_user_cost_centers__cost_center_id__users__user_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cost_center_id","in":"path","required":true,"schema":{"type":"integer","title":"Cost Center Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/per-diem/policies":{"get":{"tags":["Per Diem"],"summary":"List per diem policies","description":"Per diem policies of the admin's company with their active rate count (inactive ones with include_inactive=true).","operationId":"list_per_diem_policies_per_diem_policies_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemPolicyResponse"},"title":"Response List Per Diem Policies Per Diem Policies Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Per Diem"],"summary":"Create per diem policy","description":"Creates a new per diem policy for a company. Admin only.","operationId":"create_per_diem_policy_per_diem_policies_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemPolicyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemPolicyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/per-diem/policies/{policy_id}":{"get":{"tags":["Per Diem"],"summary":"Get per diem policy","description":"Returns one per diem policy of the admin's company (active or not). Admin only.","operationId":"get_per_diem_policy_per_diem_policies__policy_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemPolicyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Per Diem"],"summary":"Update per diem policy","description":"Updates a per diem policy. Only provided fields are modified. Admin only.","operationId":"update_per_diem_policy_per_diem_policies__policy_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemPolicyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemPolicyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Per Diem"],"summary":"Deactivate per diem policy","description":"Soft delete – sets is_active=0. Admin only.","operationId":"deactivate_per_diem_policy_per_diem_policies__policy_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/per-diem/concepts":{"get":{"tags":["Per Diem"],"summary":"List per diem concepts","description":"Active per diem concepts of the user's company (all with include_inactive=true).","operationId":"list_per_diem_concepts_per_diem_concepts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemConceptResponse"},"title":"Response List Per Diem Concepts Per Diem Concepts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Per Diem"],"summary":"Create per diem concept","description":"Creates a new per diem concept (e.g. accommodation, meals). Admin only.","operationId":"create_per_diem_concept_per_diem_concepts_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemConceptCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemConceptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/per-diem/concepts/{concept_id}":{"put":{"tags":["Per Diem"],"summary":"Update per diem concept","description":"Updates a per diem concept. Only provided fields are modified. Admin only.","operationId":"update_per_diem_concept_per_diem_concepts__concept_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"concept_id","in":"path","required":true,"schema":{"type":"integer","title":"Concept Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemConceptUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemConceptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Per Diem"],"summary":"Deactivate per diem concept","description":"Soft delete – sets is_active=0. Admin only.","operationId":"deactivate_per_diem_concept_per_diem_concepts__concept_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"concept_id","in":"path","required":true,"schema":{"type":"integer","title":"Concept Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/per-diem/rates":{"get":{"tags":["Per Diem"],"summary":"List per diem rates","description":"Returns all active rates for a given policy. Admin only.","operationId":"list_per_diem_rates_per_diem_rates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"policy_id","in":"query","required":true,"schema":{"type":"integer","description":"ID of the per diem policy","title":"Policy Id"},"description":"ID of the per diem policy"},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","description":"Also return deactivated rates","default":false,"title":"Include Inactive"},"description":"Also return deactivated rates"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemRateResponse"},"title":"Response List Per Diem Rates Per Diem Rates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Per Diem"],"summary":"Create per diem rate","description":"Creates a new rate for a policy scope combination. Returns 409 if duplicate. Admin only.","operationId":"create_per_diem_rate_per_diem_rates_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/per-diem/rates/{rate_id}":{"put":{"tags":["Per Diem"],"summary":"Update per diem rate","description":"Updates amount, max_amount or validity of a rate. Admin only.","operationId":"update_per_diem_rate_per_diem_rates__rate_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rate_id","in":"path","required":true,"schema":{"type":"integer","title":"Rate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Per Diem"],"summary":"Deactivate per diem rate","description":"Soft delete – sets is_active=0. Admin only.","operationId":"deactivate_per_diem_rate_per_diem_rates__rate_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rate_id","in":"path","required":true,"schema":{"type":"integer","title":"Rate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/per-diem/rates/resolve":{"get":{"tags":["Per Diem"],"summary":"Resolve per diem rate","description":"Resolves per diem rate using 8-tier logic for frontend ItemForm. Returns rate with source and suggested flag.","operationId":"resolve_per_diem_rate_per_diem_rates_resolve_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"concept_id","in":"query","required":true,"schema":{"type":"integer","description":"ID of per diem concept","title":"Concept Id"},"description":"ID of per diem concept"},{"name":"employee_category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Ignored: the caller's own category is used","title":"Employee Category Id"},"description":"Ignored: the caller's own category is used"},{"name":"scope_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Scope type: national or international","title":"Scope Type"},"description":"Scope type: national or international"},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Reference date in YYYY-MM-DD format","title":"Date"},"description":"Reference date in YYYY-MM-DD format"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/budgets":{"get":{"tags":["Budgets"],"summary":"List budgets","description":"Returns paginated list of budgets for the admin's company.","operationId":"list_company_budgets_budgets_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by employee","title":"User Id"},"description":"Filter by employee"},{"name":"cost_center_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by cost center","title":"Cost Center Id"},"description":"Filter by cost center"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by status: 1=active, 0=inactive","title":"Is Active"},"description":"Filter by status: 1=active, 0=inactive"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active","upcoming","expired","inactive"],"type":"string"},{"type":"null"}],"description":"Period status: active (covers today), upcoming, expired, inactive (switched off)","title":"Status"},"description":"Period status: active (covers today), upcoming, expired, inactive (switched off)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Budgets"],"summary":"Create budget","description":"Creates a new budget for an employee or cost center. Admin only.","operationId":"create_new_budget_budgets_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/budgets/balance":{"get":{"tags":["Budgets"],"summary":"Get my balance","description":"Returns consolidated available balance for the authenticated employee.","operationId":"get_my_balance_budgets_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/budgets/balance/{user_id}":{"get":{"tags":["Budgets"],"summary":"Get employee balance","description":"Returns consolidated available balance for a specific employee. Admin only.","operationId":"get_user_balance_budgets_balance__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/budgets/{budget_id}":{"get":{"tags":["Budgets"],"summary":"Get budget by ID","description":"Returns a specific budget. Admin only.","operationId":"get_budget_budgets__budget_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"integer","title":"Budget Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Budgets"],"summary":"Update budget","description":"Updates budget fields. Only provided fields are modified. Admin only.","operationId":"update_existing_budget_budgets__budget_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"integer","title":"Budget Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Budgets"],"summary":"Deactivate budget","description":"Soft delete – sets is_active=0. Admin only.","operationId":"deactivate_budget_budgets__budget_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"integer","title":"Budget Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/employee-categories":{"get":{"tags":["Admin Config"],"summary":"List employee categories","description":"Returns the active employee categories for the admin's company (all with include_inactive=true).","operationId":"list_categories_admin_employee_categories_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeCategoryResponse"},"title":"Response List Categories Admin Employee Categories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Admin Config"],"summary":"Create employee category","description":"Creates a new employee category (e.g. Analyst, Manager, Director). Admin only.","operationId":"create_category_admin_employee_categories_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeCategoryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/employee-categories/{category_id}":{"get":{"tags":["Admin Config"],"summary":"Get employee category by ID","description":"Returns a specific employee category. Admin only.","operationId":"get_category_admin_employee_categories__category_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"integer","title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Admin Config"],"summary":"Update employee category","description":"Updates an employee category. Only provided fields are modified. Admin only.","operationId":"update_category_admin_employee_categories__category_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"integer","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeCategoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Admin Config"],"summary":"Deactivate employee category","description":"Soft delete – sets is_active=0. Admin only.","operationId":"deactivate_category_admin_employee_categories__category_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"integer","title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/currencies":{"get":{"tags":["Admin Config"],"summary":"List currencies","description":"Returns active currencies; include_inactive=true also returns inactive ones (admin CRUD screen).","operationId":"list_all_currencies_admin_currencies_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CurrencyResponse"},"title":"Response List All Currencies Admin Currencies Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Admin Config"],"summary":"Create currency","description":"Creates a new currency (ISO 4217 code). Returns 409 if code already exists. Admin only.","operationId":"create_new_currency_admin_currencies_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/currencies/{currency_id}":{"put":{"tags":["Admin Config"],"summary":"Update currency","description":"Updates currency fields. Admin only.","operationId":"update_existing_currency_admin_currencies__currency_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"currency_id","in":"path","required":true,"schema":{"type":"integer","title":"Currency Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/exchange-rates":{"get":{"tags":["Admin Config"],"summary":"List exchange rates","description":"Returns active exchange rates. Optionally filter by currency pair. Admin only.","operationId":"list_rates_admin_exchange_rates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_currency_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"From Currency Id"}},{"name":"to_currency_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"To Currency Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExchangeRateResponse"},"title":"Response List Rates Admin Exchange Rates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Admin Config"],"summary":"Create exchange rate","description":"Creates a new exchange rate for a currency pair and date. Returns 409 if duplicate. Admin only.","operationId":"create_rate_admin_exchange_rates_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeRateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeRateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests":{"get":{"tags":["Travel Requests"],"summary":"List travel requests","description":"Returns paginated list of travel requests. Admin sees all requests for the company. Supervisor filters by their team. Employee sees only their own requests. Cancelled/rejected hidden by default — use show_hidden=true to include them.","operationId":"list_requests_travel_requests_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"show_hidden","in":"query","required":false,"schema":{"type":"boolean","description":"Include cancelled/rejected records","default":false,"title":"Show Hidden"},"description":"Include cancelled/rejected records"},{"name":"request_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Request identifier, canonical form TR#1370. Also accepts TR-1370, TR 1370 or the bare id.","title":"Request Number"},"description":"Request identifier, canonical form TR#1370. Also accepts TR-1370, TR 1370 or the bare id."},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by departure_date >= date_from (YYYY-MM-DD)","title":"Date From"},"description":"Filter by departure_date >= date_from (YYYY-MM-DD)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by return_date <= date_to (YYYY-MM-DD)","title":"Date To"},"description":"Filter by return_date <= date_to (YYYY-MM-DD)"},{"name":"amount_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Filter by total_estimated >= amount_min","title":"Amount Min"},"description":"Filter by total_estimated >= amount_min"},{"name":"amount_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Filter by total_estimated <= amount_max","title":"Amount Max"},"description":"Filter by total_estimated <= amount_max"},{"name":"destination","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Partial match on destination name","title":"Destination"},"description":"Partial match on destination name"},{"name":"on_behalf","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"true = only on-behalf requests","title":"On Behalf"},"description":"true = only on-behalf requests"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"One or more statuses comma-separated: approved,submitted","title":"Status"},"description":"One or more statuses comma-separated: approved,submitted"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"1=active, 0=inactive","title":"Is Active"},"description":"1=active, 0=inactive"},{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Supervisor/Admin: filter by employee","title":"Employee Id"},"description":"Supervisor/Admin: filter by employee"},{"name":"cost_center_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Supervisor/Admin: filter by cost center","title":"Cost Center Id"},"description":"Supervisor/Admin: filter by cost center"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Travel Requests"],"summary":"Create travel request","description":"Creates a new travel request in draft status. Optionally includes travel items inline. Validates budget availability if budget_id is provided.","operationId":"create_request_travel_requests_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/parent-lookup":{"get":{"tags":["Travel Requests"],"summary":"Search candidate parent travel requests","description":"Returns up to 10 travel requests the current form may link as a parent. Scoped to the traveler's own trips in a linkable status. No monetary data. Declared BEFORE /{request_id} so the static path is not parsed as an id.","operationId":"lookup_parent_candidates_travel_requests_parent_lookup_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ticket number or destination fragment","title":"Q"},"description":"Ticket number or destination fragment"},{"name":"traveler_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Traveler id when requesting on behalf","title":"Traveler User Id"},"description":"Traveler id when requesting on behalf"},{"name":"exclude_request_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Exclude this request id (edit screen)","title":"Exclude Request Id"},"description":"Exclude this request id (edit screen)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}":{"get":{"tags":["Travel Requests"],"summary":"Get travel request by ID","description":"Returns a specific travel request with all items, advances and approvals.","operationId":"get_request_travel_requests__request_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Travel Requests"],"summary":"Update travel request","description":"Updates a travel request. Only draft requests can be modified.","operationId":"update_request_travel_requests__request_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/submit":{"post":{"tags":["Travel Requests"],"summary":"Submit travel request for approval","description":"Transitions status from draft → pending. Request must have at least one item.","operationId":"submit_request_travel_requests__request_id__submit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/cancel":{"post":{"tags":["Travel Requests"],"summary":"Cancel travel request","description":"Cancels a travel request in draft or pending status.","operationId":"cancel_request_travel_requests__request_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/items":{"post":{"tags":["Travel Requests"],"summary":"Add item to travel request","description":"Adds a travel item to a draft request. Recalculates total_estimated.","operationId":"add_item_travel_requests__request_id__items_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelItemCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/items/{item_id}":{"delete":{"tags":["Travel Requests"],"summary":"Remove item from travel request","description":"Soft-deletes a travel item. Only allowed on draft requests.","operationId":"remove_item_travel_requests__request_id__items__item_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/advances":{"get":{"tags":["Travel Requests"],"summary":"List advances for a travel request","description":"Returns all active advances for the given travel request.","operationId":"list_advances_travel_requests__request_id__advances_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAdvanceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Travel Requests"],"summary":"Create advance for travel request","description":"Creates a travel advance for a pending or approved request.","operationId":"create_advance_travel_requests__request_id__advances_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAdvanceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAdvanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/advances/{advance_id}":{"put":{"tags":["Travel Requests"],"summary":"Update travel advance","description":"Updates a pending travel advance.","operationId":"update_advance_travel_requests__request_id__advances__advance_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}},{"name":"advance_id","in":"path","required":true,"schema":{"type":"integer","title":"Advance Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAdvanceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAdvanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/approve":{"post":{"tags":["Approvals"],"summary":"Approve travel request","description":"Approves a pending travel request. Creates an Approval record, optionally reserves budget, and transitions status to 'approved'.","operationId":"approve_request_travel_requests__request_id__approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/reject":{"post":{"tags":["Approvals"],"summary":"Reject travel request","description":"Rejects a pending travel request. Creates an Approval record, releases any budget reservation, and transitions status to 'rejected'.","operationId":"reject_request_travel_requests__request_id__reject_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/approvals":{"get":{"tags":["Approvals"],"summary":"List approvals for a travel request","description":"Returns the full approval history for a given travel request.","operationId":"list_request_approvals_travel_requests__request_id__approvals_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/approval-workflows":{"get":{"tags":["Approvals"],"summary":"List approval workflows","description":"Returns all approval workflows for the company. Admin only.","operationId":"list_company_workflows_approval_workflows_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by is_active: 1=active, 0=inactive","default":1,"title":"Is Active"},"description":"Filter by is_active: 1=active, 0=inactive"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflowListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/approval-workflows/{workflow_id}":{"get":{"tags":["Approvals"],"summary":"Get approval workflow by ID","description":"Returns a specific approval workflow with its steps. Admin only.","operationId":"get_company_workflow_approval_workflows__workflow_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"integer","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-categories":{"get":{"tags":["Expenses"],"summary":"List expense categories","description":"Returns all active expense categories for the company. Any authenticated user; results are scoped to their own company.","operationId":"list_categories_expense_categories_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Expenses"],"summary":"Create expense category","description":"Creates a new expense category for the company. Admin only.","operationId":"create_category_expense_categories_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-categories/{category_id}":{"get":{"tags":["Expenses"],"summary":"Get expense category by ID","description":"Returns a single expense category. Admin only.","operationId":"get_category_expense_categories__category_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"integer","title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Expenses"],"summary":"Update expense category","description":"Updates an expense category. Admin only.","operationId":"update_category_expense_categories__category_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"integer","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Expenses"],"summary":"Deactivate expense category","description":"Soft-deletes an expense category. Cannot deactivate if active expense lines reference it. Admin only.","operationId":"deactivate_category_expense_categories__category_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"integer","title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports":{"get":{"tags":["Expenses"],"summary":"List expense reports","description":"Returns paginated list of expense reports. Admin sees all reports for the company. Employee sees only their own reports. Cancelled/rejected hidden by default — use show_hidden=true to include them.","operationId":"list_reports_expense_reports_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"show_hidden","in":"query","required":false,"schema":{"type":"boolean","description":"Include cancelled/rejected records","default":false,"title":"Show Hidden"},"description":"Include cancelled/rejected records"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"One or more statuses comma-separated: draft,submitted,approved","title":"Status"},"description":"One or more statuses comma-separated: draft,submitted,approved"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by created_at >= date_from (YYYY-MM-DD)","title":"Date From"},"description":"Filter by created_at >= date_from (YYYY-MM-DD)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by created_at <= date_to (YYYY-MM-DD)","title":"Date To"},"description":"Filter by created_at <= date_to (YYYY-MM-DD)"},{"name":"amount_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Filter by total_amount >= amount_min","title":"Amount Min"},"description":"Filter by total_amount >= amount_min"},{"name":"amount_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Filter by total_amount <= amount_max","title":"Amount Max"},"description":"Filter by total_amount <= amount_max"},{"name":"travel_request_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by linked travel request","title":"Travel Request Id"},"description":"Filter by linked travel request"},{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Admin only: filter by employee (ignored for other roles)","title":"Employee Id"},"description":"Admin only: filter by employee (ignored for other roles)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Expenses"],"summary":"Create expense report","description":"Creates a new expense report in draft status linked to an approved travel request. One report per travel request (1:1 enforced).","operationId":"create_report_expense_reports_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/export/xlsx":{"get":{"tags":["Expenses"],"summary":"Export declared expense lines as a Siigo purchase book xlsx","description":"Returns an .xlsx file matching the Siigo 'Libro oficial de compras' format (10 columns, company NIT in the header). Only includes lines from reports that have been declared (receipt_number assigned — draft reports are excluded). Admin or FO.","operationId":"export_purchase_book_expense_reports_export_xlsx_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter by expense_date >= date_from","title":"Date From"},"description":"Filter by expense_date >= date_from"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter by expense_date <= date_to","title":"Date To"},"description":"Filter by expense_date <= date_to"},{"name":"expense_report_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Limit to a single expense report","title":"Expense Report Id"},"description":"Limit to a single expense report"}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/direct":{"post":{"tags":["Expenses"],"summary":"Create a direct expense declaration (NOBUDGET-01)","description":"Only for companies with budget_flow_enabled = 0. Creates a light travel request (origin DIRECT_DECLARATION, status 'approved') and its draft expense report. With has_advance_allocation, allocated_amount is stored as the request's approved amount and the closure variance applies.","operationId":"create_direct_report_expense_reports_direct_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectDeclarationCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/expense-reports/direct/cost-centers":{"get":{"tags":["Expenses"],"summary":"Active cost centers for the direct declaration header (NOBUDGET-01)","description":"Any authenticated user of a company with budget_flow_enabled = 0. Returns id/code/name of the company's active cost centers; 403 when the flow is on.","operationId":"list_direct_cost_centers_expense_reports_direct_cost_centers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response List Direct Cost Centers Expense Reports Direct Cost Centers Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/expense-reports/team-spend":{"get":{"tags":["Expenses"],"summary":"Team spend for the current supervisor (NOBUDGET-01)","description":"Read-only. Expense reports of the users the caller currently supervises, scoped to the caller's company. date_from/date_to filter on the travel request departure date. Totals include declared reports only.","operationId":"get_team_spend_expense_reports_team_spend_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSpendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/{report_id}":{"get":{"tags":["Expenses"],"summary":"Get expense report by ID","description":"Returns a specific expense report with all lines. Admin sees any report. Employee sees only their own.","operationId":"get_report_expense_reports__report_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Expenses"],"summary":"Update expense report","description":"Updates notes or currency of a draft expense report.","operationId":"update_report_expense_reports__report_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/{report_id}/submit":{"post":{"tags":["Expenses"],"summary":"Submit expense report for approval","description":"Transitions status from draft → submitted. Requires at least one active expense line.","operationId":"submit_report_expense_reports__report_id__submit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/{report_id}/settlements":{"post":{"tags":["Expenses"],"summary":"Confirm the closure settlement for a draft expense report","description":"Confirms the pending SURPLUS_TO_COMPANY or REIMBURSEMENT_TO_EMPLOYEE settlement for a draft report whose declared total does not match the approved amount. settlement_type and amount are computed server-side from the live variance, never taken from the request body. Unblocks the next call to /submit.","operationId":"create_settlement_expense_reports__report_id__settlements_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportSettlementCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportSettlementResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/{report_id}/liquidate":{"post":{"tags":["Expenses"],"summary":"Liquidate expense report","operationId":"liquidate_expense_report_endpoint_expense_reports__report_id__liquidate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/{report_id}/cancel":{"post":{"tags":["Expenses"],"summary":"Cancel expense report","description":"Cancels a draft, submitted or rejected expense report.","operationId":"cancel_report_expense_reports__report_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/{report_id}/lines":{"post":{"tags":["Expenses"],"summary":"Add expense line to report","description":"Adds an expense line to a draft report. Validates category belongs to company and receipt_mode is allowed. Recalculates report total_amount.","operationId":"add_line_expense_reports__report_id__lines_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLineCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLineResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/{report_id}/lines/{line_id}":{"put":{"tags":["Expenses"],"summary":"Update expense line","description":"Updates an expense line in a draft report. Recalculates report total_amount.","operationId":"update_line_expense_reports__report_id__lines__line_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}},{"name":"line_id","in":"path","required":true,"schema":{"type":"integer","title":"Line Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLineUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLineResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Expenses"],"summary":"Remove expense line from report","description":"Soft-deletes an expense line from a draft report. Recalculates report total_amount.","operationId":"remove_line_expense_reports__report_id__lines__line_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}},{"name":"line_id","in":"path","required":true,"schema":{"type":"integer","title":"Line Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-category-types/":{"get":{"tags":["Expense Category Types"],"summary":"Get Expense Category Types","description":"Get active expense category types for a specific category and company.\nAny authenticated user can access their company's expense category types.","operationId":"get_expense_category_types_expense_category_types__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"query","required":false,"schema":{"type":"integer","description":"Filter by expense category ID","title":"Category Id"},"description":"Filter by expense category ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseCategoryTypeResponse"},"title":"Response Get Expense Category Types Expense Category Types  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-category-types/{type_id}":{"get":{"tags":["Expense Category Types"],"summary":"Get Expense Category Type","description":"Get a specific expense category type by ID.\nAny authenticated user can access their company's expense category types.","operationId":"get_expense_category_type_expense_category_types__type_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"type_id","in":"path","required":true,"schema":{"type":"integer","title":"Type Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCategoryTypeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/document-types/":{"get":{"tags":["Document Types"],"summary":"Get Document Types","description":"Get active document types for the current user's company.\nAny authenticated user can access their company's document types.","operationId":"get_document_types_document_types__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DocumentTypeResponse"},"type":"array","title":"Response Get Document Types Document Types  Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/receipts/upload":{"post":{"tags":["receipts"],"summary":"Upload Receipt Endpoint","description":"Upload a receipt image (base64) linked to an expense report/line.","operationId":"upload_receipt_endpoint_receipts_upload_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptUploadRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/receipts/{receipt_id}/file":{"get":{"tags":["receipts"],"summary":"Receipt image (owner, or admin / FO / supervisor of the company)","operationId":"receipt_file_endpoint_receipts__receipt_id__file_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"integer","title":"Receipt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/receipts/{receipt_id}":{"delete":{"tags":["receipts"],"summary":"Remove the receipt of an expense line (owner, draft report)","operationId":"delete_receipt_endpoint_receipts__receipt_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"integer","title":"Receipt Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["receipts"],"summary":"Get Receipt Endpoint","description":"Get receipt by ID (owner or admin).","operationId":"get_receipt_endpoint_receipts__receipt_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"integer","title":"Receipt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense-reports/{report_id}/receipts":{"get":{"tags":["receipts"],"summary":"List Receipts Endpoint","description":"List all receipts for an expense report.","operationId":"list_receipts_endpoint_expense_reports__report_id__receipts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"integer","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReceiptResponse"},"title":"Response List Receipts Endpoint Expense Reports  Report Id  Receipts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/calendar-links":{"get":{"tags":["calendar"],"summary":"Get calendar deep links for a travel request","description":"Returns deep links for Google Calendar, Outlook, Yahoo, and Apple Calendar. Accessible by the traveler, the on-behalf requester, or an admin.","operationId":"get_calendar_links_endpoint_travel_requests__request_id__calendar_links_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/travel-requests/{request_id}/calendar.ics":{"get":{"tags":["calendar"],"summary":"Download .ics calendar file for a travel request","description":"Returns a RFC 5545 compliant .ics file for import into any calendar app. Accessible by the traveler, the on-behalf requester, or an admin.","operationId":"get_calendar_ics_endpoint_travel_requests__request_id__calendar_ics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/destinations":{"get":{"tags":["Destinations"],"summary":"List destinations","description":"Returns paginated list of active destinations for the company. All authenticated roles. Supports search by name and filter by type.","operationId":"list_destinations_endpoint_destinations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Partial match on destination name","title":"Search"},"description":"Partial match on destination name"},{"name":"is_international","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"0=domestic, 1=international","title":"Is International"},"description":"0=domestic, 1=international"},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","description":"Also return deactivated destinations (admin only; ignored for other roles)","default":false,"title":"Include Inactive"},"description":"Also return deactivated destinations (admin only; ignored for other roles)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Destinations"],"summary":"Create destination","description":"Admin only. The type (domestic/international) is derived from the country.","operationId":"create_destination_endpoint_destinations_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/destinations/{destination_id}":{"put":{"tags":["Destinations"],"summary":"Update destination","description":"Admin only. Send is_active=1 to reactivate.","operationId":"update_destination_endpoint_destinations__destination_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"destination_id","in":"path","required":true,"schema":{"type":"integer","title":"Destination Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Destinations"],"summary":"Deactivate destination","description":"Soft delete (is_active=0). Admin only.","operationId":"deactivate_destination_endpoint_destinations__destination_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"destination_id","in":"path","required":true,"schema":{"type":"integer","title":"Destination Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Destinations"],"summary":"Get destination by ID","description":"Returns a single destination. All authenticated roles.","operationId":"get_destination_endpoint_destinations__destination_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"destination_id","in":"path","required":true,"schema":{"type":"integer","title":"Destination Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/standards":{"get":{"tags":["Accounting"],"summary":"List accounting standards","description":"Returns all active accounting standards (NIIC, NIF, IFRS, LOCAL).","operationId":"list_standards_accounting_standards_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AccountingStandardResponse"},"type":"array","title":"Response List Standards Accounting Standards Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/account-types":{"get":{"tags":["Accounting"],"summary":"List account types","description":"Returns all active account types (ACT, PAS, PAT, ING, GAS, COS).","operationId":"list_types_accounting_account_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AccountTypeResponse"},"type":"array","title":"Response List Types Accounting Account Types Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/chart-of-accounts":{"get":{"tags":["Accounting"],"summary":"List chart of accounts","description":"Returns paginated chart of accounts for the company. Admin only.","operationId":"list_accounts_accounting_chart_of_accounts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"standard_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by accounting standard","title":"Standard Id"},"description":"Filter by accounting standard"},{"name":"account_type_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by account type","title":"Account Type Id"},"description":"Filter by account type"},{"name":"parent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by parent account","title":"Parent Id"},"description":"Filter by parent account"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Accounting"],"summary":"Create account","description":"Creates a new account in the chart of accounts. Admin only.","operationId":"create_account_accounting_chart_of_accounts_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/chart-of-accounts/{account_id}":{"put":{"tags":["Accounting"],"summary":"Update account","description":"Updates an account in the chart of accounts. Admin only.","operationId":"update_account_accounting_chart_of_accounts__account_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/periods":{"get":{"tags":["Accounting"],"summary":"List accounting periods","description":"Returns paginated list of accounting periods. Admin only.","operationId":"list_periods_accounting_periods_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: open, closed, locked","title":"Status"},"description":"Filter by status: open, closed, locked"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingPeriodListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Accounting"],"summary":"Create accounting period","description":"Creates a new open accounting period. Admin only.","operationId":"create_period_accounting_periods_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingPeriodCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingPeriodResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/periods/{period_id}/close":{"post":{"tags":["Accounting"],"summary":"Close accounting period","description":"Closes an open accounting period. Immutable after closing. Admin only.","operationId":"close_period_accounting_periods__period_id__close_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"integer","title":"Period Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingPeriodResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/journal-entries":{"get":{"tags":["Accounting"],"summary":"List journal entries","description":"Returns paginated journal entries. Admin only.","operationId":"list_entries_accounting_journal_entries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by period","title":"Period Id"},"description":"Filter by period"},{"name":"reference_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by reference type","title":"Reference Type"},"description":"Filter by reference type"},{"name":"reference_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by reference ID","title":"Reference Id"},"description":"Filter by reference ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Accounting"],"summary":"Create journal entry","description":"Creates an immutable double-entry journal entry. Total debit must equal total credit. Period must be open. Admin only.","operationId":"create_entry_accounting_journal_entries_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/journal-entries/{entry_id}/reverse":{"post":{"tags":["Accounting"],"summary":"Reverse journal entry","description":"Creates a counter-entry (reversal). Journal entries are immutable — correction via counter-entry only. Admin only.","operationId":"reverse_entry_accounting_journal_entries__entry_id__reverse_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/rules":{"get":{"tags":["Accounting"],"summary":"List accounting rules","description":"Returns all active accounting rules for the company. Admin only.","operationId":"list_rules_accounting_rules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingRuleListResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Accounting"],"summary":"Create accounting rule","description":"Creates a new accounting rule mapping an event to debit/credit accounts. Admin only.","operationId":"create_rule_accounting_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingRuleCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingRuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/rules/{rule_id}":{"put":{"tags":["Accounting"],"summary":"Update accounting rule","description":"Updates an accounting rule. Admin only.","operationId":"update_rule_accounting_rules__rule_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingRuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/accounts":{"get":{"tags":["Accounting parameters"],"summary":"Whole chart of accounts (active and inactive)","operationId":"list_accounts_accounting_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AccountOption"},"type":"array","title":"Response List Accounts Accounting Accounts Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Accounting parameters"],"summary":"Create an account; type and parent are derived from the code","operationId":"create_account_accounting_accounts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCreateIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOption"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/accounts/{account_id}":{"put":{"tags":["Accounting parameters"],"summary":"Rename, toggle posting or (de)activate an account","operationId":"update_account_accounting_accounts__account_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOption"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/accounts/import":{"post":{"tags":["Accounting parameters"],"summary":"Bulk load the chart of accounts from .xlsx/.csv (dry_run previews)","operationId":"import_accounts_accounting_accounts_import_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_accounts_accounting_accounts_import_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/accounts/load-base":{"post":{"tags":["Accounting parameters"],"summary":"Load the bundled base PUC (Colombia) — creates or updates, never deactivates","operationId":"load_base_chart_accounting_accounts_load_base_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Dry Run"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/third-parties":{"get":{"tags":["Accounting parameters"],"summary":"List third parties","operationId":"list_third_parties_accounting_third_parties_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":25,"title":"Page Size"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Q"}},{"name":"party_kind","in":"query","required":false,"schema":{"anyOf":[{"enum":["SUPPLIER","EMPLOYEE","OTHER"],"type":"string"},{"type":"null"}],"title":"Party Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Accounting parameters"],"summary":"Create a third party (NIT check digit computed)","operationId":"create_third_party_accounting_third_parties_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/third-parties/{party_id}":{"put":{"tags":["Accounting parameters"],"summary":"Update a third party","operationId":"update_third_party_accounting_third_parties__party_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"party_id","in":"path","required":true,"schema":{"type":"integer","title":"Party Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/taxes":{"get":{"tags":["Accounting parameters"],"summary":"List taxes","operationId":"list_taxes_accounting_taxes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TaxResponse"},"type":"array","title":"Response List Taxes Accounting Taxes Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Accounting parameters"],"summary":"Create a tax (IVA)","operationId":"create_tax_accounting_taxes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/taxes/{tax_id}":{"put":{"tags":["Accounting parameters"],"summary":"Update a tax","operationId":"update_tax_accounting_taxes__tax_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tax_id","in":"path","required":true,"schema":{"type":"integer","title":"Tax Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/account-mappings":{"get":{"tags":["Accounting parameters"],"summary":"Every expense category and per diem concept with its mapped account","operationId":"list_mappings_accounting_account_mappings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MappingSourceRow"},"type":"array","title":"Response List Mappings Accounting Account Mappings Get"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Accounting parameters"],"summary":"Create or change a mapping","operationId":"upsert_mapping_accounting_account_mappings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountMappingUpsert"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountMappingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/account-mappings/{mapping_id}":{"delete":{"tags":["Accounting parameters"],"summary":"Remove a mapping (falls back to the default expense account)","operationId":"remove_mapping_accounting_account_mappings__mapping_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mapping_id","in":"path","required":true,"schema":{"type":"integer","title":"Mapping Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/settings":{"get":{"tags":["Accounting parameters"],"summary":"Company accounting settings","operationId":"get_settings_accounting_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingSettingsResponse"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Accounting parameters"],"summary":"Update company accounting settings","operationId":"update_settings_accounting_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingSettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/periods/overview":{"get":{"tags":["Accounting parameters"],"summary":"Periods with entry counts","operationId":"list_periods_accounting_periods_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PeriodResponse"},"type":"array","title":"Response List Periods Accounting Periods Overview Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/periods/{period_id}/reopen":{"post":{"tags":["Accounting parameters"],"summary":"Reopen a closed period (reason required)","operationId":"reopen_period_accounting_periods__period_id__reopen_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"integer","title":"Period Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodReopen"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/entries":{"get":{"tags":["Accounting entries"],"summary":"Journal entries (server-paginated)","operationId":"list_entries_accounting_entries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":25,"title":"Page Size"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"enum":["TRAVEL_ADVANCE","EXPENSE_LEGALIZATION","DIRECT_DECLARATION","REVERSAL","MANUAL"],"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/entries/{entry_id}":{"get":{"tags":["Accounting entries"],"summary":"Journal entry with its lines","operationId":"get_entry_accounting_entries__entry_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/entries/{entry_id}/reverse":{"post":{"tags":["Accounting entries"],"summary":"Reverse an entry in the open period (reason required)","operationId":"reverse_accounting_entries__entry_id__reverse_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/pending":{"get":{"tags":["Accounting entries"],"summary":"Events waiting for their entry, with the reason","operationId":"list_pending_accounting_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/accounting/pending/{kind}/{ref_id}/post":{"post":{"tags":["Accounting entries"],"summary":"Post one pending event now","operationId":"post_pending_accounting_pending__kind___ref_id__post_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"enum":["advance","legalization","cancel"],"type":"string","title":"Kind"}},{"name":"ref_id","in":"path","required":true,"schema":{"type":"integer","title":"Ref Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/reports/journal":{"get":{"tags":["Accounting reports"],"summary":"Libro diario for a date range","operationId":"journal_accounting_reports_journal_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date From"}},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/reports/journal/xlsx":{"get":{"tags":["Accounting reports"],"summary":"Libro diario as .xlsx","operationId":"journal_xlsx_accounting_reports_journal_xlsx_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date From"}},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date To"}},{"name":"lang","in":"query","required":false,"schema":{"enum":["es","en","pt"],"type":"string","default":"es","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/reports/ledger":{"get":{"tags":["Accounting reports"],"summary":"Auxiliar by account / third party / cost center","operationId":"ledger_accounting_reports_ledger_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date From"}},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date To"}},{"name":"group_by","in":"query","required":false,"schema":{"enum":["account","third_party","cost_center"],"type":"string","default":"account","title":"Group By"}},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"}},{"name":"third_party_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Third Party Id"}},{"name":"cost_center_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/reports/ledger/xlsx":{"get":{"tags":["Accounting reports"],"summary":"Auxiliar as .xlsx","operationId":"ledger_xlsx_accounting_reports_ledger_xlsx_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date From"}},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date To"}},{"name":"group_by","in":"query","required":false,"schema":{"enum":["account","third_party","cost_center"],"type":"string","default":"account","title":"Group By"}},{"name":"lang","in":"query","required":false,"schema":{"enum":["es","en","pt"],"type":"string","default":"es","title":"Lang"}},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"}},{"name":"third_party_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Third Party Id"}},{"name":"cost_center_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/reports/purchase-book/xlsx":{"get":{"tags":["Accounting reports"],"summary":"Siigo 'Libro oficial de compras' of posted expense reports","operationId":"purchase_book_accounting_reports_purchase_book_xlsx_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date From"}},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/entries/{entry_id}/trace":{"get":{"tags":["Accounting audit"],"summary":"Entry -> source documents, approvals, receipts and audit timeline","operationId":"trace_accounting_entries__entry_id__trace_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/by-source":{"get":{"tags":["Accounting audit"],"summary":"Entries generated by a travel request or an expense report","operationId":"entries_by_source_accounting_by_source_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reference_type","in":"query","required":true,"schema":{"type":"string","pattern":"^(travel_request|expense_report)$","title":"Reference Type"}},{"name":"reference_id","in":"query","required":true,"schema":{"type":"integer","title":"Reference Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/receipts/{receipt_id}/file":{"get":{"tags":["Accounting audit"],"summary":"Download the support (receipt image / PDF) of an expense line","operationId":"receipt_file_accounting_receipts__receipt_id__file_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"integer","title":"Receipt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/audit-log":{"get":{"tags":["Accounting audit"],"summary":"Changes to accounting parameters and entries","operationId":"audit_log_accounting_audit_log_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":10,"default":25,"title":"Page Size"}},{"name":"table","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Table"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Action"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/integrity":{"get":{"tags":["Accounting audit"],"summary":"Read-only integrity checks over the books","operationId":"integrity_accounting_integrity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/users/{user_id}/emergency-contacts":{"get":{"tags":["User Profile"],"summary":"List emergency contacts","description":"Returns all active emergency contacts for a user.","operationId":"list_contacts_users__user_id__emergency_contacts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserEmergencyContactResponse"},"title":"Response List Contacts Users  User Id  Emergency Contacts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["User Profile"],"summary":"Create emergency contact","description":"Creates a new emergency contact for a user.","operationId":"create_contact_users__user_id__emergency_contacts_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmergencyContactCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmergencyContactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/emergency-contacts/{contact_id}":{"put":{"tags":["User Profile"],"summary":"Update emergency contact","description":"Updates an emergency contact.","operationId":"update_contact_users__user_id__emergency_contacts__contact_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"integer","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmergencyContactUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmergencyContactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["User Profile"],"summary":"Delete emergency contact","description":"Soft-deletes an emergency contact.","operationId":"delete_contact_users__user_id__emergency_contacts__contact_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"integer","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/insurance-policies":{"get":{"tags":["User Profile"],"summary":"List insurance policies","description":"Returns all active insurance policies for a user.","operationId":"list_policies_users__user_id__insurance_policies_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserInsurancePolicyResponse"},"title":"Response List Policies Users  User Id  Insurance Policies Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["User Profile"],"summary":"Create insurance policy","description":"Creates a new insurance policy for a user.","operationId":"create_policy_users__user_id__insurance_policies_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInsurancePolicyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInsurancePolicyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/insurance-policies/{policy_id}":{"put":{"tags":["User Profile"],"summary":"Update insurance policy","description":"Updates an insurance policy.","operationId":"update_policy_users__user_id__insurance_policies__policy_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInsurancePolicyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInsurancePolicyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["User Profile"],"summary":"Delete insurance policy","description":"Soft-deletes an insurance policy.","operationId":"delete_policy_users__user_id__insurance_policies__policy_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/insurance-policies/{policy_id}/beneficiaries":{"get":{"tags":["User Profile"],"summary":"List beneficiaries","description":"Returns all active beneficiaries for an insurance policy.","operationId":"list_policy_beneficiaries_users__user_id__insurance_policies__policy_id__beneficiaries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["User Profile"],"summary":"Create beneficiary","description":"Adds a beneficiary to an insurance policy.","operationId":"create_policy_beneficiary_users__user_id__insurance_policies__policy_id__beneficiaries_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInsuranceBeneficiaryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/insurance-policies/{policy_id}/beneficiaries/{beneficiary_id}":{"put":{"tags":["User Profile"],"summary":"Update beneficiary","description":"Updates a beneficiary.","operationId":"update_policy_beneficiary_users__user_id__insurance_policies__policy_id__beneficiaries__beneficiary_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}},{"name":"beneficiary_id","in":"path","required":true,"schema":{"type":"integer","title":"Beneficiary Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInsuranceBeneficiaryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["User Profile"],"summary":"Delete beneficiary","description":"Soft-deletes a beneficiary.","operationId":"delete_policy_beneficiary_users__user_id__insurance_policies__policy_id__beneficiaries__beneficiary_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"integer","title":"Policy Id"}},{"name":"beneficiary_id","in":"path","required":true,"schema":{"type":"integer","title":"Beneficiary Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/documents":{"get":{"tags":["User Profile"],"summary":"List employee documents","description":"Returns all active travel documents (passport, visa) for a user.","operationId":"list_documents_users__user_id__documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeDocumentResponse"},"title":"Response List Documents Users  User Id  Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["User Profile"],"summary":"Create employee document","description":"Creates a new travel document (passport, visa) for a user.","operationId":"create_document_users__user_id__documents_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDocumentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/documents/{document_id}":{"put":{"tags":["User Profile"],"summary":"Update employee document","description":"Updates a travel document.","operationId":"update_document_users__user_id__documents__document_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDocumentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["User Profile"],"summary":"Delete employee document","description":"Soft-deletes a travel document.","operationId":"delete_document_users__user_id__documents__document_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/notifications/dashboard-alerts":{"get":{"tags":["notifications"],"summary":"Get Dashboard Alerts","description":"Returns unresolved action-required notifications for the current user.\nUsed to populate the navbar badge and dashboard alert cards.","operationId":"get_dashboard_alerts_notifications_dashboard_alerts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/notifications/users/{user_id}/expiry-alerts":{"get":{"tags":["notifications"],"summary":"Get Expiry Alerts","description":"Real-time expiry badge for employee dashboard. No cron wait.","operationId":"get_expiry_alerts_notifications_users__user_id__expiry_alerts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/notifications/admin/expiry-alerts":{"get":{"tags":["notifications"],"summary":"Get Admin Expiry Alerts","description":"Consolidated expiry panel for admin: documents and insurance policies of the\ncompany's active users that are expired or due within 90 days, with whose they\nare and which one (number). Filters by type and urgency.","operationId":"get_admin_expiry_alerts_notifications_admin_expiry_alerts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"type":"string","title":"Entity Type"}},{"name":"color","in":"query","required":false,"schema":{"type":"string","title":"Color"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/travel-requests":{"get":{"tags":["Financial Officer"],"summary":"List the company's travel requests (read-only)","operationId":"list_requests_fo_travel_requests_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Page Size"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Requests Fo Travel Requests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/travel-requests/{request_id}":{"get":{"tags":["Financial Officer"],"summary":"Travel request detail with its expense report","operationId":"get_request_fo_travel_requests__request_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Request Fo Travel Requests  Request Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/expense-reports":{"get":{"tags":["Financial Officer"],"summary":"List the company's expense reports (read-only)","operationId":"list_reports_fo_expense_reports_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Page Size"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Reports Fo Expense Reports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/export/csv":{"post":{"tags":["Financial Officer"],"summary":"Export expense reports as CSV (UTF-8 BOM, max 10,000 rows)","operationId":"export_csv_fo_export_csv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/analytics":{"get":{"tags":["Financial Officer"],"summary":"Executive KPIs with filters, comparison period, breakdown and targets","operationId":"get_analytics_fo_analytics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period start (trip departure date)","title":"Date From"},"description":"Period start (trip departure date)"},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period end (trip departure date)","title":"Date To"},"description":"Period end (trip departure date)"},{"name":"compare","in":"query","required":false,"schema":{"enum":["previous_period","previous_year","none"],"type":"string","default":"previous_period","title":"Compare"}},{"name":"group_by","in":"query","required":false,"schema":{"enum":["cost_center","team","reason","destination","employee","category"],"type":"string","default":"cost_center","title":"Group By"}},{"name":"cost_center_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"title":"Cost Center Id"}},{"name":"travel_reason_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"title":"Travel Reason Id"}},{"name":"supervisor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"title":"Supervisor Id"}},{"name":"target_cost_per_trip","in":"query","required":false,"schema":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"},{"type":"null"}],"title":"Target Cost Per Trip"}},{"name":"approval_sla_hours","in":"query","required":false,"schema":{"type":"integer","maximum":720,"minimum":1,"default":48,"title":"Approval Sla Hours"}},{"name":"top_n","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":3,"default":5,"title":"Top N"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Analytics Fo Analytics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/analytics/export":{"get":{"tags":["Financial Officer"],"summary":"Download the executive analytics as CSV or PDF (same filters as the screen)","operationId":"export_analytics_fo_analytics_export_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"format","in":"query","required":false,"schema":{"enum":["csv","pdf"],"type":"string","default":"pdf","title":"Format"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","maxLength":10,"default":"es","title":"Lang"}},{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period start (trip departure date)","title":"Date From"},"description":"Period start (trip departure date)"},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period end (trip departure date)","title":"Date To"},"description":"Period end (trip departure date)"},{"name":"compare","in":"query","required":false,"schema":{"enum":["previous_period","previous_year","none"],"type":"string","default":"previous_period","title":"Compare"}},{"name":"group_by","in":"query","required":false,"schema":{"enum":["cost_center","team","reason","destination","employee","category"],"type":"string","default":"cost_center","title":"Group By"}},{"name":"cost_center_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"title":"Cost Center Id"}},{"name":"travel_reason_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"title":"Travel Reason Id"}},{"name":"supervisor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"title":"Supervisor Id"}},{"name":"target_cost_per_trip","in":"query","required":false,"schema":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"},{"type":"null"}],"title":"Target Cost Per Trip"}},{"name":"approval_sla_hours","in":"query","required":false,"schema":{"type":"integer","maximum":720,"minimum":1,"default":48,"title":"Approval Sla Hours"}},{"name":"top_n","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":3,"default":5,"title":"Top N"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/reports/travel-requests":{"get":{"tags":["FO Reports"],"summary":"FO — Travel requests report (paginated)","operationId":"list_travel_requests_report_fo_reports_travel_requests_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Per Page"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Travel Requests Report Fo Reports Travel Requests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/reports/travel-requests/export/xlsx":{"post":{"tags":["FO Reports"],"summary":"FO — Export travel requests as XLSX","operationId":"export_travel_requests_xlsx_fo_reports_travel_requests_export_xlsx_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/travel-requests/export/csv":{"post":{"tags":["FO Reports"],"summary":"FO — Export travel requests as CSV","operationId":"export_travel_requests_csv_fo_reports_travel_requests_export_csv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/travel-requests/export/pdf":{"post":{"tags":["FO Reports"],"summary":"FO — Export travel requests as PDF","operationId":"export_travel_requests_pdf_fo_reports_travel_requests_export_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/expense-summary":{"get":{"tags":["FO Reports"],"summary":"FO — Expense summary by employee (paginated)","operationId":"list_expense_summary_report_fo_reports_expense_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Per Page"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Expense Summary Report Fo Reports Expense Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/reports/expense-summary/export/xlsx":{"post":{"tags":["FO Reports"],"summary":"FO — Export expense summary as XLSX","operationId":"export_expense_summary_xlsx_fo_reports_expense_summary_export_xlsx_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/expense-summary/export/csv":{"post":{"tags":["FO Reports"],"summary":"FO — Export expense summary as CSV","operationId":"export_expense_summary_csv_fo_reports_expense_summary_export_csv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/expense-summary/export/pdf":{"post":{"tags":["FO Reports"],"summary":"FO — Export expense summary as PDF","operationId":"export_expense_summary_pdf_fo_reports_expense_summary_export_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-purpose":{"get":{"tags":["FO Reports"],"summary":"FO — Requests grouped by travel reason (paginated)","operationId":"list_by_purpose_fo_reports_by_purpose_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Per Page"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List By Purpose Fo Reports By Purpose Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/reports/by-purpose/export/xlsx":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-purpose as XLSX","operationId":"export_by_purpose_xlsx_fo_reports_by_purpose_export_xlsx_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurposeExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-purpose/export/csv":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-purpose as CSV","operationId":"export_by_purpose_csv_fo_reports_by_purpose_export_csv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurposeExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-purpose/export/pdf":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-purpose as PDF","operationId":"export_by_purpose_pdf_fo_reports_by_purpose_export_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurposeExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-destination":{"get":{"tags":["FO Reports"],"summary":"FO — Requests grouped by destination (paginated)","operationId":"list_by_destination_fo_reports_by_destination_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Per Page"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List By Destination Fo Reports By Destination Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/reports/by-destination/export/xlsx":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-destination as XLSX","operationId":"export_by_destination_xlsx_fo_reports_by_destination_export_xlsx_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurposeExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-destination/export/csv":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-destination as CSV","operationId":"export_by_destination_csv_fo_reports_by_destination_export_csv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurposeExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-destination/export/pdf":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-destination as PDF","operationId":"export_by_destination_pdf_fo_reports_by_destination_export_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurposeExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-amount":{"get":{"tags":["FO Reports"],"summary":"FO — Requests ordered by amount desc (paginated)","operationId":"list_by_amount_fo_reports_by_amount_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Per Page"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}},{"name":"amount_min","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Min"}},{"name":"amount_max","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Max"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List By Amount Fo Reports By Amount Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fo/reports/by-amount/export/xlsx":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-amount as XLSX","operationId":"export_by_amount_xlsx_fo_reports_by_amount_export_xlsx_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmountExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-amount/export/csv":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-amount as CSV","operationId":"export_by_amount_csv_fo_reports_by_amount_export_csv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmountExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/fo/reports/by-amount/export/pdf":{"post":{"tags":["FO Reports"],"summary":"FO — Export by-amount as PDF","operationId":"export_by_amount_pdf_fo_reports_by_amount_export_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmountExportFilters"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/{employee_id}/supervisor":{"put":{"tags":["supervisor-reassignment"],"summary":"Reassign Supervisor One","description":"1-to-1 supervisor reassignment. Admin only.","operationId":"reassign_supervisor_one_users__employee_id__supervisor_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"integer","title":"Employee Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupervisorReassignRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supervisors/{supervisor_id}/transfer-preview":{"get":{"tags":["supervisor-reassignment"],"summary":"Transfer Preview","description":"Dry run preview for bulk transfer. No DB writes. Admin only.","operationId":"transfer_preview_supervisors__supervisor_id__transfer_preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"supervisor_id","in":"path","required":true,"schema":{"type":"integer","title":"Supervisor Id"}},{"name":"target_supervisor_id","in":"query","required":true,"schema":{"type":"integer","title":"Target Supervisor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supervisors/{supervisor_id}/transfer-employees":{"put":{"tags":["supervisor-reassignment"],"summary":"Transfer Employees Bulk","description":"Bulk transfer all employees from supervisor A to supervisor B. Admin only.","operationId":"transfer_employees_bulk_supervisors__supervisor_id__transfer_employees_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"supervisor_id","in":"path","required":true,"schema":{"type":"integer","title":"Supervisor Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTransferRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{employee_id}/supervisor-history":{"get":{"tags":["supervisor-reassignment"],"summary":"Get History","description":"Full supervisor assignment history for ISO 27001 audit. Admin only.","operationId":"get_history_users__employee_id__supervisor_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"integer","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/geography/countries":{"get":{"tags":["Geography"],"summary":"Get Countries","description":"List all countries.\n\nRequires JWT authentication. Any authenticated user can list countries.\nReturns only active countries ordered by name ascending.","operationId":"get_countries_geography_countries_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CountryResponse"},"type":"array","title":"Response Get Countries Geography Countries Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/geography/cities":{"get":{"tags":["Geography"],"summary":"Get Cities","description":"List cities, optionally filtered by country.\n\nRequires JWT authentication. Any authenticated user can list cities.\nReturns only active cities ordered by name ascending.\nIf country_id is provided, filters cities by that country.","operationId":"get_cities_geography_cities_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"country_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter cities by country ID","title":"Country Id"},"description":"Filter cities by country ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CityResponse"},"title":"Response Get Cities Geography Cities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/settings":{"get":{"tags":["companies"],"summary":"Get company settings","description":"Returns company general settings. Admin only.","operationId":"get_company_settings_endpoint_companies__company_id__settings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanySettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["companies"],"summary":"Update company settings","description":"Updates company general settings. Admin only. Partial update supported.","operationId":"update_company_settings_endpoint_companies__company_id__settings_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanySettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanySettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/super-admin/auth/login":{"post":{"tags":["super-admin"],"summary":"Super-Admin login","description":"Authenticates with email and password. Email must end with @viatimate.com. Returns access token (2 hours). Locks account after 5 failed attempts.","operationId":"super_admin_login_super_admin_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Credentials"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Super Admin Login Super Admin Auth Login Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/super-admin/auth/logout":{"post":{"tags":["super-admin"],"summary":"Super-Admin logout","description":"Revokes the current session.","operationId":"super_admin_logout_super_admin_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Super Admin Logout Super Admin Auth Logout Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/super-admin/auth/me":{"get":{"tags":["super-admin"],"summary":"Get current Super-Admin","description":"Returns the authenticated super-admin user info.","operationId":"get_super_admin_me_super_admin_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Super Admin Me Super Admin Auth Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/super-admin/auth/change-password":{"post":{"tags":["super-admin"],"summary":"Change Super-Admin password","description":"Updates the password for the authenticated super-admin.","operationId":"change_super_admin_password_super_admin_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Change Super Admin Password Super Admin Auth Change Password Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/super-admin/companies":{"get":{"tags":["super-admin"],"summary":"List companies","description":"Lists every tenant company with its budget-flow mode (NOBUDGET-01).","operationId":"list_companies_super_admin_companies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Companies Super Admin Companies Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["super-admin"],"summary":"Create company","description":"Stub endpoint. Company registration available in PR-015.","operationId":"create_company_super_admin_companies_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/super-admin/companies/{company_id}/budget-flow":{"patch":{"tags":["super-admin"],"summary":"Switch a company's budget flow on or off","description":"NOBUDGET-01. OFF = expense-declaration-only mode. Switching OFF is refused (409 BUDGET_FLOW_HAS_OPEN_REQUESTS) while full-flow requests are pending approval or approved without a declaration. Audited in super_admin_audit_log.","operationId":"update_company_budget_flow_super_admin_companies__company_id__budget_flow_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetFlowUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Update Company Budget Flow Super Admin Companies  Company Id  Budget Flow Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/super-admin/metrics":{"get":{"tags":["super-admin"],"summary":"Get platform metrics","description":"Platform-wide counts: companies by mode, users, and activity in the last 30 days.","operationId":"get_metrics_super_admin_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Metrics Super Admin Metrics Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/super-admin/audit":{"get":{"tags":["super-admin"],"summary":"Get audit log entries","description":"Returns paginated audit log entries for super-admin actions.","operationId":"get_audit_log_super_admin_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Audit Log Super Admin Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/travel-reasons":{"get":{"tags":["Travel Reasons"],"summary":"List travel reasons","description":"Returns list of travel reasons for the company. All authenticated roles.","operationId":"list_travel_reasons_endpoint_admin_travel_reasons_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by is_active status (0=inactive, 1=active)","title":"Is Active"},"description":"Filter by is_active status (0=inactive, 1=active)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Travel Reasons"],"summary":"Create travel reason","description":"Create a new travel reason. Admin only.","operationId":"create_travel_reason_endpoint_admin_travel_reasons_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelReasonCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/travel-reasons/{reason_id}":{"get":{"tags":["Travel Reasons"],"summary":"Get travel reason by ID","description":"Returns a single travel reason. All authenticated roles.","operationId":"get_travel_reason_endpoint_admin_travel_reasons__reason_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reason_id","in":"path","required":true,"schema":{"type":"integer","title":"Reason Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Travel Reasons"],"summary":"Update travel reason","description":"Update an existing travel reason. Admin only.","operationId":"update_travel_reason_endpoint_admin_travel_reasons__reason_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reason_id","in":"path","required":true,"schema":{"type":"integer","title":"Reason Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelReasonUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Travel Reasons"],"summary":"Soft delete travel reason","description":"Soft delete a travel reason (set is_active=0). Admin only.","operationId":"soft_delete_travel_reason_endpoint_admin_travel_reasons__reason_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reason_id","in":"path","required":true,"schema":{"type":"integer","title":"Reason Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["System"],"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"tags":["System"],"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AccountCreateIn":{"properties":{"code":{"type":"string","maxLength":20,"minLength":1,"title":"Code"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"}},"type":"object","required":["code","name"],"title":"AccountCreateIn"},"AccountMappingResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"expense_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Category Id"},"per_diem_concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Concept Id"},"account_id":{"type":"integer","title":"Account Id"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","company_id","account_id","is_active"],"title":"AccountMappingResponse"},"AccountMappingUpsert":{"properties":{"expense_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Category Id"},"per_diem_concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Concept Id"},"account_id":{"type":"integer","title":"Account Id"}},"type":"object","required":["account_id"],"title":"AccountMappingUpsert"},"AccountOption":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"},"account_type_id":{"type":"integer","title":"Account Type Id"},"allows_transactions":{"type":"integer","title":"Allows Transactions"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","code","name","account_type_id","allows_transactions","is_active"],"title":"AccountOption"},"AccountTypeResponse":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"nature":{"type":"string","title":"Nature"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","code","name","nature","is_active"],"title":"AccountTypeResponse"},"AccountUpdateIn":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"allows_transactions":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Allows Transactions"},"is_active":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"AccountUpdateIn"},"AccountingPeriodCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"}},"type":"object","required":["name","start_date","end_date"],"title":"AccountingPeriodCreate"},"AccountingPeriodListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccountingPeriodResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"AccountingPeriodListResponse"},"AccountingPeriodResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"status":{"type":"string","title":"Status"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At"},"closed_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Closed By Id"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","company_id","name","start_date","end_date","status","is_active"],"title":"AccountingPeriodResponse"},"AccountingRuleCreate":{"properties":{"standard_id":{"type":"integer","title":"Standard Id"},"event_type":{"type":"string","maxLength":100,"minLength":1,"title":"Event Type"},"debit_account_id":{"type":"integer","title":"Debit Account Id"},"credit_account_id":{"type":"integer","title":"Credit Account Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["standard_id","event_type","debit_account_id","credit_account_id"],"title":"AccountingRuleCreate"},"AccountingRuleListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccountingRuleResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"AccountingRuleListResponse"},"AccountingRuleResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"standard_id":{"type":"integer","title":"Standard Id"},"event_type":{"type":"string","title":"Event Type"},"debit_account_id":{"type":"integer","title":"Debit Account Id"},"credit_account_id":{"type":"integer","title":"Credit Account Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","company_id","standard_id","event_type","debit_account_id","credit_account_id","is_active"],"title":"AccountingRuleResponse"},"AccountingRuleUpdate":{"properties":{"debit_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Debit Account Id"},"credit_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credit Account Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"AccountingRuleUpdate"},"AccountingSettingsResponse":{"properties":{"company_id":{"type":"integer","title":"Company Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"advance_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Advance Account Id"},"employee_payable_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Payable Account Id"},"employee_receivable_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Receivable Account Id"},"default_expense_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Expense Account Id"},"default_tax_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Tax Id"},"fx_gain_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fx Gain Account Id"},"fx_loss_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fx Loss Account Id"}},"type":"object","required":["company_id"],"title":"AccountingSettingsResponse"},"AccountingSettingsUpdate":{"properties":{"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"advance_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Advance Account Id"},"employee_payable_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Payable Account Id"},"employee_receivable_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Receivable Account Id"},"default_expense_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Expense Account Id"},"default_tax_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Tax Id"},"fx_gain_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fx Gain Account Id"},"fx_loss_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fx Loss Account Id"}},"type":"object","title":"AccountingSettingsUpdate"},"AccountingStandardResponse":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","code","name","is_active"],"title":"AccountingStandardResponse"},"AmountExportFilters":{"properties":{"date_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"},"date_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"},"amount_min":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Min"},"amount_max":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Max"}},"type":"object","title":"AmountExportFilters"},"ApprovalActionRequest":{"properties":{"step_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Step Id"},"approved_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Approved Amount"},"comments":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Comments"}},"type":"object","title":"ApprovalActionRequest"},"ApprovalListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApprovalResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"ApprovalListResponse"},"ApprovalResponse":{"properties":{"id":{"type":"integer","title":"Id"},"travel_request_id":{"type":"integer","title":"Travel Request Id"},"step_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Step Id"},"step":{"anyOf":[{"$ref":"#/components/schemas/StepBasic"},{"type":"null"}]},"approver_id":{"type":"integer","title":"Approver Id"},"approver":{"anyOf":[{"$ref":"#/components/schemas/UserBasic"},{"type":"null"}]},"status":{"type":"string","title":"Status"},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments"},"acted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acted At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","travel_request_id","approver_id","status","comments","acted_at","created_at","updated_at"],"title":"ApprovalResponse"},"ApprovalWorkflowListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApprovalWorkflowResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"ApprovalWorkflowListResponse"},"ApprovalWorkflowResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","name","description","is_active","created_at","updated_at"],"title":"ApprovalWorkflowResponse"},"BalanceResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"company_id":{"type":"integer","title":"Company Id"},"total_allocated":{"type":"number","title":"Total Allocated"},"total_reserved":{"type":"number","title":"Total Reserved"},"total_used":{"type":"number","title":"Total Used"},"total_available":{"type":"number","title":"Total Available"},"currency_code":{"type":"string","title":"Currency Code"}},"type":"object","required":["user_id","company_id","total_allocated","total_reserved","total_used","total_available","currency_code"],"title":"BalanceResponse","description":"Summary of available funds for an employee."},"Body_import_accounts_accounting_accounts_import_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"mode":{"type":"string","enum":["upsert","replace"],"title":"Mode","default":"upsert"},"dry_run":{"type":"boolean","title":"Dry Run","default":true}},"type":"object","required":["file"],"title":"Body_import_accounts_accounting_accounts_import_post"},"BudgetBasic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"total_amount":{"type":"string","title":"Total Amount"}},"type":"object","required":["id","name","total_amount"],"title":"BudgetBasic"},"BudgetCreate":{"properties":{"company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Company Id"},"name":{"type":"string","maxLength":255,"title":"Name"},"amount":{"type":"number","title":"Amount"},"currency_id":{"type":"integer","title":"Currency Id"},"period_start":{"type":"string","format":"date","title":"Period Start"},"period_end":{"type":"string","format":"date","title":"Period End"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"cost_center_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"},"amount_base_currency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Base Currency"},"exchange_rate_used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exchange Rate Used"}},"type":"object","required":["name","amount","currency_id","period_start","period_end"],"title":"BudgetCreate","example":{"amount":5000.0,"company_id":1,"currency_id":1,"name":"Q1 2026 – Sales Team","period_end":"2026-03-31","period_start":"2026-01-01","user_id":7}},"BudgetFlowUpdate":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"BudgetFlowUpdate"},"BudgetListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BudgetResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","per_page","pages"],"title":"BudgetListResponse"},"BudgetResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"amount":{"type":"number","title":"Amount"},"reserved_amount":{"type":"number","title":"Reserved Amount"},"used_amount":{"type":"number","title":"Used Amount"},"available_amount":{"type":"number","title":"Available Amount"},"amount_base_currency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Base Currency"},"exchange_rate_used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exchange Rate Used"},"currency_id":{"type":"integer","title":"Currency Id"},"period_start":{"type":"string","format":"date","title":"Period Start"},"period_end":{"type":"string","format":"date","title":"Period End"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"cost_center_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyBasic"},{"type":"null"}]}},"type":"object","required":["id","company_id","name","amount","reserved_amount","used_amount","available_amount","currency_id","period_start","period_end","is_active","created_at","updated_at"],"title":"BudgetResponse"},"BudgetUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End"},"is_active":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"BudgetUpdate"},"BulkTransferRequest":{"properties":{"target_supervisor_id":{"type":"integer","title":"Target Supervisor Id"},"transfer_pending_approvals":{"type":"boolean","title":"Transfer Pending Approvals","default":false}},"type":"object","required":["target_supervisor_id"],"title":"BulkTransferRequest"},"ChartImportError":{"properties":{"row":{"type":"integer","title":"Row"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["row","reason"],"title":"ChartImportError"},"ChartImportResult":{"properties":{"dry_run":{"type":"boolean","title":"Dry Run"},"mode":{"type":"string","title":"Mode"},"total_rows":{"type":"integer","title":"Total Rows"},"created":{"type":"integer","title":"Created"},"updated":{"type":"integer","title":"Updated"},"deactivated":{"type":"integer","title":"Deactivated"},"unchanged":{"type":"integer","title":"Unchanged"},"errors":{"items":{"$ref":"#/components/schemas/ChartImportError"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["dry_run","mode","total_rows","created","updated","deactivated","unchanged"],"title":"ChartImportResult"},"ChartOfAccountCreate":{"properties":{"standard_id":{"type":"integer","title":"Standard Id"},"account_type_id":{"type":"integer","title":"Account Type Id"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"},"code":{"type":"string","maxLength":50,"minLength":1,"title":"Code"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"allows_transactions":{"type":"integer","title":"Allows Transactions","default":1}},"type":"object","required":["standard_id","account_type_id","code","name"],"title":"ChartOfAccountCreate"},"ChartOfAccountListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ChartOfAccountResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"ChartOfAccountListResponse"},"ChartOfAccountResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"standard_id":{"type":"integer","title":"Standard Id"},"account_type_id":{"type":"integer","title":"Account Type Id"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"allows_transactions":{"type":"integer","title":"Allows Transactions"},"is_active":{"type":"integer","title":"Is Active"},"standard":{"anyOf":[{"$ref":"#/components/schemas/AccountingStandardResponse"},{"type":"null"}]},"account_type":{"anyOf":[{"$ref":"#/components/schemas/AccountTypeResponse"},{"type":"null"}]}},"type":"object","required":["id","company_id","standard_id","account_type_id","code","name","allows_transactions","is_active"],"title":"ChartOfAccountResponse"},"ChartOfAccountUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"allows_transactions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Allows Transactions"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"ChartOfAccountUpdate"},"CityResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"country_id":{"type":"integer","title":"Country Id"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","country_id","is_active","created_at","updated_at"],"title":"CityResponse","description":"City response schema for API endpoints"},"CompanyBasic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"base_currency_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Currency Id"},"base_currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Currency Code"},"budget_flow_enabled":{"type":"boolean","title":"Budget Flow Enabled","default":true}},"type":"object","required":["id","name"],"title":"CompanyBasic","description":"Summarized company for embedding in user responses."},"CompanySettingsResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"legal_name":{"type":"string","title":"Legal Name"},"tax_id":{"type":"string","title":"Tax Id"},"legal_entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Entity Type"},"tax_id_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id Type"},"tax_regime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Regime"},"fiscal_year_start_month":{"type":"integer","title":"Fiscal Year Start Month"},"country_code":{"type":"string","title":"Country Code"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state_province":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Province"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"company_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Email"},"billing_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Email"},"accounting_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounting Email"},"accounting_email_cc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounting Email Cc"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"default_locale":{"type":"string","title":"Default Locale"},"timezone":{"type":"string","title":"Timezone"},"legal_representative_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Representative Name"},"legal_representative_tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Representative Tax Id"},"industry_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry Code"},"data_retention_months":{"type":"integer","title":"Data Retention Months"},"compliance_tier":{"type":"string","title":"Compliance Tier"},"is_public_entity":{"type":"integer","title":"Is Public Entity"},"is_active":{"type":"integer","title":"Is Active"},"base_currency_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Currency Id"},"notifications_enabled":{"type":"integer","title":"Notifications Enabled","default":1},"alert_days_doc_first":{"type":"integer","title":"Alert Days Doc First","default":90},"alert_days_doc_second":{"type":"integer","title":"Alert Days Doc Second","default":30},"alert_days_policy_first":{"type":"integer","title":"Alert Days Policy First","default":60},"alert_days_policy_second":{"type":"integer","title":"Alert Days Policy Second","default":15},"budget_flow_enabled":{"type":"integer","title":"Budget Flow Enabled","default":1}},"type":"object","required":["id","name","legal_name","tax_id","fiscal_year_start_month","country_code","default_locale","timezone","data_retention_months","compliance_tier","is_public_entity","is_active"],"title":"CompanySettingsResponse","description":"Full company settings response including all editable and identity fields."},"CompanySettingsUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"legal_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Legal Name"},"legal_entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Entity Type"},"tax_id_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id Type"},"tax_regime":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Tax Regime"},"fiscal_year_start_month":{"anyOf":[{"type":"integer","maximum":12.0,"minimum":1.0},{"type":"null"}],"title":"Fiscal Year Start Month"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Address"},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"City"},"state_province":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"State Province"},"postal_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Postal Code"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"company_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company Email"},"billing_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Billing Email"},"accounting_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Accounting Email"},"accounting_email_cc":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Accounting Email Cc"},"website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Website"},"logo_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Logo Url"},"default_locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Locale"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"legal_representative_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Legal Representative Name"},"legal_representative_tax_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Legal Representative Tax Id"},"industry_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Industry Code"},"data_retention_months":{"anyOf":[{"type":"integer","maximum":600.0,"minimum":1.0},{"type":"null"}],"title":"Data Retention Months"},"compliance_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compliance Tier"},"is_public_entity":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Is Public Entity"},"notifications_enabled":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Notifications Enabled"},"alert_days_doc_first":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Alert Days Doc First"},"alert_days_doc_second":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Alert Days Doc Second"},"alert_days_policy_first":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Alert Days Policy First"},"alert_days_policy_second":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Alert Days Policy Second"}},"type":"object","title":"CompanySettingsUpdate","description":"Partial update schema for company settings. All fields optional.\n\nBlank strings in optional fields mean \"clear this value\" (stored as NULL)."},"ConceptBasic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"requires_receipt":{"type":"integer","title":"Requires Receipt"}},"type":"object","required":["id","name","requires_receipt"],"title":"ConceptBasic"},"ConceptBasicTravel":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"requires_receipt":{"type":"boolean","title":"Requires Receipt"}},"type":"object","required":["id","name","requires_receipt"],"title":"ConceptBasicTravel"},"CostCenterCreate":{"properties":{"code":{"type":"string","maxLength":50,"title":"Code"},"name":{"type":"string","maxLength":255,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"}},"type":"object","required":["code","name"],"title":"CostCenterCreate","description":"Data for creating a cost center (POST /cost-centers).","example":{"code":"TECH-001","description":"Cost center for the technology area","name":"Technology and Innovation"}},"CostCenterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CostCenterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","per_page","pages"],"title":"CostCenterListResponse","description":"Paginated response for GET /cost-centers."},"CostCenterResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","code","name","is_active","created_at","updated_at"],"title":"CostCenterResponse","description":"Public representation of a cost center."},"CostCenterUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"},"is_active":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"CostCenterUpdate","description":"Updatable cost center fields.\nThe 'code' field is NOT updatable after creation."},"CountryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"code":{"type":"string","title":"Code"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","code","is_active","created_at","updated_at"],"title":"CountryResponse","description":"Country response schema for API endpoints"},"CurrencyBasic":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"type":"string","title":"Code"},"symbol":{"type":"string","title":"Symbol"}},"type":"object","required":["id","code","symbol"],"title":"CurrencyBasic"},"CurrencyBasicTravel":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","code","name"],"title":"CurrencyBasicTravel"},"CurrencyCreate":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"symbol":{"type":"string","title":"Symbol"},"decimal_places":{"type":"integer","title":"Decimal Places","default":2}},"type":"object","required":["code","name","symbol"],"title":"CurrencyCreate","example":{"code":"USD","decimal_places":2,"name":"US Dollar","symbol":"$"}},"CurrencyResponse":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"symbol":{"type":"string","title":"Symbol"},"decimal_places":{"type":"integer","title":"Decimal Places"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","code","name","symbol","decimal_places","is_active","created_at","updated_at"],"title":"CurrencyResponse"},"CurrencyUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"decimal_places":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Decimal Places"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"CurrencyUpdate"},"DestinationBasic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"country_id":{"type":"integer","title":"Country Id"}},"type":"object","required":["id","name","country_id"],"title":"DestinationBasic"},"DestinationCreate":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name"},"country_id":{"type":"integer","title":"Country Id"},"city_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"City Id"}},"type":"object","required":["name","country_id"],"title":"DestinationCreate"},"DestinationUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"country_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Country Id"},"city_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"City Id"},"is_active":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"DestinationUpdate"},"DirectDeclarationCreate":{"properties":{"travel_reason_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Travel Reason Id"},"destination_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Destination Id"},"departure_date":{"type":"string","format":"date","title":"Departure Date"},"return_date":{"type":"string","format":"date","title":"Return Date"},"cost_center_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Cost Center Id"},"currency_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Currency Id"},"has_advance_allocation":{"type":"boolean","title":"Has Advance Allocation","default":false},"allocated_amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"},{"type":"null"}],"title":"Allocated Amount"}},"type":"object","required":["travel_reason_id","destination_id","departure_date","return_date","currency_id"],"title":"DirectDeclarationCreate","description":"NOBUDGET-01: header of a direct expense declaration (no request flow).\n\nallocated_amount is required (> 0) when has_advance_allocation is true and\nmust be absent otherwise; it is persisted as travel_requests.total_approved\nso the existing closure variance applies unchanged."},"DocumentTypeResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"expirable":{"type":"integer","title":"Expirable"},"alert_days":{"type":"integer","title":"Alert Days"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","company_id","name","expirable","alert_days","is_active"],"title":"DocumentTypeResponse"},"EmployeeCategoryBasicTravel":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"EmployeeCategoryBasicTravel"},"EmployeeCategoryCreate":{"properties":{"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"level":{"type":"integer","title":"Level","default":1},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"per_diem_policy_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Policy Id"}},"type":"object","required":["company_id","name"],"title":"EmployeeCategoryCreate","example":{"company_id":1,"description":"C-level and director positions","level":3,"name":"Director"}},"EmployeeCategoryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"level":{"type":"integer","title":"Level"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"per_diem_policy_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Policy Id"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","name","level","is_active","created_at","updated_at"],"title":"EmployeeCategoryResponse"},"EmployeeCategoryUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"per_diem_policy_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Policy Id"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"EmployeeCategoryUpdate"},"EmployeeDocumentCreate":{"properties":{"document_type_id":{"type":"integer","title":"Document Type Id"},"document_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Document Number"},"issuing_country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Issuing Country"},"issuing_authority":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Issuing Authority"},"linked_passport_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Linked Passport Id"},"issue_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issue Date"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date"},"file_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"File Url"},"status":{"type":"string","title":"Status","default":"active"}},"type":"object","required":["document_type_id"],"title":"EmployeeDocumentCreate"},"EmployeeDocumentResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"document_type_id":{"type":"integer","title":"Document Type Id"},"document_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Number"},"issuing_country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuing Country"},"issuing_authority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuing Authority"},"linked_passport_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Linked Passport Id"},"issue_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issue Date"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date"},"file_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Url"},"status":{"type":"string","title":"Status"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"document_type":{"anyOf":[{"$ref":"#/components/schemas/DocumentTypeResponse"},{"type":"null"}]}},"type":"object","required":["id","user_id","document_type_id","status","is_active","created_at","updated_at"],"title":"EmployeeDocumentResponse"},"EmployeeDocumentUpdate":{"properties":{"document_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Document Type Id"},"document_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Document Number"},"issuing_country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Issuing Country"},"issuing_authority":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Issuing Authority"},"linked_passport_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Linked Passport Id"},"issue_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issue Date"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date"},"file_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"File Url"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"EmployeeDocumentUpdate"},"ExchangeRateCreate":{"properties":{"from_currency_id":{"type":"integer","title":"From Currency Id"},"to_currency_id":{"type":"integer","title":"To Currency Id"},"rate":{"type":"number","title":"Rate"},"rate_date":{"type":"string","format":"date","title":"Rate Date"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","required":["from_currency_id","to_currency_id","rate","rate_date"],"title":"ExchangeRateCreate","example":{"from_currency_id":2,"rate":0.00026,"rate_date":"2026-03-06","source":"Banco de la República","to_currency_id":1}},"ExchangeRateResponse":{"properties":{"id":{"type":"integer","title":"Id"},"from_currency_id":{"type":"integer","title":"From Currency Id"},"to_currency_id":{"type":"integer","title":"To Currency Id"},"rate":{"type":"number","title":"Rate"},"rate_date":{"type":"string","format":"date","title":"Rate Date"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","from_currency_id","to_currency_id","rate","rate_date","is_active","created_at","updated_at"],"title":"ExchangeRateResponse"},"ExpenseCategoryBasic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"type":"object","required":["id","name"],"title":"ExpenseCategoryBasic"},"ExpenseCategoryCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"per_diem_concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Concept Id"},"allowed_receipt_modes":{"type":"string","title":"Allowed Receipt Modes","description":"Comma-separated allowed receipt modes: none | ocr | generated","default":"none,ocr,generated"}},"type":"object","required":["name"],"title":"ExpenseCategoryCreate"},"ExpenseCategoryListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExpenseCategoryResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"pages":{"type":"integer","title":"Pages","default":1}},"type":"object","required":["items","total"],"title":"ExpenseCategoryListResponse"},"ExpenseCategoryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"per_diem_concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Concept Id"},"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"allowed_receipt_modes":{"type":"string","title":"Allowed Receipt Modes"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","name","allowed_receipt_modes","is_active","created_at","updated_at"],"title":"ExpenseCategoryResponse"},"ExpenseCategoryTypeResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"category_id":{"type":"integer","title":"Category Id"},"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"default_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Default Amount"},"requires_receipt":{"type":"integer","title":"Requires Receipt"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","company_id","category_id","name","requires_receipt","is_active"],"title":"ExpenseCategoryTypeResponse","description":"Expense category type response for API endpoints."},"ExpenseCategoryUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"per_diem_concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Concept Id"},"allowed_receipt_modes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allowed Receipt Modes"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"ExpenseCategoryUpdate"},"ExpenseLineBasic":{"properties":{"id":{"type":"integer","title":"Id"},"description":{"type":"string","title":"Description"},"amount":{"type":"number","title":"Amount"},"expense_date":{"type":"string","format":"date","title":"Expense Date"},"receipt_mode":{"type":"string","title":"Receipt Mode"},"receipt_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Receipt Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"vendor_id_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id Number"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"},"subtotal_taxable":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Subtotal Taxable"},"subtotal_exempt":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Subtotal Exempt"},"iva_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Iva Amount"}},"type":"object","required":["id","description","amount","expense_date","receipt_mode"],"title":"ExpenseLineBasic","description":"Minimal representation for nested use inside ExpenseReportResponse.\n\nCarries the 6 fiscal fields (not just id/description/amount) so the\nfrontend can prefill them when editing a previously-saved line —\notherwise editing would round-trip blank fiscal inputs back as null\nand silently wipe the data (S9.11-DECL-FISCAL-MIN-F1)."},"ExpenseLineCreate":{"properties":{"expense_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Category Id"},"per_diem_concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Concept Id"},"currency_id":{"type":"integer","title":"Currency Id"},"description":{"type":"string","maxLength":255,"minLength":1,"title":"Description"},"amount":{"type":"number","exclusiveMinimum":0.0,"title":"Amount"},"expense_date":{"type":"string","format":"date","title":"Expense Date"},"receipt_mode":{"type":"string","title":"Receipt Mode","default":"none"},"vendor_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Vendor Name"},"vendor_id_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Vendor Id Number"},"invoice_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Invoice Number"},"subtotal_taxable":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Subtotal Taxable"},"subtotal_exempt":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Subtotal Exempt"},"iva_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Iva Amount"}},"type":"object","required":["currency_id","description","amount","expense_date"],"title":"ExpenseLineCreate"},"ExpenseLineResponse":{"properties":{"id":{"type":"integer","title":"Id"},"expense_report_id":{"type":"integer","title":"Expense Report Id"},"expense_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Category Id"},"per_diem_concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Concept Id"},"currency_id":{"type":"integer","title":"Currency Id"},"description":{"type":"string","title":"Description"},"amount":{"type":"number","title":"Amount"},"amount_base_currency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Base Currency"},"exchange_rate_used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exchange Rate Used"},"expense_date":{"type":"string","format":"date","title":"Expense Date"},"receipt_mode":{"type":"string","title":"Receipt Mode"},"receipt_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Receipt Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"vendor_id_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id Number"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"},"subtotal_taxable":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Subtotal Taxable"},"subtotal_exempt":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Subtotal Exempt"},"iva_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Iva Amount"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"category":{"anyOf":[{"$ref":"#/components/schemas/ExpenseCategoryBasic"},{"type":"null"}]}},"type":"object","required":["id","expense_report_id","currency_id","description","amount","expense_date","receipt_mode","is_active","created_at","updated_at"],"title":"ExpenseLineResponse"},"ExpenseLineUpdate":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Description"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amount"},"expense_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expense Date"},"currency_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Currency Id"},"expense_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Category Id"},"per_diem_concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Diem Concept Id"},"receipt_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receipt Mode"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"vendor_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Vendor Name"},"vendor_id_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Vendor Id Number"},"invoice_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Invoice Number"},"subtotal_taxable":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Subtotal Taxable"},"subtotal_exempt":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Subtotal Exempt"},"iva_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Iva Amount"}},"type":"object","title":"ExpenseLineUpdate"},"ExpenseReportCreate":{"properties":{"travel_request_id":{"type":"integer","title":"Travel Request Id"},"currency_id":{"type":"integer","title":"Currency Id"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["travel_request_id","currency_id"],"title":"ExpenseReportCreate"},"ExpenseReportListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExpenseReportResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"pages":{"type":"integer","title":"Pages","default":1}},"type":"object","required":["items","total"],"title":"ExpenseReportListResponse"},"ExpenseReportResponse":{"properties":{"id":{"type":"integer","title":"Id"},"travel_request_id":{"type":"integer","title":"Travel Request Id"},"travel_request":{"anyOf":[{"$ref":"#/components/schemas/TravelRequestRef"},{"type":"null"}]},"user_id":{"type":"integer","title":"User Id"},"company_id":{"type":"integer","title":"Company Id"},"currency_id":{"type":"integer","title":"Currency Id"},"status":{"type":"string","title":"Status"},"total_amount":{"type":"number","title":"Total Amount"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"receipt_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receipt Number"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"liquidated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Liquidated At"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"lines":{"items":{"$ref":"#/components/schemas/ExpenseLineBasic"},"type":"array","title":"Lines","default":[]}},"type":"object","required":["id","travel_request_id","user_id","company_id","currency_id","status","total_amount","is_active","created_at","updated_at"],"title":"ExpenseReportResponse"},"ExpenseReportSettlementCreate":{"properties":{"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"ExpenseReportSettlementCreate"},"ExpenseReportSettlementResponse":{"properties":{"id":{"type":"integer","title":"Id"},"expense_report_id":{"type":"integer","title":"Expense Report Id"},"settlement_type":{"type":"string","title":"Settlement Type"},"amount":{"type":"number","title":"Amount"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_by":{"type":"integer","title":"Created By"},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","expense_report_id","settlement_type","amount","created_by","is_active","created_at","updated_at"],"title":"ExpenseReportSettlementResponse"},"ExpenseReportUpdate":{"properties":{"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"currency_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Currency Id"}},"type":"object","title":"ExpenseReportUpdate"},"ExportFilters":{"properties":{"date_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"},"date_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"ExportFilters"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest","description":"Request body for POST /auth/forgot-password.","example":{"email":"user@example.com"}},"ForgotPasswordResponse":{"properties":{"message":{"type":"string","title":"Message","default":"If the email exists, a reset link has been sent."}},"type":"object","title":"ForgotPasswordResponse","description":"Generic response for /auth/forgot-password.\nReturns same message regardless of whether email exists (anti-enumeration, ISO 27001)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JournalEntryCreate":{"properties":{"period_id":{"type":"integer","title":"Period Id"},"reference_type":{"type":"string","maxLength":50,"minLength":1,"title":"Reference Type"},"reference_id":{"type":"integer","title":"Reference Id"},"description":{"type":"string","minLength":1,"title":"Description"},"entry_date":{"type":"string","format":"date","title":"Entry Date"},"lines":{"items":{"$ref":"#/components/schemas/JournalLineCreate"},"type":"array","minItems":2,"title":"Lines"}},"type":"object","required":["period_id","reference_type","reference_id","description","entry_date","lines"],"title":"JournalEntryCreate"},"JournalEntryListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JournalEntryResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"JournalEntryListResponse"},"JournalEntryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"period_id":{"type":"integer","title":"Period Id"},"reference_type":{"type":"string","title":"Reference Type"},"reference_id":{"type":"integer","title":"Reference Id"},"entry_number":{"type":"string","title":"Entry Number"},"description":{"type":"string","title":"Description"},"entry_date":{"type":"string","format":"date","title":"Entry Date"},"is_reversal":{"type":"integer","title":"Is Reversal"},"reversed_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reversed By Id"},"total_debit":{"type":"string","title":"Total Debit"},"total_credit":{"type":"string","title":"Total Credit"},"external_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Ref"},"export_status":{"type":"string","title":"Export Status","default":"pending"},"exported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Exported At"},"exported_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exported To"},"created_by_id":{"type":"integer","title":"Created By Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"lines":{"items":{"$ref":"#/components/schemas/JournalLineResponse"},"type":"array","title":"Lines","default":[]}},"type":"object","required":["id","company_id","period_id","reference_type","reference_id","entry_number","description","entry_date","is_reversal","total_debit","total_credit","created_by_id","created_at"],"title":"JournalEntryResponse"},"JournalLineCreate":{"properties":{"account_id":{"type":"integer","title":"Account Id"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"debit_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"}],"title":"Debit Amount","default":"0.00"},"credit_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"}],"title":"Credit Amount","default":"0.00"},"currency_id":{"type":"integer","title":"Currency Id"},"exchange_rate":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"}],"title":"Exchange Rate","default":"1.000000"}},"type":"object","required":["account_id","currency_id"],"title":"JournalLineCreate"},"JournalLineResponse":{"properties":{"id":{"type":"integer","title":"Id"},"journal_entry_id":{"type":"integer","title":"Journal Entry Id"},"account_id":{"type":"integer","title":"Account Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"debit_amount":{"type":"string","title":"Debit Amount"},"credit_amount":{"type":"string","title":"Credit Amount"},"currency_id":{"type":"integer","title":"Currency Id"},"exchange_rate":{"type":"string","title":"Exchange Rate"},"base_amount":{"type":"string","title":"Base Amount"}},"type":"object","required":["id","journal_entry_id","account_id","debit_amount","credit_amount","currency_id","exchange_rate","base_amount"],"title":"JournalLineResponse"},"LogoutRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"LogoutRequest","description":"Request body for POST /auth/logout."},"MappingSourceRow":{"properties":{"source_type":{"type":"string","enum":["category","concept"],"title":"Source Type"},"source_id":{"type":"integer","title":"Source Id"},"source_name":{"type":"string","title":"Source Name"},"source_active":{"type":"integer","title":"Source Active"},"mapping_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mapping Id"},"account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"}},"type":"object","required":["source_type","source_id","source_name","source_active"],"title":"MappingSourceRow","description":"One expense category or per diem concept with its current mapping (if any)."},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message"},"success":{"type":"boolean","title":"Success","default":true}},"type":"object","required":["message"],"title":"MessageResponse","description":"Generic confirmation response."},"PerDiemConceptCreate":{"properties":{"company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Company Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"requires_receipt":{"type":"integer","title":"Requires Receipt","default":1}},"type":"object","required":["name"],"title":"PerDiemConceptCreate","example":{"company_id":1,"description":"Hotel or lodging expenses","name":"Accommodation","requires_receipt":1}},"PerDiemConceptResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"requires_receipt":{"type":"integer","title":"Requires Receipt"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","name","requires_receipt","is_active","created_at","updated_at"],"title":"PerDiemConceptResponse"},"PerDiemConceptUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"requires_receipt":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requires Receipt"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"PerDiemConceptUpdate"},"PerDiemPolicyCreate":{"properties":{"company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Company Id"},"name":{"type":"string","title":"Name"},"base_currency_id":{"type":"integer","title":"Base Currency Id"}},"type":"object","required":["name","base_currency_id"],"title":"PerDiemPolicyCreate","example":{"base_currency_id":1,"company_id":1,"name":"Standard Travel Policy 2026"}},"PerDiemPolicyResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"base_currency_id":{"type":"integer","title":"Base Currency Id"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"base_currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyBasic"},{"type":"null"}]},"rates_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rates Count"}},"type":"object","required":["id","company_id","name","base_currency_id","is_active","created_at","updated_at"],"title":"PerDiemPolicyResponse"},"PerDiemPolicyUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"base_currency_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Currency Id"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"PerDiemPolicyUpdate"},"PerDiemRateCreate":{"properties":{"policy_id":{"type":"integer","title":"Policy Id"},"concept_id":{"type":"integer","title":"Concept Id"},"scope_type":{"type":"string","title":"Scope Type"},"country_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Country Id"},"city_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"City Id"},"employee_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Category Id"},"amount":{"type":"number","title":"Amount"},"max_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Amount"},"currency_id":{"type":"integer","title":"Currency Id"},"valid_from":{"type":"string","format":"date","title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"}},"type":"object","required":["policy_id","concept_id","scope_type","amount","currency_id","valid_from"],"title":"PerDiemRateCreate","example":{"amount":130.0,"concept_id":1,"country_id":42,"currency_id":1,"max_amount":150.0,"policy_id":1,"scope_type":"country","valid_from":"2026-01-01"}},"PerDiemRateResponse":{"properties":{"id":{"type":"integer","title":"Id"},"policy_id":{"type":"integer","title":"Policy Id"},"concept_id":{"type":"integer","title":"Concept Id"},"scope_type":{"type":"string","title":"Scope Type"},"country_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Country Id"},"city_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"City Id"},"employee_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Category Id"},"amount":{"type":"number","title":"Amount"},"max_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Amount"},"currency_id":{"type":"integer","title":"Currency Id"},"valid_from":{"type":"string","format":"date","title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"suggested":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Suggested"},"concept":{"anyOf":[{"$ref":"#/components/schemas/ConceptBasic"},{"type":"null"}]},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyBasic"},{"type":"null"}]}},"type":"object","required":["id","policy_id","concept_id","scope_type","amount","currency_id","valid_from","is_active","created_at","updated_at"],"title":"PerDiemRateResponse"},"PerDiemRateUpdate":{"properties":{"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"max_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Amount"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"PerDiemRateUpdate"},"PeriodReopen":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":5,"title":"Reason"}},"type":"object","required":["reason"],"title":"PeriodReopen"},"PeriodResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"name":{"type":"string","title":"Name"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"status":{"type":"string","title":"Status"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At"},"closed_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Closed By Id"},"reopened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reopened At"},"reopened_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reopened By Id"},"entry_count":{"type":"integer","title":"Entry Count","default":0},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","company_id","name","start_date","end_date","status","is_active"],"title":"PeriodResponse"},"PurposeExportFilters":{"properties":{"date_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"},"date_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}},"type":"object","title":"PurposeExportFilters"},"ReceiptResponse":{"properties":{"id":{"type":"integer","title":"Id"},"expense_line_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Line Id"},"user_id":{"type":"integer","title":"User Id"},"company_id":{"type":"integer","title":"Company Id"},"template_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Id"},"receipt_mode":{"type":"string","title":"Receipt Mode"},"file_name":{"type":"string","title":"File Name"},"mime_type":{"type":"string","title":"Mime Type"},"file_size_kb":{"type":"integer","title":"File Size Kb"},"ocr_processed":{"type":"boolean","title":"Ocr Processed"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"capture_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capture Source"},"captured_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Captured At"},"device_platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Platform"},"device_user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device User Agent"},"original_width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Width"},"original_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Height"},"original_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Bytes"},"processed_width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Width"},"processed_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Height"},"processed_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Bytes"}},"type":"object","required":["id","user_id","company_id","receipt_mode","file_name","mime_type","file_size_kb","ocr_processed","is_active","created_at","updated_at"],"title":"ReceiptResponse"},"ReceiptUploadRequest":{"properties":{"expense_report_id":{"type":"integer","title":"Expense Report Id"},"expense_line_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Line Id"},"file_name":{"type":"string","maxLength":255,"minLength":1,"title":"File Name"},"mime_type":{"type":"string","maxLength":100,"title":"Mime Type","default":"image/jpeg"},"file_data":{"type":"string","minLength":1,"title":"File Data"},"receipt_mode":{"type":"string","title":"Receipt Mode","default":"ocr"},"capture_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capture Source"},"captured_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Captured At"},"device_platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Platform"},"device_user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device User Agent"},"original_width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Width"},"original_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Height"},"original_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Bytes"},"processed_width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Width"},"processed_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Height"},"processed_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Bytes"}},"type":"object","required":["expense_report_id","file_name","file_data"],"title":"ReceiptUploadRequest"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest","description":"Request body for POST /auth/refresh."},"ResetPasswordRequest":{"properties":{"token":{"type":"string","maxLength":100,"minLength":20,"title":"Token","description":"Reset token from email link"},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password","description":"New password (min 8 chars)"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest","description":"Request body for POST /auth/reset-password.","example":{"new_password":"MyNewPassword456!","token":"AbC123XyZ_secureRandomToken-32bytes"}},"ResetPasswordResponse":{"properties":{"message":{"type":"string","title":"Message","default":"Password reset successful. Please log in with your new password."}},"type":"object","title":"ResetPasswordResponse","description":"Response for POST /auth/reset-password."},"ReverseIn":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":5,"title":"Reason"}},"type":"object","required":["reason"],"title":"ReverseIn"},"RoleBasic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"RoleBasic","description":"Summarized role for embedding in user responses."},"StepBasic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"step_order":{"type":"integer","title":"Step Order"}},"type":"object","required":["id","name","step_order"],"title":"StepBasic"},"SupervisorAssign":{"properties":{"supervisor_id":{"type":"integer","title":"Supervisor Id"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["supervisor_id"],"title":"SupervisorAssign","description":"Request body for POST /users/{id}/supervisor.","example":{"notes":"Assignment due to team restructuring Q1 2026","supervisor_id":5}},"SupervisorReassignRequest":{"properties":{"new_supervisor_id":{"type":"integer","title":"New Supervisor Id"}},"type":"object","required":["new_supervisor_id"],"title":"SupervisorReassignRequest"},"SupervisorResponse":{"properties":{"supervisor_id":{"type":"integer","title":"Supervisor Id"},"supervisor_name":{"type":"string","title":"Supervisor Name"},"supervisor_email":{"type":"string","title":"Supervisor Email"},"effective_from":{"type":"string","title":"Effective From"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["supervisor_id","supervisor_name","supervisor_email","effective_from"],"title":"SupervisorResponse","description":"Active supervisor of a user."},"TaxCreate":{"properties":{"code":{"type":"string","maxLength":20,"minLength":1,"title":"Code"},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"rate":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"string"}],"title":"Rate"},"treatment":{"type":"string","enum":["DEDUCTIBLE","COST"],"title":"Treatment","default":"COST"},"account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"}},"type":"object","required":["code","name","rate"],"title":"TaxCreate"},"TaxResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"tax_type":{"type":"string","title":"Tax Type"},"rate":{"type":"string","title":"Rate"},"treatment":{"type":"string","title":"Treatment"},"account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","company_id","code","name","tax_type","rate","treatment","is_active"],"title":"TaxResponse"},"TaxUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"rate":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Rate"},"treatment":{"anyOf":[{"type":"string","enum":["DEDUCTIBLE","COST"]},{"type":"null"}],"title":"Treatment"},"account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"TaxUpdate"},"TeamSpendEmployee":{"properties":{"user_id":{"type":"integer","title":"User Id"},"employee_name":{"type":"string","title":"Employee Name"},"currency_code":{"type":"string","title":"Currency Code"},"total_declared":{"type":"string","title":"Total Declared"},"declared_count":{"type":"integer","title":"Declared Count"},"draft_count":{"type":"integer","title":"Draft Count"}},"type":"object","required":["user_id","employee_name","currency_code","total_declared","declared_count","draft_count"],"title":"TeamSpendEmployee"},"TeamSpendReport":{"properties":{"expense_report_id":{"type":"integer","title":"Expense Report Id"},"travel_request_id":{"type":"integer","title":"Travel Request Id"},"user_id":{"type":"integer","title":"User Id"},"employee_name":{"type":"string","title":"Employee Name"},"title":{"type":"string","title":"Title"},"departure_date":{"type":"string","format":"date","title":"Departure Date"},"return_date":{"type":"string","format":"date","title":"Return Date"},"status":{"type":"string","title":"Status"},"receipt_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receipt Number"},"total_amount":{"type":"string","title":"Total Amount"},"allocated_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allocated Amount"},"currency_code":{"type":"string","title":"Currency Code"}},"type":"object","required":["expense_report_id","travel_request_id","user_id","employee_name","title","departure_date","return_date","status","total_amount","currency_code"],"title":"TeamSpendReport"},"TeamSpendResponse":{"properties":{"employees":{"items":{"$ref":"#/components/schemas/TeamSpendEmployee"},"type":"array","title":"Employees"},"reports":{"items":{"$ref":"#/components/schemas/TeamSpendReport"},"type":"array","title":"Reports"},"team_members":{"type":"integer","title":"Team Members","default":0}},"type":"object","required":["employees","reports"],"title":"TeamSpendResponse","description":"NOBUDGET-01: supervisor's read-only team spend (no budgets)."},"ThirdPartyCreate":{"properties":{"id_type":{"type":"string","enum":["NIT","CC","CE","PASSPORT","OTHER"],"title":"Id Type"},"id_number":{"type":"string","maxLength":50,"minLength":3,"title":"Id Number"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"party_kind":{"type":"string","enum":["SUPPLIER","EMPLOYEE","OTHER"],"title":"Party Kind"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},"type":"object","required":["id_type","id_number","name","party_kind"],"title":"ThirdPartyCreate"},"ThirdPartyListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ThirdPartyResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","pages"],"title":"ThirdPartyListResponse"},"ThirdPartyResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"id_type":{"type":"string","title":"Id Type"},"id_number":{"type":"string","title":"Id Number"},"check_digit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check Digit"},"name":{"type":"string","title":"Name"},"party_kind":{"type":"string","title":"Party Kind"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["id","company_id","id_type","id_number","name","party_kind","is_active"],"title":"ThirdPartyResponse"},"ThirdPartyUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"party_kind":{"anyOf":[{"type":"string","enum":["SUPPLIER","EMPLOYEE","OTHER"]},{"type":"null"}],"title":"Party Kind"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"ThirdPartyUpdate"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In","default":1800}},"type":"object","required":["access_token","refresh_token"],"title":"TokenResponse","description":"Successful login response.\naccess_token: short-lived JWT (30 min)\nrefresh_token: long-lived token (7 days)"},"TravelAdvanceCreate":{"properties":{"travel_request_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Travel Request Id"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"}],"title":"Amount"},"currency_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Currency Id"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["travel_request_id","amount","currency_id"],"title":"TravelAdvanceCreate"},"TravelAdvanceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TravelAdvanceResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"TravelAdvanceListResponse"},"TravelAdvanceResponse":{"properties":{"id":{"type":"integer","title":"Id"},"travel_request_id":{"type":"integer","title":"Travel Request Id"},"user_id":{"type":"integer","title":"User Id"},"user":{"anyOf":[{"$ref":"#/components/schemas/UserBasic"},{"type":"null"}]},"amount":{"type":"string","title":"Amount"},"amount_base_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Base Currency"},"exchange_rate_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exchange Rate Used"},"currency_id":{"type":"integer","title":"Currency Id"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyBasicTravel"},{"type":"null"}]},"status":{"type":"string","title":"Status"},"disbursed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disbursed At"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","travel_request_id","user_id","amount","amount_base_currency","exchange_rate_used","currency_id","status","disbursed_at","notes","is_active","created_at","updated_at"],"title":"TravelAdvanceResponse"},"TravelAdvanceUpdate":{"properties":{"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"},{"type":"null"}],"title":"Amount"},"currency_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Currency Id"},"status":{"anyOf":[{"type":"string","enum":["pending","approved","disbursed","liquidated"]},{"type":"null"}],"title":"Status"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"TravelAdvanceUpdate"},"TravelFlightSegmentCreate":{"properties":{"segment_order":{"type":"integer","maximum":99.0,"minimum":1.0,"title":"Segment Order","default":1},"segment_type":{"type":"string","title":"Segment Type","default":"outbound"},"flight_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Flight Number"},"airline_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Airline Name"},"airline_code":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Airline Code"},"origin_airport":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Origin Airport"},"origin_city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Origin City"},"destination_airport":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Destination Airport"},"destination_city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Destination City"},"departure_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Departure Date"},"departure_time":{"type":"string","format":"time","title":"Departure Time","default":"00:00:00"},"arrival_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Arrival Date"},"arrival_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Arrival Time"},"inherit_date":{"type":"integer","title":"Inherit Date","default":1},"departure_datetime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Departure Datetime"},"arrival_datetime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Arrival Datetime"},"flight_class":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Flight Class"},"pnr":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Pnr"},"seat_number":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Seat Number"},"baggage_allowance":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Baggage Allowance"},"ticket_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Ticket Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"TravelFlightSegmentCreate"},"TravelFlightSegmentResponse":{"properties":{"id":{"type":"integer","title":"Id"},"travel_request_id":{"type":"integer","title":"Travel Request Id"},"segment_order":{"type":"integer","title":"Segment Order"},"segment_type":{"type":"string","title":"Segment Type"},"flight_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flight Number"},"airline_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Airline Name"},"airline_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Airline Code"},"origin_airport":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin Airport"},"origin_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin City"},"destination_airport":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination Airport"},"destination_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination City"},"departure_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Departure Date"},"departure_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Departure Time"},"arrival_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Arrival Date"},"arrival_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Arrival Time"},"inherit_date":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inherit Date"},"departure_datetime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Departure Datetime"},"arrival_datetime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Arrival Datetime"},"flight_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flight Class"},"pnr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pnr"},"seat_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seat Number"},"baggage_allowance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Baggage Allowance"},"ticket_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ticket Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","travel_request_id","segment_order","segment_type","is_active","created_at","updated_at"],"title":"TravelFlightSegmentResponse"},"TravelItemCreate":{"properties":{"concept_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Concept Id"},"expense_category_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Expense Category Id"},"expense_category_type_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Expense Category Type Id"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","default":1},"unit_amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"},{"type":"null"}],"title":"Unit Amount"},"estimated_amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"},{"type":"null"}],"title":"Estimated Amount"},"currency_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Currency Id"},"days":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Days","default":1}},"type":"object","required":["expense_category_id","currency_id"],"title":"TravelItemCreate"},"TravelItemResponse":{"properties":{"id":{"type":"integer","title":"Id"},"travel_request_id":{"type":"integer","title":"Travel Request Id"},"concept_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Concept Id"},"concept":{"anyOf":[{"$ref":"#/components/schemas/ConceptBasicTravel"},{"type":"null"}]},"expense_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Category Id"},"expense_category_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Category Type Id"},"expense_category_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expense Category Name"},"expense_category_type_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expense Category Type Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","default":1},"unit_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unit Amount"},"estimated_amount":{"type":"string","title":"Estimated Amount"},"approved_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved Amount"},"currency_id":{"type":"integer","title":"Currency Id"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyBasicTravel"},{"type":"null"}]},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","travel_request_id","description","unit_amount","estimated_amount","approved_amount","currency_id","is_active","created_at","updated_at"],"title":"TravelItemResponse"},"TravelReasonBasic":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","code","name"],"title":"TravelReasonBasic"},"TravelReasonCreate":{"properties":{"code":{"type":"string","maxLength":10,"minLength":1,"title":"Code"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"}},"type":"object","required":["code","name"],"title":"TravelReasonCreate"},"TravelReasonUpdate":{"properties":{"code":{"anyOf":[{"type":"string","maxLength":10,"minLength":1},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"is_active":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"TravelReasonUpdate"},"TravelRequestCreate":{"properties":{"destination_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Destination Id"},"travel_reason_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Travel Reason Id"},"workflow_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Workflow Id"},"budget_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Budget Id"},"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title"},"purpose":{"type":"string","maxLength":5000,"minLength":1,"title":"Purpose"},"departure_date":{"type":"string","format":"date","title":"Departure Date"},"return_date":{"type":"string","format":"date","title":"Return Date"},"currency_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Currency Id"},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Notes"},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/TravelItemCreate"},"type":"array"},{"type":"null"}],"title":"Items"},"hotel_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Hotel Name"},"hotel_address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Hotel Address"},"hotel_phone":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Hotel Phone"},"hotel_city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Hotel City"},"hotel_country":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Hotel Country"},"hotel_stars":{"anyOf":[{"type":"integer","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Hotel Stars"},"hotel_checkin_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Hotel Checkin Date"},"hotel_checkout_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Hotel Checkout Date"},"hotel_room_rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Hotel Room Rate"},"hotel_confirmation":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Hotel Confirmation"},"transport_company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Transport Company"},"transport_type":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Transport Type"},"transport_driver_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Transport Driver Name"},"transport_vehicle":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Transport Vehicle"},"transport_plate":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Transport Plate"},"transport_pickup_datetime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Transport Pickup Datetime"},"travel_purpose":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Travel Purpose"},"client_project":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Client Project"},"emergency_contact_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Emergency Contact Id"},"insurance_policy_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Insurance Policy Id"},"special_requirements":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Special Requirements"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes"},"visa_required":{"type":"integer","title":"Visa Required","default":0},"flight_layover_info":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Flight Layover Info"},"is_on_behalf":{"type":"integer","title":"Is On Behalf","default":0},"traveler_user_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Traveler User Id"},"requested_by_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Requested By Id"},"parent_request_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Parent Request Id"},"flight_segments":{"anyOf":[{"items":{"$ref":"#/components/schemas/TravelFlightSegmentCreate"},"type":"array"},{"type":"null"}],"title":"Flight Segments"}},"type":"object","required":["destination_id","travel_reason_id","title","purpose","departure_date","return_date","currency_id"],"title":"TravelRequestCreate"},"TravelRequestListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TravelRequestResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"TravelRequestListResponse"},"TravelRequestLookupItem":{"properties":{"id":{"type":"integer","title":"Id"},"destination_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination Name"},"departure_date":{"type":"string","format":"date","title":"Departure Date"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","departure_date","status"],"title":"TravelRequestLookupItem","description":"Minimal projection of a candidate parent travel request.\n\nDeliberately excludes monetary fields: this payload is reachable by any\nauthenticated user for any traveler in the same company (see DT-53). The\npersisted model has no request-number column, so the numeric id is the public\nidentifier here — the UI renders it as \"TR #<id>\"."},"TravelRequestLookupResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TravelRequestLookupItem"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"TravelRequestLookupResponse"},"TravelRequestRef":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"}},"type":"object","required":["id","title"],"title":"TravelRequestRef","description":"Just enough of the linked travel request to name it in lists."},"TravelRequestResponse":{"properties":{"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"user_id":{"type":"integer","title":"User Id"},"user":{"anyOf":[{"$ref":"#/components/schemas/UserWithCategory"},{"type":"null"}]},"destination_id":{"type":"integer","title":"Destination Id"},"destination":{"anyOf":[{"$ref":"#/components/schemas/DestinationBasic"},{"type":"null"}]},"travel_reason_id":{"type":"integer","title":"Travel Reason Id"},"travel_reason":{"anyOf":[{"$ref":"#/components/schemas/TravelReasonBasic"},{"type":"null"}]},"workflow_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Workflow Id"},"workflow":{"anyOf":[{"$ref":"#/components/schemas/WorkflowBasic"},{"type":"null"}]},"budget_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Budget Id"},"budget":{"anyOf":[{"$ref":"#/components/schemas/BudgetBasic"},{"type":"null"}]},"title":{"type":"string","title":"Title"},"purpose":{"type":"string","title":"Purpose"},"departure_date":{"type":"string","format":"date","title":"Departure Date"},"return_date":{"type":"string","format":"date","title":"Return Date"},"status":{"type":"string","title":"Status"},"total_estimated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Estimated"},"total_approved":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Approved"},"total_liquidated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Liquidated"},"currency_id":{"type":"integer","title":"Currency Id"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyBasicTravel"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"hotel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hotel Name"},"hotel_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hotel Address"},"hotel_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hotel Phone"},"hotel_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hotel City"},"hotel_country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hotel Country"},"hotel_stars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Hotel Stars"},"hotel_checkin_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Hotel Checkin Date"},"hotel_checkout_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Hotel Checkout Date"},"hotel_room_rate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hotel Room Rate"},"hotel_confirmation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hotel Confirmation"},"transport_company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Company"},"transport_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Type"},"transport_driver_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Driver Name"},"transport_vehicle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Vehicle"},"transport_plate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Plate"},"transport_pickup_datetime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Transport Pickup Datetime"},"travel_purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Travel Purpose"},"client_project":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Project"},"emergency_contact_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Emergency Contact Id"},"emergency_contact":{"anyOf":[{"$ref":"#/components/schemas/UserEmergencyContactBasic"},{"type":"null"}]},"insurance_policy_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Insurance Policy Id"},"insurance_policy":{"anyOf":[{"$ref":"#/components/schemas/UserInsurancePolicyBasic"},{"type":"null"}]},"special_requirements":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Special Requirements"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes"},"visa_required":{"type":"integer","title":"Visa Required","default":0},"flight_layover_info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flight Layover Info"},"is_on_behalf":{"type":"integer","title":"Is On Behalf","default":0},"traveler_user_id":{"type":"integer","title":"Traveler User Id","default":0},"traveler":{"anyOf":[{"$ref":"#/components/schemas/UserBasic"},{"type":"null"}]},"requested_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requested By Id"},"requested_by":{"anyOf":[{"$ref":"#/components/schemas/UserBasic"},{"type":"null"}]},"parent_request_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Request Id"},"origin":{"type":"string","title":"Origin","default":"FULL_FLOW"},"has_advance_allocation":{"type":"integer","title":"Has Advance Allocation","default":0},"cost_center_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"},"items":{"items":{"$ref":"#/components/schemas/TravelItemResponse"},"type":"array","title":"Items"},"advances":{"items":{"$ref":"#/components/schemas/TravelAdvanceResponse"},"type":"array","title":"Advances"},"approvals":{"items":{"$ref":"#/components/schemas/ApprovalResponse"},"type":"array","title":"Approvals"},"flight_segments":{"items":{"$ref":"#/components/schemas/TravelFlightSegmentResponse"},"type":"array","title":"Flight Segments"},"total_amount":{"type":"number","title":"Total Amount","default":0.0},"currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency Code"}},"type":"object","required":["id","company_id","user_id","destination_id","travel_reason_id","workflow_id","budget_id","title","purpose","departure_date","return_date","status","total_estimated","total_approved","total_liquidated","currency_id","notes","is_active","created_at","updated_at"],"title":"TravelRequestResponse"},"TravelRequestUpdate":{"properties":{"destination_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Destination Id"},"travel_reason_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Travel Reason Id"},"workflow_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Workflow Id"},"budget_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Budget Id"},"title":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Title"},"purpose":{"anyOf":[{"type":"string","maxLength":5000,"minLength":1},{"type":"null"}],"title":"Purpose"},"departure_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Departure Date"},"return_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Return Date"},"currency_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Currency Id"},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Notes"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"hotel_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Hotel Name"},"hotel_address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Hotel Address"},"hotel_phone":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Hotel Phone"},"hotel_city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Hotel City"},"hotel_country":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Hotel Country"},"hotel_stars":{"anyOf":[{"type":"integer","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Hotel Stars"},"hotel_checkin_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Hotel Checkin Date"},"hotel_checkout_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Hotel Checkout Date"},"hotel_room_rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Hotel Room Rate"},"hotel_confirmation":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Hotel Confirmation"},"transport_company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Transport Company"},"transport_type":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Transport Type"},"transport_driver_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Transport Driver Name"},"transport_vehicle":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Transport Vehicle"},"transport_plate":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Transport Plate"},"transport_pickup_datetime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Transport Pickup Datetime"},"travel_purpose":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Travel Purpose"},"client_project":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Client Project"},"emergency_contact_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Emergency Contact Id"},"insurance_policy_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Insurance Policy Id"},"special_requirements":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Special Requirements"},"internal_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Notes"},"visa_required":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Visa Required"},"flight_layover_info":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Flight Layover Info"},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/TravelItemCreate"},"type":"array"},{"type":"null"}],"title":"Items"},"is_on_behalf":{"anyOf":[{"type":"integer","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Is On Behalf"},"traveler_user_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Traveler User Id"},"requested_by_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Requested By Id"},"parent_request_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Parent Request Id"},"flight_segments":{"anyOf":[{"items":{"$ref":"#/components/schemas/TravelFlightSegmentCreate"},"type":"array"},{"type":"null"}],"title":"Flight Segments"}},"type":"object","title":"TravelRequestUpdate"},"UserBasic":{"properties":{"id":{"type":"integer","title":"Id"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"email":{"type":"string","title":"Email"}},"type":"object","required":["id","first_name","last_name","email"],"title":"UserBasic"},"UserCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Company Id"},"cost_center_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"},"employee_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Category Id"},"role_ids":{"items":{"type":"integer"},"type":"array","title":"Role Ids"},"preferred_language":{"type":"string","title":"Preferred Language","default":"es-LA"}},"type":"object","required":["email","password","first_name","last_name","role_ids"],"title":"UserCreate","description":"Data for creating a new user.\nOnly Admin can use this schema (POST /users).","example":{"company_id":1,"cost_center_id":1,"email":"john.doe@company.com","employee_category_id":1,"first_name":"John","last_name":"Doe","password":"Secure1234!","phone":"+57 300 123 4567","preferred_language":"es-LA","role_ids":[2]}},"UserEmergencyContactBasic":{"properties":{"id":{"type":"integer","title":"Id"},"full_name":{"type":"string","title":"Full Name"},"relationship":{"type":"string","title":"Relationship"},"phone_primary":{"type":"string","title":"Phone Primary"}},"type":"object","required":["id","full_name","relationship","phone_primary"],"title":"UserEmergencyContactBasic","description":"Minimal nested representation in TravelRequestResponse."},"UserEmergencyContactCreate":{"properties":{"full_name":{"type":"string","maxLength":255,"minLength":1,"title":"Full Name"},"relationship":{"type":"string","maxLength":100,"title":"Relationship"},"phone_primary":{"type":"string","maxLength":50,"minLength":1,"title":"Phone Primary"},"phone_secondary":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone Secondary"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"country":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Country"},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"City"},"is_primary":{"type":"integer","title":"Is Primary","default":1},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","required":["full_name","relationship","phone_primary"],"title":"UserEmergencyContactCreate"},"UserEmergencyContactResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"full_name":{"type":"string","title":"Full Name"},"relationship":{"type":"string","title":"Relationship"},"phone_primary":{"type":"string","title":"Phone Primary"},"phone_secondary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Secondary"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"is_primary":{"type":"integer","title":"Is Primary"},"is_active":{"type":"integer","title":"Is Active"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","user_id","full_name","relationship","phone_primary","is_primary","is_active","created_at","updated_at"],"title":"UserEmergencyContactResponse"},"UserEmergencyContactUpdate":{"properties":{"full_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Full Name"},"relationship":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Relationship"},"phone_primary":{"anyOf":[{"type":"string","maxLength":50,"minLength":1},{"type":"null"}],"title":"Phone Primary"},"phone_secondary":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone Secondary"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"country":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Country"},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"City"},"is_primary":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Primary"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","title":"UserEmergencyContactUpdate"},"UserInsuranceBeneficiaryCreate":{"properties":{"full_name":{"type":"string","maxLength":255,"minLength":1,"title":"Full Name"},"id_type":{"type":"string","maxLength":30,"title":"Id Type"},"id_number":{"type":"string","maxLength":50,"minLength":1,"title":"Id Number"},"relationship":{"type":"string","maxLength":100,"title":"Relationship"},"birthdate":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Birthdate"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"benefit_percentage":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"string"}],"title":"Benefit Percentage","default":"100.00"},"benefit_type":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Benefit Type"},"is_primary":{"type":"integer","title":"Is Primary","default":1},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","required":["full_name","id_type","id_number","relationship"],"title":"UserInsuranceBeneficiaryCreate"},"UserInsuranceBeneficiaryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"policy_id":{"type":"integer","title":"Policy Id"},"user_id":{"type":"integer","title":"User Id"},"full_name":{"type":"string","title":"Full Name"},"id_type":{"type":"string","title":"Id Type"},"id_number":{"type":"string","title":"Id Number"},"contact_relationship":{"type":"string","title":"Contact Relationship"},"birthdate":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Birthdate"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"benefit_percentage":{"type":"string","title":"Benefit Percentage"},"benefit_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Benefit Type"},"is_primary":{"type":"integer","title":"Is Primary"},"is_active":{"type":"integer","title":"Is Active"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","policy_id","user_id","full_name","id_type","id_number","contact_relationship","benefit_percentage","is_primary","is_active","created_at","updated_at"],"title":"UserInsuranceBeneficiaryResponse"},"UserInsuranceBeneficiaryUpdate":{"properties":{"full_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Full Name"},"id_type":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Id Type"},"id_number":{"anyOf":[{"type":"string","maxLength":50,"minLength":1},{"type":"null"}],"title":"Id Number"},"relationship":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Relationship"},"birthdate":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Birthdate"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"benefit_percentage":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Benefit Percentage"},"benefit_type":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Benefit Type"},"is_primary":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Primary"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","title":"UserInsuranceBeneficiaryUpdate"},"UserInsurancePolicyBasic":{"properties":{"id":{"type":"integer","title":"Id"},"policy_number":{"type":"string","title":"Policy Number"},"insurance_company":{"type":"string","title":"Insurance Company"},"insurance_type":{"type":"string","title":"Insurance Type"},"coverage_scope":{"type":"string","title":"Coverage Scope"},"expiry_date":{"type":"string","format":"date","title":"Expiry Date"}},"type":"object","required":["id","policy_number","insurance_company","insurance_type","coverage_scope","expiry_date"],"title":"UserInsurancePolicyBasic","description":"Minimal nested representation in TravelRequestResponse."},"UserInsurancePolicyCreate":{"properties":{"policy_number":{"type":"string","maxLength":100,"minLength":1,"title":"Policy Number"},"insurance_company":{"type":"string","maxLength":255,"minLength":1,"title":"Insurance Company"},"insurance_company_phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Insurance Company Phone"},"insurance_company_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Insurance Company Email"},"insurance_company_web":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Insurance Company Web"},"insurance_type":{"type":"string","maxLength":50,"title":"Insurance Type"},"coverage_scope":{"type":"string","maxLength":20,"title":"Coverage Scope","default":"national"},"coverage_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coverage Description"},"effective_date":{"type":"string","format":"date","title":"Effective Date"},"expiry_date":{"type":"string","format":"date","title":"Expiry Date"},"renewal_type":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Renewal Type"},"auto_renewal":{"type":"integer","title":"Auto Renewal","default":0},"alert_days_before_expiry":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Alert Days Before Expiry","default":30},"coverage_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Coverage Amount"},"coverage_currency":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Coverage Currency","default":"USD"},"deductible_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Deductible Amount"},"monthly_premium":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Monthly Premium"},"premium_currency":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Premium Currency","default":"USD"},"covers_medical":{"type":"integer","title":"Covers Medical","default":0},"covers_evacuation":{"type":"integer","title":"Covers Evacuation","default":0},"covers_trip_cancellation":{"type":"integer","title":"Covers Trip Cancellation","default":0},"covers_lost_luggage":{"type":"integer","title":"Covers Lost Luggage","default":0},"covers_personal_liability":{"type":"integer","title":"Covers Personal Liability","default":0},"max_trip_duration_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Max Trip Duration Days"},"is_company_provided":{"type":"integer","title":"Is Company Provided","default":0},"document_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Document Url"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["policy_number","insurance_company","insurance_type","effective_date","expiry_date"],"title":"UserInsurancePolicyCreate"},"UserInsurancePolicyResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"created_by":{"type":"integer","title":"Created By"},"policy_number":{"type":"string","title":"Policy Number"},"insurance_company":{"type":"string","title":"Insurance Company"},"insurance_company_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insurance Company Phone"},"insurance_company_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insurance Company Email"},"insurance_company_web":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insurance Company Web"},"insurance_type":{"type":"string","title":"Insurance Type"},"coverage_scope":{"type":"string","title":"Coverage Scope"},"coverage_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coverage Description"},"effective_date":{"type":"string","format":"date","title":"Effective Date"},"expiry_date":{"type":"string","format":"date","title":"Expiry Date"},"renewal_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Renewal Type"},"auto_renewal":{"type":"integer","title":"Auto Renewal"},"alert_days_before_expiry":{"type":"integer","title":"Alert Days Before Expiry"},"coverage_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coverage Amount"},"coverage_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coverage Currency"},"deductible_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deductible Amount"},"monthly_premium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Monthly Premium"},"premium_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Premium Currency"},"covers_medical":{"type":"integer","title":"Covers Medical"},"covers_evacuation":{"type":"integer","title":"Covers Evacuation"},"covers_trip_cancellation":{"type":"integer","title":"Covers Trip Cancellation"},"covers_lost_luggage":{"type":"integer","title":"Covers Lost Luggage"},"covers_personal_liability":{"type":"integer","title":"Covers Personal Liability"},"max_trip_duration_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Trip Duration Days"},"is_company_provided":{"type":"integer","title":"Is Company Provided"},"document_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Url"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"beneficiaries":{"items":{"$ref":"#/components/schemas/UserInsuranceBeneficiaryResponse"},"type":"array","title":"Beneficiaries","default":[]}},"type":"object","required":["id","user_id","created_by","policy_number","insurance_company","insurance_type","coverage_scope","effective_date","expiry_date","auto_renewal","alert_days_before_expiry","covers_medical","covers_evacuation","covers_trip_cancellation","covers_lost_luggage","covers_personal_liability","is_company_provided","is_active","created_at","updated_at"],"title":"UserInsurancePolicyResponse"},"UserInsurancePolicyUpdate":{"properties":{"insurance_company":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Insurance Company"},"insurance_company_phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Insurance Company Phone"},"insurance_company_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Insurance Company Email"},"insurance_company_web":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Insurance Company Web"},"coverage_scope":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Coverage Scope"},"coverage_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coverage Description"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date"},"renewal_type":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Renewal Type"},"auto_renewal":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Renewal"},"alert_days_before_expiry":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Alert Days Before Expiry"},"coverage_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Coverage Amount"},"deductible_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Deductible Amount"},"monthly_premium":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string"},{"type":"null"}],"title":"Monthly Premium"},"covers_medical":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Covers Medical"},"covers_evacuation":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Covers Evacuation"},"covers_trip_cancellation":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Covers Trip Cancellation"},"covers_lost_luggage":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Covers Lost Luggage"},"covers_personal_liability":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Covers Personal Liability"},"max_trip_duration_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Max Trip Duration Days"},"document_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Document Url"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UserInsurancePolicyUpdate"},"UserListItem":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"company_id":{"type":"integer","title":"Company Id"},"cost_center_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"},"employee_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Category Id"},"preferred_language":{"type":"string","title":"Preferred Language"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"company":{"anyOf":[{"$ref":"#/components/schemas/CompanyBasic"},{"type":"null"}]},"roles":{"items":{"$ref":"#/components/schemas/RoleBasic"},"type":"array","title":"Roles","default":[]},"supervisor_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Supervisor Id"},"supervisor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supervisor Name"}},"type":"object","required":["id","email","first_name","last_name","company_id","preferred_language","is_active","created_at","updated_at"],"title":"UserListItem","description":"User row for the admin list: adds the currently active supervisor."},"UserListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UserListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","per_page","pages"],"title":"UserListResponse","description":"Paginated response for GET /users."},"UserLogin":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"UserLogin","description":"Login credentials — input for POST /auth/login."},"UserResponse":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"company_id":{"type":"integer","title":"Company Id"},"cost_center_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"},"employee_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Category Id"},"preferred_language":{"type":"string","title":"Preferred Language"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"is_active":{"type":"integer","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"company":{"anyOf":[{"$ref":"#/components/schemas/CompanyBasic"},{"type":"null"}]},"roles":{"items":{"$ref":"#/components/schemas/RoleBasic"},"type":"array","title":"Roles","default":[]}},"type":"object","required":["id","email","first_name","last_name","company_id","preferred_language","is_active","created_at","updated_at"],"title":"UserResponse","description":"Public representation of a user.\nNEVER includes: password_hash."},"UserUpdate":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"cost_center_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Center Id"},"employee_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Category Id"},"role_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Role Ids"},"preferred_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Language"},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UserUpdate","description":"Updatable user fields.\nAll optional — only provided fields are updated.\nPassword is NOT changed through this route (use POST /users/{id}/password)."},"UserWithCategory":{"properties":{"id":{"type":"integer","title":"Id"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"email":{"type":"string","title":"Email"},"employee_category":{"anyOf":[{"$ref":"#/components/schemas/EmployeeCategoryBasicTravel"},{"type":"null"}]}},"type":"object","required":["id","first_name","last_name","email"],"title":"UserWithCategory"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WorkflowBasic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"WorkflowBasic"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}