{"openapi":"3.1.0","info":{"title":"Enterprise AI ERP 2.0","description":"全功能企業級 AI Agent 網頁版會計、電子發票、勞基法打卡與審批簽核系統 (具備 iOS/Android OpenAPI 兼容)","version":"2.0.0"},"paths":{"/api/v1/auth/login":{"post":{"tags":["認證與帳號管理"],"summary":"使用者登入 (取得 JWT 憑證)","operationId":"login_api_v1_auth_login_post","parameters":[{"name":"X-Company-Tax-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Tax-Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_api_v1_auth_login_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/config":{"get":{"tags":["認證與帳號管理"],"summary":"取得 Google 登入組態","description":"回傳系統當前 Google OAuth Client ID 與啟用狀態 (支援資料庫動態設定與環境變數)","operationId":"get_google_config_api_v1_auth_google_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleConfigResponse"}}}}}},"put":{"tags":["認證與帳號管理"],"summary":"更新 Google 登入組態 (動態儲存 Client ID 與自動開通設定)","description":"允許於前端或公司設定直接配置 Google OAuth Client ID 與自動開通選項，免重啟立即生效","operationId":"update_google_config_api_v1_auth_google_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleConfigUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/login":{"get":{"tags":["認證與帳號管理"],"summary":"直接跳轉至 Google OAuth 2.0 第三方登入與帳號選擇頁面","description":"使用者點擊『使用 Google 帳號登入』時，直接重導向 (302) 至 Google 官方第三方登入與選擇帳號畫面\n(https://accounts.google.com/o/oauth2/v2/auth)，無須使用者手動填寫 Google 帳號或姓名。","operationId":"google_oauth_redirect_login_api_v1_auth_google_login_get","parameters":[{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"前端當前 Origin","title":"Origin"},"description":"前端當前 Origin"},{"name":"prompt","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Google OAuth prompt 模式","default":"select_account","title":"Prompt"},"description":"Google OAuth prompt 模式"},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"OAuth state 參數","title":"State"},"description":"OAuth state 參數"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/callback":{"get":{"tags":["認證與帳號管理"],"summary":"Google OAuth 2.0 第三方登入驗證回呼端點","description":"接收 Google OAuth 2.0 第三方驗證完成後的回呼 (支援 Authorization Code 與 Implicit id_token/access_token)，\n自動將憑證寫入前端會話並導回 ERP 主頁面自動完成登入。","operationId":"google_oauth_callback_api_v1_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"id_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id Token"}},{"name":"access_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/accounts":{"get":{"tags":["認證與帳號管理"],"summary":"取得全體可單獨使用 Google Account 登入之啟用帳號清單（含系統管理員）","description":"回傳系統內全部啟用中帳號（含系統管理員 admin 及 7 大 RBAC 角色同仁），\n供前端 Google Account 登入面板呈現全帳號一鍵獨立登入與首次登入強制綁定測試。","operationId":"list_google_login_accounts_api_v1_auth_google_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/google":{"post":{"tags":["認證與帳號管理"],"summary":"Google 帳號憑證登入 (Google Identity Services)","description":"透過 Google Identity Services / OAuth 2.0 簽發之 ID Token 或 Access Token 驗證並登入。\n支援全體帳號（含系統管理員 admin）單獨使用 Google 帳號登入，及首次登入強制綁定流程。","operationId":"google_login_api_v1_auth_google_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/demo":{"post":{"tags":["認證與帳號管理"],"summary":"Google 登入開發示範模擬（支援全體帳號與系統管理員首次登入強制綁定）","description":"於尚未完成 Google Cloud Console Client ID 正式設定之開發/展示期間，\n提供前端一鍵模擬全體帳號（含系統管理員 admin）單獨使用 Google 帳號登入與首次登入強制綁定體驗。","operationId":"google_demo_login_api_v1_auth_google_demo_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDemoAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/first-login/send-code":{"post":{"tags":["認證與帳號管理"],"summary":"初次登入：發送信箱安全驗證碼","operationId":"first_login_send_code_api_v1_auth_first_login_send_code_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SendEmailVerificationCodeRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailVerificationCodeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/first-login/verify-email":{"post":{"tags":["認證與帳號管理"],"summary":"初次登入：驗證 Email 驗證碼","operationId":"first_login_verify_email_api_v1_auth_first_login_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/first-login/complete":{"post":{"tags":["認證與帳號管理"],"summary":"初次登入：完成強制綁定 (1. Username 與 Password、2. 跨網域備用 Email)","operationId":"first_login_complete_api_v1_auth_first_login_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirstLoginSetupRequest"}}},"required":true},"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"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/forgot-password":{"post":{"tags":["認證與帳號管理"],"summary":"忘記密碼申請：發送臨時新密碼至已驗證 Email","operationId":"forgot_password_endpoint_api_v1_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"}}}}}}},"/api/v1/auth/force-change-password":{"post":{"tags":["認證與帳號管理"],"summary":"登入後強制修改密碼","operationId":"force_change_password_endpoint_api_v1_auth_force_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForceChangePasswordRequest"}}},"required":true},"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"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/me":{"get":{"tags":["認證與帳號管理"],"summary":"取得當前登入者資訊","operationId":"get_me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["認證與帳號管理"],"summary":"修改個人帳戶設定與密碼","operationId":"update_my_profile_api_v1_auth_me_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileUpdate"}}},"required":true},"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"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/me/google-binding":{"put":{"tags":["認證與帳號管理"],"summary":"更新個人 Google 帳號與跨網域備用 Email 綁定","operationId":"update_my_google_binding_api_v1_auth_me_google_binding_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAccountBindingRequest"}}},"required":true},"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"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/users/{user_id}/google-binding":{"put":{"tags":["認證與帳號管理"],"summary":"管理員更新指定使用者之 Google 帳號與備用 Email 綁定","operationId":"update_user_google_binding_api_v1_auth_users__user_id__google_binding_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAccountBindingRequest"}}}},"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"}}}}}}},"/api/v1/auth/colleagues":{"get":{"tags":["認證與帳號管理"],"summary":"取得在職同仁選單 (供指定代理人或審核人)","operationId":"list_colleagues_api_v1_auth_colleagues_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ColleagueOptionResponse"},"type":"array","title":"Response List Colleagues Api V1 Auth Colleagues Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/departments":{"get":{"tags":["認證與帳號管理"],"summary":"查詢部門清單","operationId":"list_departments_api_v1_auth_departments_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DepartmentResponse"},"type":"array","title":"Response List Departments Api V1 Auth Departments Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/users":{"get":{"tags":["認證與帳號管理"],"summary":"查詢所有使用者列表 (Admin/CFO/HR)","operationId":"list_users_api_v1_auth_users_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/UserRole"},{"type":"null"}],"title":"Role"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserResponse"},"title":"Response List Users Api V1 Auth Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["認證與帳號管理"],"summary":"建立新使用者 (限 Admin 或具備 users.create 權限)","operationId":"add_user_api_v1_auth_users_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"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"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["認證與帳號管理"],"summary":"相容註冊端點 (限 Admin 或具備 users.create 權限)","operationId":"register_user_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"required":true},"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"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/users/{user_id}":{"get":{"tags":["認證與帳號管理"],"summary":"取得單一使用者詳情 (限 Admin 或具備 users.view 權限)","operationId":"get_user_detail_api_v1_auth_users__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"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":["認證與帳號管理"],"summary":"更新使用者資料與狀態 (限 Admin 或具備 users.edit / users.status 權限)","operationId":"update_user_info_api_v1_auth_users__user_id__put","security":[{"OAuth2PasswordBearer":[]}],"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":["認證與帳號管理"],"summary":"刪除或停用使用者 (限 Admin 或具備 users.delete / users.status 權限)","operationId":"delete_or_deactivate_user_endpoint_api_v1_auth_users__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"action","in":"query","required":false,"schema":{"type":"string","description":"操作類型：'deactivate' (停用帳號) 或 'delete' (徹底刪除)","default":"deactivate","title":"Action"},"description":"操作類型：'deactivate' (停用帳號) 或 'delete' (徹底刪除)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/users/{user_id}/reset-password":{"post":{"tags":["認證與帳號管理"],"summary":"管理員快速重設使用者密碼 (限 Admin 或具備 users.reset_pwd 權限)","operationId":"reset_password_endpoint_api_v1_auth_users__user_id__reset_password_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPasswordReset"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/permissions/definitions":{"get":{"tags":["認證與帳號管理"],"summary":"取得全模組細項權限定義與角色預設矩陣","operationId":"get_permissions_definitions_api_v1_auth_permissions_definitions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemPermissionsDefinitionsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/permission-managers":{"get":{"tags":["認證與帳號管理"],"summary":"取得所有具備權限設定資格的使用者清單","operationId":"list_permission_managers_api_v1_auth_permission_managers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/UserResponse"},"type":"array","title":"Response List Permission Managers Api V1 Auth Permission Managers Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/users/{user_id}/permissions":{"get":{"tags":["認證與帳號管理"],"summary":"查詢特定使用者細項權限配置","operationId":"get_user_permissions_api_v1_auth_users__user_id__permissions_get","security":[{"OAuth2PasswordBearer":[]}],"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/UserPermissionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["認證與帳號管理"],"summary":"設定特定使用者細項權限與指派權限管理者","operationId":"set_user_permissions_api_v1_auth_users__user_id__permissions_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPermissionsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPermissionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/onboarding/status":{"get":{"tags":["認證與帳號管理"],"summary":"取得『AI導引：新帳號設定』員工設定完整度雷達、職務範本與法規參數","operationId":"get_onboarding_status_api_v1_auth_onboarding_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/onboarding/ai-parse":{"post":{"tags":["認證與帳號管理"],"summary":"『AI導引：新帳號設定』自然語言智慧解析並自動對齊勞健保級距","operationId":"ai_parse_onboarding_prompt_api_v1_auth_onboarding_ai_parse_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingAiParseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/onboarding/execute":{"post":{"tags":["認證與帳號管理"],"summary":"執行『AI導引：新帳號設定』一站式原子化建立或更新員工全模組設定","operationId":"execute_onboarding_wizard_api_v1_auth_onboarding_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/invoices/upload-ocr":{"post":{"tags":["發票與加值中心管理"],"summary":"紙本發票/收據圖像拍照上傳與 AI 辨識 (支援 Gemini Vision / 本地 Mock 雙引擎)","description":"接收紙本發票照片 (支援手機相機直傳 / 檔案上傳)\n啟動 AI Vision 多模態辨識或本地智慧 Mock 辨識，抽取字軌、金額、稅額、統編，並推薦會計科目","operationId":"upload_invoice_ocr_api_v1_invoices_upload_ocr_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engine","in":"query","required":false,"schema":{"type":"string","description":"辨識引擎: auto (自動) / gemini (Gemini Vision API) / mock (本地智慧Mock離線測試)","default":"auto","title":"Engine"},"description":"辨識引擎: auto (自動) / gemini (Gemini Vision API) / mock (本地智慧Mock離線測試)"},{"name":"gemini_api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"使用者自訂 Google Gemini API Key (可選)","title":"Gemini Api Key"},"description":"使用者自訂 Google Gemini API Key (可選)"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_invoice_ocr_api_v1_invoices_upload_ocr_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OcrParseResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/":{"post":{"tags":["發票與加值中心管理"],"summary":"建立發票並自動轉入流水帳日記帳","operationId":"create_invoice_api_v1_invoices__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"auto_post_journal","in":"query","required":false,"schema":{"type":"boolean","description":"是否自動產生並過帳會計傳票","default":true,"title":"Auto Post Journal"},"description":"是否自動產生並過帳會計傳票"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["發票與加值中心管理"],"summary":"查詢發票列表 (支援篩選)","operationId":"list_invoices_api_v1_invoices__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invoice_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/InvoiceType"},{"type":"null"}],"title":"Invoice Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/InvoiceStatus"},{"type":"null"}],"title":"Status"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/InvoiceSource"},{"type":"null"}],"title":"Source"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceResponse"},"title":"Response List Invoices Api V1 Invoices  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/{invoice_id}":{"get":{"tags":["發票與加值中心管理"],"summary":"查詢單張發票明細","operationId":"get_invoice_api_v1_invoices__invoice_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"integer","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invoices/sync-einvoice":{"post":{"tags":["發票與加值中心管理"],"summary":"電子發票加值中心 API 同步 (鯨躍/綠界/財政部標準)","operationId":"sync_einvoice_gateway_api_v1_invoices_sync_einvoice_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EinvoiceSyncRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/invoices/reconcile-batch":{"post":{"tags":["發票與加值中心管理"],"summary":"電子發票批次核銷與過帳","operationId":"batch_reconcile_invoices_api_v1_invoices_reconcile_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EinvoiceReconcileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/accounting/accounts":{"get":{"tags":["會計與傳票管理"],"summary":"查詢會計科目表 (Chart of Accounts)","operationId":"list_accounts_api_v1_accounting_accounts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/AccountCategory"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountResponse"},"title":"Response List Accounts Api V1 Accounting Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["會計與傳票管理"],"summary":"新增會計科目 (需財務長/會計權限)","operationId":"create_account_api_v1_accounting_accounts_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting/entries":{"get":{"tags":["會計與傳票管理"],"summary":"查詢會計傳票 / 日記帳流水帳","operationId":"list_journal_entries_api_v1_accounting_entries_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JournalStatus"},{"type":"null"}],"title":"Status"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"關鍵字搜尋（傳票號、摘要、備註）","title":"Search"},"description":"關鍵字搜尋（傳票號、摘要、備註）"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JournalEntryResponse"},"title":"Response List Journal Entries Api V1 Accounting Entries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["會計與傳票管理"],"summary":"手動建立會計傳票 (嚴格檢核借貸平衡)","operationId":"create_journal_entry_api_v1_accounting_entries_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryCreate"}}}},"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"}}}}}}},"/api/v1/accounting/entries/{entry_id}":{"get":{"tags":["會計與傳票管理"],"summary":"查詢單張會計傳票明細","operationId":"get_journal_entry_api_v1_accounting_entries__entry_id__get","security":[{"OAuth2PasswordBearer":[]}],"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"}}}}}},"put":{"tags":["會計與傳票管理"],"summary":"手動修改會計傳票與分錄明細 (需財務長/會計權限)","operationId":"update_journal_entry_api_v1_accounting_entries__entry_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryUpdate"}}}},"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"}}}}}},"delete":{"tags":["會計與傳票管理"],"summary":"作廢或刪除會計傳票 (需財務長/會計/管理員權限)","operationId":"delete_journal_entry_api_v1_accounting_entries__entry_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"action","in":"query","required":false,"schema":{"type":"string","description":"操作類型：'void' (作廢) 或 'delete' (刪除)","default":"void","title":"Action"},"description":"操作類型：'void' (作廢) 或 'delete' (刪除)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting/templates":{"get":{"tags":["會計與傳票管理"],"summary":"取得常用會計傳票範本","operationId":"list_journal_templates_api_v1_accounting_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/JournalTemplateResponse"},"type":"array","title":"Response List Journal Templates Api V1 Accounting Templates Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/reports/trial-balance":{"get":{"tags":["財務報表與稅務申報"],"summary":"試算表 (Trial Balance)","operationId":"get_trial_balance_api_v1_reports_trial_balance_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialBalanceReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/balance-sheet":{"get":{"tags":["財務報表與稅務申報"],"summary":"資產負債表 (Balance Sheet)","operationId":"get_balance_sheet_api_v1_reports_balance_sheet_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceSheetReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/income-statement":{"get":{"tags":["財務報表與稅務申報"],"summary":"綜合損益表 (Income Statement / P&L)","operationId":"get_income_statement_api_v1_reports_income_statement_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncomeStatementReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/cash-flow":{"get":{"tags":["財務報表與稅務申報"],"summary":"現金流量表 (Cash Flow Statement)","operationId":"get_cash_flow_api_v1_reports_cash_flow_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashFlowReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/vat-401":{"get":{"tags":["財務報表與稅務申報"],"summary":"財政部 401 營業稅申報試算底稿","operationId":"get_vat_401_api_v1_reports_vat_401_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vat401Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/export-csv":{"get":{"tags":["財務報表與稅務申報"],"summary":"匯出報表為標準 CSV (UTF-8 with BOM，相容 Excel)","operationId":"export_csv_report_api_v1_reports_export_csv_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_type","in":"query","required":true,"schema":{"type":"string","description":"trial_balance | balance_sheet | income_statement | cash_flow | vat_401","title":"Report Type"},"description":"trial_balance | balance_sheet | income_statement | cash_flow | vat_401"},{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of Date"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/export-pdf":{"get":{"tags":["財務報表與稅務申報"],"summary":"匯出四大會計報表為專業 PDF (試算表、資產負債表、損益表、現金流量表、401底稿)","operationId":"export_pdf_report_api_v1_reports_export_pdf_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_type","in":"query","required":true,"schema":{"type":"string","description":"trial_balance | balance_sheet | income_statement | cash_flow | vat_401","title":"Report Type"},"description":"trial_balance | balance_sheet | income_statement | cash_flow | vat_401"},{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of Date"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month"}},{"name":"preview","in":"query","required":false,"schema":{"type":"boolean","description":"True 為線上預覽 (inline)，False 為下載檔案 (attachment)","default":false,"title":"Preview"},"description":"True 為線上預覽 (inline)，False 為下載檔案 (attachment)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/trigger-daily-snapshot":{"post":{"tags":["財務報表與稅務申報"],"summary":"手動觸發每日全套報表自動結算與快照封存","operationId":"trigger_daily_snapshot_api_v1_reports_trigger_daily_snapshot_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"target_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Target Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/snapshots":{"get":{"tags":["財務報表與稅務申報"],"summary":"查詢每日結帳歷史快照列表","operationId":"list_snapshots_api_v1_reports_snapshots_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/settings/geofence":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"取得 GPS 圍欄打卡設定狀態","operationId":"get_geofence_setting_api_v1_attendance_settings_geofence_get","security":[{"OAuth2PasswordBearer":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeofenceSettingsSchema"}}}}}},"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"開啟/關閉 GPS 圍欄打卡限制 (支援全區彈性打卡)","operationId":"toggle_geofence_setting_api_v1_attendance_settings_geofence_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"enabled","in":"query","required":true,"schema":{"type":"boolean","description":"True: 開啟圍欄嚴格檢核; False: 關閉圍欄全員彈性打卡","title":"Enabled"},"description":"True: 開啟圍欄嚴格檢核; False: 關閉圍欄全員彈性打卡"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeofenceSettingsSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/punch":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"上下班/外出打卡 (支援 GPS 定位與 IP 紀錄)","operationId":"punch_attendance_api_v1_attendance_punch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PunchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PunchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/records":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"查詢全員打卡紀錄 (法定留存五年)","operationId":"list_attendance_records_api_v1_attendance_records_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttendanceRecordResponse"},"title":"Response List Attendance Records Api V1 Attendance Records Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/my-records":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"查詢個人打卡歷程","operationId":"get_my_records_api_v1_attendance_my_records_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AttendanceRecordResponse"},"type":"array","title":"Response Get My Records Api V1 Attendance My Records Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/export-csv":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"匯出出勤打卡紀錄為標準 CSV (UTF-8 with BOM，相容 Excel)","description":"匯出出勤打卡紀錄為 CSV 檔案\n資料隔離保護：一般同仁僅能匯出本人資料；具 attendance.view_all 權限者可匯出指定或全員資料","operationId":"export_attendance_csv_endpoint_api_v1_attendance_export_csv_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/export-pdf":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"匯出出勤打卡紀錄為專業 PDF (A4橫向排版、內嵌字型)","description":"匯出出勤打卡紀錄為 PDF 檔案\n資料隔離保護：一般同仁僅能匯出本人資料；具 attendance.view_all 權限者可匯出指定或全員資料","operationId":"export_attendance_pdf_endpoint_api_v1_attendance_export_pdf_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"preview","in":"query","required":false,"schema":{"type":"boolean","description":"True 為線上預覽 (inline)，False 為下載檔案 (attachment)","default":false,"title":"Preview"},"description":"True 為線上預覽 (inline)，False 為下載檔案 (attachment)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/my-daily-summaries":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"查詢個人每日工時與階梯加班費明細","description":"查詢當前登入使用者之個人每日工時與階梯加班費明細，嚴格限制僅能查詢自己","operationId":"get_my_daily_summaries_api_v1_attendance_my_daily_summaries_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"target_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Target Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DailyWorkSummaryResponse"},"title":"Response Get My Daily Summaries Api V1 Attendance My Daily Summaries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/daily-summaries":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"每日工時與階梯加班費統計","operationId":"list_daily_summaries_api_v1_attendance_daily_summaries_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},{"name":"all_users","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"All Users"}},{"name":"target_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Target Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DailyWorkSummaryResponse"},"title":"Response List Daily Summaries Api V1 Attendance Daily Summaries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/compliance-check":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"勞基法 46 小時加班上限檢核","operationId":"check_compliance_api_v1_attendance_compliance_check_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlyLaborComplianceStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/payroll-journal":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"月底人資工時薪資自動轉入會計傳票","operationId":"generate_payroll_journal_api_v1_attendance_payroll_journal_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","description":"年份","title":"Year"},"description":"年份"},{"name":"month","in":"query","required":true,"schema":{"type":"integer","description":"月份 (1-12)","title":"Month"},"description":"月份 (1-12)"}],"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"}}}}}}},"/api/v1/attendance/overtime-requests":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"申請加班單","operationId":"submit_overtime_request_api_v1_attendance_overtime_requests_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OvertimeRequestCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OvertimeRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/leave-requests":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"申請請假單 (支援指定代理人與自訂簽核流程)","operationId":"submit_leave_request_api_v1_attendance_leave_requests_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveRequestCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/my-leaves":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"查詢個人請假單與簽核進度","operationId":"list_my_leaves_api_v1_attendance_my_leaves_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LeaveRequestResponse"},"type":"array","title":"Response List My Leaves Api V1 Attendance My Leaves Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/my-substitute-leaves":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"查詢受託代理之同仁請假單","operationId":"list_my_substitute_leaves_api_v1_attendance_my_substitute_leaves_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LeaveRequestResponse"},"type":"array","title":"Response List My Substitute Leaves Api V1 Attendance My Substitute Leaves Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/leave-requests/{leave_id}/cancel":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"申請人撤回請假單","operationId":"cancel_leave_request_api_v1_attendance_leave_requests__leave_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"leave_id","in":"path","required":true,"schema":{"type":"integer","title":"Leave Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/makeup-requests":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"提出忘記打卡補登錄（補卡）申請單","operationId":"submit_makeup_punch_request_api_v1_attendance_makeup_requests_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MakeupPunchRequestCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MakeupPunchRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"查詢全體忘記打卡補登申請單 (主管與人資專用)","operationId":"list_all_makeup_requests_api_v1_attendance_makeup_requests_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"依同仁 ID 篩選","title":"User Id"},"description":"依同仁 ID 篩選"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"依審批狀態篩選","title":"Status"},"description":"依審批狀態篩選"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MakeupPunchRequestResponse"},"title":"Response List All Makeup Requests Api V1 Attendance Makeup Requests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/my-makeup-requests":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"查詢個人忘記打卡補登紀錄與簽核進度","operationId":"list_my_makeup_requests_api_v1_attendance_my_makeup_requests_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MakeupPunchRequestResponse"},"type":"array","title":"Response List My Makeup Requests Api V1 Attendance My Makeup Requests Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/makeup-requests/{makeup_id}/cancel":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"申請人主動撤回補打卡申請單","operationId":"cancel_makeup_request_api_v1_attendance_makeup_requests__makeup_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"makeup_id","in":"path","required":true,"schema":{"type":"integer","title":"Makeup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MakeupPunchRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/my-leave-balances":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"查詢個人帳戶全部請假項目可申請時數＆剩餘可用時數","description":"提供使用者查詢個人帳戶全部請假項目（特休、病假、事假、生理假、喪假、婚假、產假/陪產假、補休、公假、公傷病假）之：\n- 可申請時數 (依照勞基法規定或公司自訂額度)\n- 已休時數 (已核准)\n- 簽核審查中時數\n- 剩餘可用時數","operationId":"get_my_leave_balances_api_v1_attendance_my_leave_balances_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"查詢年度 (預設當年度)","title":"Year"},"description":"查詢年度 (預設當年度)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLeaveBalanceSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/users/{user_id}/leave-balances":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"管理員/人資查詢指定同仁全部請假項目可申請時數＆剩餘可用時數","operationId":"get_user_leave_balances_api_v1_attendance_users__user_id__leave_balances_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"查詢年度 (預設當年度)","title":"Year"},"description":"查詢年度 (預設當年度)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLeaveBalanceSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/users/{user_id}/leave-quotas":{"put":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"管理員/人資調整指定同仁特定假別之可申請時數 (額度)","operationId":"update_user_leave_quota_api_v1_attendance_users__user_id__leave_quotas_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveQuotaUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/happiness-leaves":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"人資主管/管理員查詢全體同仁幸福假設定與使用現況","description":"供人資主管 (HR Manager) 與管理員專屬查閱：\n- 全體在職同仁之姓名、部門、角色\n- 當年度幸福假可申請總時數 (額度)\n- 已休時數、審核中時數、剩餘可用時數","operationId":"get_all_users_happiness_leaves_api_v1_attendance_happiness_leaves_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"查詢年度 (預設當年度)","title":"Year"},"description":"查詢年度 (預設當年度)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HappinessLeaveUserItem"},"title":"Response Get All Users Happiness Leaves Api V1 Attendance Happiness Leaves Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/users/{user_id}/happiness-leave":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"人資主管為每位同仁設定專屬幸福假時數","description":"由『人資主管 HR Manager』為特定使用者設定『幸福假』時數 (例如 8h, 16h, 24h 等)。\n設定後即時生效，該同仁可於差勤系統查閱其幸福假可申請時數與剩餘可用時數並提出請假申請。","operationId":"set_user_happiness_leave_api_v1_attendance_users__user_id__happiness_leave_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetHappinessLeaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLeaveBalanceSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/happiness-leaves/batch":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"人資主管批次為全體或指定同仁設定幸福假時數","description":"人資主管 (HR Manager) 一鍵為全體在職同仁（或指定同仁）批次配發全薪幸福假時數。","operationId":"batch_set_happiness_leaves_api_v1_attendance_happiness_leaves_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchSetHappinessLeaveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/HappinessLeaveUserItem"},"type":"array","title":"Response Batch Set Happiness Leaves Api V1 Attendance Happiness Leaves Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/agent/chat":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"出勤打卡智能助理 AI Agent 對話互動","description":"出勤打卡專屬智能助理 (Attendance AI Agent)，支援打卡狀態、假別額度、工時加班試算、\n法規圍欄諮詢與動態行動按鈕 (打卡/請假/匯出)，並整合 Google Gemini 多模型顧問洞察。","operationId":"attendance_agent_chat_api_v1_attendance_agent_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttendanceAgentChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttendanceAgentChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/agent/insights":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"目前登入者出勤每日主動洞察與溫馨提醒","description":"提供使用者今日主動式出勤洞察 (今日打卡狀態、特休/幸福假餘額、本月工時與建議操作)。","operationId":"attendance_agent_insights_api_v1_attendance_agent_insights_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/auto-punch/config":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"取得登入者 AI Agent 自動打卡排程設定","description":"取得目前登入者的 AI Agent 自動打卡排程設定。","operationId":"get_user_auto_punch_config_api_v1_attendance_auto_punch_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoPunchConfigResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"更新登入者 AI Agent 自動打卡排程設定","description":"更新目前登入者的 AI Agent 自動打卡排程設定 (可開關、自訂上下班打卡時間)。","operationId":"update_user_auto_punch_config_api_v1_attendance_auto_punch_config_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoPunchConfigUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoPunchConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/auto-punch/trigger":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"立即請 AI Agent 執行智慧代理打卡","description":"立即請 AI Agent 進行出勤現況研判並代為完成打卡 (未上班打上班卡、未下班打下班卡)。","operationId":"trigger_user_auto_punch_api_v1_attendance_auto_punch_trigger_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerAutoPunchResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/import/template":{"get":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"下載第三方出勤打卡匯入標準 CSV 範本","description":"下載支援 Excel 直接開啟 (UTF-8 with BOM) 之第三方考勤匯入標準 CSV 範本。","operationId":"download_third_party_attendance_template_api_v1_attendance_import_template_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_type","in":"query","required":false,"schema":{"type":"string","description":"範本模式: daily_pair (每日成對上下班) | single_log (單筆刷卡流水)","default":"daily_pair","title":"Template Type"},"description":"範本模式: daily_pair (每日成對上下班) | single_log (單筆刷卡流水)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/attendance/import/preview":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"上傳並預覽檢核第三方出勤打卡 CSV/TSV 檔案","description":"上傳第三方門禁卡機 (SOYAL / ZKTeco / 七友) 或雲端人資系統 (104 / Apollo / NUEIP / 鼎新) 打卡檔，\n自動偵測 UTF-8 / Big5 編碼、對映系統員工並檢核重複紀錄，回傳預覽結果供確認。","operationId":"preview_third_party_attendance_import_api_v1_attendance_import_preview_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_preview_third_party_attendance_import_api_v1_attendance_import_preview_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyAttendancePreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/attendance/import/execute":{"post":{"tags":["HR人資管理 - 差勤系統 (台灣勞基法合規)"],"summary":"確認執行第三方出勤打卡紀錄批次匯入並自動重算工時與加班費","description":"將預覽檢核通過之第三方打卡明細批次寫入出勤資料庫，設定 5 年法定保存期限，\n並自動觸發每日工時與勞基法第 24 條分級加班費重算。","operationId":"execute_third_party_attendance_import_api_v1_attendance_import_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyAttendanceExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyAttendanceExecuteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workflow/pending":{"get":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"查詢當前使用者待簽核單據列表","operationId":"list_pending_approvals_api_v1_workflow_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApprovalRequestResponse"},"type":"array","title":"Response List Pending Approvals Api V1 Workflow Pending Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workflow/my-requests":{"get":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"查詢我提交的簽核申請單","operationId":"list_my_requests_api_v1_workflow_my_requests_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApprovalRequestResponse"},"type":"array","title":"Response List My Requests Api V1 Workflow My Requests Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workflow/all":{"get":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"查詢全公司簽核單據總覽 (支援狀態與類別篩選)","operationId":"list_all_requests_api_v1_workflow_all_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"篩選狀態: pending, approved, rejected, cancelled","title":"Status"},"description":"篩選狀態: pending, approved, rejected, cancelled"},{"name":"workflow_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"篩選單據類別","title":"Workflow Type"},"description":"篩選單據類別"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalRequestResponse"},"title":"Response List All Requests Api V1 Workflow All Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/quick-action":{"get":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"Email / Teams 一鍵快速簽核落地頁與執行端點","operationId":"quick_action_landing_api_v1_workflow_quick_action_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","description":"HMAC 加密簽核權杖","title":"Token"},"description":"HMAC 加密簽核權杖"},{"name":"action","in":"query","required":false,"schema":{"type":"string","description":"approve 或 reject","default":"approve","title":"Action"},"description":"approve 或 reject"},{"name":"auto","in":"query","required":false,"schema":{"type":"integer","description":"若為 1 則立即執行核准/駁回","default":0,"title":"Auto"},"description":"若為 1 則立即執行核准/駁回"},{"name":"comment","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"審批意見","title":"Comment"},"description":"審批意見"},{"name":"format","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"若為 json 則回傳 JSON","title":"Format"},"description":"若為 json 則回傳 JSON"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"執行 Email / Teams 免登入加密權杖一鍵簽核","operationId":"execute_quick_action_api_v1_workflow_quick_action_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickActionExecuteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/teams-webhook-action":{"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"接收 Microsoft Teams Outgoing Webhook / Power Automate 互動簽核回呼","operationId":"handle_teams_webhook_action_api_v1_workflow_teams_webhook_action_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamsWebhookActionPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/gemini-app-action":{"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"接收 Google Gemini Enterprise App / Google Workspace 互動卡片一鍵簽核回呼","operationId":"handle_gemini_app_action_api_v1_workflow_gemini_app_action_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeminiAppActionPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/notifications/logs":{"get":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"查詢 Email、Microsoft Teams 與 Gemini Enterprise App 通知發送歷史與卡片預覽紀錄","operationId":"list_notification_logs_api_v1_workflow_notifications_logs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"篩選通道: email, teams, 或 gemini_app","title":"Channel"},"description":"篩選通道: email, teams, 或 gemini_app"},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"篩選事件類型","title":"Event Type"},"description":"篩選事件類型"},{"name":"request_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"篩選簽核單 ID","title":"Request Id"},"description":"篩選簽核單 ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NotificationLogResponse"},"title":"Response List Notification Logs Api V1 Workflow Notifications Logs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/notifications/send-custom":{"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"發送自訂 Email、Microsoft Teams 與 Gemini Enterprise App 多通道公告或簽核通知","operationId":"send_custom_notification_api_v1_workflow_notifications_send_custom_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomNotificationSendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workflow/notifications/settings":{"get":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"取得 Email (SMTP)、個人專屬 Microsoft Teams 與 Gemini Enterprise App 整合設定","operationId":"get_notification_settings_api_v1_workflow_notifications_settings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"target_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsPayload"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"更新個人專屬 Microsoft Teams 設定與公司 Email (SMTP) / Gemini Enterprise App 整合設定","operationId":"update_notification_settings_api_v1_workflow_notifications_settings_put","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsPayload"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/notifications/test":{"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"測試發送 Email、個人專屬 Microsoft Teams 與 Gemini Enterprise App 連線","operationId":"test_notification_channels_api_v1_workflow_notifications_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workflow/{request_id}":{"get":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"查詢簽核單據詳細歷程與關卡","operationId":"get_approval_request_api_v1_workflow__request_id__get","security":[{"OAuth2PasswordBearer":[]}],"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/ApprovalRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/":{"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"提交新簽核申請單 (自動發送 Email + Teams 待簽通知)","operationId":"create_approval_request_api_v1_workflow__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequestCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workflow/{request_id}/action":{"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"執行審批動作 (核准 / 駁回)","operationId":"execute_approval_action_api_v1_workflow__request_id__action_post","security":[{"OAuth2PasswordBearer":[]}],"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/ApprovalRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/{request_id}/cancel":{"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"申請人或管理員撤回審核中的申請單","operationId":"cancel_approval_request_api_v1_workflow__request_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/{request_id}/remind":{"post":{"tags":["多級動態簽核審批中心 & Email/Teams/Gemini Enterprise App 通知整合"],"summary":"針對待審單據一鍵發送 Email 與 Microsoft Teams 急件催簽提醒","operationId":"remind_approval_request_api_v1_workflow__request_id__remind_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRemindRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-agent/gemini-status":{"get":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"查詢系統後端 Gemini 3.8 多模型串接與金鑰狀態","operationId":"get_gemini_status_api_v1_ai_agent_gemini_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-agent/gemini-config":{"put":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"更新系統後端全域 Gemini 3.8 模型版本與 API Key (需管理員或財務長權限)","operationId":"update_gemini_config_api_v1_ai_agent_gemini_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeminiConfigUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-agent/chat":{"post":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"與 AI 財務與人資助理對話 (支援自然語言直接提出申請)","operationId":"chat_with_copilot_api_v1_ai_agent_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatQuery"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-agent/audit":{"get":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"執行主動式 AI 異常風險稽核掃描","operationId":"run_ai_audit_api_v1_ai_agent_audit_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-agent/voice-command":{"post":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"透過語音指令請 AI 顧問建立申請單或執行簽核操作","operationId":"execute_voice_command_api_v1_ai_agent_voice_command_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceCommandRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-agent/voice-transcribe":{"post":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"上傳語音音訊檔並轉錄為繁體中文企業指令 (STT)","operationId":"transcribe_voice_audio_api_v1_ai_agent_voice_transcribe_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_transcribe_voice_audio_api_v1_ai_agent_voice_transcribe_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-agent/teams-voice-webhook":{"post":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"Microsoft Teams 語音 Bot / Outgoing Webhook 雙向串接端點","description":"接收來自 Microsoft Teams (手機版 / 桌機版語音輸入、@AI顧問 Outgoing Webhook、Power Automate 語音流程) 之請求：\n1. 自動依據 Teams 使用者 Email (UPN)、姓名或帳號匹配公司內部對應員工 (User)\n2. 解析自然語言請假、加班、補打卡、報銷、採購、打卡、催簽、撤回等意圖\n3. 自動建立單據並回傳 Microsoft Teams 標準 Adaptive Card v1.4 互動式收據卡片","operationId":"handle_teams_voice_webhook_api_v1_ai_agent_teams_voice_webhook_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamsVoiceWebhookPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-agent/gemini-app-webhook":{"post":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"Google Gemini Enterprise App 語音/對話 Bot 與互動卡片雙向串接端點","description":"接收來自 Google Gemini Enterprise App / Google Workspace Agent (@Gemini) 之語音或文字指令請求：\n1. 自動依據 Google Workspace 使用者 Email、姓名或帳號匹配公司內部對應員工 (User)\n2. 解析自然語言請假、加班、補打卡、報銷、採購、打卡、催簽、撤回與【主管直接核准/駁回】等意圖\n3. 自動建立單據或執行簽核，並回傳 Google Gemini Enterprise App 標準 Card v2 互動式收據卡片","operationId":"handle_gemini_app_webhook_api_v1_ai_agent_gemini_app_webhook_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeminiAppWebhookPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-agent/voice-logs":{"get":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"查詢 Teams 語音指令與 AI 自動申請稽核歷史紀錄","operationId":"list_voice_command_logs_api_v1_ai_agent_voice_logs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"篩選特定員工 ID","title":"User Id"},"description":"篩選特定員工 ID"},{"name":"intent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"篩選特定語音意圖","title":"Intent"},"description":"篩選特定語音意圖"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-agent/employees-voice-directory":{"get":{"tags":["AI Copilot 智慧財務與 Teams 語音申請中心"],"summary":"取得全公司可透過 Teams 語音提出申請之同仁名冊與權限狀態","operationId":"get_employees_voice_directory_api_v1_ai_agent_employees_voice_directory_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/accounting/import-third-party/preview":{"post":{"tags":["會計報表與第三方系統匯入"],"summary":"上傳第三方會計報表並進行預覽與借貸平衡檢核","description":"支援鼎新 (Digiwin)、正航 (Chi)、鉅茂 (JiuMao)、QuickBooks 及通用 Excel / CSV。\n上傳檔案或傳送字串後，進行編碼解析、智慧欄位映射、借貸總和檢核與新建科目預覽。\n可接受 multipart/form-data 檔案上傳或 application/json 示範文字資料。","operationId":"preview_third_party_import_api_v1_accounting_import_third_party_preview_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPreviewResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/accounting/import-third-party/execute":{"post":{"tags":["會計報表與第三方系統匯入"],"summary":"正式確認執行第三方報表匯入與傳票入帳","description":"根據確認無誤的預覽資料，於資料庫交易內自動建立未建置之會計科目，\n並生成「期初開帳傳票 (Opening Balance)」或「歷史傳票日記帳 (Batch Journal Entries)」，即時連動四大財務報表。","operationId":"execute_third_party_import_api_v1_accounting_import_third_party_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResultResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/accounting/import-third-party/template":{"get":{"tags":["會計報表與第三方系統匯入"],"summary":"下載各類第三方會計系統與標準格式 CSV 範本","description":"下載帶有 UTF-8 BOM 之繁體中文標準匯入 CSV 範本，支援 Excel 直接開啟","operationId":"download_import_template_api_v1_accounting_import_third_party_template_get","parameters":[{"name":"template_type","in":"query","required":false,"schema":{"type":"string","description":"trial_balance | journal_entries | digiwin_sample | chi_sample","default":"trial_balance","title":"Template Type"},"description":"trial_balance | journal_entries | digiwin_sample | chi_sample"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounting/import-third-party/sample-data":{"get":{"tags":["會計報表與第三方系統匯入"],"summary":"取得第三方系統示範資料 (供前端一鍵快速體驗)","description":"回傳示範報表資料，前端可直接填入並預覽","operationId":"get_sample_data_api_v1_accounting_import_third_party_sample_data_get","parameters":[{"name":"system_type","in":"query","required":false,"schema":{"type":"string","description":"digiwin | chi | generic","default":"digiwin","title":"System Type"},"description":"digiwin | chi | generic"},{"name":"import_mode","in":"query","required":false,"schema":{"type":"string","description":"trial_balance | journal_entries","default":"trial_balance","title":"Import Mode"},"description":"trial_balance | journal_entries"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/company/public":{"get":{"tags":["公司基本資料設定"],"summary":"取得公開公司名稱、統編與 Logo (供登入頁面展示)","description":"免認證取得企業法定名稱、英文名稱、統一編號與 Logo 網址","operationId":"get_public_company_info_api_v1_company_public_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/company/logo":{"post":{"tags":["公司基本資料設定"],"summary":"上傳公司 Logo 圖檔 (需管理員或財務長權限)","description":"上傳公司 Logo 檔案，儲存至靜態目錄並更新資料庫中公司檔案","operationId":"upload_company_logo_api_v1_company_logo_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_company_logo_api_v1_company_logo_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["公司基本資料設定"],"summary":"刪除公司 Logo (需管理員或財務長權限)","description":"移除公司自訂 Logo，恢復系統預設識別標章","operationId":"delete_company_logo_api_v1_company_logo_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfileResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/company/":{"get":{"tags":["公司基本資料設定"],"summary":"取得公司基本資料與全域組態","description":"取得企業法定資訊、聯絡資訊、稅務設定、打卡圍欄與會計制度","operationId":"get_company_profile_api_v1_company__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfileResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["公司基本資料設定"],"summary":"更新公司基本資料 (需管理員或財務長權限)","description":"更新企業基本資料，包含統編檢核與全域即時組態同步","operationId":"update_company_profile_api_v1_company__put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/company/verify-tax-id":{"post":{"tags":["公司基本資料設定"],"summary":"即時驗證台灣統一編號 (模數 10 算法)","description":"驗算輸入之 8 碼統一編號是否符合財政部模數 10 演算法規範","operationId":"verify_company_tax_id_api_v1_company_verify_tax_id_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxIdVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxIdVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/company/reset-demo":{"post":{"tags":["公司基本資料設定"],"summary":"重設為示範公司完整資料 (需管理員權限)","description":"將公司基本資料還原為標準台灣示範企業設定","operationId":"reset_demo_company_profile_api_v1_company_reset_demo_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfileResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/financial-products":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Get Financial Products","description":"查詢金融商品交易庫存列表","operationId":"get_financial_products_api_v1_inventory_financial_products_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"symbol","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"商品代碼篩選","title":"Symbol"},"description":"商品代碼篩選"},{"name":"product_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"商品類別 (stock, bond, future, option, fund_etf, fx_crypto, other)","title":"Product Type"},"description":"商品類別 (stock, bond, future, option, fund_etf, fx_crypto, other)"},{"name":"market","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"市場 (TWSE, TPEx, US, Global, OTC)","title":"Market"},"description":"市場 (TWSE, TPEx, US, Global, OTC)"},{"name":"position_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"部位 (long, short)","title":"Position Type"},"description":"部位 (long, short)"},{"name":"pnl_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"損益狀況 (gain, loss, even)","title":"Pnl Status"},"description":"損益狀況 (gain, loss, even)"},{"name":"keyword","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"關鍵字搜尋","title":"Keyword"},"description":"關鍵字搜尋"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Financial Products Api V1 Inventory Financial Products Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["庫存管理 - 金融業"],"summary":"Create Financial Product","description":"手動新增金融商品庫存","operationId":"create_financial_product_api_v1_inventory_financial_products_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinancialInventoryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinancialInventoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/financial-products/summary":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Get Financial Products Summary","description":"取得金融商品庫存總市值、總成本、未實現損益與分佈摘要","operationId":"get_financial_products_summary_api_v1_inventory_financial_products_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinancialInventorySummary"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/financial-products/template":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Download Inventory Template","description":"下載標準繁體中文 CSV 匯入範本 (含 UTF-8 BOM，相容 Excel)","operationId":"download_inventory_template_api_v1_inventory_financial_products_template_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/financial-products/export":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Export Financial Products Csv","description":"匯出現有金融商品交易庫存明細為 CSV 檔案","operationId":"export_financial_products_csv_api_v1_inventory_financial_products_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/financial-products/sample-data":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Get Sample Financial Data","description":"取得券商對帳單示範資料","operationId":"get_sample_financial_data_api_v1_inventory_financial_products_sample_data_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/financial-products/{item_id}":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Get Financial Product By Id","description":"取得單筆金融商品庫存詳情","operationId":"get_financial_product_by_id_api_v1_inventory_financial_products__item_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"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/FinancialInventoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["庫存管理 - 金融業"],"summary":"Update Financial Product","description":"手動編輯金融商品庫存 (自動重新計算總成本與損益)","operationId":"update_financial_product_api_v1_inventory_financial_products__item_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinancialInventoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinancialInventoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["庫存管理 - 金融業"],"summary":"Delete Financial Product","description":"刪除單筆金融商品庫存紀錄","operationId":"delete_financial_product_api_v1_inventory_financial_products__item_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/financial-products/batch-delete":{"post":{"tags":["庫存管理 - 金融業"],"summary":"Batch Delete Financial Products","description":"批次刪除金融商品庫存紀錄","operationId":"batch_delete_financial_products_api_v1_inventory_financial_products_batch_delete_post","requestBody":{"content":{"application/json":{"schema":{"items":{"type":"integer"},"type":"array","title":"Item Ids"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/financial-products/import/preview":{"post":{"tags":["庫存管理 - 金融業"],"summary":"Preview External Import","description":"預覽外部資料匯入：\n支援上傳 Excel (.xlsx, .xls)、CSV (.csv) 或貼上純文字/JSON\n自動進行券商欄位智慧映射並試算預估總市值與損益","operationId":"preview_external_import_api_v1_inventory_financial_products_import_preview_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_preview_external_import_api_v1_inventory_financial_products_import_preview_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinancialImportPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/financial-products/import/execute":{"post":{"tags":["庫存管理 - 金融業"],"summary":"Execute External Import","description":"執行外部資料正式入庫：\n可選 'append' (追加保留既有資料) 或 'overwrite' (覆蓋重置所有庫存)","operationId":"execute_external_import_api_v1_inventory_financial_products_import_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinancialImportExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinancialImportExecuteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/medical/products":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Get Medical Products","description":"查詢醫療藥品與衛材耗材庫存列表","operationId":"get_medical_products_api_v1_inventory_medical_products_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"keyword","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"關鍵字搜尋（品名、健保碼、料號、規格、庫位、廠商）","title":"Keyword"},"description":"關鍵字搜尋（品名、健保碼、料號、規格、庫位、廠商）"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"醫療類別篩選","title":"Category"},"description":"醫療類別篩選"},{"name":"storage_condition","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"儲存溫層篩選","title":"Storage Condition"},"description":"儲存溫層篩選"},{"name":"stock_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"庫存水位狀態 (out_of_stock, low_stock, critical_or_low, normal, excess)","title":"Stock Status"},"description":"庫存水位狀態 (out_of_stock, low_stock, critical_or_low, normal, excess)"},{"name":"expiry_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"效期狀態 (expired, expiring_soon, normal)","title":"Expiry Status"},"description":"效期狀態 (expired, expiring_soon, normal)"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Medical Products Api V1 Inventory Medical Products Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["庫存管理 - 金融業"],"summary":"Create Medical Product","description":"新增醫療藥品或衛材耗材品項","operationId":"create_medical_product_api_v1_inventory_medical_products_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalInventoryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalInventoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/medical/products/summary":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Get Medical Products Summary","description":"取得醫療品項庫存總額、缺貨數、低於安全存量警示數與效期風險分佈","operationId":"get_medical_products_summary_api_v1_inventory_medical_products_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalInventorySummary"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/medical/products/template":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Download Medical Inventory Template","description":"下載醫療藥品與衛材耗材標準繁體中文 CSV 匯入範本 (含 UTF-8 BOM)","operationId":"download_medical_inventory_template_api_v1_inventory_medical_products_template_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/medical/products/export":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Export Medical Inventory Csv","description":"匯出全體醫療藥品衛材庫存清冊 CSV (含 UTF-8 BOM，相容 Excel)","operationId":"export_medical_inventory_csv_api_v1_inventory_medical_products_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/medical/products/seed":{"post":{"tags":["庫存管理 - 金融業"],"summary":"Seed Medical Sample Data","description":"植入台灣醫療常備處方藥、管制藥、冷鏈疫苗與耗材等高品質真實示範資料","operationId":"seed_medical_sample_data_api_v1_inventory_medical_products_seed_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/medical/products/check-safety-alerts":{"post":{"tags":["庫存管理 - 金融業"],"summary":"Check Safety Stock Alerts","description":"掃描全體或指定之醫療藥品衛材，對低於最低安全庫存者立即發送 Email 警示通知","operationId":"check_safety_stock_alerts_api_v1_inventory_medical_products_check_safety_alerts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalSafetyAlertRequest","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalSafetyAlertResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/inventory/medical/products/{item_id}/send-alert":{"post":{"tags":["庫存管理 - 金融業"],"summary":"Send Single Item Alert","description":"針對特定藥品衛材手動即時發送最低安全庫存提醒信","operationId":"send_single_item_alert_api_v1_inventory_medical_products__item_id__send_alert_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}},{"name":"target_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"指定寄送信箱","title":"Target Email"},"description":"指定寄送信箱"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/medical/products/{item_id}/adjust":{"post":{"tags":["庫存管理 - 金融業"],"summary":"Adjust Medical Stock","description":"快速入庫、領出出庫或盤點庫存校正","operationId":"adjust_medical_stock_api_v1_inventory_medical_products__item_id__adjust_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalStockAdjustRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/medical/products/{item_id}":{"get":{"tags":["庫存管理 - 金融業"],"summary":"Get Medical Product Detail","description":"取得單一醫療品項詳細資料","operationId":"get_medical_product_detail_api_v1_inventory_medical_products__item_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"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/MedicalInventoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["庫存管理 - 金融業"],"summary":"Update Medical Product","description":"更新醫療品項資料與安全水位閾值","operationId":"update_medical_product_api_v1_inventory_medical_products__item_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalInventoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalInventoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["庫存管理 - 金融業"],"summary":"Delete Medical Product","description":"刪除醫療品項","operationId":"delete_medical_product_api_v1_inventory_medical_products__item_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inventory/medical/products/batch-delete":{"post":{"tags":["庫存管理 - 金融業"],"summary":"Batch Delete Medical Products","description":"批次刪除醫療品項","operationId":"batch_delete_medical_products_api_v1_inventory_medical_products_batch_delete_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":{"items":{"type":"integer"},"type":"array"},"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/cloud-files/stats":{"get":{"tags":["雲端檔案庫 (契約書與報價單)"],"summary":"取得雲端檔案庫統計指標","operationId":"read_cloud_vault_stats_api_v1_cloud_files_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudVaultStatsResponse"}}}}}}},"/api/v1/cloud-files/":{"get":{"tags":["雲端檔案庫 (契約書與報價單)"],"summary":"查詢雲端檔案庫 (契約書、報價單)","operationId":"list_cloud_documents_api_v1_cloud_files__get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"類別篩選: all, contract, quotation, supplement, po","title":"Category"},"description":"類別篩選: all, contract, quotation, supplement, po"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"狀態篩選: all, draft, pending_sign, active, expiring_soon, expired, archived","title":"Status"},"description":"狀態篩選: all, draft, pending_sign, active, expiring_soon, expired, archived"},{"name":"keyword","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"關鍵字搜尋","title":"Keyword"},"description":"關鍵字搜尋"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"關鍵字搜尋 (相容參數)","title":"Search"},"description":"關鍵字搜尋 (相容參數)"},{"name":"expiring_only","in":"query","required":false,"schema":{"type":"boolean","description":"僅顯示即將到期或已逾期文件","default":false,"title":"Expiring Only"},"description":"僅顯示即將到期或已逾期文件"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudDocumentResponse"},"title":"Response List Cloud Documents Api V1 Cloud Files  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cloud-files/upload":{"post":{"tags":["雲端檔案庫 (契約書與報價單)"],"summary":"上傳新契約書或報價單至雲端檔案庫","operationId":"upload_cloud_document_api_v1_cloud_files_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_cloud_document_api_v1_cloud_files_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudDocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cloud-files/{doc_id}":{"put":{"tags":["雲端檔案庫 (契約書與報價單)"],"summary":"更新契約書或報價單資訊及新版本檔案","operationId":"update_cloud_document_api_v1_cloud_files__doc_id__put","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_cloud_document_api_v1_cloud_files__doc_id__put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudDocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["雲端檔案庫 (契約書與報價單)"],"summary":"刪除雲端檔案庫文件","operationId":"delete_cloud_document_api_v1_cloud_files__doc_id__delete","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cloud-files/{doc_id}/download":{"get":{"tags":["雲端檔案庫 (契約書與報價單)"],"summary":"線上預覽或下載雲端契約書/報價單檔案","operationId":"download_or_preview_cloud_document_api_v1_cloud_files__doc_id__download_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}},{"name":"inline","in":"query","required":false,"schema":{"type":"boolean","description":"True=瀏覽器內嵌線上預覽, False=強制下載檔案","default":false,"title":"Inline"},"description":"True=瀏覽器內嵌線上預覽, False=強制下載檔案"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/meta/banks":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"取得台灣銀行總行代碼清單與企網銀批次匯出格式規格 (相容別名)","operationId":"get_taiwan_banks_and_templates_api_v1_payroll_meta_banks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/payroll/banks":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"取得台灣銀行總行代碼清單與企網銀批次匯出格式規格","operationId":"get_taiwan_banks_and_templates_api_v1_payroll_banks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/payroll/overview":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"取得台灣銀行清單、企網銀媒體範本與近期薪資批次概覽","operationId":"get_taiwan_banks_and_templates_api_v1_payroll_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/payroll/statutory-standards":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"取得目前生效之勞健保／勞退主管機關費率參數、官方公告預設集與官方投保薪資分級表","operationId":"get_statutory_standards_api_v1_payroll_statutory_standards_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/payroll/statutory-standards/align-preview":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"試算指定月薪對應之官方勞保、健保、勞退投保級距與雙方保費","operationId":"preview_statutory_grade_alignment_api_v1_payroll_statutory_standards_align_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatutoryAlignPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/payroll/statutory-standards/sync":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"同步主管機關公告勞健保／勞退費率與基本工資標準，並批次對齊全體員工官方投保級距","operationId":"sync_statutory_standards_endpoint_api_v1_payroll_statutory_standards_sync_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatutorySyncRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/payroll/profiles":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"查詢全體員工薪資結構、勞健保級距與台灣銀行轉帳帳戶設定","operationId":"list_employee_payroll_profiles_api_v1_payroll_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/payroll/profiles/{user_id}":{"put":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"更新員工薪資結構、勞健保設定與台灣銀行薪轉帳號","operationId":"update_employee_payroll_profile_api_v1_payroll_profiles__user_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeePayrollProfileUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"取得所有月度薪資核算批次清單 (若無紀錄則自動建立當月批次)","operationId":"list_payroll_runs_api_v1_payroll_runs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/calculate":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"與『差勤系統』同步考勤與請假並核算指定年月之薪資批次","operationId":"calculate_payroll_run_endpoint_api_v1_payroll_runs_calculate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollCalculateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/payroll/runs/{run_id}":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"取得單一薪資核算批次完整明細、會計分錄預覽與企網銀檢核狀態","operationId":"get_payroll_run_detail_api_v1_payroll_runs__run_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/slips/batch":{"put":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"線上整批儲存薪資明細 (別名)","operationId":"batch_update_payroll_run_api_v1_payroll_runs__run_id__slips_batch_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollBatchEditRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/batch-edit":{"put":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"線上整批儲存薪資明細與公司付款銀行設定","operationId":"batch_update_payroll_run_api_v1_payroll_runs__run_id__batch_edit_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollBatchEditRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/slips/{slip_id}":{"put":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"線上編輯單一員工薪資明細單 (含批次ID路徑別名)","operationId":"update_single_payroll_slip_api_v1_payroll_runs__run_id__slips__slip_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"slip_id","in":"path","required":true,"schema":{"type":"integer","title":"Slip Id"}},{"name":"run_id","in":"path","required":true,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollSlipUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/slips/{slip_id}":{"put":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"線上編輯單一員工薪資明細單 (即時重算應發、應扣與實發轉帳淨額)","operationId":"update_single_payroll_slip_api_v1_payroll_slips__slip_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"slip_id","in":"path","required":true,"schema":{"type":"integer","title":"Slip Id"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollSlipUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/approve":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"核定鎖定薪資核算批次","operationId":"approve_payroll_run_api_v1_payroll_runs__run_id__approve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/unlock":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"解鎖薪資批次返回草稿狀態","operationId":"unlock_payroll_run_api_v1_payroll_runs__run_id__unlock_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/post-accrual-journal":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"與『會計系統』連動：拋轉階段一『薪資計提傳票』(別名)","operationId":"post_accrual_journal_endpoint_api_v1_payroll_runs__run_id__post_accrual_journal_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollPostJournalRequest","default":{"include_employer_statutory_cost":true}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/post-accrual":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"與『會計系統』連動：拋轉階段一『薪資計提傳票』","operationId":"post_accrual_journal_endpoint_api_v1_payroll_runs__run_id__post_accrual_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollPostJournalRequest","default":{"include_employer_statutory_cost":true}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/post-payment-journal":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"與『會計系統』連動：拋轉階段二『薪資發放傳票』(別名)","operationId":"post_payment_journal_endpoint_api_v1_payroll_runs__run_id__post_payment_journal_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollPostJournalRequest","default":{"include_employer_statutory_cost":true}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/post-payment":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"與『會計系統』連動：拋轉階段二『薪資發放傳票』","operationId":"post_payment_journal_endpoint_api_v1_payroll_runs__run_id__post_payment_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollPostJournalRequest","default":{"include_employer_statutory_cost":true}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/post-both-journals":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"一鍵完成雙階段會計傳票拋轉 (別名)","operationId":"post_combined_journals_endpoint_api_v1_payroll_runs__run_id__post_both_journals_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollPostJournalRequest","default":{"include_employer_statutory_cost":true}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/post-combined":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"一鍵完成雙階段會計傳票拋轉（薪資計提 + 企網銀撥薪發放）","operationId":"post_combined_journals_endpoint_api_v1_payroll_runs__run_id__post_combined_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayrollPostJournalRequest","default":{"include_employer_statutory_cost":true}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/bank-preview":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"線上即時預覽台灣企網銀批次上傳媒體檔內容與檢核結果 (別名)","operationId":"preview_bank_media_file_api_v1_payroll_runs__run_id__bank_preview_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"format_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format Type"}},{"name":"bank_template","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Template"}},{"name":"template_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"}},{"name":"encoding","in":"query","required":false,"schema":{"type":"string","description":"big5 | utf-8","default":"big5","title":"Encoding"},"description":"big5 | utf-8"},{"name":"date_format","in":"query","required":false,"schema":{"type":"string","description":"roc | ad","default":"roc","title":"Date Format"},"description":"roc | ad"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/preview-bank-file":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"線上即時預覽台灣企網銀批次上傳媒體檔內容與檢核結果","operationId":"preview_bank_media_file_api_v1_payroll_runs__run_id__preview_bank_file_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"format_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format Type"}},{"name":"bank_template","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Template"}},{"name":"template_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"}},{"name":"encoding","in":"query","required":false,"schema":{"type":"string","description":"big5 | utf-8","default":"big5","title":"Encoding"},"description":"big5 | utf-8"},{"name":"date_format","in":"query","required":false,"schema":{"type":"string","description":"roc | ad","default":"roc","title":"Date Format"},"description":"roc | ad"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/export-bank":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"匯出台灣企網銀批次轉帳媒體檔 (別名)","operationId":"export_payroll_file_endpoint_api_v1_payroll_runs__run_id__export_bank_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"format_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format Type"}},{"name":"template_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"}},{"name":"encoding","in":"query","required":false,"schema":{"type":"string","description":"big5 (ANSI/CP950) | utf-8 | utf-8-sig","default":"utf-8","title":"Encoding"},"description":"big5 (ANSI/CP950) | utf-8 | utf-8-sig"},{"name":"date_format","in":"query","required":false,"schema":{"type":"string","description":"roc | ad","default":"roc","title":"Date Format"},"description":"roc | ad"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/export":{"get":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"匯出台灣企網銀批次轉帳媒體檔、可編輯 Excel/CSV 或正式 PDF 薪資報表","operationId":"export_payroll_file_endpoint_api_v1_payroll_runs__run_id__export_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"format_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format Type"}},{"name":"template_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"}},{"name":"encoding","in":"query","required":false,"schema":{"type":"string","description":"big5 (ANSI/CP950) | utf-8 | utf-8-sig","default":"utf-8","title":"Encoding"},"description":"big5 (ANSI/CP950) | utf-8 | utf-8-sig"},{"name":"date_format","in":"query","required":false,"schema":{"type":"string","description":"roc | ad","default":"roc","title":"Date Format"},"description":"roc | ad"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payroll/runs/{run_id}/import-edits":{"post":{"tags":["薪資核算與台灣企網銀轉帳媒體系統"],"summary":"上傳經 Excel/CSV 編輯後之薪資批次檔並回寫更新系統","operationId":"import_payroll_edits_endpoint_api_v1_payroll_runs__run_id__import_edits_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_payroll_edits_endpoint_api_v1_payroll_runs__run_id__import_edits_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"前端 Web SPA 介面 (Mobile-First / PWA)","operationId":"index_page__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/v1/health":{"get":{"summary":"API 健康檢查端點","operationId":"health_check_api_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"系統與資料庫健康檢查端點","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AccountCategory":{"type":"string","enum":["asset","liability","equity","revenue","cost","expense","non_op_income","non_op_expense"],"title":"AccountCategory"},"AccountCreate":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"category":{"$ref":"#/components/schemas/AccountCategory"},"normal_balance":{"$ref":"#/components/schemas/BalanceDirection","default":"debit"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["code","name","category"],"title":"AccountCreate"},"AccountResponse":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"category":{"$ref":"#/components/schemas/AccountCategory"},"normal_balance":{"$ref":"#/components/schemas/BalanceDirection","default":"debit"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"boolean","title":"Is Active","default":true},"id":{"type":"integer","title":"Id"}},"type":"object","required":["code","name","category","id"],"title":"AccountResponse"},"ApprovalActionRequest":{"properties":{"action":{"type":"string","title":"Action","description":"approve 或 reject"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["action"],"title":"ApprovalActionRequest"},"ApprovalAuditLogResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"action":{"type":"string","title":"Action"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"action_time":{"type":"string","format":"date-time","title":"Action Time"}},"type":"object","required":["id","user_id","action","action_time"],"title":"ApprovalAuditLogResponse"},"ApprovalCancelRequest":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"撤回原因說明"}},"type":"object","title":"ApprovalCancelRequest"},"ApprovalRemindRequest":{"properties":{"custom_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Message","description":"催簽補充留言"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note","description":"催簽補充留言 (相容欄位)"}},"type":"object","title":"ApprovalRemindRequest"},"ApprovalRequestCreate":{"properties":{"workflow_type":{"$ref":"#/components/schemas/WorkflowType"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"amount":{"type":"number","title":"Amount","default":0.0},"related_entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related Entity Type"},"related_entity_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Related Entity Id"},"custom_steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/CustomStepInput"},"type":"array"},{"type":"null"}],"title":"Custom Steps"}},"type":"object","required":["workflow_type","title"],"title":"ApprovalRequestCreate"},"ApprovalRequestResponse":{"properties":{"id":{"type":"integer","title":"Id"},"request_number":{"type":"string","title":"Request Number"},"workflow_type":{"$ref":"#/components/schemas/WorkflowType"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"amount":{"type":"number","title":"Amount"},"applicant_id":{"type":"integer","title":"Applicant Id"},"applicant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applicant Name"},"current_step":{"type":"integer","title":"Current Step"},"total_steps":{"type":"integer","title":"Total Steps"},"status":{"$ref":"#/components/schemas/WorkflowStatus"},"related_entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related Entity Type"},"related_entity_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Related Entity Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"steps":{"items":{"$ref":"#/components/schemas/ApprovalStepResponse"},"type":"array","title":"Steps","default":[]},"logs":{"items":{"$ref":"#/components/schemas/ApprovalAuditLogResponse"},"type":"array","title":"Logs","default":[]}},"type":"object","required":["id","request_number","workflow_type","title","amount","applicant_id","current_step","total_steps","status","created_at"],"title":"ApprovalRequestResponse"},"ApprovalStepResponse":{"properties":{"id":{"type":"integer","title":"Id"},"step_order":{"type":"integer","title":"Step Order"},"step_name":{"type":"string","title":"Step Name"},"approver_role":{"anyOf":[{"$ref":"#/components/schemas/UserRole"},{"type":"null"}]},"approver_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approver Id"},"approver_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver Name"},"status":{"$ref":"#/components/schemas/StepStatus"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"action_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Action Time"}},"type":"object","required":["id","step_order","step_name","status"],"title":"ApprovalStepResponse"},"AttendanceAgentChatRequest":{"properties":{"query":{"type":"string","title":"Query"},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key"}},"type":"object","required":["query"],"title":"AttendanceAgentChatRequest"},"AttendanceAgentChatResponse":{"properties":{"intent":{"type":"string","title":"Intent"},"message":{"type":"string","title":"Message"},"suggested_actions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Suggested Actions","default":[]},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"}},"type":"object","required":["intent","message"],"title":"AttendanceAgentChatResponse"},"AttendanceRecordResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"punch_date":{"type":"string","format":"date","title":"Punch Date"},"punch_time":{"type":"string","format":"date-time","title":"Punch Time"},"punch_type":{"$ref":"#/components/schemas/PunchType"},"latitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latitude"},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Longitude"},"distance_from_office_meters":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Distance From Office Meters"},"is_geofence_valid":{"type":"boolean","title":"Is Geofence Valid"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_makeup":{"type":"boolean","title":"Is Makeup"},"retention_until":{"type":"string","format":"date","title":"Retention Until"}},"type":"object","required":["id","user_id","punch_date","punch_time","punch_type","latitude","longitude","distance_from_office_meters","is_geofence_valid","ip_address","notes","is_makeup","retention_until"],"title":"AttendanceRecordResponse"},"AutoPunchConfigResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"clock_in_time":{"type":"string","title":"Clock In Time"},"clock_out_time":{"type":"string","title":"Clock Out Time"},"workdays_only":{"type":"boolean","title":"Workdays Only"},"skip_if_on_leave":{"type":"boolean","title":"Skip If On Leave"},"last_clock_in_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Last Clock In Date"},"last_clock_out_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Last Clock Out Date"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["user_id","is_enabled","clock_in_time","clock_out_time","workdays_only","skip_if_on_leave"],"title":"AutoPunchConfigResponse"},"AutoPunchConfigUpdate":{"properties":{"is_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"},"clock_in_time":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}],"title":"Clock In Time","description":"上班打卡時間 (HH:MM)"},"clock_out_time":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}],"title":"Clock Out Time","description":"下班打卡時間 (HH:MM)"},"workdays_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Workdays Only"},"skip_if_on_leave":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Skip If On Leave"}},"type":"object","title":"AutoPunchConfigUpdate"},"BalanceDirection":{"type":"string","enum":["debit","credit"],"title":"BalanceDirection"},"BalanceSheetItem":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"amount":{"type":"number","title":"Amount"}},"type":"object","required":["code","name","amount"],"title":"BalanceSheetItem"},"BalanceSheetReport":{"properties":{"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"assets":{"items":{"$ref":"#/components/schemas/BalanceSheetItem"},"type":"array","title":"Assets"},"total_assets":{"type":"number","title":"Total Assets"},"liabilities":{"items":{"$ref":"#/components/schemas/BalanceSheetItem"},"type":"array","title":"Liabilities"},"total_liabilities":{"type":"number","title":"Total Liabilities"},"equity":{"items":{"$ref":"#/components/schemas/BalanceSheetItem"},"type":"array","title":"Equity"},"current_net_income":{"type":"number","title":"Current Net Income"},"total_equity":{"type":"number","title":"Total Equity"},"total_liabilities_and_equity":{"type":"number","title":"Total Liabilities And Equity"},"is_balanced":{"type":"boolean","title":"Is Balanced"}},"type":"object","required":["as_of_date","assets","total_assets","liabilities","total_liabilities","equity","current_net_income","total_equity","total_liabilities_and_equity","is_balanced"],"title":"BalanceSheetReport"},"BatchSetHappinessLeaveRequest":{"properties":{"user_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"User Ids","description":"指定使用者 ID 清單，若留空則為全體在職員工"},"hours":{"type":"number","minimum":0.0,"title":"Hours","description":"設定幸福假總時數 (額度)"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year","description":"設定年度 (預設當年度)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"核發原因或備註"}},"type":"object","required":["hours"],"title":"BatchSetHappinessLeaveRequest"},"Body_import_payroll_edits_endpoint_api_v1_payroll_runs__run_id__import_edits_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_payroll_edits_endpoint_api_v1_payroll_runs__run_id__import_edits_post"},"Body_login_api_v1_auth_login_post":{"properties":{"company_tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Tax Id"},"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"password","title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_api_v1_auth_login_post"},"Body_preview_external_import_api_v1_inventory_financial_products_import_preview_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"},"raw_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Content"}},"type":"object","title":"Body_preview_external_import_api_v1_inventory_financial_products_import_preview_post"},"Body_preview_third_party_attendance_import_api_v1_attendance_import_preview_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"第三方考勤匯出之 CSV 或 TSV 檔案"},"source_system":{"type":"string","title":"Source System","description":"來源系統: general / access_card / cloud_hr","default":"general"},"import_mode":{"type":"string","title":"Import Mode","description":"解析模式: auto / daily_pair / single_log","default":"auto"}},"type":"object","required":["file"],"title":"Body_preview_third_party_attendance_import_api_v1_attendance_import_preview_post"},"Body_transcribe_voice_audio_api_v1_ai_agent_voice_transcribe_post":{"properties":{"audio_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Audio File"},"hint_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hint Text"},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key"}},"type":"object","title":"Body_transcribe_voice_audio_api_v1_ai_agent_voice_transcribe_post"},"Body_update_cloud_document_api_v1_cloud_files__doc_id__put":{"properties":{"title":{"type":"string","title":"Title","description":"文件名稱/主旨"},"category":{"type":"string","title":"Category","description":"類別","default":"contract"},"counterparty_name":{"type":"string","title":"Counterparty Name","description":"客戶/廠商名稱","default":""},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty","description":"客戶/廠商名稱(相容欄位)"},"counterparty_tax_id":{"type":"string","title":"Counterparty Tax Id","description":"客戶/廠商統編","default":""},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount","description":"合約/報價總金額"},"total_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Amount","description":"合約/報價總金額(相容欄位)"},"contract_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Contract Amount","description":"合約/報價總金額(相容欄位)"},"currency":{"type":"string","title":"Currency","description":"幣別","default":"TWD"},"status":{"type":"string","title":"Status","description":"狀態","default":"active"},"effective_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Date","description":"生效日期 YYYY-MM-DD"},"expiry_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiry Date","description":"到期日期 YYYY-MM-DD"},"version":{"type":"string","title":"Version","description":"版本號","default":"v1.0"},"tags":{"type":"string","title":"Tags","description":"標籤","default":""},"notes":{"type":"string","title":"Notes","description":"重要條款摘要或備註","default":""},"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File","description":"選填：上傳新版本檔案"}},"type":"object","required":["title"],"title":"Body_update_cloud_document_api_v1_cloud_files__doc_id__put"},"Body_upload_cloud_document_api_v1_cloud_files_upload_post":{"properties":{"title":{"type":"string","title":"Title","description":"文件名稱/主旨"},"category":{"type":"string","title":"Category","description":"類別: contract(契約書), quotation(報價單), supplement(增補協議), po(採購單)","default":"contract"},"doc_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Number","description":"選填：自訂文件單號"},"counterparty_name":{"type":"string","title":"Counterparty Name","description":"客戶/廠商名稱","default":""},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty","description":"客戶/廠商名稱(相容欄位)"},"counterparty_tax_id":{"type":"string","title":"Counterparty Tax Id","description":"客戶/廠商統編","default":""},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount","description":"合約/報價總金額"},"total_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Amount","description":"合約/報價總金額(相容欄位)"},"contract_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Contract Amount","description":"合約/報價總金額(相容欄位)"},"currency":{"type":"string","title":"Currency","description":"幣別","default":"TWD"},"status":{"type":"string","title":"Status","description":"狀態","default":"active"},"effective_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Date","description":"生效日期 YYYY-MM-DD"},"expiry_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiry Date","description":"到期日期 YYYY-MM-DD"},"version":{"type":"string","title":"Version","description":"版本號","default":"v1.0"},"tags":{"type":"string","title":"Tags","description":"標籤","default":""},"notes":{"type":"string","title":"Notes","description":"重要條款摘要或備註","default":""},"uploaded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded By","description":"上傳者姓名"},"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File","description":"上傳之契約書或報價單檔案 (PDF/圖片/Word/Excel)"}},"type":"object","required":["title"],"title":"Body_upload_cloud_document_api_v1_cloud_files_upload_post"},"Body_upload_company_logo_api_v1_company_logo_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"公司 Logo 圖檔 (PNG/JPG/WEBP/SVG/GIF, <=5MB)"}},"type":"object","required":["file"],"title":"Body_upload_company_logo_api_v1_company_logo_post"},"Body_upload_invoice_ocr_api_v1_invoices_upload_ocr_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_invoice_ocr_api_v1_invoices_upload_ocr_post"},"CashFlowReport":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"operating_activities":{"$ref":"#/components/schemas/CashFlowSection"},"investing_activities":{"$ref":"#/components/schemas/CashFlowSection"},"financing_activities":{"$ref":"#/components/schemas/CashFlowSection"},"net_cash_flow":{"type":"number","title":"Net Cash Flow"},"beginning_cash":{"type":"number","title":"Beginning Cash"},"ending_cash":{"type":"number","title":"Ending Cash"}},"type":"object","required":["start_date","end_date","operating_activities","investing_activities","financing_activities","net_cash_flow","beginning_cash","ending_cash"],"title":"CashFlowReport"},"CashFlowSection":{"properties":{"title":{"type":"string","title":"Title"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"},"total":{"type":"number","title":"Total"}},"type":"object","required":["title","items","total"],"title":"CashFlowSection"},"ChatQuery":{"properties":{"query":{"type":"string","title":"Query"},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key","description":"選填：前端動態傳入之 Google Gemini API Key"}},"type":"object","required":["query"],"title":"ChatQuery"},"ChatResponse":{"properties":{"intent":{"type":"string","title":"Intent"},"message":{"type":"string","title":"Message"},"data":{"additionalProperties":true,"type":"object","title":"Data","default":{}}},"type":"object","required":["intent","message"],"title":"ChatResponse"},"CloudDocumentResponse":{"properties":{"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title","description":"文件名稱/主旨"},"category":{"type":"string","title":"Category","description":"類別: contract, quotation, supplement, po","default":"contract"},"counterparty_name":{"type":"string","title":"Counterparty Name","description":"客戶或廠商名稱","default":""},"counterparty_tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty Tax Id","description":"客戶或廠商統一編號","default":""},"amount":{"type":"number","minimum":0.0,"title":"Amount","description":"合約或報價總金額","default":0.0},"total_amount":{"type":"number","minimum":0.0,"title":"Total Amount","description":"合約或報價總金額 (前端相容欄位)","default":0.0},"tax_amount":{"type":"number","minimum":0.0,"title":"Tax Amount","description":"營業稅額","default":0.0},"currency":{"type":"string","title":"Currency","description":"幣別","default":"TWD"},"status":{"type":"string","title":"Status","description":"狀態: draft, pending_sign, active, expiring_soon, expired, archived","default":"active"},"effective_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective Date"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date"},"signed_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Signed Date"},"version":{"type":"string","title":"Version","description":"版本號","default":"v1.0"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department","description":"負責部門","default":"業務與法務部"},"project_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Code","description":"專案代碼","default":""},"tags":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags","description":"標籤 (逗號分隔)","default":""},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"條款摘要與備註","default":""},"id":{"type":"integer","title":"Id"},"doc_number":{"type":"string","title":"Doc Number"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","default":""},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","default":""},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type","default":"application/pdf"},"file_size":{"type":"integer","title":"File Size","default":0},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Path","default":""},"sha256_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sha256 Hash","default":""},"has_file":{"type":"boolean","title":"Has File","default":false},"days_until_expiry":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Until Expiry"},"is_expiring_soon":{"type":"boolean","title":"Is Expiring Soon","default":false},"is_expired":{"type":"boolean","title":"Is Expired","default":false},"uploaded_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Uploaded By Id"},"uploaded_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded By Name","default":"系統管理員"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["title","id","doc_number"],"title":"CloudDocumentResponse"},"CloudVaultStatsResponse":{"properties":{"total_documents":{"type":"integer","title":"Total Documents","default":0},"total_files":{"type":"integer","title":"Total Files","default":0},"contract_count":{"type":"integer","title":"Contract Count","default":0},"contract_active_amount":{"type":"number","title":"Contract Active Amount","default":0.0},"active_contract_amount":{"type":"number","title":"Active Contract Amount","default":0.0},"quotation_count":{"type":"integer","title":"Quotation Count","default":0},"quotation_total_amount":{"type":"number","title":"Quotation Total Amount","default":0.0},"active_quotation_amount":{"type":"number","title":"Active Quotation Amount","default":0.0},"supplement_count":{"type":"integer","title":"Supplement Count","default":0},"po_count":{"type":"integer","title":"Po Count","default":0},"expiring_soon_count":{"type":"integer","title":"Expiring Soon Count","default":0},"expired_count":{"type":"integer","title":"Expired Count","default":0},"total_storage_bytes":{"type":"integer","title":"Total Storage Bytes","default":0},"total_storage_kb":{"type":"number","title":"Total Storage Kb","default":0.0}},"type":"object","title":"CloudVaultStatsResponse"},"ColleagueOptionResponse":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"full_name":{"type":"string","title":"Full Name"},"role":{"$ref":"#/components/schemas/UserRole"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"department_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Name"}},"type":"object","required":["id","username","full_name","role"],"title":"ColleagueOptionResponse"},"CompanyProfileResponse":{"properties":{"company_name":{"type":"string","title":"Company Name","description":"公司中文全名","default":"智慧企業股份有限公司"},"company_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name En","description":"公司英文全名","default":"Smart Enterprise Co., Ltd."},"tax_id":{"type":"string","title":"Tax Id","description":"統一編號8碼","default":"22099131"},"tax_registration_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Registration Number","description":"稅籍編號9碼","default":"310123456"},"representative_name":{"type":"string","title":"Representative Name","description":"代表人 / 負責人姓名","default":"王大明"},"incorporation_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Incorporation Date","description":"設立核准日期","default":"2020-05-20"},"capital_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Capital Amount","description":"實收資本額","default":100000000.0},"industry_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry Category","description":"營業項目/產業別","default":"I301010 資訊軟體服務業"},"tax_office_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Office Name","description":"營業稅主管稽徵機關","default":"財政部臺北國稅局信義稽徵所"},"registered_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registered Address","description":"公司登記地址","default":"台北市信義區信義路五段7號89樓"},"business_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Address","description":"營運及通訊地址","default":"台北市信義區松智路1號15樓"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone","description":"代表電話","default":"02-2345-6789"},"fax_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fax Number","description":"傳真電話","default":"02-2345-6780"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"公司代表信箱","default":"service@smart-enterprise.com.tw"},"billing_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Email","description":"財務會計信箱","default":"accounting@smart-enterprise.com.tw"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website","description":"官方網站","default":"https://www.smart-enterprise.com.tw"},"vat_tax_type":{"type":"string","title":"Vat Tax Type","description":"營業稅申報類別 (401/403/404)","default":"401"},"invoice_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Title","description":"發票預設開立抬頭","default":"智慧企業股份有限公司"},"einvoice_provider":{"type":"string","title":"Einvoice Provider","description":"電子發票加值中心業者","default":"whale"},"einvoice_gateway_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Einvoice Gateway Url","description":"加值中心API網址","default":"https://api.einvoice-gateway.com.tw/v1"},"einvoice_app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Einvoice App Id","description":"加值中心 App ID","default":"WHALE_ENTERPRISE_PROD_APPID"},"einvoice_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Einvoice Api Key","description":"加值中心 API Key","default":"WHALE_SECRET_KEY_PROD_9981"},"office_latitude":{"type":"number","title":"Office Latitude","description":"打卡基準緯度","default":25.033964},"office_longitude":{"type":"number","title":"Office Longitude","description":"打卡基準經度","default":121.564468},"geofence_radius_meters":{"type":"number","title":"Geofence Radius Meters","description":"GPS圍欄半徑(公尺)","default":300.0},"enable_gps_geofence":{"type":"boolean","title":"Enable Gps Geofence","description":"是否啟用GPS打卡限制","default":true},"labor_daily_normal_hours":{"type":"number","title":"Labor Daily Normal Hours","description":"每日正常工時上限","default":8.0},"labor_weekly_normal_hours":{"type":"number","title":"Labor Weekly Normal Hours","description":"每週正常工時上限","default":40.0},"labor_monthly_max_overtime":{"type":"number","title":"Labor Monthly Max Overtime","description":"每月加班上限","default":46.0},"labor_monthly_extended_overtime":{"type":"number","title":"Labor Monthly Extended Overtime","description":"延長加班上限","default":54.0},"fiscal_year_type":{"type":"string","title":"Fiscal Year Type","description":"會計年度制","default":"calendar"},"base_currency":{"type":"string","title":"Base Currency","description":"本位幣別","default":"TWD"},"decimal_places":{"type":"integer","title":"Decimal Places","description":"小數位數","default":2},"timezone":{"type":"string","title":"Timezone","description":"系統標準時區 (IANA 時區，如 Asia/Taipei)","default":"Asia/Taipei"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"公司 Logo"},"seal_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seal Text","description":"公司印章印文","default":"智慧企業股份有限公司 發票與報表專用章"},"google_login_enabled":{"type":"boolean","title":"Google Login Enabled","description":"是否啟用 Google 帳號登入","default":true},"google_client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Client Id","description":"Google OAuth 2.0 Client ID","default":""},"google_auto_provision":{"type":"boolean","title":"Google Auto Provision","description":"是否允許新 Google 帳號首次登入自動開通","default":true},"google_allowed_domains":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Allowed Domains","description":"允許登入之網域白名單 (逗號分隔，空白代表不限)","default":""},"email_notifications_enabled":{"type":"boolean","title":"Email Notifications Enabled","description":"是否啟用 Email 簽核通知","default":true},"smtp_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp Host","description":"SMTP 伺服器主機","default":""},"smtp_port":{"type":"integer","title":"Smtp Port","description":"SMTP 連接埠","default":587},"smtp_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp User","description":"SMTP 帳號","default":""},"smtp_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp Password","description":"SMTP 密碼","default":""},"smtp_from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp From Email","description":"寄件人信箱","default":"noreply@smart-enterprise.com.tw"},"smtp_from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp From Name","description":"寄件人顯示名稱","default":"智慧企業 AI ERP 2.0 簽核中心"},"smtp_tls":{"type":"boolean","title":"Smtp Tls","description":"是否啟用 STARTTLS","default":true},"teams_enabled":{"type":"boolean","title":"Teams Enabled","description":"是否啟用 Microsoft Teams 通知與簽核","default":true},"teams_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Webhook Url","description":"Microsoft Teams Webhook URL","default":""},"teams_channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Channel Name","description":"Teams 頻道名稱","default":"#ERP-簽核審批中心"},"teams_notify_events":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Notify Events","description":"Teams 推播事件清單","default":"pending,progress,completed,rejected,reminder,cancelled"},"teams_voice_bot_enabled":{"type":"boolean","title":"Teams Voice Bot Enabled","description":"是否啟用 Microsoft Teams 全員語音 AI 顧問申請功能","default":true},"teams_voice_auto_submit":{"type":"boolean","title":"Teams Voice Auto Submit","description":"Teams 語音指令參數完整時是否自動送出申請單","default":true},"teams_outgoing_webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Outgoing Webhook Secret","description":"Teams Outgoing Webhook HMAC 驗證金鑰","default":""},"gemini_app_enabled":{"type":"boolean","title":"Gemini App Enabled","description":"是否啟用 Gemini Enterprise App 通知與互動簽核","default":true},"gemini_app_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Webhook Url","description":"Gemini Enterprise App Webhook URL","default":""},"gemini_app_channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Channel Name","description":"Gemini Enterprise App 目標空間或助理名稱","default":"@Gemini-ERP-企業簽核與差勤助理"},"gemini_app_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Project Id","description":"Gemini Enterprise Agent Project / App ID","default":""},"gemini_app_notify_events":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Notify Events","description":"Gemini Enterprise App 推播事件清單","default":"pending,progress,completed,rejected,reminder,cancelled"},"gemini_app_voice_enabled":{"type":"boolean","title":"Gemini App Voice Enabled","description":"是否啟用 Gemini Enterprise App 語音/對話提出請假與簽核功能","default":true},"gemini_app_auto_submit":{"type":"boolean","title":"Gemini App Auto Submit","description":"Gemini Enterprise App 指令完整時是否自動送出申請單","default":true},"gemini_app_webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Webhook Secret","description":"Gemini Enterprise App Webhook HMAC 驗證金鑰","default":""},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key","description":"Google Gemini API Key (後端全域金鑰)","default":""},"gemini_model":{"type":"string","title":"Gemini Model","description":"Google Gemini 首選模型版本 (預設 gemini-3.8-flash)","default":"gemini-3.8-flash"},"public_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Base Url","description":"外部一鍵簽核連結基底網址","default":""},"statutory_effective_year":{"type":"string","title":"Statutory Effective Year","description":"適用主管機關勞健保/基本工資公告版本 (如 2024, 2025, 2026)","default":"2024"},"minimum_monthly_wage":{"type":"number","title":"Minimum Monthly Wage","description":"最低基本工資月薪 (NTD)","default":27470.0},"minimum_hourly_wage":{"type":"number","title":"Minimum Hourly Wage","description":"最低基本工資時薪 (NTD)","default":183.0},"labor_ins_rate":{"type":"number","title":"Labor Ins Rate","description":"勞保普通事故+就業保險合計費率","default":0.12},"labor_ins_emp_share":{"type":"number","title":"Labor Ins Emp Share","description":"勞保費員工負擔比例 (20%)","default":0.2},"labor_ins_empr_share":{"type":"number","title":"Labor Ins Empr Share","description":"勞保費雇主負擔比例 (70%)","default":0.7},"occupational_accident_rate":{"type":"number","title":"Occupational Accident Rate","description":"職災保險費率 (雇主全額負擔)","default":0.0},"labor_ins_max_grade":{"type":"number","title":"Labor Ins Max Grade","description":"勞保投保薪資最高級距上限","default":45800.0},"health_ins_rate":{"type":"number","title":"Health Ins Rate","description":"全民健保保險費率","default":0.0517},"health_ins_emp_share":{"type":"number","title":"Health Ins Emp Share","description":"健保費員工負擔比例 (30%)","default":0.3},"health_ins_empr_share":{"type":"number","title":"Health Ins Empr Share","description":"健保費雇主負擔比例 (60%)","default":0.6},"health_ins_avg_dependents":{"type":"number","title":"Health Ins Avg Dependents","description":"健保雇主負擔平均眷口數","default":0.57},"health_ins_max_grade":{"type":"number","title":"Health Ins Max Grade","description":"健保投保金額最高級距上限","default":313000.0},"pension_employer_rate":{"type":"number","title":"Pension Employer Rate","description":"勞退雇主強制提繳率","default":0.06},"pension_max_grade":{"type":"number","title":"Pension Max Grade","description":"勞退月提繳工資最高級距上限","default":150000.0},"auto_align_ins_grades":{"type":"boolean","title":"Auto Align Ins Grades","description":"是否自動對齊勞健保官方投保薪資分級表","default":true},"statutory_last_synced_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statutory Last Synced At","description":"最後與主管機關公告標準同步時間","default":""},"id":{"type":"integer","title":"Id"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id"],"title":"CompanyProfileResponse"},"CompanyProfileUpdate":{"properties":{"company_name":{"type":"string","title":"Company Name","description":"公司中文全名","default":"智慧企業股份有限公司"},"company_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name En","description":"公司英文全名","default":"Smart Enterprise Co., Ltd."},"tax_id":{"type":"string","title":"Tax Id","description":"統一編號8碼","default":"22099131"},"tax_registration_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Registration Number","description":"稅籍編號9碼","default":"310123456"},"representative_name":{"type":"string","title":"Representative Name","description":"代表人 / 負責人姓名","default":"王大明"},"incorporation_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Incorporation Date","description":"設立核准日期","default":"2020-05-20"},"capital_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Capital Amount","description":"實收資本額","default":100000000.0},"industry_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry Category","description":"營業項目/產業別","default":"I301010 資訊軟體服務業"},"tax_office_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Office Name","description":"營業稅主管稽徵機關","default":"財政部臺北國稅局信義稽徵所"},"registered_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registered Address","description":"公司登記地址","default":"台北市信義區信義路五段7號89樓"},"business_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Address","description":"營運及通訊地址","default":"台北市信義區松智路1號15樓"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone","description":"代表電話","default":"02-2345-6789"},"fax_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fax Number","description":"傳真電話","default":"02-2345-6780"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"公司代表信箱","default":"service@smart-enterprise.com.tw"},"billing_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Email","description":"財務會計信箱","default":"accounting@smart-enterprise.com.tw"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website","description":"官方網站","default":"https://www.smart-enterprise.com.tw"},"vat_tax_type":{"type":"string","title":"Vat Tax Type","description":"營業稅申報類別 (401/403/404)","default":"401"},"invoice_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Title","description":"發票預設開立抬頭","default":"智慧企業股份有限公司"},"einvoice_provider":{"type":"string","title":"Einvoice Provider","description":"電子發票加值中心業者","default":"whale"},"einvoice_gateway_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Einvoice Gateway Url","description":"加值中心API網址","default":"https://api.einvoice-gateway.com.tw/v1"},"einvoice_app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Einvoice App Id","description":"加值中心 App ID","default":"WHALE_ENTERPRISE_PROD_APPID"},"einvoice_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Einvoice Api Key","description":"加值中心 API Key","default":"WHALE_SECRET_KEY_PROD_9981"},"office_latitude":{"type":"number","title":"Office Latitude","description":"打卡基準緯度","default":25.033964},"office_longitude":{"type":"number","title":"Office Longitude","description":"打卡基準經度","default":121.564468},"geofence_radius_meters":{"type":"number","title":"Geofence Radius Meters","description":"GPS圍欄半徑(公尺)","default":300.0},"enable_gps_geofence":{"type":"boolean","title":"Enable Gps Geofence","description":"是否啟用GPS打卡限制","default":true},"labor_daily_normal_hours":{"type":"number","title":"Labor Daily Normal Hours","description":"每日正常工時上限","default":8.0},"labor_weekly_normal_hours":{"type":"number","title":"Labor Weekly Normal Hours","description":"每週正常工時上限","default":40.0},"labor_monthly_max_overtime":{"type":"number","title":"Labor Monthly Max Overtime","description":"每月加班上限","default":46.0},"labor_monthly_extended_overtime":{"type":"number","title":"Labor Monthly Extended Overtime","description":"延長加班上限","default":54.0},"fiscal_year_type":{"type":"string","title":"Fiscal Year Type","description":"會計年度制","default":"calendar"},"base_currency":{"type":"string","title":"Base Currency","description":"本位幣別","default":"TWD"},"decimal_places":{"type":"integer","title":"Decimal Places","description":"小數位數","default":2},"timezone":{"type":"string","title":"Timezone","description":"系統標準時區 (IANA 時區，如 Asia/Taipei)","default":"Asia/Taipei"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"公司 Logo"},"seal_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seal Text","description":"公司印章印文","default":"智慧企業股份有限公司 發票與報表專用章"},"google_login_enabled":{"type":"boolean","title":"Google Login Enabled","description":"是否啟用 Google 帳號登入","default":true},"google_client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Client Id","description":"Google OAuth 2.0 Client ID","default":""},"google_auto_provision":{"type":"boolean","title":"Google Auto Provision","description":"是否允許新 Google 帳號首次登入自動開通","default":true},"google_allowed_domains":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Allowed Domains","description":"允許登入之網域白名單 (逗號分隔，空白代表不限)","default":""},"email_notifications_enabled":{"type":"boolean","title":"Email Notifications Enabled","description":"是否啟用 Email 簽核通知","default":true},"smtp_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp Host","description":"SMTP 伺服器主機","default":""},"smtp_port":{"type":"integer","title":"Smtp Port","description":"SMTP 連接埠","default":587},"smtp_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp User","description":"SMTP 帳號","default":""},"smtp_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp Password","description":"SMTP 密碼","default":""},"smtp_from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp From Email","description":"寄件人信箱","default":"noreply@smart-enterprise.com.tw"},"smtp_from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp From Name","description":"寄件人顯示名稱","default":"智慧企業 AI ERP 2.0 簽核中心"},"smtp_tls":{"type":"boolean","title":"Smtp Tls","description":"是否啟用 STARTTLS","default":true},"teams_enabled":{"type":"boolean","title":"Teams Enabled","description":"是否啟用 Microsoft Teams 通知與簽核","default":true},"teams_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Webhook Url","description":"Microsoft Teams Webhook URL","default":""},"teams_channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Channel Name","description":"Teams 頻道名稱","default":"#ERP-簽核審批中心"},"teams_notify_events":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Notify Events","description":"Teams 推播事件清單","default":"pending,progress,completed,rejected,reminder,cancelled"},"teams_voice_bot_enabled":{"type":"boolean","title":"Teams Voice Bot Enabled","description":"是否啟用 Microsoft Teams 全員語音 AI 顧問申請功能","default":true},"teams_voice_auto_submit":{"type":"boolean","title":"Teams Voice Auto Submit","description":"Teams 語音指令參數完整時是否自動送出申請單","default":true},"teams_outgoing_webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Outgoing Webhook Secret","description":"Teams Outgoing Webhook HMAC 驗證金鑰","default":""},"gemini_app_enabled":{"type":"boolean","title":"Gemini App Enabled","description":"是否啟用 Gemini Enterprise App 通知與互動簽核","default":true},"gemini_app_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Webhook Url","description":"Gemini Enterprise App Webhook URL","default":""},"gemini_app_channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Channel Name","description":"Gemini Enterprise App 目標空間或助理名稱","default":"@Gemini-ERP-企業簽核與差勤助理"},"gemini_app_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Project Id","description":"Gemini Enterprise Agent Project / App ID","default":""},"gemini_app_notify_events":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Notify Events","description":"Gemini Enterprise App 推播事件清單","default":"pending,progress,completed,rejected,reminder,cancelled"},"gemini_app_voice_enabled":{"type":"boolean","title":"Gemini App Voice Enabled","description":"是否啟用 Gemini Enterprise App 語音/對話提出請假與簽核功能","default":true},"gemini_app_auto_submit":{"type":"boolean","title":"Gemini App Auto Submit","description":"Gemini Enterprise App 指令完整時是否自動送出申請單","default":true},"gemini_app_webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Webhook Secret","description":"Gemini Enterprise App Webhook HMAC 驗證金鑰","default":""},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key","description":"Google Gemini API Key (後端全域金鑰)","default":""},"gemini_model":{"type":"string","title":"Gemini Model","description":"Google Gemini 首選模型版本 (預設 gemini-3.8-flash)","default":"gemini-3.8-flash"},"public_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Base Url","description":"外部一鍵簽核連結基底網址","default":""},"statutory_effective_year":{"type":"string","title":"Statutory Effective Year","description":"適用主管機關勞健保/基本工資公告版本 (如 2024, 2025, 2026)","default":"2024"},"minimum_monthly_wage":{"type":"number","title":"Minimum Monthly Wage","description":"最低基本工資月薪 (NTD)","default":27470.0},"minimum_hourly_wage":{"type":"number","title":"Minimum Hourly Wage","description":"最低基本工資時薪 (NTD)","default":183.0},"labor_ins_rate":{"type":"number","title":"Labor Ins Rate","description":"勞保普通事故+就業保險合計費率","default":0.12},"labor_ins_emp_share":{"type":"number","title":"Labor Ins Emp Share","description":"勞保費員工負擔比例 (20%)","default":0.2},"labor_ins_empr_share":{"type":"number","title":"Labor Ins Empr Share","description":"勞保費雇主負擔比例 (70%)","default":0.7},"occupational_accident_rate":{"type":"number","title":"Occupational Accident Rate","description":"職災保險費率 (雇主全額負擔)","default":0.0},"labor_ins_max_grade":{"type":"number","title":"Labor Ins Max Grade","description":"勞保投保薪資最高級距上限","default":45800.0},"health_ins_rate":{"type":"number","title":"Health Ins Rate","description":"全民健保保險費率","default":0.0517},"health_ins_emp_share":{"type":"number","title":"Health Ins Emp Share","description":"健保費員工負擔比例 (30%)","default":0.3},"health_ins_empr_share":{"type":"number","title":"Health Ins Empr Share","description":"健保費雇主負擔比例 (60%)","default":0.6},"health_ins_avg_dependents":{"type":"number","title":"Health Ins Avg Dependents","description":"健保雇主負擔平均眷口數","default":0.57},"health_ins_max_grade":{"type":"number","title":"Health Ins Max Grade","description":"健保投保金額最高級距上限","default":313000.0},"pension_employer_rate":{"type":"number","title":"Pension Employer Rate","description":"勞退雇主強制提繳率","default":0.06},"pension_max_grade":{"type":"number","title":"Pension Max Grade","description":"勞退月提繳工資最高級距上限","default":150000.0},"auto_align_ins_grades":{"type":"boolean","title":"Auto Align Ins Grades","description":"是否自動對齊勞健保官方投保薪資分級表","default":true},"statutory_last_synced_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statutory Last Synced At","description":"最後與主管機關公告標準同步時間","default":""}},"type":"object","title":"CompanyProfileUpdate"},"CustomNotificationSendRequest":{"properties":{"channels":{"items":{"type":"string"},"type":"array","title":"Channels","description":"發送通道: email, teams, gemini_app","default":["email","teams","gemini_app"]},"recipient_user_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Recipient User Ids","description":"指定系統使用者 ID 清單"},"recipient_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recipient User Id","description":"指定單一系統使用者 ID"},"custom_emails":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Custom Emails","description":"自訂外部 Email 清單"},"recipient_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Email","description":"指定單一外部 Email"},"gemini_app_channel_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Channel Override","description":"自訂 Gemini Enterprise App 頻道名稱"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"通知主旨"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","description":"通知主旨 (相容欄位)"},"message":{"type":"string","title":"Message","description":"通知內容"},"priority":{"type":"string","title":"Priority","description":"normal, high, urgent","default":"normal"},"request_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Request Id","description":"關聯簽核單 ID"},"include_quick_action_links":{"type":"boolean","title":"Include Quick Action Links","description":"是否附帶一鍵核准/駁回按鈕","default":true},"action_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Url"}},"type":"object","required":["message"],"title":"CustomNotificationSendRequest"},"CustomStepInput":{"properties":{"step_name":{"type":"string","title":"Step Name"},"approver_role":{"anyOf":[{"$ref":"#/components/schemas/UserRole"},{"type":"null"}]},"approver_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approver Id"}},"type":"object","required":["step_name"],"title":"CustomStepInput"},"DailyWorkSummaryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"work_date":{"type":"string","format":"date","title":"Work Date"},"day_type":{"$ref":"#/components/schemas/DayType"},"first_clock_in":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Clock In"},"last_clock_out":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Clock Out"},"normal_hours":{"type":"number","title":"Normal Hours"},"ot_tier1_hours":{"type":"number","title":"Ot Tier1 Hours"},"ot_tier2_hours":{"type":"number","title":"Ot Tier2 Hours"},"ot_tier3_hours":{"type":"number","title":"Ot Tier3 Hours"},"holiday_hours":{"type":"number","title":"Holiday Hours"},"total_work_hours":{"type":"number","title":"Total Work Hours"},"calculated_overtime_pay":{"type":"number","title":"Calculated Overtime Pay"},"is_anomaly":{"type":"boolean","title":"Is Anomaly"}},"type":"object","required":["id","user_id","work_date","day_type","first_clock_in","last_clock_out","normal_hours","ot_tier1_hours","ot_tier2_hours","ot_tier3_hours","holiday_hours","total_work_hours","calculated_overtime_pay","is_anomaly"],"title":"DailyWorkSummaryResponse"},"DayType":{"type":"string","enum":["regular","rest_day","regular_leave","holiday"],"title":"DayType"},"DepartmentResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"code":{"type":"string","title":"Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","code","created_at"],"title":"DepartmentResponse"},"EinvoiceReconcileRequest":{"properties":{"invoice_ids":{"items":{"type":"integer"},"type":"array","title":"Invoice Ids"},"account_code":{"type":"string","title":"Account Code"},"payment_account_code":{"type":"string","title":"Payment Account Code","default":"1101"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["invoice_ids","account_code"],"title":"EinvoiceReconcileRequest"},"EinvoiceSyncRequest":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"invoice_type":{"$ref":"#/components/schemas/InvoiceType","default":"input_b2b"},"gateway_provider":{"type":"string","title":"Gateway Provider","default":"whale"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"}},"type":"object","required":["start_date","end_date"],"title":"EinvoiceSyncRequest"},"EmployeePayrollProfileUpdate":{"properties":{"employee_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Code"},"national_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"National Id","description":"身分證字號或居留證號"},"salary_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salary Type","description":"monthly 或 hourly"},"base_salary":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Base Salary","description":"核定本薪"},"meal_allowance":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Meal Allowance","description":"伙食津貼"},"position_allowance":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Position Allowance","description":"職務津貼"},"transport_allowance":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Transport Allowance","description":"交通津貼 (選填)"},"full_attendance_bonus":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Full Attendance Bonus","description":"全勤獎金"},"full_attendance_bonus_standard":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Full Attendance Bonus Standard"},"labor_ins_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Labor Ins Grade","description":"勞保投保級距"},"labor_insurance_bracket":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Labor Insurance Bracket"},"health_ins_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Health Ins Grade","description":"健保投保級距"},"health_insurance_bracket":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Health Insurance Bracket"},"health_dependents":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Health Dependents","description":"健保眷屬人數"},"dependents_count":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Dependents Count"},"pension_self_rate":{"anyOf":[{"type":"number","maximum":6.0,"minimum":0.0},{"type":"null"}],"title":"Pension Self Rate","description":"勞退自提比例 (0~0.06 或 0~6)"},"labor_pension_self_rate":{"anyOf":[{"type":"number","maximum":6.0,"minimum":0.0},{"type":"null"}],"title":"Labor Pension Self Rate"},"tax_withholding_rate":{"anyOf":[{"type":"number","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Tax Withholding Rate","description":"薪資所得稅代扣率"},"income_tax_withholding_rate":{"anyOf":[{"type":"number","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Income Tax Withholding Rate"},"fixed_income_tax":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Fixed Income Tax"},"bank_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Code","description":"收款銀行3碼總行代號"},"branch_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Code","description":"收款銀行4碼分行代號"},"bank_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Account","description":"收款銀行帳號"},"bank_account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Account Number"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name","description":"收款戶名"},"bank_account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Account Name"},"hourly_rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Hourly Rate","description":"時薪基準 (同步更新 users.hourly_rate)"},"auto_align_grades":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Align Grades","description":"儲存時是否依本薪+伙食+職務加給自動對齊官方勞健保分級表"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"EmployeePayrollProfileUpdate"},"FinancialImportExecuteRequest":{"properties":{"import_mode":{"type":"string","title":"Import Mode","description":"append: 追加模式, overwrite: 覆蓋現有全部庫存","default":"append"},"items":{"items":{"$ref":"#/components/schemas/FinancialInventoryCreate"},"type":"array","title":"Items"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"}},"type":"object","required":["items"],"title":"FinancialImportExecuteRequest"},"FinancialImportExecuteResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"batch_id":{"type":"string","title":"Batch Id"},"imported_count":{"type":"integer","title":"Imported Count"},"import_mode":{"type":"string","title":"Import Mode"},"total_market_value":{"type":"number","title":"Total Market Value"},"total_cost":{"type":"number","title":"Total Cost"}},"type":"object","required":["success","message","batch_id","imported_count","import_mode","total_market_value","total_cost"],"title":"FinancialImportExecuteResponse"},"FinancialImportPreviewItem":{"properties":{"symbol":{"type":"string","title":"Symbol"},"name":{"type":"string","title":"Name"},"product_type":{"type":"string","title":"Product Type","default":"stock"},"market":{"type":"string","title":"Market","default":"TWSE"},"currency":{"type":"string","title":"Currency","default":"TWD"},"position_type":{"type":"string","title":"Position Type","default":"long"},"quantity":{"type":"number","title":"Quantity","default":0.0},"cost_price":{"type":"number","title":"Cost Price","default":0.0},"current_price":{"type":"number","title":"Current Price","default":0.0},"total_cost":{"type":"number","title":"Total Cost","default":0.0},"market_value":{"type":"number","title":"Market Value","default":0.0},"unrealized_pnl":{"type":"number","title":"Unrealized Pnl","default":0.0},"unrealized_pnl_rate":{"type":"number","title":"Unrealized Pnl Rate","default":0.0},"broker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broker"},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number"},"trade_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trade Date"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_valid":{"type":"boolean","title":"Is Valid","default":true},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["symbol","name"],"title":"FinancialImportPreviewItem"},"FinancialImportPreviewResponse":{"properties":{"filename":{"type":"string","title":"Filename"},"total_rows":{"type":"integer","title":"Total Rows"},"valid_rows":{"type":"integer","title":"Valid Rows"},"invalid_rows":{"type":"integer","title":"Invalid Rows"},"estimated_total_cost":{"type":"number","title":"Estimated Total Cost"},"estimated_market_value":{"type":"number","title":"Estimated Market Value"},"estimated_unrealized_pnl":{"type":"number","title":"Estimated Unrealized Pnl"},"detected_columns":{"items":{"type":"string"},"type":"array","title":"Detected Columns"},"preview_items":{"items":{"$ref":"#/components/schemas/FinancialImportPreviewItem"},"type":"array","title":"Preview Items"}},"type":"object","required":["filename","total_rows","valid_rows","invalid_rows","estimated_total_cost","estimated_market_value","estimated_unrealized_pnl","detected_columns","preview_items"],"title":"FinancialImportPreviewResponse"},"FinancialInventoryCreate":{"properties":{"symbol":{"type":"string","title":"Symbol","description":"商品代碼 (如 2330, 0050, AAPL)"},"name":{"type":"string","title":"Name","description":"商品名稱 (如 台積電, 元大台灣50, 蘋果公司)"},"product_type":{"type":"string","title":"Product Type","description":"商品類別 (stock, bond, future, option, fund_etf, fx_crypto, other)","default":"stock"},"market":{"type":"string","title":"Market","description":"交易市場 (TWSE, TPEx, US, Global, OTC)","default":"TWSE"},"currency":{"type":"string","title":"Currency","description":"計價幣別 (TWD, USD, EUR, JPY, HKD)","default":"TWD"},"position_type":{"type":"string","title":"Position Type","description":"部位方向 (long 多頭, short 空頭)","default":"long"},"quantity":{"type":"number","title":"Quantity","description":"持倉數量 (股數/口數/張數/單位)"},"cost_price":{"type":"number","title":"Cost Price","description":"單位持有平均成本"},"current_price":{"type":"number","title":"Current Price","description":"當前市價"},"trade_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Trade Date","description":"交易取得日期"},"settlement_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Settlement Date","description":"交割日或結算日"},"broker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broker","description":"經紀券商 / 保管金控 (如 元大證券, 凱基, 富邦)"},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number","description":"交易帳戶或集保帳號"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"備註說明"}},"type":"object","required":["symbol","name","quantity","cost_price","current_price"],"title":"FinancialInventoryCreate"},"FinancialInventoryResponse":{"properties":{"symbol":{"type":"string","title":"Symbol","description":"商品代碼 (如 2330, 0050, AAPL)"},"name":{"type":"string","title":"Name","description":"商品名稱 (如 台積電, 元大台灣50, 蘋果公司)"},"product_type":{"type":"string","title":"Product Type","description":"商品類別 (stock, bond, future, option, fund_etf, fx_crypto, other)","default":"stock"},"market":{"type":"string","title":"Market","description":"交易市場 (TWSE, TPEx, US, Global, OTC)","default":"TWSE"},"currency":{"type":"string","title":"Currency","description":"計價幣別 (TWD, USD, EUR, JPY, HKD)","default":"TWD"},"position_type":{"type":"string","title":"Position Type","description":"部位方向 (long 多頭, short 空頭)","default":"long"},"quantity":{"type":"number","title":"Quantity","description":"持倉數量 (股數/口數/張數/單位)"},"cost_price":{"type":"number","title":"Cost Price","description":"單位持有平均成本"},"current_price":{"type":"number","title":"Current Price","description":"當前市價"},"trade_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Trade Date","description":"交易取得日期"},"settlement_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Settlement Date","description":"交割日或結算日"},"broker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broker","description":"經紀券商 / 保管金控 (如 元大證券, 凱基, 富邦)"},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number","description":"交易帳戶或集保帳號"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"備註說明"},"id":{"type":"integer","title":"Id"},"total_cost":{"type":"number","title":"Total Cost"},"market_value":{"type":"number","title":"Market Value"},"unrealized_pnl":{"type":"number","title":"Unrealized Pnl"},"unrealized_pnl_rate":{"type":"number","title":"Unrealized Pnl Rate"},"source_type":{"type":"string","title":"Source Type"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"created_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["symbol","name","quantity","cost_price","current_price","id","total_cost","market_value","unrealized_pnl","unrealized_pnl_rate","source_type","created_at"],"title":"FinancialInventoryResponse"},"FinancialInventorySummary":{"properties":{"total_market_value":{"type":"number","title":"Total Market Value"},"total_cost":{"type":"number","title":"Total Cost"},"total_unrealized_pnl":{"type":"number","title":"Total Unrealized Pnl"},"total_unrealized_pnl_rate":{"type":"number","title":"Total Unrealized Pnl Rate"},"total_positions":{"type":"integer","title":"Total Positions"},"long_positions":{"type":"integer","title":"Long Positions"},"short_positions":{"type":"integer","title":"Short Positions"},"product_type_breakdown":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Product Type Breakdown"},"currency_breakdown":{"additionalProperties":{"type":"number"},"type":"object","title":"Currency Breakdown"}},"type":"object","required":["total_market_value","total_cost","total_unrealized_pnl","total_unrealized_pnl_rate","total_positions","long_positions","short_positions","product_type_breakdown","currency_breakdown"],"title":"FinancialInventorySummary"},"FinancialInventoryUpdate":{"properties":{"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"product_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Type"},"market":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"position_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Type"},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quantity"},"cost_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Price"},"current_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Price"},"trade_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Trade Date"},"settlement_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Settlement Date"},"broker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broker"},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"FinancialInventoryUpdate"},"FirstLoginSetupRequest":{"properties":{"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"backup_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Backup Email"},"verification_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Code"},"current_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Password"},"new_password":{"type":"string","title":"New Password"},"confirm_password":{"type":"string","title":"Confirm Password"}},"type":"object","required":["new_password","confirm_password"],"title":"FirstLoginSetupRequest"},"ForceChangePasswordRequest":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","title":"New Password"},"confirm_password":{"type":"string","title":"Confirm Password"}},"type":"object","required":["current_password","new_password","confirm_password"],"title":"ForceChangePasswordRequest"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"company_tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Tax Id"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"ForgotPasswordResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message"},"masked_email":{"type":"string","title":"Masked Email"},"debug_temp_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debug Temp Password"}},"type":"object","required":["message","masked_email"],"title":"ForgotPasswordResponse"},"GeminiAppActionPayload":{"properties":{"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token","description":"HMAC 加密簽核權杖"},"request_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Request Id"},"request_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Number"},"approver_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approver Id"},"approver_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver Username"},"approver_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver Email"},"action":{"type":"string","title":"Action","description":"approve 或 reject","default":"approve"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret"}},"type":"object","title":"GeminiAppActionPayload"},"GeminiAppWebhookPayload":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Google Gemini Enterprise App Event type (MESSAGE / CARD_CLICKED / VOICE_COMMAND)","default":"MESSAGE"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Gemini Enterprise App 語音/對話訊息文字 (可含 @Gemini)"},"transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcript","description":"語音轉錄文字"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"指令文字"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id","description":"ERP 使用者 ID"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email","description":"Google Workspace / Gemini Enterprise 使用者信箱"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"ERP 帳號名稱"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name","description":"Gemini Enterprise 顯示姓名"},"user":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User","description":"Google Workspace / Gemini user 物件"},"sender":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Sender","description":"Sender 物件"},"message":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Message","description":"Google Chat / Gemini message 物件"},"space":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Space","description":"Google Workspace Space 物件"},"auto_submit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Submit","description":"是否自動正式送出簽核"},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Webhook 驗證金鑰"},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key","description":"選填：Google Gemini API Key"}},"type":"object","title":"GeminiAppWebhookPayload"},"GeminiConfigUpdateRequest":{"properties":{"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key","description":"Google Gemini API Key (傳入 None 代表保留原金鑰，傳入空字串代表清除)"},"gemini_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Model","description":"後端首選 Gemini 模型版本 (預設 gemini-3.8-flash)","default":"gemini-3.8-flash"}},"type":"object","title":"GeminiConfigUpdateRequest"},"GeofenceSettingsSchema":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"office_latitude":{"type":"number","title":"Office Latitude"},"office_longitude":{"type":"number","title":"Office Longitude"},"radius_meters":{"type":"number","title":"Radius Meters"},"message":{"type":"string","title":"Message"}},"type":"object","required":["enabled","office_latitude","office_longitude","radius_meters","message"],"title":"GeofenceSettingsSchema"},"GoogleAccountBindingRequest":{"properties":{"google_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Google Email"},"backup_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Backup Email"},"auth_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Provider"},"unbind_google":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Unbind Google","default":false},"is_first_login":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is First Login"}},"type":"object","title":"GoogleAccountBindingRequest"},"GoogleAuthRequest":{"properties":{"credential":{"type":"string","title":"Credential"},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"},"company_tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Tax Id"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"simulate_first_login":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Simulate First Login","default":false},"bound_account_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Bound Account Snapshot"}},"type":"object","required":["credential"],"title":"GoogleAuthRequest"},"GoogleConfigResponse":{"properties":{"client_id":{"type":"string","title":"Client Id","default":""},"enabled":{"type":"boolean","title":"Enabled","default":true},"oauth_configured":{"type":"boolean","title":"Oauth Configured","default":false},"auto_provision":{"type":"boolean","title":"Auto Provision","default":true},"allowed_domains":{"type":"string","title":"Allowed Domains","default":""},"redirect_uri":{"type":"string","title":"Redirect Uri","default":""},"javascript_origin":{"type":"string","title":"Javascript Origin","default":""}},"type":"object","title":"GoogleConfigResponse"},"GoogleConfigUpdateRequest":{"properties":{"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id","default":""},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","default":true},"auto_provision":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Provision","default":true},"allowed_domains":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allowed Domains","default":""}},"type":"object","title":"GoogleConfigUpdateRequest"},"GoogleDemoAuthRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"picture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture"},"company_tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Tax Id"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"simulate_first_login":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Simulate First Login","default":false},"bound_account_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Bound Account Snapshot"}},"type":"object","required":["email"],"title":"GoogleDemoAuthRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HappinessLeaveUserItem":{"properties":{"user_id":{"type":"integer","title":"User Id"},"username":{"type":"string","title":"Username"},"full_name":{"type":"string","title":"Full Name"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"department_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Name"},"role":{"type":"string","title":"Role"},"year":{"type":"integer","title":"Year"},"entitled_hours":{"type":"number","title":"Entitled Hours"},"used_hours":{"type":"number","title":"Used Hours"},"pending_hours":{"type":"number","title":"Pending Hours"},"remaining_hours":{"type":"number","title":"Remaining Hours"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["user_id","username","full_name","role","year","entitled_hours","used_hours","pending_hours","remaining_hours"],"title":"HappinessLeaveUserItem"},"ImportExecuteRequest":{"properties":{"source_system":{"type":"string","title":"Source System","default":"generic"},"system_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Type","description":"相容前端欄位別名 (同 source_system)"},"import_mode":{"type":"string","title":"Import Mode","default":"trial_balance"},"cutoff_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Cutoff Date","description":"期初開帳日期 (預設為今日或本年期初)"},"description_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description Prefix","description":"匯入備註前綴"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"相容前端摘要備註欄位"},"reference_no":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference No","description":"相容前端關聯單號欄位"},"auto_create_accounts":{"type":"boolean","title":"Auto Create Accounts","description":"是否自動建立未存在的會計科目","default":true},"rows":{"items":{"$ref":"#/components/schemas/StandardImportRow"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"ImportExecuteRequest"},"ImportPreviewResponse":{"properties":{"source_system":{"type":"string","title":"Source System"},"system_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Type"},"import_mode":{"type":"string","title":"Import Mode"},"total_rows":{"type":"integer","title":"Total Rows"},"valid_rows_count":{"type":"integer","title":"Valid Rows Count"},"total_debit":{"type":"number","title":"Total Debit"},"total_credit":{"type":"number","title":"Total Credit"},"difference":{"type":"number","title":"Difference"},"balance_diff":{"type":"number","title":"Balance Diff","default":0.0},"is_balanced":{"type":"boolean","title":"Is Balanced"},"detected_encoding":{"type":"string","title":"Detected Encoding","default":"UTF-8"},"new_accounts":{"items":{"$ref":"#/components/schemas/NewAccountPreview"},"type":"array","title":"New Accounts"},"preview_rows":{"items":{"$ref":"#/components/schemas/StandardImportRow"},"type":"array","title":"Preview Rows"},"rows":{"items":{"$ref":"#/components/schemas/StandardImportRow"},"type":"array","title":"Rows","default":[]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["source_system","import_mode","total_rows","valid_rows_count","total_debit","total_credit","difference","is_balanced","new_accounts","preview_rows"],"title":"ImportPreviewResponse"},"ImportResultResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"created_accounts":{"type":"integer","title":"Created Accounts"},"new_accounts_created":{"items":{"type":"string"},"type":"array","title":"New Accounts Created","default":[]},"created_entries":{"type":"integer","title":"Created Entries"},"created_journal_entries":{"type":"integer","title":"Created Journal Entries","default":0},"created_items":{"type":"integer","title":"Created Items"},"imported_items_count":{"type":"integer","title":"Imported Items Count","default":0},"entry_numbers":{"items":{"type":"string"},"type":"array","title":"Entry Numbers"},"total_debit":{"type":"number","title":"Total Debit"},"total_credit":{"type":"number","title":"Total Credit"}},"type":"object","required":["success","message","created_accounts","created_entries","created_items","entry_numbers","total_debit","total_credit"],"title":"ImportResultResponse"},"IncomeStatementReport":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"revenue":{"$ref":"#/components/schemas/IncomeStatementSection"},"cost":{"$ref":"#/components/schemas/IncomeStatementSection"},"gross_profit":{"type":"number","title":"Gross Profit"},"gross_margin_rate":{"type":"number","title":"Gross Margin Rate"},"expenses":{"$ref":"#/components/schemas/IncomeStatementSection"},"operating_income":{"type":"number","title":"Operating Income"},"non_operating_income":{"type":"number","title":"Non Operating Income"},"non_operating_expense":{"type":"number","title":"Non Operating Expense"},"net_income_before_tax":{"type":"number","title":"Net Income Before Tax"},"net_income":{"type":"number","title":"Net Income"}},"type":"object","required":["start_date","end_date","revenue","cost","gross_profit","gross_margin_rate","expenses","operating_income","non_operating_income","non_operating_expense","net_income_before_tax","net_income"],"title":"IncomeStatementReport"},"IncomeStatementSection":{"properties":{"title":{"type":"string","title":"Title"},"items":{"items":{"$ref":"#/components/schemas/BalanceSheetItem"},"type":"array","title":"Items"},"subtotal":{"type":"number","title":"Subtotal"}},"type":"object","required":["title","items","subtotal"],"title":"IncomeStatementSection"},"InvoiceCreate":{"properties":{"invoice_number":{"type":"string","title":"Invoice Number"},"invoice_date":{"type":"string","format":"date","title":"Invoice Date"},"invoice_type":{"$ref":"#/components/schemas/InvoiceType","default":"input_b2b"},"source":{"$ref":"#/components/schemas/InvoiceSource","default":"paper_ocr"},"buyer_tax_id":{"type":"string","title":"Buyer Tax Id"},"buyer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyer Name"},"seller_tax_id":{"type":"string","title":"Seller Tax Id"},"seller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seller Name"},"sales_amount":{"type":"number","title":"Sales Amount"},"tax_amount":{"type":"number","title":"Tax Amount"},"total_amount":{"type":"number","title":"Total Amount"},"format_code":{"type":"string","title":"Format Code","default":"21"},"tax_deductible":{"type":"boolean","title":"Tax Deductible","default":true},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"recommended_account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Account Code"},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/InvoiceItemCreate"},"type":"array"},{"type":"null"}],"title":"Items","default":[]}},"type":"object","required":["invoice_number","invoice_date","buyer_tax_id","seller_tax_id","sales_amount","tax_amount","total_amount"],"title":"InvoiceCreate"},"InvoiceItemCreate":{"properties":{"item_name":{"type":"string","title":"Item Name"},"quantity":{"type":"number","title":"Quantity","default":1.0},"unit_price":{"type":"number","title":"Unit Price","default":0.0},"amount":{"type":"number","title":"Amount","default":0.0}},"type":"object","required":["item_name"],"title":"InvoiceItemCreate"},"InvoiceItemResponse":{"properties":{"item_name":{"type":"string","title":"Item Name"},"quantity":{"type":"number","title":"Quantity","default":1.0},"unit_price":{"type":"number","title":"Unit Price","default":0.0},"amount":{"type":"number","title":"Amount","default":0.0},"id":{"type":"integer","title":"Id"}},"type":"object","required":["item_name","id"],"title":"InvoiceItemResponse"},"InvoiceResponse":{"properties":{"id":{"type":"integer","title":"Id"},"invoice_number":{"type":"string","title":"Invoice Number"},"invoice_date":{"type":"string","format":"date","title":"Invoice Date"},"invoice_type":{"$ref":"#/components/schemas/InvoiceType"},"source":{"$ref":"#/components/schemas/InvoiceSource"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"buyer_tax_id":{"type":"string","title":"Buyer Tax Id"},"buyer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyer Name"},"seller_tax_id":{"type":"string","title":"Seller Tax Id"},"seller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seller Name"},"sales_amount":{"type":"number","title":"Sales Amount"},"tax_amount":{"type":"number","title":"Tax Amount"},"total_amount":{"type":"number","title":"Total Amount"},"format_code":{"type":"string","title":"Format Code"},"tax_deductible":{"type":"boolean","title":"Tax Deductible"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"recommended_account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Account Code"},"journal_entry_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Journal Entry Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"items":{"items":{"$ref":"#/components/schemas/InvoiceItemResponse"},"type":"array","title":"Items","default":[]}},"type":"object","required":["id","invoice_number","invoice_date","invoice_type","source","status","buyer_tax_id","seller_tax_id","sales_amount","tax_amount","total_amount","format_code","tax_deductible","created_at"],"title":"InvoiceResponse"},"InvoiceSource":{"type":"string","enum":["paper_ocr","gateway_api","batch_file","manual"],"title":"InvoiceSource"},"InvoiceStatus":{"type":"string","enum":["pending_review","verified","reconciled","void"],"title":"InvoiceStatus"},"InvoiceType":{"type":"string","enum":["input_b2b","output_b2b","input_allowance","output_allowance","receipt"],"title":"InvoiceType"},"JournalEntryCreate":{"properties":{"entry_date":{"type":"string","format":"date","title":"Entry Date"},"description":{"type":"string","title":"Description"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"status":{"anyOf":[{"$ref":"#/components/schemas/JournalStatus"},{"type":"null"}],"default":"posted"},"items":{"items":{"$ref":"#/components/schemas/JournalItemCreate"},"type":"array","title":"Items"}},"type":"object","required":["description","items"],"title":"JournalEntryCreate"},"JournalEntryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"entry_number":{"type":"string","title":"Entry Number"},"entry_date":{"type":"string","format":"date","title":"Entry Date"},"description":{"type":"string","title":"Description"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"status":{"$ref":"#/components/schemas/JournalStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"created_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By Id"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"total_debit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Debit","default":0.0},"total_credit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Credit","default":0.0},"is_balanced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Balanced","default":true},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type","default":"manual"},"items":{"items":{"$ref":"#/components/schemas/JournalItemResponse"},"type":"array","title":"Items"}},"type":"object","required":["id","entry_number","entry_date","description","status","created_at","items"],"title":"JournalEntryResponse"},"JournalEntryUpdate":{"properties":{"entry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Entry Date"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"status":{"anyOf":[{"$ref":"#/components/schemas/JournalStatus"},{"type":"null"}]},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/JournalItemCreate"},"type":"array"},{"type":"null"}],"title":"Items"}},"type":"object","title":"JournalEntryUpdate"},"JournalItemCreate":{"properties":{"account_id":{"type":"integer","title":"Account Id"},"debit":{"type":"number","minimum":0.0,"title":"Debit","default":0.0},"credit":{"type":"number","minimum":0.0,"title":"Credit","default":0.0},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["account_id"],"title":"JournalItemCreate"},"JournalItemResponse":{"properties":{"id":{"type":"integer","title":"Id"},"account_id":{"type":"integer","title":"Account Id"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Category"},"debit":{"type":"number","title":"Debit"},"credit":{"type":"number","title":"Credit"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["id","account_id","debit","credit"],"title":"JournalItemResponse"},"JournalStatus":{"type":"string","enum":["draft","submitted","posted","void"],"title":"JournalStatus"},"JournalTemplateItem":{"properties":{"account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Id"},"account_code":{"type":"string","title":"Account Code"},"account_name":{"type":"string","title":"Account Name"},"default_side":{"type":"string","title":"Default Side"},"description":{"type":"string","title":"Description"}},"type":"object","required":["account_code","account_name","default_side","description"],"title":"JournalTemplateItem"},"JournalTemplateResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"description":{"type":"string","title":"Description"},"default_items":{"items":{"$ref":"#/components/schemas/JournalTemplateItem"},"type":"array","title":"Default Items"},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/JournalTemplateItem"},"type":"array"},{"type":"null"}],"title":"Items"}},"type":"object","required":["id","name","category","description","default_items"],"title":"JournalTemplateResponse"},"LeaveBalanceItem":{"properties":{"leave_type":{"type":"string","title":"Leave Type"},"leave_type_name":{"type":"string","title":"Leave Type Name"},"pay_type":{"type":"string","title":"Pay Type"},"entitled_hours":{"type":"number","title":"Entitled Hours"},"used_hours":{"type":"number","title":"Used Hours"},"pending_hours":{"type":"number","title":"Pending Hours"},"remaining_hours":{"type":"number","title":"Remaining Hours"},"unit":{"type":"string","title":"Unit","default":"小時"},"law_reference":{"type":"string","title":"Law Reference"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_custom_quota":{"type":"boolean","title":"Is Custom Quota","default":false},"usage_percentage":{"type":"number","title":"Usage Percentage","default":0.0}},"type":"object","required":["leave_type","leave_type_name","pay_type","entitled_hours","used_hours","pending_hours","remaining_hours","law_reference"],"title":"LeaveBalanceItem"},"LeaveQuotaUpdateRequest":{"properties":{"leave_type":{"$ref":"#/components/schemas/LeaveType"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"},"entitled_hours":{"type":"number","minimum":0.0,"title":"Entitled Hours","description":"設定可申請總時數 (額度)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"調整原因或備註"}},"type":"object","required":["leave_type","entitled_hours"],"title":"LeaveQuotaUpdateRequest"},"LeaveRequestCreate":{"properties":{"leave_type":{"$ref":"#/components/schemas/LeaveType"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"hours":{"type":"number","exclusiveMinimum":0.0,"title":"Hours"},"reason":{"type":"string","title":"Reason"},"substitute_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Substitute Id"},"custom_steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/CustomStepInput"},"type":"array"},{"type":"null"}],"title":"Custom Steps"}},"type":"object","required":["leave_type","start_time","end_time","hours","reason"],"title":"LeaveRequestCreate"},"LeaveRequestResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"leave_type":{"$ref":"#/components/schemas/LeaveType"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"hours":{"type":"number","title":"Hours"},"reason":{"type":"string","title":"Reason"},"status":{"$ref":"#/components/schemas/RequestStatus"},"substitute_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Substitute Id"},"substitute_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Substitute Name"},"approval_request_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approval Request Id"},"approval_request":{"anyOf":[{"$ref":"#/components/schemas/ApprovalRequestResponse"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","leave_type","start_time","end_time","hours","reason","status","created_at"],"title":"LeaveRequestResponse"},"LeaveType":{"type":"string","enum":["special","sick","personal","menstrual","bereavement","marriage","maternity","compensatory","official","injury","happiness","birthday"],"title":"LeaveType"},"MakeupPunchRequestCreate":{"properties":{"punch_date":{"type":"string","format":"date","title":"Punch Date","description":"補打卡日期 (YYYY-MM-DD)"},"punch_time":{"type":"string","format":"date-time","title":"Punch Time","description":"補打卡時間 (ISO 格式)"},"punch_type":{"$ref":"#/components/schemas/PunchType","description":"補登打卡類型 (clock_in 上班 / clock_out 下班 / break_start 外出 / break_end 返回)"},"reason":{"type":"string","maxLength":100,"minLength":2,"title":"Reason","description":"補卡事由 (如忘記打卡、公差外勤、設備異常、遠距辦公漏打)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"詳細備註說明"}},"type":"object","required":["punch_date","punch_time","punch_type","reason"],"title":"MakeupPunchRequestCreate"},"MakeupPunchRequestResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"punch_date":{"type":"string","format":"date","title":"Punch Date"},"punch_time":{"type":"string","format":"date-time","title":"Punch Time"},"punch_type":{"$ref":"#/components/schemas/PunchType"},"reason":{"type":"string","title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"$ref":"#/components/schemas/RequestStatus"},"approved_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approved By Id"},"approved_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By Name"},"approval_request_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approval Request Id"},"attendance_record_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Attendance Record Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","user_id","punch_date","punch_time","punch_type","reason","status","created_at"],"title":"MakeupPunchRequestResponse"},"MedicalInventoryCreate":{"properties":{"item_code":{"type":"string","title":"Item Code","description":"院內品項代碼/料號 (如 MED-00101)"},"nhi_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nhi Code","description":"健保藥品或特材代碼 (如 AC48293100)"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number","description":"衛福部許可證號 (如 衛部藥製字第058821號)"},"name":{"type":"string","title":"Name","description":"中文藥品/衛材品名 (如 普拿疼加強錠 500mg)"},"generic_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generic Name","description":"英文學名/主要成分 (如 Acetaminophen 500mg)"},"category":{"type":"string","title":"Category","description":"類別: prescription_drug, controlled_drug, otc_drug, consumable, reagent, ppe, other","default":"prescription_drug"},"specification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specification","description":"規格劑型 (如 500mg/錠, 100錠/盒)"},"storage_condition":{"type":"string","title":"Storage Condition","description":"溫層: room_temperature, cold_chain, frozen, light_sensitive","default":"room_temperature"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location","description":"存放庫位 (如 總藥局 A1-02, 急診藥櫃)"},"batch_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Number","description":"批號 (如 LOT-202610A)"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date","description":"有效期限"},"supplier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier","description":"供貨廠商 / 原廠藥廠"},"unit":{"type":"string","title":"Unit","description":"庫存計量單位 (盒, 支, 瓶, 包, 顆)","default":"盒"},"current_stock":{"type":"number","title":"Current Stock","description":"目前庫存數量","default":0.0},"min_safety_stock":{"type":"number","title":"Min Safety Stock","description":"最低安全庫存量警戒水位 (低於或等於此值時觸發警告與 Email 提醒)","default":10.0},"max_safety_stock":{"type":"number","title":"Max Safety Stock","description":"最高建議安全庫存量","default":100.0},"unit_cost":{"type":"number","title":"Unit Cost","description":"進貨成本單價","default":0.0},"selling_price":{"type":"number","title":"Selling Price","description":"健保給付價 / 自費定價","default":0.0},"is_alert_enabled":{"type":"boolean","title":"Is Alert Enabled","description":"是否啟用低於安全庫存 Email 警示","default":true},"alert_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Email","description":"專用安全庫存通知信箱 (未填寫則預設發送至庫存負責人)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"備註說明與臨床調劑警語"}},"type":"object","required":["item_code","name"],"title":"MedicalInventoryCreate"},"MedicalInventoryResponse":{"properties":{"item_code":{"type":"string","title":"Item Code","description":"院內品項代碼/料號 (如 MED-00101)"},"nhi_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nhi Code","description":"健保藥品或特材代碼 (如 AC48293100)"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number","description":"衛福部許可證號 (如 衛部藥製字第058821號)"},"name":{"type":"string","title":"Name","description":"中文藥品/衛材品名 (如 普拿疼加強錠 500mg)"},"generic_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generic Name","description":"英文學名/主要成分 (如 Acetaminophen 500mg)"},"category":{"type":"string","title":"Category","description":"類別: prescription_drug, controlled_drug, otc_drug, consumable, reagent, ppe, other","default":"prescription_drug"},"specification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specification","description":"規格劑型 (如 500mg/錠, 100錠/盒)"},"storage_condition":{"type":"string","title":"Storage Condition","description":"溫層: room_temperature, cold_chain, frozen, light_sensitive","default":"room_temperature"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location","description":"存放庫位 (如 總藥局 A1-02, 急診藥櫃)"},"batch_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Number","description":"批號 (如 LOT-202610A)"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date","description":"有效期限"},"supplier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier","description":"供貨廠商 / 原廠藥廠"},"unit":{"type":"string","title":"Unit","description":"庫存計量單位 (盒, 支, 瓶, 包, 顆)","default":"盒"},"current_stock":{"type":"number","title":"Current Stock","description":"目前庫存數量","default":0.0},"min_safety_stock":{"type":"number","title":"Min Safety Stock","description":"最低安全庫存量警戒水位 (低於或等於此值時觸發警告與 Email 提醒)","default":10.0},"max_safety_stock":{"type":"number","title":"Max Safety Stock","description":"最高建議安全庫存量","default":100.0},"unit_cost":{"type":"number","title":"Unit Cost","description":"進貨成本單價","default":0.0},"selling_price":{"type":"number","title":"Selling Price","description":"健保給付價 / 自費定價","default":0.0},"is_alert_enabled":{"type":"boolean","title":"Is Alert Enabled","description":"是否啟用低於安全庫存 Email 警示","default":true},"alert_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Email","description":"專用安全庫存通知信箱 (未填寫則預設發送至庫存負責人)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"備註說明與臨床調劑警語"},"id":{"type":"integer","title":"Id"},"total_cost":{"type":"number","title":"Total Cost"},"total_value":{"type":"number","title":"Total Value"},"stock_status":{"type":"string","title":"Stock Status"},"expiry_status":{"type":"string","title":"Expiry Status"},"last_alert_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Alert Sent At"},"created_by_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["item_code","name","id","total_cost","total_value","stock_status","expiry_status","created_at"],"title":"MedicalInventoryResponse"},"MedicalInventorySummary":{"properties":{"total_items":{"type":"integer","title":"Total Items"},"total_cost":{"type":"number","title":"Total Cost"},"total_value":{"type":"number","title":"Total Value"},"low_stock_count":{"type":"integer","title":"Low Stock Count"},"out_of_stock_count":{"type":"integer","title":"Out Of Stock Count"},"expiring_soon_count":{"type":"integer","title":"Expiring Soon Count"},"expired_count":{"type":"integer","title":"Expired Count"},"normal_stock_count":{"type":"integer","title":"Normal Stock Count"},"category_breakdown":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Category Breakdown"},"storage_condition_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Storage Condition Breakdown"}},"type":"object","required":["total_items","total_cost","total_value","low_stock_count","out_of_stock_count","expiring_soon_count","expired_count","normal_stock_count","category_breakdown","storage_condition_breakdown"],"title":"MedicalInventorySummary"},"MedicalInventoryUpdate":{"properties":{"item_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Code"},"nhi_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nhi Code"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"generic_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generic Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"specification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specification"},"storage_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storage Condition"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"batch_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Number"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date"},"supplier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"current_stock":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Stock"},"min_safety_stock":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Safety Stock"},"max_safety_stock":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Safety Stock"},"unit_cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unit Cost"},"selling_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Selling Price"},"is_alert_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Alert Enabled"},"alert_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Email"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"MedicalInventoryUpdate"},"MedicalSafetyAlertRequest":{"properties":{"item_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Item Ids","description":"指定發送警報的品項 ID 列表，為空則檢測所有低於最低安全存量品項"},"target_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Email","description":"指定接收提醒的電子信箱 (選填)"}},"type":"object","title":"MedicalSafetyAlertRequest"},"MedicalSafetyAlertResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"scanned_count":{"type":"integer","title":"Scanned Count"},"alerted_items_count":{"type":"integer","title":"Alerted Items Count"},"recipient_email":{"type":"string","title":"Recipient Email"},"alerted_items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Alerted Items"},"sent_at":{"type":"string","title":"Sent At"}},"type":"object","required":["success","message","scanned_count","alerted_items_count","recipient_email","alerted_items","sent_at"],"title":"MedicalSafetyAlertResponse"},"MedicalStockAdjustRequest":{"properties":{"action_type":{"type":"string","title":"Action Type","description":"in: 進貨入庫, out: 領料出庫, adjust: 盤點校正","default":"in"},"quantity":{"type":"number","exclusiveMinimum":0.0,"title":"Quantity","description":"異動數量 (必須大於 0)"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"異動原因","default":"一般出入庫作業"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["quantity"],"title":"MedicalStockAdjustRequest"},"ModulePermissionsDefinition":{"properties":{"module_key":{"type":"string","title":"Module Key"},"module_name":{"type":"string","title":"Module Name"},"description":{"type":"string","title":"Description"},"permissions":{"items":{"$ref":"#/components/schemas/PermissionItem"},"type":"array","title":"Permissions"}},"type":"object","required":["module_key","module_name","description","permissions"],"title":"ModulePermissionsDefinition"},"MonthlyLaborComplianceStatus":{"properties":{"user_id":{"type":"integer","title":"User Id"},"user_name":{"type":"string","title":"User Name"},"month":{"type":"string","title":"Month"},"total_normal_hours":{"type":"number","title":"Total Normal Hours"},"total_overtime_hours":{"type":"number","title":"Total Overtime Hours"},"monthly_ot_limit":{"type":"number","title":"Monthly Ot Limit","default":46.0},"ot_usage_percentage":{"type":"number","title":"Ot Usage Percentage"},"is_approaching_limit":{"type":"boolean","title":"Is Approaching Limit"},"is_exceeded_limit":{"type":"boolean","title":"Is Exceeded Limit"},"estimated_overtime_pay":{"type":"number","title":"Estimated Overtime Pay"},"compliance_notes":{"items":{"type":"string"},"type":"array","title":"Compliance Notes"}},"type":"object","required":["user_id","user_name","month","total_normal_hours","total_overtime_hours","ot_usage_percentage","is_approaching_limit","is_exceeded_limit","estimated_overtime_pay","compliance_notes"],"title":"MonthlyLaborComplianceStatus"},"NewAccountPreview":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"normal_balance":{"type":"string","title":"Normal Balance"}},"type":"object","required":["code","name","category","normal_balance"],"title":"NewAccountPreview"},"NotificationLogResponse":{"properties":{"id":{"type":"integer","title":"Id"},"channel":{"type":"string","title":"Channel"},"event_type":{"type":"string","title":"Event Type"},"request_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Request Id"},"request_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Number"},"recipient":{"type":"string","title":"Recipient"},"recipient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Name"},"subject":{"type":"string","title":"Subject"},"plain_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plain Body"},"html_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Html Body"},"adaptive_card_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adaptive Card Json"},"action_approve_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Approve Url"},"action_reject_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Reject Url"},"delivery_mode":{"type":"string","title":"Delivery Mode"},"success":{"type":"boolean","title":"Success"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","channel","event_type","recipient","subject","delivery_mode","success","created_at"],"title":"NotificationLogResponse"},"NotificationSettingsPayload":{"properties":{"target_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target User Id","description":"指定設定之使用者帳號 ID（未傳則預設為當前登入帳號）"},"target_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Username","description":"目標帳號名稱"},"target_user_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target User Full Name","description":"目標帳號顯示姓名"},"email_notifications_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email Notifications Enabled"},"email_notification_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email Notification Enabled"},"smtp_host":{"type":"string","title":"Smtp Host","default":""},"smtp_port":{"type":"integer","title":"Smtp Port","default":587},"smtp_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp User"},"smtp_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smtp Username"},"smtp_password":{"type":"string","title":"Smtp Password","default":""},"smtp_from_email":{"type":"string","title":"Smtp From Email","default":"noreply@enterprise-erp.tw"},"smtp_from_name":{"type":"string","title":"Smtp From Name","default":"Enterprise AI ERP 2.0 通知中心"},"smtp_tls":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Smtp Tls"},"smtp_use_tls":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Smtp Use Tls"},"teams_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Teams Enabled"},"teams_notification_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Teams Notification Enabled"},"teams_webhook_url":{"type":"string","title":"Teams Webhook Url","default":""},"teams_channel_name":{"type":"string","title":"Teams Channel Name","default":"ERP 簽核與企業通知頻道"},"teams_notify_events":{"type":"string","title":"Teams Notify Events","default":"pending,progress,completed,rejected,cancelled,reminder"},"public_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Base Url"},"approval_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Base Url"},"teams_voice_bot_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Teams Voice Bot Enabled","default":true},"teams_voice_auto_submit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Teams Voice Auto Submit","default":true},"teams_outgoing_webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Outgoing Webhook Secret","default":""},"gemini_app_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Gemini App Enabled"},"gemini_app_notification_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Gemini App Notification Enabled"},"gemini_app_webhook_url":{"type":"string","title":"Gemini App Webhook Url","default":""},"gemini_app_channel_name":{"type":"string","title":"Gemini App Channel Name","default":"Gemini Enterprise App 智慧簽核與助理"},"gemini_app_project_id":{"type":"string","title":"Gemini App Project Id","default":""},"gemini_app_notify_events":{"type":"string","title":"Gemini App Notify Events","default":"pending,progress,completed,rejected,cancelled,reminder"},"gemini_app_voice_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Gemini App Voice Enabled","default":true},"gemini_app_auto_submit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Gemini App Auto Submit","default":true},"gemini_app_webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini App Webhook Secret","default":""}},"type":"object","title":"NotificationSettingsPayload"},"NotificationTestRequest":{"properties":{"channel":{"type":"string","title":"Channel","description":"email, teams, gemini_app, both, 或 all","default":"all"},"test_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Email"},"include_teams":{"type":"boolean","title":"Include Teams","default":true},"include_gemini_app":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Gemini App"},"target_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target User Id","description":"測試指定帳號之個人專屬 Teams Webhook 通道"}},"type":"object","title":"NotificationTestRequest"},"OcrParseResult":{"properties":{"invoice_number":{"type":"string","title":"Invoice Number"},"invoice_date":{"type":"string","title":"Invoice Date"},"buyer_tax_id":{"type":"string","title":"Buyer Tax Id"},"buyer_tax_id_valid":{"type":"boolean","title":"Buyer Tax Id Valid"},"seller_tax_id":{"type":"string","title":"Seller Tax Id"},"seller_tax_id_valid":{"type":"boolean","title":"Seller Tax Id Valid"},"tax_id_valid":{"type":"boolean","title":"Tax Id Valid","default":true},"seller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seller Name"},"sales_amount":{"type":"number","title":"Sales Amount"},"tax_amount":{"type":"number","title":"Tax Amount"},"total_amount":{"type":"number","title":"Total Amount"},"amount_valid":{"type":"boolean","title":"Amount Valid"},"format_code":{"type":"string","title":"Format Code"},"recommended_account_code":{"type":"string","title":"Recommended Account Code"},"recommended_account_name":{"type":"string","title":"Recommended Account Name"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items","default":[]},"is_duplicate":{"type":"boolean","title":"Is Duplicate","default":false},"confidence":{"type":"number","title":"Confidence","default":0.95},"engine_used":{"type":"string","title":"Engine Used","default":"local_mock"},"engine_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine Note"}},"type":"object","required":["invoice_number","invoice_date","buyer_tax_id","buyer_tax_id_valid","seller_tax_id","seller_tax_id_valid","sales_amount","tax_amount","total_amount","amount_valid","format_code","recommended_account_code","recommended_account_name"],"title":"OcrParseResult"},"OnboardingAiParseRequest":{"properties":{"prompt":{"type":"string","minLength":2,"title":"Prompt","description":"HR 自然語言描述新員工設定內容"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"type":"object","required":["prompt"],"title":"OnboardingAiParseRequest"},"OnboardingExecuteRequest":{"properties":{"mode":{"type":"string","title":"Mode","description":"'create' 新增員工帳號 或 'update' 補齊/更新既有員工","default":"create"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id","description":"若為 update 模式，指定既有 User ID"},"username":{"type":"string","maxLength":50,"minLength":2,"title":"Username"},"full_name":{"type":"string","maxLength":100,"minLength":1,"title":"Full Name"},"email":{"type":"string","maxLength":100,"minLength":3,"title":"Email"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","description":"初始登入密碼"},"initial_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Password","description":"初始登入密碼 (前端欄位別名)"},"role":{"$ref":"#/components/schemas/UserRole","default":"employee"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"new_department_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Department Name"},"google_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Email"},"backup_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Backup Email"},"auth_provider":{"type":"string","title":"Auth Provider","default":"both"},"must_change_password":{"type":"boolean","title":"Must Change Password","default":true},"is_first_login":{"type":"boolean","title":"Is First Login","default":true},"is_active":{"type":"boolean","title":"Is Active","default":true},"national_id":{"type":"string","maxLength":20,"title":"National Id","default":""},"salary_type":{"type":"string","title":"Salary Type","description":"'MONTHLY'/'monthly' 或 'HOURLY'/'hourly'","default":"MONTHLY"},"base_salary":{"type":"number","minimum":0.0,"title":"Base Salary","default":42000.0},"meal_allowance":{"type":"number","minimum":0.0,"title":"Meal Allowance","default":3000.0},"fixed_allowance":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Fixed Allowance"},"position_allowance":{"type":"number","minimum":0.0,"title":"Position Allowance","default":0.0},"full_attendance_bonus":{"type":"number","minimum":0.0,"title":"Full Attendance Bonus","default":0.0},"hourly_rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Hourly Rate"},"auto_align_grades":{"type":"boolean","title":"Auto Align Grades","default":true},"labor_ins_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Labor Ins Grade"},"labor_insurance_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Labor Insurance Grade"},"health_ins_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Health Ins Grade"},"health_insurance_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Health Insurance Grade"},"pension_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Pension Grade"},"health_dependents":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Health Dependents"},"dependents_count":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Dependents Count"},"pension_employer_rate":{"type":"number","maximum":0.2,"minimum":0.0,"title":"Pension Employer Rate","default":0.06},"pension_self_rate":{"type":"number","maximum":0.06,"minimum":0.0,"title":"Pension Self Rate","default":0.0},"tax_withholding_rate":{"type":"number","maximum":0.5,"minimum":0.0,"title":"Tax Withholding Rate","default":0.0},"bank_code":{"type":"string","maxLength":10,"title":"Bank Code","default":"822"},"branch_code":{"type":"string","maxLength":10,"title":"Branch Code","default":"0152"},"bank_account":{"type":"string","maxLength":30,"title":"Bank Account","default":""},"account_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Account Name"},"payroll_notes":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Payroll Notes"},"auto_punch_enabled":{"type":"boolean","title":"Auto Punch Enabled","default":true},"clock_in_time":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Clock In Time"},"clock_out_time":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Clock Out Time"},"punch_in_time":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Punch In Time"},"punch_out_time":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Punch Out Time"},"random_buffer_minutes":{"anyOf":[{"type":"integer","maximum":60.0,"minimum":0.0},{"type":"null"}],"title":"Random Buffer Minutes","default":3},"workdays_only":{"type":"boolean","title":"Workdays Only","default":true},"skip_if_on_leave":{"type":"boolean","title":"Skip If On Leave","default":true},"latitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latitude"},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Longitude"},"location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Name"},"quota_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quota Year"},"leave_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Leave Year"},"special_leave_hours":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Special Leave Hours"},"annual_leave_hours":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Annual Leave Hours"},"happiness_leave_hours":{"type":"number","minimum":0.0,"title":"Happiness Leave Hours","default":16.0},"birthday_leave_hours":{"type":"number","minimum":0.0,"title":"Birthday Leave Hours","default":8.0},"sick_leave_hours":{"type":"number","minimum":0.0,"title":"Sick Leave Hours","default":240.0},"personal_leave_hours":{"type":"number","minimum":0.0,"title":"Personal Leave Hours","default":112.0},"comp_leave_hours":{"type":"number","minimum":0.0,"title":"Comp Leave Hours","default":0.0},"use_role_default_permissions":{"type":"boolean","title":"Use Role Default Permissions","default":true},"custom_permissions_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Custom Permissions Enabled"},"custom_permissions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Custom Permissions"},"permissions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Permissions"},"can_manage_permissions":{"type":"boolean","title":"Can Manage Permissions","default":false},"teams_enabled":{"type":"boolean","title":"Teams Enabled","default":true},"teams_channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Channel Name","default":""},"teams_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Webhook Url","default":""},"teams_voice_bot_enabled":{"type":"boolean","title":"Teams Voice Bot Enabled","default":true},"teams_voice_auto_submit":{"type":"boolean","title":"Teams Voice Auto Submit","default":true},"sync_current_month_payroll":{"type":"boolean","title":"Sync Current Month Payroll","default":true},"sync_current_payroll":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sync Current Payroll"},"send_welcome_notification":{"type":"boolean","title":"Send Welcome Notification","default":true}},"type":"object","required":["username","full_name","email"],"title":"OnboardingExecuteRequest"},"OvertimeRequestCreate":{"properties":{"overtime_date":{"type":"string","format":"date","title":"Overtime Date"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"hours":{"type":"number","exclusiveMinimum":0.0,"title":"Hours"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["overtime_date","start_time","end_time","hours","reason"],"title":"OvertimeRequestCreate"},"OvertimeRequestResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"overtime_date":{"type":"string","format":"date","title":"Overtime Date"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"hours":{"type":"number","title":"Hours"},"reason":{"type":"string","title":"Reason"},"status":{"$ref":"#/components/schemas/RequestStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","overtime_date","start_time","end_time","hours","reason","status","created_at"],"title":"OvertimeRequestResponse"},"PayrollBatchEditRequest":{"properties":{"pay_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Pay Date"},"company_bank_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Bank Code"},"company_branch_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Branch Code"},"company_bank_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Bank Account"},"company_enterprise_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Enterprise Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"items":{"items":{"$ref":"#/components/schemas/PayrollBatchSlipUpdateItem"},"type":"array","title":"Items","default":[]}},"type":"object","title":"PayrollBatchEditRequest"},"PayrollBatchSlipUpdateItem":{"properties":{"base_pay":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Base Pay"},"meal_allowance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Meal Allowance"},"position_allowance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Position Allowance"},"full_attendance_bonus":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Full Attendance Bonus"},"overtime_pay":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overtime Pay"},"performance_bonus":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Performance Bonus"},"other_additions":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Other Additions"},"leave_deduction":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Leave Deduction"},"labor_ins_employee":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Labor Ins Employee"},"health_ins_employee":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Health Ins Employee"},"pension_self_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pension Self Amount"},"tax_withheld":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tax Withheld"},"other_deductions":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Other Deductions"},"bank_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Code"},"branch_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Code"},"bank_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Account"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"national_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"National Id"},"transfer_fee":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Transfer Fee"},"transfer_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Note"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"remark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remark"},"slip_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Slip Id"},"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"employee_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Code"}},"type":"object","title":"PayrollBatchSlipUpdateItem"},"PayrollCalculateRequest":{"properties":{"year":{"type":"integer","maximum":2100.0,"minimum":2020.0,"title":"Year"},"month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Month"},"pay_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Pay Date"},"payment_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Payment Date"},"company_bank_code":{"type":"string","title":"Company Bank Code","description":"公司付款銀行3碼代號","default":"822"},"company_branch_code":{"type":"string","title":"Company Branch Code","description":"公司付款分行4碼代號","default":"0152"},"company_bank_account":{"type":"string","title":"Company Bank Account","description":"公司企網銀扣款帳號","default":"152540088991"},"company_enterprise_code":{"type":"string","title":"Company Enterprise Code","description":"企業統編或銀行特約代號","default":"22099131"},"company_tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Tax Id"},"company_account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Account Name"},"preserve_manual_overrides":{"type":"boolean","title":"Preserve Manual Overrides","description":"重新同步考勤時是否保留已手動調整的獎金與加減項","default":true},"force_recalculate":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Force Recalculate"},"force_reset_manual":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Force Reset Manual"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["year","month"],"title":"PayrollCalculateRequest"},"PayrollPostJournalRequest":{"properties":{"include_employer_statutory_cost":{"type":"boolean","title":"Include Employer Statutory Cost","description":"計提傳票是否一併認列雇主負擔之勞健保費(6126保險費)與勞退6%(6127退休金費用)","default":true},"entry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Entry Date"},"custom_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Description"}},"type":"object","title":"PayrollPostJournalRequest"},"PayrollSlipUpdate":{"properties":{"base_pay":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Base Pay"},"meal_allowance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Meal Allowance"},"position_allowance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Position Allowance"},"full_attendance_bonus":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Full Attendance Bonus"},"overtime_pay":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overtime Pay"},"performance_bonus":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Performance Bonus"},"other_additions":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Other Additions"},"leave_deduction":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Leave Deduction"},"labor_ins_employee":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Labor Ins Employee"},"health_ins_employee":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Health Ins Employee"},"pension_self_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pension Self Amount"},"tax_withheld":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tax Withheld"},"other_deductions":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Other Deductions"},"bank_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Code"},"branch_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Code"},"bank_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Account"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"national_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"National Id"},"transfer_fee":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Transfer Fee"},"transfer_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Note"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"remark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remark"}},"type":"object","title":"PayrollSlipUpdate"},"PermissionItem":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"desc":{"type":"string","title":"Desc"}},"type":"object","required":["code","name","desc"],"title":"PermissionItem"},"PunchRequest":{"properties":{"punch_type":{"$ref":"#/components/schemas/PunchType"},"latitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latitude"},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Longitude"},"accuracy_meters":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy Meters"},"enforce_geofence":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enforce Geofence","default":true},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"device_info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Info"}},"type":"object","required":["punch_type"],"title":"PunchRequest"},"PunchResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"user_name":{"type":"string","title":"User Name"},"punch_date":{"type":"string","format":"date","title":"Punch Date"},"punch_time":{"type":"string","format":"date-time","title":"Punch Time"},"punch_type":{"$ref":"#/components/schemas/PunchType"},"distance_meters":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Distance Meters"},"is_geofence_valid":{"type":"boolean","title":"Is Geofence Valid"},"geofence_enforced":{"type":"boolean","title":"Geofence Enforced","default":true},"status_message":{"type":"string","title":"Status Message"}},"type":"object","required":["id","user_id","user_name","punch_date","punch_time","punch_type","distance_meters","is_geofence_valid","status_message"],"title":"PunchResponse"},"PunchType":{"type":"string","enum":["clock_in","clock_out","break_start","break_end"],"title":"PunchType"},"QuickActionExecuteRequest":{"properties":{"token":{"type":"string","title":"Token","description":"HMAC 加密簽核權杖"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action","description":"approve 或 reject (若未傳則由 token 解出)"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment","description":"審核意見"}},"type":"object","required":["token"],"title":"QuickActionExecuteRequest"},"RequestStatus":{"type":"string","enum":["pending","approved","rejected","cancelled"],"title":"RequestStatus"},"SendEmailVerificationCodeRequest":{"properties":{"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"}},"type":"object","title":"SendEmailVerificationCodeRequest"},"SendEmailVerificationCodeResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message"},"masked_email":{"type":"string","title":"Masked Email"},"debug_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debug Code"}},"type":"object","required":["message","masked_email"],"title":"SendEmailVerificationCodeResponse"},"SetHappinessLeaveRequest":{"properties":{"hours":{"type":"number","minimum":0.0,"title":"Hours","description":"設定幸福假總時數 (額度)"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year","description":"設定年度 (預設當年度)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"核發原因或備註"}},"type":"object","required":["hours"],"title":"SetHappinessLeaveRequest"},"StandardImportRow":{"properties":{"account_code":{"type":"string","title":"Account Code","description":"會計科目代碼 (e.g. 1101, 2101, 5101)"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name","description":"會計科目名稱"},"debit":{"type":"number","title":"Debit","description":"借方金額","default":0.0},"credit":{"type":"number","title":"Credit","description":"貸方金額","default":0.0},"entry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Entry Date","description":"傳票日期 (日記帳模式必填，試算表模式選填)"},"entry_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entry Number","description":"原系統傳票編號 (日記帳模式適用)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"摘要或備註說明"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference","description":"關聯單號或發票號碼"}},"type":"object","required":["account_code"],"title":"StandardImportRow"},"StatutoryAlignPreviewRequest":{"properties":{"monthly_salary":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Monthly Salary","description":"經常性月薪總額 (若未填則由本薪+伙食+職務加給合計)"},"monthly_regular_salary":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Monthly Regular Salary","description":"經常性月薪總額別名"},"base_salary":{"type":"number","minimum":0.0,"title":"Base Salary","default":0.0},"meal_allowance":{"type":"number","minimum":0.0,"title":"Meal Allowance","default":0.0},"position_allowance":{"type":"number","minimum":0.0,"title":"Position Allowance","default":0.0},"dependents":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Dependents","default":0},"health_dependents":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Health Dependents"},"pension_self_rate":{"type":"number","maximum":6.0,"minimum":0.0,"title":"Pension Self Rate","default":0.0},"tax_withholding_rate":{"type":"number","maximum":50.0,"minimum":0.0,"title":"Tax Withholding Rate","default":0.0}},"type":"object","title":"StatutoryAlignPreviewRequest"},"StatutorySyncRequest":{"properties":{"preset_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preset Year","description":"指定同步之主管機關公告標準年度 (2024 / 2025 / 2026)"},"effective_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Effective Year","description":"指定同步之主管機關公告標準年度別名 (2024 / 2025 / 2026)"},"align_all_employees":{"type":"boolean","title":"Align All Employees","description":"是否一併將全體在職員工之勞保、健保投保級距自動對齊官方分級表","default":true},"align_all_profiles":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Align All Profiles","description":"align_all_employees 相容別名"},"recalculate_current_run":{"type":"boolean","title":"Recalculate Current Run","description":"是否一併重算指定或草稿中之薪資核算批次","default":false},"current_period_month":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period Month","description":"指定重算之薪資年月 YYYY-MM"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year","description":"指定重算之薪資年份"},"month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month","description":"指定重算之薪資月份"},"statutory_effective_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statutory Effective Year"},"minimum_monthly_wage":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Minimum Monthly Wage"},"minimum_hourly_wage":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Minimum Hourly Wage"},"labor_ins_rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Labor Ins Rate"},"labor_ins_emp_share":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Labor Ins Emp Share"},"labor_ins_empr_share":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Labor Ins Empr Share"},"occupational_accident_rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Occupational Accident Rate"},"labor_ins_max_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Labor Ins Max Grade"},"health_ins_rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Health Ins Rate"},"health_ins_emp_share":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Health Ins Emp Share"},"health_ins_empr_share":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Health Ins Empr Share"},"health_ins_avg_dependents":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Health Ins Avg Dependents"},"health_ins_max_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Health Ins Max Grade"},"pension_employer_rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Pension Employer Rate"},"pension_max_grade":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Pension Max Grade"},"auto_align_ins_grades":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Align Ins Grades"}},"type":"object","title":"StatutorySyncRequest"},"StepStatus":{"type":"string","enum":["waiting","pending","approved","rejected","skipped"],"title":"StepStatus"},"SystemPermissionsDefinitionsResponse":{"properties":{"modules":{"items":{"$ref":"#/components/schemas/ModulePermissionsDefinition"},"type":"array","title":"Modules"},"role_defaults":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Role Defaults"}},"type":"object","required":["modules","role_defaults"],"title":"SystemPermissionsDefinitionsResponse"},"TaxIdVerifyRequest":{"properties":{"tax_id":{"type":"string","title":"Tax Id","description":"待檢驗統一編號 (8碼)"}},"type":"object","required":["tax_id"],"title":"TaxIdVerifyRequest"},"TaxIdVerifyResponse":{"properties":{"tax_id":{"type":"string","title":"Tax Id"},"is_valid":{"type":"boolean","title":"Is Valid"},"status_message":{"type":"string","title":"Status Message"},"moea_status":{"type":"string","title":"Moea Status"},"algorithm":{"type":"string","title":"Algorithm","default":"財政部/經濟部統一編號模數 10 算法"}},"type":"object","required":["tax_id","is_valid","status_message","moea_status"],"title":"TaxIdVerifyResponse"},"TeamsVoiceWebhookPayload":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Teams Bot Activity type","default":"message"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Teams 語音訊息文字 (可含 <at>AI顧問</at>)"},"transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcript","description":"語音轉錄文字"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id","description":"ERP 使用者 ID"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email","description":"Teams 使用者信箱 (UPN)"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"ERP 帳號名稱"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name","description":"Teams 顯示姓名"},"from":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"From","description":"Teams Activity from 物件"},"channelData":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Channeldata","description":"Teams channelData 物件"},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id","description":"頻道識別","default":"msteams"},"auto_submit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Submit","description":"是否自動自動送出簽核"},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"選填：Teams Outgoing Webhook 驗證金鑰"},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key","description":"選填：Google Gemini API Key"}},"type":"object","title":"TeamsVoiceWebhookPayload"},"TeamsWebhookActionPayload":{"properties":{"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token","description":"HMAC 加密簽核權杖"},"request_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Request Id"},"approver_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approver Id"},"approver_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver Username"},"action":{"type":"string","title":"Action","description":"approve 或 reject","default":"approve"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","title":"TeamsWebhookActionPayload"},"ThirdPartyAttendanceExecuteRequest":{"properties":{"duplicate_strategy":{"type":"string","title":"Duplicate Strategy","description":"重複打卡處理策略: skip (略過同日同類別重複打卡) | overwrite (覆寫更新同日同類別打卡時間)","default":"skip"},"source_system":{"type":"string","title":"Source System","description":"來源系統代碼 (general / access_card / cloud_hr)","default":"general"},"items":{"items":{"$ref":"#/components/schemas/ThirdPartyPunchImportItemInput"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ThirdPartyAttendanceExecuteRequest"},"ThirdPartyAttendanceExecuteResponse":{"properties":{"imported_count":{"type":"integer","title":"Imported Count"},"updated_count":{"type":"integer","title":"Updated Count"},"skipped_duplicate_count":{"type":"integer","title":"Skipped Duplicate Count"},"affected_employee_count":{"type":"integer","title":"Affected Employee Count"},"recomputed_summary_count":{"type":"integer","title":"Recomputed Summary Count"},"message":{"type":"string","title":"Message"}},"type":"object","required":["imported_count","updated_count","skipped_duplicate_count","affected_employee_count","recomputed_summary_count","message"],"title":"ThirdPartyAttendanceExecuteResponse"},"ThirdPartyAttendancePreviewResponse":{"properties":{"source_system":{"type":"string","title":"Source System"},"source_system_label":{"type":"string","title":"Source System Label"},"detected_mode":{"type":"string","title":"Detected Mode"},"detected_encoding":{"type":"string","title":"Detected Encoding"},"total_raw_rows":{"type":"integer","title":"Total Raw Rows"},"total_punch_items":{"type":"integer","title":"Total Punch Items"},"valid_count":{"type":"integer","title":"Valid Count"},"invalid_count":{"type":"integer","title":"Invalid Count"},"duplicate_count":{"type":"integer","title":"Duplicate Count"},"matched_employee_count":{"type":"integer","title":"Matched Employee Count"},"unmatched_identifiers":{"items":{"type":"string"},"type":"array","title":"Unmatched Identifiers","default":[]},"items":{"items":{"$ref":"#/components/schemas/ThirdPartyPunchPreviewItem"},"type":"array","title":"Items"}},"type":"object","required":["source_system","source_system_label","detected_mode","detected_encoding","total_raw_rows","total_punch_items","valid_count","invalid_count","duplicate_count","matched_employee_count","items"],"title":"ThirdPartyAttendancePreviewResponse"},"ThirdPartyPunchImportItemInput":{"properties":{"user_id":{"type":"integer","title":"User Id"},"punch_date":{"type":"string","format":"date","title":"Punch Date"},"punch_time":{"type":"string","format":"date-time","title":"Punch Time"},"punch_type":{"$ref":"#/components/schemas/PunchType"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System","default":"general"},"device_info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Info"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["user_id","punch_date","punch_time","punch_type"],"title":"ThirdPartyPunchImportItemInput"},"ThirdPartyPunchPreviewItem":{"properties":{"row_index":{"type":"integer","title":"Row Index"},"raw_employee_identifier":{"type":"string","title":"Raw Employee Identifier"},"matched_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Matched User Id"},"matched_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Username"},"matched_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Full Name"},"matched_department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Department"},"punch_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Punch Date"},"punch_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Punch Time"},"punch_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Punch Type"},"punch_type_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Punch Type Label"},"source_system":{"type":"string","title":"Source System","default":"general"},"device_info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Info"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_valid":{"type":"boolean","title":"Is Valid","default":true},"is_duplicate":{"type":"boolean","title":"Is Duplicate","default":false},"validation_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validation Message"}},"type":"object","required":["row_index","raw_employee_identifier"],"title":"ThirdPartyPunchPreviewItem"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"},"role":{"type":"string","title":"Role"},"username":{"type":"string","title":"Username"},"full_name":{"type":"string","title":"Full Name"},"user_id":{"type":"integer","title":"User Id"},"can_manage_permissions":{"type":"boolean","title":"Can Manage Permissions","default":false},"effective_permissions":{"items":{"type":"string"},"type":"array","title":"Effective Permissions","default":[]},"must_change_password":{"type":"boolean","title":"Must Change Password","default":false},"is_email_verified":{"type":"boolean","title":"Is Email Verified","default":true},"is_first_login":{"type":"boolean","title":"Is First Login","default":false},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"google_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Id"},"google_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Email"},"auth_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Provider","default":"both"},"backup_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Backup Email"}},"type":"object","required":["access_token","token_type","role","username","full_name","user_id"],"title":"Token"},"TrialBalanceItem":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"category":{"$ref":"#/components/schemas/AccountCategory"},"initial_debit":{"type":"number","title":"Initial Debit","default":0.0},"initial_credit":{"type":"number","title":"Initial Credit","default":0.0},"period_debit":{"type":"number","title":"Period Debit","default":0.0},"period_credit":{"type":"number","title":"Period Credit","default":0.0},"ending_debit":{"type":"number","title":"Ending Debit","default":0.0},"ending_credit":{"type":"number","title":"Ending Credit","default":0.0}},"type":"object","required":["code","name","category"],"title":"TrialBalanceItem"},"TrialBalanceReport":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TrialBalanceItem"},"type":"array","title":"Items"},"total_ending_debit":{"type":"number","title":"Total Ending Debit"},"total_ending_credit":{"type":"number","title":"Total Ending Credit"},"is_balanced":{"type":"boolean","title":"Is Balanced"}},"type":"object","required":["items","total_ending_debit","total_ending_credit","is_balanced"],"title":"TrialBalanceReport"},"TriggerAutoPunchResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"punch_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Punch Type"},"punch_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Punch Time"},"distance_meters":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Distance Meters"},"is_geofence_valid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Geofence Valid"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"TriggerAutoPunchResponse"},"UserCreate":{"properties":{"username":{"type":"string","title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"password":{"type":"string","title":"Password"},"role":{"$ref":"#/components/schemas/UserRole","default":"employee"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"hourly_rate":{"type":"number","title":"Hourly Rate","default":200.0},"google_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Google Email"},"auth_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Provider","default":"both"},"backup_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Backup Email"}},"type":"object","required":["username","email","full_name","password"],"title":"UserCreate"},"UserLeaveBalanceSummary":{"properties":{"user_id":{"type":"integer","title":"User Id"},"user_name":{"type":"string","title":"User Name"},"department_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Name"},"year":{"type":"integer","title":"Year"},"seniority_years":{"type":"number","title":"Seniority Years"},"total_entitled_hours":{"type":"number","title":"Total Entitled Hours"},"total_used_hours":{"type":"number","title":"Total Used Hours"},"total_pending_hours":{"type":"number","title":"Total Pending Hours"},"total_remaining_hours":{"type":"number","title":"Total Remaining Hours"},"items":{"items":{"$ref":"#/components/schemas/LeaveBalanceItem"},"type":"array","title":"Items"}},"type":"object","required":["user_id","user_name","year","seniority_years","total_entitled_hours","total_used_hours","total_pending_hours","total_remaining_hours","items"],"title":"UserLeaveBalanceSummary"},"UserPasswordReset":{"properties":{"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["new_password"],"title":"UserPasswordReset"},"UserPermissionsResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"username":{"type":"string","title":"Username"},"full_name":{"type":"string","title":"Full Name"},"role":{"$ref":"#/components/schemas/UserRole"},"can_manage_permissions":{"type":"boolean","title":"Can Manage Permissions"},"is_custom":{"type":"boolean","title":"Is Custom"},"custom_permissions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Custom Permissions"},"effective_permissions":{"items":{"type":"string"},"type":"array","title":"Effective Permissions"},"role_default_permissions":{"items":{"type":"string"},"type":"array","title":"Role Default Permissions"}},"type":"object","required":["user_id","username","full_name","role","can_manage_permissions","is_custom","effective_permissions","role_default_permissions"],"title":"UserPermissionsResponse"},"UserPermissionsUpdate":{"properties":{"can_manage_permissions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Can Manage Permissions"},"custom_permissions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Custom Permissions"},"reset_to_default":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Reset To Default","default":false}},"type":"object","title":"UserPermissionsUpdate"},"UserProfileUpdate":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"google_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Google Email"},"backup_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Backup Email"},"old_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Password"},"new_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Password"}},"type":"object","title":"UserProfileUpdate"},"UserResponse":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"role":{"$ref":"#/components/schemas/UserRole"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"department_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Name"},"hourly_rate":{"type":"number","title":"Hourly Rate"},"is_active":{"type":"boolean","title":"Is Active"},"can_manage_permissions":{"type":"boolean","title":"Can Manage Permissions","default":false},"custom_permissions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Custom Permissions"},"effective_permissions":{"items":{"type":"string"},"type":"array","title":"Effective Permissions","default":[]},"must_change_password":{"type":"boolean","title":"Must Change Password","default":false},"is_email_verified":{"type":"boolean","title":"Is Email Verified","default":true},"is_first_login":{"type":"boolean","title":"Is First Login","default":false},"google_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Id"},"google_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Email"},"auth_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Provider","default":"both"},"backup_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Backup Email"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","username","email","full_name","role","hourly_rate","is_active","created_at"],"title":"UserResponse"},"UserRole":{"type":"string","enum":["admin","cfo","accountant","auditor","hr_manager","manager","employee"],"title":"UserRole"},"UserUpdate":{"properties":{"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"anyOf":[{"$ref":"#/components/schemas/UserRole"},{"type":"null"}]},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"hourly_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hourly Rate"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"must_change_password":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Must Change Password"},"is_email_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Email Verified"},"is_first_login":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is First Login"},"google_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Google Email"},"auth_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Provider"},"backup_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Backup Email"}},"type":"object","title":"UserUpdate"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Vat401Item":{"properties":{"format_code":{"type":"string","title":"Format Code"},"description":{"type":"string","title":"Description"},"count":{"type":"integer","title":"Count"},"sales_amount":{"type":"number","title":"Sales Amount"},"tax_amount":{"type":"number","title":"Tax Amount"}},"type":"object","required":["format_code","description","count","sales_amount","tax_amount"],"title":"Vat401Item"},"Vat401Report":{"properties":{"period":{"type":"string","title":"Period"},"company_name":{"type":"string","title":"Company Name"},"company_tax_id":{"type":"string","title":"Company Tax Id"},"output_items":{"items":{"$ref":"#/components/schemas/Vat401Item"},"type":"array","title":"Output Items"},"total_output_sales":{"type":"number","title":"Total Output Sales"},"total_output_tax":{"type":"number","title":"Total Output Tax"},"input_items":{"items":{"$ref":"#/components/schemas/Vat401Item"},"type":"array","title":"Input Items"},"total_input_sales":{"type":"number","title":"Total Input Sales"},"total_input_tax":{"type":"number","title":"Total Input Tax"},"net_tax_payable":{"type":"number","title":"Net Tax Payable"},"tax_status":{"type":"string","title":"Tax Status"}},"type":"object","required":["period","company_name","company_tax_id","output_items","total_output_sales","total_output_tax","input_items","total_input_sales","total_input_tax","net_tax_payable","tax_status"],"title":"Vat401Report"},"VerifyEmailRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"VerifyEmailRequest"},"VerifyEmailResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message"},"is_email_verified":{"type":"boolean","title":"Is Email Verified","default":true}},"type":"object","required":["message"],"title":"VerifyEmailResponse"},"VoiceCommandRequest":{"properties":{"voice_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Text","description":"語音轉文字內容"},"transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcript","description":"語音轉文字內容"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"語音指令內容 (相容欄位)"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"語音指令內容 (Teams / Gemini 相容欄位)"},"employee_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee User Id","description":"指定員工 ID (供語音模擬器切換員工身分)"},"target_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target User Id","description":"指定員工 ID (相容欄位)"},"employee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Email","description":"指定員工 Email"},"employee_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Name","description":"指定員工姓名"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel","description":"來源管道: teams_voice, gemini_app","default":"teams_voice"},"source_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Channel","description":"來源管道: teams_voice, gemini_app, web_voice_mic, teams_mobile"},"auto_submit":{"type":"boolean","title":"Auto Submit","description":"是否直接正式立案送出簽核 (False 則為預覽草稿)","default":true},"send_teams_card":{"type":"boolean","title":"Send Teams Card","description":"是否推送 Teams Adaptive Card","default":true},"send_gemini_card":{"type":"boolean","title":"Send Gemini Card","description":"是否推送 Gemini Enterprise App Card","default":false},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key","description":"選填：Google Gemini API Key"}},"type":"object","title":"VoiceCommandRequest"},"WorkflowStatus":{"type":"string","enum":["pending","approved","rejected","cancelled"],"title":"WorkflowStatus"},"WorkflowType":{"type":"string","enum":["expense_claim","leave","overtime","purchase","journal_posting","makeup_punch","payroll"],"title":"WorkflowType"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/auth/login"}}}}}}