{"openapi":"3.1.0","info":{"title":"LeapsurgeAPI","version":"1.3"},"paths":{"/api/AdminPortal/DelOrg":{"post":{"tags":["AdminPortal"],"summary":"Delorg","operationId":"DelOrg_api_AdminPortal_DelOrg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/AdminPortal/RestoreOrg":{"post":{"tags":["AdminPortal"],"summary":"Restoreorg","operationId":"RestoreOrg_api_AdminPortal_RestoreOrg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/AdminPortal/DelUsers":{"post":{"tags":["AdminPortal"],"summary":"Delusers","operationId":"DelUsers_api_AdminPortal_DelUsers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/AdminPortal/RestoreUser":{"post":{"tags":["AdminPortal"],"summary":"Restoreuser","operationId":"RestoreUser_api_AdminPortal_RestoreUser_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/AdminPortal/DelFirm":{"post":{"tags":["AdminPortal"],"summary":"Delfirm","operationId":"DelFirm_api_AdminPortal_DelFirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/AdminPortal/RestoreFirm":{"post":{"tags":["AdminPortal"],"summary":"Restorefirm","operationId":"RestoreFirm_api_AdminPortal_RestoreFirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/AdminPortal/UpdateCode":{"post":{"tags":["AdminPortal"],"summary":"Updatecode","operationId":"UpdateCode_api_AdminPortal_UpdateCode_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateCustCode"}}},"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/AdminPortal/LoginUsers":{"get":{"tags":["AdminPortal"],"summary":"Loginusers","operationId":"LoginUsers_api_AdminPortal_LoginUsers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/AdminPortal/SendFirebaseNotification":{"post":{"tags":["AdminPortal"],"summary":"Sendfirebasenotification","operationId":"sendFirebaseNotification_api_AdminPortal_SendFirebaseNotification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirebaseSendNotification"}}},"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":[]}]}},"/auth/token":{"post":{"tags":["Auth"],"summary":"Authenticate User","operationId":"authenticate_user_auth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_authenticate_user_auth_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/refresh":{"post":{"tags":["Auth"],"summary":"Refresh Access Token","operationId":"refresh_access_token_auth_refresh_post","parameters":[{"name":"refresh-token","in":"header","required":true,"schema":{"type":"string","title":"Refresh-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppData":{"post":{"tags":["AppData"],"summary":"Appdata","operationId":"appData_api_AppData_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/query"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppData/Master/{type}":{"post":{"tags":["AppData"],"summary":"Masterappdata","operationId":"masterAppData_api_AppData_Master__type__post","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","title":"Type"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/query"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppData/Insert/{type}":{"post":{"tags":["AppData"],"summary":"Insertappdata","operationId":"insertAppData_api_AppData_Insert__type__post","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","title":"Type"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/query"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppData/Trigger":{"post":{"tags":["AppData"],"summary":"Trigger","operationId":"Trigger_api_AppData_Trigger_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/triggerData"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppData/UserActivity":{"get":{"tags":["AppData"],"summary":"Useractivity","operationId":"UserActivity_api_AppData_UserActivity_get","parameters":[{"name":"lscode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}},{"name":"app-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/DelOrg":{"post":{"tags":["BestBi"],"summary":"Delorg","operationId":"DelOrg_api_BestBi_DelOrg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/BestBi/RestoreOrg":{"post":{"tags":["BestBi"],"summary":"Restoreorg","operationId":"RestoreOrg_api_BestBi_RestoreOrg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/BestBi/DelUsers":{"post":{"tags":["BestBi"],"summary":"Delusers","operationId":"DelUsers_api_BestBi_DelUsers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/BestBi/RestoreUser":{"post":{"tags":["BestBi"],"summary":"Restoreuser","operationId":"RestoreUser_api_BestBi_RestoreUser_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/BestBi/DelFirm":{"post":{"tags":["BestBi"],"summary":"Delfirm","operationId":"DelFirm_api_BestBi_DelFirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/BestBi/RestoreFirm":{"post":{"tags":["BestBi"],"summary":"Restorefirm","operationId":"RestoreFirm_api_BestBi_RestoreFirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/getAdminCodes"}}},"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/BestBi/UpdateCode":{"post":{"tags":["BestBi"],"summary":"Updatecode","operationId":"UpdateCode_api_BestBi_UpdateCode_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateCustCode"}}},"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/BestBi/LoginUsers":{"get":{"tags":["BestBi"],"summary":"Loginusers","operationId":"LoginUsers_api_BestBi_LoginUsers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/BestBi/SendFirebaseNotification":{"post":{"tags":["BestBi"],"summary":"Sendfirebasenotification","operationId":"sendFirebaseNotification_api_BestBi_SendFirebaseNotification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirebaseSendNotification"}}},"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/BestBi/MobileApp/GetUserDetails":{"get":{"tags":["BestBi"],"summary":"Mobile App User Details","operationId":"mobile_app_user_details_api_BestBi_MobileApp_GetUserDetails_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"aadId","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aadid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/GetUserReportDetails":{"get":{"tags":["BestBi"],"summary":"Mobile App User Report Details","operationId":"mobile_app_user_report_details_api_BestBi_MobileApp_GetUserReportDetails_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/InsertAppLog":{"post":{"tags":["BestBi"],"summary":"Create Log","operationId":"create_log_api_BestBi_MobileApp_InsertAppLog_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsertAppLog"}}},"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/BestBi/MobileApp/Bookmarks":{"get":{"tags":["BestBi"],"summary":"Bookmarklist","description":"**Function**: `Bookmark List`  \n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function retrieves a list of bookmarks or fetch specific bookmark associated with a specific user and report. The bookmarks are returned in JSON format and can be used to manage user preferences or quick access links.\n\n**Usage**:  \nThis API is used to fetch bookmarks for a particular user concerning a specific report. The user and report codes must be URL-encoded to ensure proper transmission of data.\n\n**Endpoint**:  \n`GET http://<baseURL>/api/BestBi/MobileApp/Bookmarks?user=<Encoded User Code>&report=<Encoded Report Code>`\n\n**Headers**:  \n- `Customer-Key`: Required. An encoded string containing the `LSCode` and `FirmCode`, separated by a pipe (`|`).\n\n**Query Parameters**\n- `action` (string, required): `0` for `list` and `1` for `fetch`.\n- `user` (string, required): The encoded user code for which bookmarks are being retrieved.\n- `report` (string, required): The encoded report code related to the bookmarks.\n\n**Request Example**:  \n```\nGET /api/BestBi/MobileApp/Bookmarks?user=Encoded User Code&report=Encoded Report Code\nHeaders:\nCustomer-Key: Encoded LSCode|Encoded FirmCode\n```\n\n**Response**:  \nA JSON object containing a list of bookmarks associated with the specified user and report.\n\n**Response Example**:  \n```json\n{\n    \"bookmarksList\": [\n        {\n            \"bookmark_id\": \"<\"Bookmark Id\">\",\n            \"bookmark_name\": \"<\"Bookmark Name\">\",\n            \"bookmark_state\": \"<\"bookmark state\">\",\n            \"is_default\": null\n        },\n        ...\n    ]\n}\n```\n\n**Notes**:  \n- The `bookmark_id` is a unique identifier for each bookmark.\n- The `bookmark_name` indicates the display name of the bookmark.\n- The `bookmark_state` may contain additional state information related to the bookmark.\n- The `is_default` field indicates whether the bookmark is a default bookmark (may return `null` if not applicable).\n\n**Error Handling**:  \nIf the request fails (e.g., due to invalid parameters or authentication issues), an appropriate error response will be returned.\n\n**Example Error Response**:  \n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid user code or report code\"\n}\n```\n\n**Important**:  \nEnsure that the user code and report code are properly encoded to prevent issues with special characters in the URL.","operationId":"BookmarkList_api_BestBi_MobileApp_Bookmarks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","title":"Action"}},{"name":"user","in":"query","required":true,"schema":{"type":"string","title":"User"}},{"name":"report","in":"query","required":true,"schema":{"type":"string","title":"Report"}},{"name":"customer-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer-Key"}},{"name":"bookmark-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bookmark-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/DeviceSettings":{"post":{"tags":["BestBi"],"summary":"Create Device Settings","operationId":"create_device_settings_api_BestBi_MobileApp_DeviceSettings_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSettings"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/EmbedToken":{"get":{"tags":["BestBi"],"summary":"Get Embed Token","operationId":"get_embed_token_api_BestBi_MobileApp_EmbedToken_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user","in":"query","required":true,"schema":{"type":"string","title":"User"}},{"name":"report","in":"query","required":true,"schema":{"type":"string","title":"Report"}},{"name":"app_code","in":"query","required":true,"schema":{"type":"string","title":"App Code"}},{"name":"customer-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/AppAccess/{flag}":{"post":{"tags":["BestBi"],"summary":"Create Mobile App Access","operationId":"create_mobile_app_access_api_BestBi_MobileApp_AppAccess__flag__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"path","required":true,"schema":{"type":"integer","title":"Flag"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileAppAccess"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/Otp/{flag}":{"get":{"tags":["BestBi"],"summary":"Send Otp","operationId":"send_otp_api_BestBi_MobileApp_Otp__flag__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"path","required":true,"schema":{"type":"integer","title":"Flag"}},{"name":"user-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}},{"name":"key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/userdasboard":{"get":{"tags":["BestBi"],"summary":"Get Data","operationId":"get_data_api_BestBi_MobileApp_userdasboard_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}},{"name":"lscode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}},{"name":"company-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company-Code"}},{"name":"app-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/useractivitydata":{"get":{"tags":["BestBi"],"summary":"Get User Activity","operationId":"get_user_activity_api_BestBi_MobileApp_useractivitydata_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"subuser-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subuser-Code"}},{"name":"lscode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}},{"name":"app-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/NotificationStatusUpdate":{"patch":{"tags":["BestBi"],"summary":"Update Notification Status","operationId":"update_notification_status_api_BestBi_MobileApp_NotificationStatusUpdate_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"messageId","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messageid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/UserNotificationList":{"get":{"tags":["BestBi"],"summary":"Get User Notifications","operationId":"get_user_notifications_api_BestBi_MobileApp_UserNotificationList_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"deviceId","in":"header","required":true,"schema":{"type":"string","title":"Deviceid"}},{"name":"time","in":"header","required":true,"schema":{"type":"string","title":"Time"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/profileimageupload":{"post":{"tags":["BestBi"],"summary":"Profileimageupload","operationId":"profileImageUpload_api_BestBi_MobileApp_profileimageupload_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}},{"name":"lscode","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_profileImageUpload_api_BestBi_MobileApp_profileimageupload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/subscriptionexpirysendmail":{"get":{"tags":["BestBi"],"summary":"Subscriptionexpiredmail","operationId":"subscriptionExpiredMail_api_BestBi_MobileApp_subscriptionexpirysendmail_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/adduserfavorite":{"get":{"tags":["BestBi"],"summary":"Adduserfavorite","operationId":"addUserFavorite_api_BestBi_MobileApp_adduserfavorite_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"company-code","in":"header","required":true,"schema":{"type":"string","title":"Company-Code"}},{"name":"report-code","in":"header","required":true,"schema":{"type":"string","title":"Report-Code"}},{"name":"fav-flag","in":"header","required":true,"schema":{"type":"integer","title":"Fav-Flag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/getInfo":{"get":{"tags":["BestBi"],"summary":"Getuserinformation","operationId":"getUserInformation_api_BestBi_MobileApp_getInfo_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/MobileApp/bookmarkAction":{"post":{"tags":["BestBi"],"summary":"Bookmark Action","description":"**Function**: `bookmarkAction`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThis API endpoint allows the user to perform various actions on bookmarks, including creating, fetching, listing, setting as default, renaming, removing default, and deleting a bookmark.\n\n**Endpoint**:  \n`POST http://<baseURL>/api/BestBi/MobileApp/bookmarkAction`\n\n**Headers**:  \nThe request must include the following headers:\n- `userCode`: Encoded user code to identify the user making the request.\n- `customerKey`: Encoded customer key used to verify the customer's identity.\n- `reportCode`: Encoded user code to identify the report to bookmark.\n\n**Request Parameters**:  \nThe request should specify an `action` parameter to indicate the operation to be performed on the bookmark. The possible values and required fields in the JSON request body are:\n\n**Action Help Info**:\n- `0`: Create.\n- `1`: Set Default.\n- `2`: Rename.\n- `3`: Remove Default.\n- `4`: Delete Bookmark.\n\n- **create**: Creates a new bookmark.\n- **Request Body Fields**:\n    - `bookmarkId`: Bookmark identifier.\n    - `bookmarkName`: User-friendly name for the bookmark.\n    - `bookmarkState`: State information for the bookmark.\n\n- **fetch**: Retrieves a specific bookmark’s state.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to be fetched.\n\n- **list**: Lists all bookmarks associated with a report.\n- **Request Body Fields**:\n    - `reportname`: Name of the report for which bookmarks should be listed.\n\n- **setdefault**: Sets a bookmark as the default.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to set as default.\n\n- **rename**: Renames a bookmark.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to rename.\n    - `bookmarkName`: New name for the bookmark.\n\n- **removedefault**: Removes a bookmark from being the default.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to remove as default.\n\n- **delete**: Deletes a bookmark.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to delete.\n\n**Response**:  \nReturns a JSON response with a status message based on the result of the action.\n\n**Response Structure**:  \nThe response format varies based on the action:\n- **create**: Confirmation of bookmark creation.\n```json\n{\n    \"message\": \"Bookmark created successfully\"\n}\n```\n- **fetch**: Returns the state of the requested bookmark.\n```json\n{\n    \"data\": \"<Bookmark_State>\"\n}\n```\n- **list**: List of all bookmarks for a specific report.\n```json\n{\n    \"data\": [\n        {\n            \"Bookmark_Id\": \"<bookmark_id>\",\n            \"Bookmark_Name\": \"<bookmark_name>\",\n            \"Isdefault\": <default_status>\n        }\n    ]\n}\n```\n- **setdefault**: Confirmation of bookmark being set as default.\n```json\n{\n    \"message\": \"Bookmark set as default\"\n}\n```\n- **rename**: Confirmation of successful rename.\n```json\n{\n    \"message\": \"Bookmark renamed successfully\"\n}\n```\n- **removedefault**: Confirmation of default status removal.\n```json\n{\n    \"message\": \"Bookmark default removed\"\n}\n```\n- **delete**: Confirmation of deletion.\n```json\n{\n    \"message\": \"Bookmark deleted successfully\"\n}\n```\n\n**Notes**:  \n- Ensure `userCode`, `customerKey` and `reportCode` headers are valid and provided for the request to succeed.\n- Each action must be accompanied by the correct body fields, and missing fields will result in an error.\n- This endpoint is intended for managing user-specific bookmarks within the application.","operationId":"bookmark_action_api_BestBi_MobileApp_bookmarkAction_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"userCode","in":"header","required":true,"schema":{"type":"string","title":"Usercode"}},{"name":"customerKey","in":"header","required":true,"schema":{"type":"string","title":"Customerkey"}},{"name":"reportCode","in":"header","required":true,"schema":{"type":"string","title":"Reportcode"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookmarkActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/login":{"get":{"tags":["BestBi"],"summary":"Login","description":"**Function**: `login`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function verifies the user's credentials and returns a JSON response indicating whether the login was successful or not.\n\n**URL**:  \n`GET http://<baseURL>/api/BestBI/login`\n\n**Request Headers**:\n- **Username** (Header, required):  \n  The email address of the user to log in.\n- **Password** (Header, required):  \n  The password of the user to log in.\n\n**Response**:  \nA JSON response containing the status of the login attempt.\nIf the login is successful, the response will contain a \"status\" key with the value \"success\" and either an \"mfa\" or \"message\" key depending on whether MFA is enabled or not.\nIf the login fails, the response will contain a \"status\" key with the value \"failed\" and a \"message\" key with the error message.\n\n**Error Handling**:\n- Raises HTTP 401 if the email or password is incorrect.\n- Raises HTTP 500 for any other exceptions encountered during execution.","operationId":"login_api_BestBi_login_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Username","in":"header","required":true,"schema":{"type":"string","title":"Username"}},{"name":"Password","in":"header","required":true,"schema":{"type":"string","title":"Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/otp_send_and_verify":{"get":{"tags":["BestBi"],"summary":"Send Or Verify Otp","description":"**Function**: `send_or_verify_otp`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function is used to send an OTP to the user's email address or to verify an OTP sent to the user. It is used for user authentication.\n\n**URL**:  \n`GET http://<baseURL>/api/BestBI/otp_send_and_verify`\n\n**Request Headers**:\n- **Key** (Header, required):  \n  The email address or mobile number of the user to send the OTP to.\n- **otp** (Header, optional):  \n  The OTP sent to the user to verify.\n\n**Response**:  \nA JSON response containing the result of the OTP verification or a message indicating that the OTP has been sent to the user's email address.\n\n**Error Handling**:\n- Raises HTTP 404 if the user is not found.\n- Raises HTTP 400 if the OTP is invalid or has expired.\n- Raises HTTP 500 for any other exceptions encountered during execution.","operationId":"send_or_verify_otp_api_BestBi_otp_send_and_verify_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string","title":"Key"}},{"name":"otp","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Otp"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/BestBi/reset_password":{"post":{"tags":["BestBi"],"summary":"Reset Password","description":"**Function**: `reset_password`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nResets the password of a user.\n\n**URL**:  \n`POST http://<baseURL>/api/BestBI/reset_password`\n\n**Request Headers**:\n- **Email** (Header, required):  \n  The email address of the user to reset the password for.\n- **new_password** (Header, required):  \n  The new password to set for the user.\n\n**Response**:  \nA JSON response containing a message indicating that the password has been reset successfully.\n\n**Error Handling**:\n- Raises HTTP 404 if the user is not found.\n- Raises HTTP 500 for any other exceptions encountered during execution.","operationId":"reset_password_api_BestBi_reset_password_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Email","in":"header","required":true,"schema":{"type":"string","title":"Email"}},{"name":"new-password","in":"header","required":true,"schema":{"type":"string","title":"New-Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppDataBBI":{"post":{"tags":["BestBi AppData"],"summary":"Appdata","operationId":"appData_api_AppDataBBI_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/query"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppDataBBI/Master/{type}":{"post":{"tags":["BestBi AppData"],"summary":"Masterappdata","operationId":"masterAppData_api_AppDataBBI_Master__type__post","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","title":"Type"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/query"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppDataBBI/Insert/{type}":{"post":{"tags":["BestBi AppData"],"summary":"Insertappdata","operationId":"insertAppData_api_AppDataBBI_Insert__type__post","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","title":"Type"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/query"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppDataBBI/Trigger":{"post":{"tags":["BestBi AppData"],"summary":"Trigger","operationId":"Trigger_api_AppDataBBI_Trigger_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/triggerData"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/AppDataBBI/UserActivity":{"get":{"tags":["BestBi AppData"],"summary":"Useractivity","operationId":"UserActivity_api_AppDataBBI_UserActivity_get","parameters":[{"name":"lscode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}},{"name":"app-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/CustDataBBI/{Type}/{customer_key}/{Db_Type}":{"post":{"tags":["BestBi CustData"],"summary":"Custdata","operationId":"CustData_api_CustDataBBI__Type___customer_key___Db_Type__post","parameters":[{"name":"Type","in":"path","required":true,"schema":{"type":"string","title":"Type"}},{"name":"customer_key","in":"path","required":true,"schema":{"type":"string","title":"Customer Key"}},{"name":"Db_Type","in":"path","required":true,"schema":{"type":"string","title":"Db Type"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/query"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bestbi/SSO/token":{"post":{"tags":["BestBi SSO"],"summary":"Authenticate Bestbi User","operationId":"authenticate_bestbi_user_api_bestbi_SSO_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_authenticate_bestbi_user_api_bestbi_SSO_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bestbi/SSO/initial-login-set-password":{"get":{"tags":["BestBi SSO"],"summary":"Forgot Password","operationId":"forgot_password_api_bestbi_SSO_initial_login_set_password_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["BestBi SSO"],"summary":"Set Password","operationId":"set_password_api_bestbi_SSO_initial_login_set_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_set_password_api_bestbi_SSO_initial_login_set_password_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bestbi/SSO/forgot-password":{"get":{"tags":["BestBi SSO"],"summary":"Forgot Password","operationId":"forgot_password_api_bestbi_SSO_forgot_password_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["BestBi SSO"],"summary":"Forgot Password Submit","operationId":"forgot_password_submit_api_bestbi_SSO_forgot_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_forgot_password_submit_api_bestbi_SSO_forgot_password_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bestbi/SSO/verify-otp-password":{"get":{"tags":["BestBi SSO"],"summary":"Verify Otp Password","operationId":"verify_otp_password_api_bestbi_SSO_verify_otp_password_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["BestBi SSO"],"summary":"Verify Otp Password","operationId":"verify_otp_password_api_bestbi_SSO_verify_otp_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_verify_otp_password_api_bestbi_SSO_verify_otp_password_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bestbi/SSO/resend-otp":{"post":{"tags":["BestBi SSO"],"summary":"Resend Otp","operationId":"resend_otp_api_bestbi_SSO_resend_otp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bestbi/SSO/reset-password":{"post":{"tags":["BestBi SSO"],"summary":"Reset Password Submit","operationId":"reset_password_submit_api_bestbi_SSO_reset_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_reset_password_submit_api_bestbi_SSO_reset_password_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bestbi/SSO/desktopToken":{"post":{"tags":["BestBi SSO"],"summary":"Authenticate Desktop User","operationId":"authenticate_desktop_user_api_bestbi_SSO_desktopToken_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_authenticate_desktop_user_api_bestbi_SSO_desktopToken_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bestbi/SSO/desktopRefresh":{"post":{"tags":["BestBi SSO"],"summary":"Refresh Desktop Access Token","operationId":"refresh_desktop_access_token_api_bestbi_SSO_desktopRefresh_post","parameters":[{"name":"refresh-token","in":"header","required":true,"schema":{"type":"string","title":"Refresh-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chatbot/currentuserdetails":{"get":{"tags":["ChatBot"],"summary":"Currentuserdetails","operationId":"currentUserDetails_api_chatbot_currentuserdetails_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"AAD","in":"header","required":true,"schema":{"type":"string","title":"Aad"}},{"name":"appName","in":"header","required":true,"schema":{"type":"string","title":"Appname"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chatbot/getadminuser":{"get":{"tags":["ChatBot"],"summary":"Getadminuser","operationId":"getAdminUser_api_chatbot_getadminuser_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"usercode","in":"header","required":true,"schema":{"type":"string","title":"Usercode"}},{"name":"appName","in":"header","required":true,"schema":{"type":"string","title":"Appname"}},{"name":"flag","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Flag"}},{"name":"Appcode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appcode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chatbot/getcustomeruser":{"get":{"tags":["ChatBot"],"summary":"Getcustomeruser","operationId":"getCustomerUser_api_chatbot_getcustomeruser_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"appName","in":"header","required":true,"schema":{"type":"string","title":"Appname"}},{"name":"usercode","in":"header","required":true,"schema":{"type":"string","title":"Usercode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chatbot/getchat":{"get":{"tags":["ChatBot"],"summary":"Showchat","operationId":"showChat_api_chatbot_getchat_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"userCode","in":"header","required":true,"schema":{"type":"string","title":"Usercode"}},{"name":"appName","in":"header","required":true,"schema":{"type":"string","title":"Appname"}},{"name":"chatid","in":"header","required":true,"schema":{"type":"string","title":"Chatid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chatbot/insertchatdetails":{"post":{"tags":["ChatBot"],"summary":"Insertchatdetails","operationId":"insertChatDetails_api_chatbot_insertchatdetails_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"appName","in":"header","required":true,"schema":{"type":"string","title":"Appname"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/chatInsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chatbot/updateDetails":{"post":{"tags":["ChatBot"],"summary":"Updatedetails","operationId":"updateDetails_api_chatbot_updateDetails_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"header","required":true,"schema":{"type":"string","title":"Flag"}},{"name":"appName","in":"header","required":true,"schema":{"type":"string","title":"Appname"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/chatUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/CustData/{Type}/{customer_key}/{Db_Type}":{"post":{"tags":["CustData"],"summary":"Custdata","operationId":"CustData_api_CustData__Type___customer_key___Db_Type__post","parameters":[{"name":"Type","in":"path","required":true,"schema":{"type":"string","title":"Type"}},{"name":"customer_key","in":"path","required":true,"schema":{"type":"string","title":"Customer Key"}},{"name":"Db_Type","in":"path","required":true,"schema":{"type":"string","title":"Db Type"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/query"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/CustData/get-ip":{"get":{"tags":["CustData"],"summary":"Get Api Ip","description":"Returns the IP address of the client making the request.\n\nReturns a JSON response with a key-value pair of \"client_ip\" and the IP address of the client and \"status\" with a value of \"success\" if the IP address is successfully retrieved. If an exception occurs, it returns a JSON response with a key-value pair of \"error\" and the error message and \"status\" with a value of \"failed\".\n\n:param request: The incoming request object.\n:return: A JSON response object.","operationId":"get_api_ip_api_CustData_get_ip_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/CustData/instructions":{"get":{"tags":["CustData"],"summary":"Get Instructions","operationId":"get_instructions_api_CustData_instructions_get","parameters":[{"name":"customer_key","in":"query","required":true,"schema":{"type":"string","title":"Customer Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/DatabaseDetails/getdetails/{dbtype}":{"get":{"tags":["DatabaseDetails"],"summary":"Get Details","operationId":"get_details_api_DatabaseDetails_getdetails__dbtype__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"dbtype","in":"path","required":true,"schema":{"type":"integer","title":"Dbtype"}},{"name":"data","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/DatabaseDetails/db_credentials":{"get":{"tags":["DatabaseDetails"],"summary":"Get Db Credentials","description":"**Function**: `get_db_credentials`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nRetrieves the database credentials from the environment variables.\n\n**URL**:  \n`GET http://<baseURL>/api/MobileApp/db_credentials`\n\n**Response**:  \nA JSON response containing the database credentials.\n\n**Error Handling**:\n- Raises HTTP 500 for any exceptions encountered during execution.","operationId":"get_db_credentials_api_DatabaseDetails_db_credentials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/GenerateToken/{customer_key}":{"post":{"tags":["GenerateToken"],"summary":"Generatetoken","operationId":"GenerateToken_api_GenerateToken__customer_key__post","parameters":[{"name":"customer_key","in":"path","required":true,"schema":{"type":"string","title":"Customer Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/generateToken"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/userdasboard":{"get":{"tags":["LeapsurgeBI"],"summary":"Userdasboarddata","description":"**Function**: `userDasboardData`\n**Type**: API Endpoint (GET)\n\n**Purpose**:\nReturns dashboard data for the logged-in Leapsurge BI user and firm. The endpoint decodes the\nsupplied header values, checks the user's administrator/group context, and builds dashboard\nsections for user counts, reports, sync status, source status, and today's activity log.\n\n**Headers**:\n- `user_code` (str, required): Base64-encoded user code.\n- `lscode` (str, required): Base64-encoded customer/LS code.\n- `company_code` (str, required): Base64-encoded firm/company code.\n- `app_code` (str, required): Base64-encoded application code.\n\n**Response**:\nReturns a JSON object containing:\n- `cardDetails`: User, active user, inactive user, subscribed report, assigned license,\n  and pending license counts for administrator users.\n- `favouritereportList`: Favorite subscribed reports for the user.\n- `recentReportList`: Recently opened reports available to the user or assigned group.\n- `reportoverviewList`: Requested, subscribed, rejected, and disabled report counts.\n- `dataSyncDetails`: Report sync and dataset sync status details.\n- `sourceData`: Customer firm and sync source/server status information.\n- `reportsTrace`: Report subscription status summary.\n- `activityLog`: Current-day activity event counts grouped by time.\n\n**Exceptions**:\n- Returns HTTP 500 with an error message if dashboard data cannot be retrieved.","operationId":"userDasboardData_api_LeapsurgeBI_userdasboard_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}},{"name":"lscode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}},{"name":"company-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company-Code"}},{"name":"app-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/report_list":{"get":{"tags":["LeapsurgeBI"],"summary":"Report List","description":"Returns all report master records from `LS_Report_Master`.","operationId":"report_list_api_LeapsurgeBI_report_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/LeapsurgeBI/firm_list":{"get":{"tags":["LeapsurgeBI"],"summary":"Firm List","description":"Returns firm master records from `LS_Customer_Firm_Details` for the decoded customer key.","operationId":"firm_list_api_LeapsurgeBI_firm_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"LS-Code","in":"header","required":true,"schema":{"type":"string","title":"Ls-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/user_list":{"get":{"tags":["LeapsurgeBI"],"summary":"User List","description":"Returns user master records from `LS_User_Master` for the decoded LS code.","operationId":"user_list_api_LeapsurgeBI_user_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"LS-Code","in":"header","required":true,"schema":{"type":"string","title":"Ls-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/group_list":{"get":{"tags":["LeapsurgeBI"],"summary":"Group List","description":"Returns group master records from `LS_User_Group_Master` for the decoded customer key.","operationId":"group_list_api_LeapsurgeBI_group_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"LS-Code","in":"header","required":true,"schema":{"type":"string","title":"Ls-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/user_details":{"get":{"tags":["LeapsurgeBI"],"summary":"User Details","description":"Returns one or all users' details. Report and RLS access are grouped inside each firm entry.","operationId":"user_details_api_LeapsurgeBI_user_details_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"LS-Code","in":"header","required":true,"schema":{"type":"string","title":"Ls-Code"}},{"name":"User-Code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/group_details":{"get":{"tags":["LeapsurgeBI"],"summary":"Group Details","description":"Returns one or all groups' details. Report and RLS access are grouped inside each firm entry.","operationId":"group_details_api_LeapsurgeBI_group_details_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"LS-Code","in":"header","required":true,"schema":{"type":"string","title":"Ls-Code"}},{"name":"Group-Code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/user_details_crud":{"post":{"tags":["LeapsurgeBI"],"summary":"User Details Crud","description":"**Function**: `user_details_crud`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nPerforms create, read, update, and delete operations for Leapsurge BI users. The operation is\nselected through the `action` header, while the request body supplies user details, firm access,\nreport access, menu access, and RLS access details as needed.\n\n**Headers**:\n- `LSCode` (str, required): Base64 encoded LS code to identify the customer context.\n- `action` (str, required): CRUD action to perform. Supported values are:\n  `create`, `read`, `update`, and `delete`.\n\n**Request Body**:\n- `user_code` (str, optional): Required for `update` and `delete`; optional filter for `read`.\n- `user_details` (dict, optional): User master details such as `first_name`, `last_name`,\n  `email`, `mobile`, `password`, `application_code`, `user_group_code`, `is_active`,\n  `is_administrator`, `is_license`, `two_factor_auth`, `is_support_admin`, `default_firm`,\n  `is_group`, and `access_sync_app`.\n- `firm_access` (list, optional): Firm access records for `LS_User_Firm_Access`, each with\n  `firm_code` and `active`.\n- `report_details` (list, optional): Report access records, each with `report_code` or\n  `report_id`, and `access`.\n- `menu_details` (list, optional): Menu access records, each with `menuCode`, `menu_code`, or\n  `menu_id`, and `access`.\n- `rls_details` (list, optional): Userwise RLS access records with `report_code`, `rls_email`,\n  `rls_role`, `active`, and optional hierarchy fields.\n- `modified_user` (str, optional): User name to store in audit columns. Defaults to the\n  authenticated user's name/email.\n\n**Behavior**:\n- `create`: Creates an `LS_User_Master` record, generates a new user code, updates the serial\n  number, and inserts related firm/report/menu/RLS access records.\n- `read`: Returns one user when `user_code` is supplied, otherwise returns all users for the\n  decoded LSCode.\n- `update`: Updates user master fields and replaces supplied firm/report/menu/RLS access sets.\n- `delete`: Deletes the user and related firm/report/menu/RLS access records for the decoded LSCode.\n\n**Response**:\nReturns a JSON response with `status`, `message`, and when applicable `user_code` or `data`.\n\n**Exceptions**:\n- Returns HTTP 400 for invalid customer key, invalid action, missing required input, or duplicate email.\n- Returns HTTP 404 when an update/delete user is not found.\n- Returns HTTP 500 with the exception message if an unexpected error occurs.","operationId":"user_details_crud_api_LeapsurgeBI_user_details_crud_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"LSCode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"action","in":"header","required":true,"schema":{"type":"string","title":"Action"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCrudSchema"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/group_details_crud":{"post":{"tags":["LeapsurgeBI"],"summary":"Group Details Crud","description":"**Function**: `group_details_crud`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nPerforms create, read, update, and delete operations for Leapsurge BI user groups. The\noperation is selected through the `action` header, while the request body supplies group master\ndata, firm access, report access, menu access, and RLS access details as needed.\n\n**Headers**:\n- `LSCode` (str, required): Base64-encoded LS code to identify the customer context.\n- `action` (str, required): CRUD action to perform. Supported values are:\n  `create`, `read`, `update`, and `delete`.\n\n**Request Body**:\n- `group_code` (str, optional): Required for `update` and `delete`; optional filter for `read`.\n- `group_name` (str, optional): Group name. Required for `create`; optional for `update`.\n- `is_active` (bool, optional): Active status for the group.\n- `application_code` (str, optional): Required for `create` and `update`; optional filter for `read`.\n- `report_list` (list, optional): Report codes to assign to the group.\n- `menu_list` (list, optional): Menu access records, each with `menuCode` and `access`.\n- `firm_access` (list, optional): Firm access records for `LS_User_Firm_Access`, each with\n  `firm_code` and `active`.\n- `rls_details` (list, optional): Group RLS access records with `report_code`, `rls_email`,\n  `rls_role`, `active`, and optional hierarchy fields.\n- `modified_user` (str, optional): User name to store in audit columns. Defaults to the\n  authenticated user's name/email.\n\n**Behavior**:\n- `create`: Creates an `LS_User_Group_Master` record, generates a new group code, updates the\n  serial number, and inserts related firm/report/menu/RLS access records.\n- `read`: Returns one group when `group_code` is supplied, otherwise returns groups for the\n  decoded LSCode and optional `application_code`.\n- `update`: Updates group master fields and replaces supplied firm/report/menu/RLS access sets.\n- `delete`: Deletes the group and related firm/report/menu/RLS access records for the decoded LSCode.\n\n**Response**:\nReturns a JSON response with `status`, `message`, and when applicable `group_code` or `data`.\n\n**Exceptions**:\n- Returns HTTP 400 for invalid customer key, invalid action, missing required input, duplicate\n  group name, or group not found.\n- Returns HTTP 500 with the exception message if an unexpected error occurs.","operationId":"group_details_crud_api_LeapsurgeBI_group_details_crud_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"LSCode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"action","in":"header","required":true,"schema":{"type":"string","title":"Action"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCrudSchema"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/LeapsurgeBI/get_customer_details":{"get":{"tags":["LeapsurgeBI"],"summary":"Get Customer Details","operationId":"get_customer_details_api_LeapsurgeBI_get_customer_details_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lia/login":{"post":{"tags":["Lia"],"summary":"Login","operationId":"login_api_lia_login_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"email","in":"header","required":true,"schema":{"type":"string","title":"Email"}},{"name":"password","in":"header","required":true,"schema":{"type":"string","title":"Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lia/get_sessions":{"get":{"tags":["Lia"],"summary":"Get chat sessions for a workspace","operationId":"get_sessions_api_lia_get_sessions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","description":"Base64 encoded","title":"User-Code"},"description":"Base64 encoded"},{"name":"firm-code","in":"header","required":true,"schema":{"type":"string","description":"Base64 encoded","title":"Firm-Code"},"description":"Base64 encoded"},{"name":"app-code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lia/get_messages":{"get":{"tags":["Lia"],"summary":"Get chat messages for a session","operationId":"get_messages_api_lia_get_messages_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"session-id","in":"header","required":true,"schema":{"type":"string","description":"Base64 encoded","title":"Session-Id"},"description":"Base64 encoded"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lia/get_firms":{"get":{"tags":["Lia"],"summary":"Get list available firms for the user","operationId":"get_firms_api_lia_get_firms_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"email","in":"header","required":true,"schema":{"type":"string","description":"Base64 encoded","title":"Email"},"description":"Base64 encoded"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lia/send_content":{"post":{"tags":["Lia"],"summary":"LIA Chat — AI sales analyst","operationId":"chat_endpoint_api_lia_send_content_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"session-id","in":"header","required":true,"schema":{"type":"string","title":"Session-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/sql_server":{"post":{"tags":["MCP Server"],"summary":"SQL Server MCP — Claude & ChatGPT Connector","description":"**MCP SQL Server Endpoint (ChatGPT & Claude Connector)**\n\n**URL:** `POST /api/mcp/sql_server`\n\n**Header:**\n- `Mcp-Session-Id` (optional but recommended) — will be echoed back in every response.\n\n**Methods Supported (`method`):**\n- `initialize`\n- `notifications/initialized`\n- `ping`\n- `tools/list`\n- `tools/call`\n\n**Example — List tools:**\n```json\n{ \"jsonrpc\": \"2.0\", \"method\": \"tools/list\", \"params\": {}, \"id\": 1 }\n```\n\n**Example — Call tool:**\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"tools/call\",\n  \"params\": { \"name\": \"sqlserver_list_tables\", \"arguments\": {} },\n  \"id\": 1\n}\n```\n\n**Tools**\n- `sqlserver_list_tables`\n- `sqlserver_describe_table`\n- `sqlserver_execute_query`\n- `sqlserver_list_schemas`\n- `sqlserver_get_table_stats`\n- `sqlserver_search_tables`\n\n**Security**\n- Read-only enforced (SELECT / WITH…SELECT only)\n- Multiple statements blocked\n- Max rows limited\n- Session header echoed to prevent ChatGPT link expiry","operationId":"mcp_sql_server_api_mcp_sql_server_post","parameters":[{"name":"Mcp-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mcp-Session-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/databricks":{"post":{"tags":["MCP Server"],"summary":"Databricks MCP — Claude & ChatGPT Connector","description":"**MCP Databricks Endpoint (ChatGPT & Claude Connector)**\n\n**URL:** `POST /api/mcp/databricks`\n\n**Header:**\n- `Mcp-Session-Id` (optional but recommended) — will be echoed back in every response.\n\n**Methods Supported (`method`):**\n- `initialize`\n- `notifications/initialized`\n- `ping`\n- `tools/list`\n- `tools/call`\n\n**Example — List tools:**\n```json\n{ \"jsonrpc\": \"2.0\", \"method\": \"tools/list\", \"params\": {}, \"id\": 1 }\n```\n\n**Example — Call tool:**\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"tools/call\",\n  \"params\": { \"name\": \"list_tables\", \"arguments\": { \"database\": \"datamarts\", \"schema\": \"gold\" } },\n  \"id\": 1\n}\n```\n\n**Tools**\n- `list_databases_and_schemas`\n- `list_tables`\n- `describe_table`\n- `query_table`\n- `execute_custom_query`\n- `search_tables`\n- `get_column_info`\n\n**Security**\n- Read-only enforced (blocks INSERT/UPDATE/DELETE/CREATE/DROP/etc.)\n- Row limit enforced\n- Session header echoed to prevent ChatGPT link expiry","operationId":"mcp_databricks_api_mcp_databricks_post","parameters":[{"name":"Mcp-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mcp-Session-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/mongodb":{"post":{"tags":["MCP Server"],"summary":"MongoDB MCP — Claude & ChatGPT Connector","description":"**MCP MongoDB Endpoint (ChatGPT & Claude Connector)**\n\n**URL:** `POST /api/mcp/mongodb`\n\n**Header:**\n- `Mcp-Session-Id` (optional but recommended) — will be echoed back in every response.\n\n**Methods Supported (`method`):**\n- `initialize`\n- `notifications/initialized`\n- `ping`\n- `tools/list`\n- `tools/call`\n\n**Example — List tools:**\n```json\n{ \"jsonrpc\": \"2.0\", \"method\": \"tools/list\", \"params\": {}, \"id\": 1 }\n```\n\n**Example — Call tool:**\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"tools/call\",\n  \"params\": { \"name\": \"mongodb_find\", \"arguments\": { \"database\": \"mydb\", \"collection\": \"orders\", \"filter_json\": \"{\"status\": \"active\"}\", \"limit\": 50 } },\n  \"id\": 1\n}\n```\n\n**Tools**\n- `mongodb_list_databases`\n- `mongodb_list_collections`\n- `mongodb_describe_collection`\n- `mongodb_find`\n- `mongodb_aggregate`\n- `mongodb_count_documents`\n- `mongodb_get_collection_stats`\n- `mongodb_search_collections`\n\n**Security**\n- Read-only enforced ($out and $merge pipeline stages blocked)\n- Write operators blocked in filters\n- Max documents limited\n- Session header echoed to prevent ChatGPT link expiry\n\n**Required env vars:** MONGODB_URI, MONGODB_DATABASE (optional default db)","operationId":"mcp_mongodb_api_mcp_mongodb_post","parameters":[{"name":"Mcp-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mcp-Session-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/reference_table_list":{"get":{"tags":["MDM"],"summary":"Referencetablelist","description":"**Function**: `ReferenceTableList`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nReturns a list of tables in the customer database.\n\n**URL**:  \n`GET /api/mdm/reference_table_list`\n\n**Parameters**:\n- `customer_key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n\n**Request Body**: None\n\n**Response**:\nA JSON object containing an array of table objects, each with a `name` property.\n\n**Status Codes**:\n- 200: Success\n- 400: Invalid `customer_key`\n- 500: Internal Server Error","operationId":"ReferenceTableList_api_mdm_reference_table_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/reference_column_list/{TableName}":{"get":{"tags":["MDM"],"summary":"Referencecolumnlist","description":"**Function**: `ReferenceColumnList`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nReturns a list of columns in a specified table in the customer database.\n\n**URL**:  \n`GET /api/mdm/reference_column_list/{TableName}`\n\n**Parameters**:\n- `customer_key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `TableName` (Path, required): The name of the table to retrieve columns from.\n\n**Request Body**: None\n\n**Response**:\nA JSON object containing an array of column objects, each with `colId` and `colName` properties.\n\n**Status Codes**:\n- 200: Success\n- 400: Invalid `customer_key`\n- 404: Table not found\n- 500: Internal Server Error","operationId":"ReferenceColumnList_api_mdm_reference_column_list__TableName__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"TableName","in":"path","required":true,"schema":{"type":"string","title":"Tablename"}},{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/table_list/":{"get":{"tags":["MDM"],"summary":"Tablelist","description":"**Function**: `TableList`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe function retrieves a paginated list of tables and their additional fields from the customer database based on the provided `customer_key`. It also includes the count of 'In progress' uploads for each table.\n\n**URL**:  \n`POST /api/mdm/table_list/`\n\n**Request Parameters**:\n- **Customer-Key** (Header, required):  \nA base64 encoded string that contains `lscode` and `firmcode`, separated by a pipe (`|`).\n\n**Request Example**:\n```http\nGET /api/mdm/table_list/?page=1&limit=25 HTTP/1.1\nHost: yourdomain.com\nContent-Type: application/json\nCustomer_Key: \"your customer key\"\n```\n\n**Response Example**:\n```json\n{\n    \"total_count\": <total_count>,\n    \"data\": [\n        {\n            \"Table Name\": \"<Table Name>\",\n            \"Description\": \"<Description>\",\n            \"Active Status\": <Active Status>,\n            \"Error Type\": \"<Error Type>\",\n            \"Delete Option\": \"<Delete Option>\",\n            \"In progress Uploads\": <In progress Uploads>,\n            \"Record count\": <Record count>\n        },\n        {\n            \"Table Name\": \"<Table Name>\",\n            \"Description\": \"<Description>\",\n            \"Active Status\": <Active Status>,\n            \"Error Type\": \"<Error Type>\",\n            \"Delete Option\": \"<Delete Option>\",\n            \"In progress Uploads\": <In progress Uploads>,\n            \"Record count\": <Record count>\n        },\n    ......\n]\n}\n```\n\n**Steps**:\n1. **Log Creation**:  \nA unique log ID is generated using the current timestamp for logging purposes.\n\n2. **Customer Key Decoding**:  \nThe `customer_key` is decoded from base64. It should contain `lscode` and `firmcode` separated by a pipe (`|`). If the key is empty, improperly formatted, or cannot be decoded, an error response is returned.\n\n3. **Database Connection**:  \nThe decoded `lscode` and `firmcode` are used to establish a connection to the customer’s database using the `custCursorConnection` function. If the connection fails, an error is raised.\n\n4. **Query Execution**:  \nA SQL query is prepared and executed to fetch a paginated list of tables from the `[dbo].[LS_Custom_Tables]` table. Only active tables (`[Active Flag] = 1`) are retrieved.  \nThe query results include table details like `Table Name`, `Delete Option`, `Error Type`, and `Description`.\n\n5. **In Progress Upload Count**:  \nFor each table, a query is made using SQLAlchemy to fetch the count of 'In progress' uploads from the `LSMDMFileUploadQueue` table based on the table name.\n\n6. **Response Construction**:  \nThe retrieved data is formatted into a list of dictionaries containing basic and additional table details. The result is logged and returned as a JSON response.\n\n**Error Handling**:\n- **Invalid Customer Key**:  \nIf the `customer_key` is invalid or incorrectly formatted, an error message is returned.\n- **Database Errors**:  \nAny issues during query execution or connection are caught, rolled back, logged, and returned as a 500 error response.\n\n**Security Considerations**:\n- The `customer_key` is encoded to protect sensitive data like `lscode` and `firmcode`.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"Connection failed\"\n    }\n}\n```","operationId":"TableList_api_mdm_table_list__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/data_list/":{"get":{"tags":["MDM"],"summary":"Datalist","description":"**Function**: `DataList`\n**Type**: API Endpoint (GET)\n\n**Purpose**:\nRetrieves a paginated list of data from the specified table in the customer database. Supports searching and caching for optimized performance.\n\n**URL**:\n`GET /api/mdm/data_list/`\n\n**Request Headers**:\n- `Customer-Key` (str, required): A base64-encoded string identifying the customer and database.\n- `Table-Name` (str, required): The name of the table to retrieve data from.\n\n**Request Parameters**:\n- `page` (int, optional): The page number for pagination (default is 1).\n- `limit` (int, optional): The number of rows to fetch per page (default is 25).\n- `search` (str, optional): A JSON string representing search parameters.\n\n**Response**:\nReturns a JSON object containing the requested data. Supports cached responses for quick retrieval.\n\n**Exceptions**:\n- Raises a 400 HTTPException for invalid customer key or search format.\n- Raises a 500 HTTPException for server-side errors.","operationId":"DataList_api_mdm_data_list__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","title":"Search"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/column_list/":{"get":{"tags":["MDM"],"summary":"Columnlist","description":"**Function**: `ColumnList`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis API endpoint retrieves a paginated list of columns from a specified table for a particular customer based on the provided `customer_key`.\n\n**URL**:  \n`GET /api/mdm/column_list/?page=<page_num>&limit=<limit_num>`\n\n**Request Headers**:\n- **Customer-Key** (Header, required):  \n    A base64 encoded string that contains `lscode` and `firmcode`, separated by a pipe (`|`).\n- **Table-Name** (Header, required):  \n    The name of the table from which to retrieve column details.\n\n**Steps**:\n1. **Log Creation**:  \n    Generates a unique log ID based on the current timestamp to track each request.\n2. **Customer Key Decoding**:  \n    The `Customer-Key` is decoded from base64 and split into `lscode` and `firmcode`. \n    If the format is invalid, an error message is returned.\n3. **Database Connection**:  \n    The `custCursorConnection` function uses `lscode` and `firmcode` to connect to the specific customer’s database.\n4. **Query Execution**:  \n    Retrieves the column data for the specified `Table_Name` from the `[dbo].[LS_Custom_Columns]` table. \n    Results are filtered by `Active Flag` and paginated based on `page` and `limit` parameters.\n5. **Result Processing**:  \n    The query results are formatted as a list of dictionaries, handling data types such as `Decimal` and `datetime` for JSON serialization.\n6. **Response Construction**:  \n    A JSON response is returned with the formatted list of column details.\n\n**Response Example**:\n```json\n[\n    \"total_count\": <total_count>,\n    \"table_details\": [\n        {\n            \"Table Name\": \"<Table Name>\",\n            \"Description\": \"<Description>\",\n            \"Error Type\": \"<Error Type>\",\n            \"Delete Option\": \"<Delete Option>\"\n        }\n    ],\n    \"columns\": [\n        {\n            \"LSCode\": \"<LSCode>\",\n            \"LSFirmCode\": \"<LSFirmCode>\",\n            \"Table\": \"<Table>\",\n            \"column_id\": \"<column_id>\",\n            \"Column Name\": \"<Column Name>\",\n            \"Data Type\": \"<Data Type>\",\n            \"Length\": \"<Length>\",\n            \"Scale\": \"<Scale>\",\n            \"Required\": \"<Required>\",\n            \"Column Type\": \"<Column Type>\",\n            \"Reference Type\": \"<Reference Type>\",\n            \"Description\": \"<Description>\",\n            \"Default Value\": \"<Default Value>\",\n            \"Compute Formula\": \"<Compute Formula>\",\n            \"Sequence\": \"<Sequence>\",\n            \"Active Flag\": \"<Active Flag>\",\n            \"Created By\": \"<Created By>\",\n            \"Date Of Item Created\": \"<Date Of Item Created>\",\n            \"Modified By\": \"<Modified By>\",\n            \"Date of Modification\": \"<Date of Modification>\",\n            \"Pkey\": \"<Date of Modification>\",\n            \"Delete_on\": \"<Delete_on>\"\n        },\n        {\n        .....\n        },\n        .....\n    {\n]\n```\n\n**Error Handling**:\n- **Invalid Customer Key**:  \n    If `customer_key` decoding fails, an error message with \"Invalid Customer Key\" is returned.\n- **Database Connection/Execution Errors**:  \n    Any issues during connection or query execution are caught, rolled back, logged, and returned with a 500 status.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"table does not exist\"\n    }\n}\n```\n\n**Security Considerations**:\n- Sensitive data in the `customer_key` (like `lscode` and `firmcode`) is encoded to provide security. \n- The database is accessed only if the `customer_key` is valid and properly formatted.","operationId":"ColumnList_api_mdm_column_list__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/value_list":{"post":{"tags":["MDM"],"summary":"Valuelist","description":"**Function**: `ValueList`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe function retrieves a list of values from a specified table and column in the customer database. The specifics of the request are provided in the request body.\n\n**URL**:  \n`POST /api/mdm/value_list`\n\n**Request Headers**:\n- `customer_key` (str, required): An encoded string containing the `lscode` and `firmcode` for the customer. This must be decoded for database access.\n\n**Request Body**:\n```json\n{\n    \"refTable\": \"<Table Name>\",\n    \"dataColumn\": \"<colName>\",\n    \"displayColumn1\": \"<colName>\",\n    \"displayColumn2\": \"<colName>\",\n    \"displayColumn3\": \"<colName>\",\n    \"displayColumn4\": \"<colName>\",\n    \"displayColumn5\": \"<colName>\",\n    \"filter\": \"<filter>\"\n}\n```\n\n**Response Example**:\n```json\n[\n    [{\"Division Group\": \"<Division Group>\", \"division_code\": \"<division_code>\"},\n    {\"Division Group\": \"<Division Group>\", \"division_code\": \"<division_code>\"},\n    {\"Division Group\": \"<Division Group>\", \"division_code\": \"<division_code>\"}]\n]\n```\n\n**Steps**:\n1. **Customer Key Decoding**:  \nThe function decodes the `customer_key` from base64 to extract the `lscode` and `firmcode`. If decoding fails or the format is incorrect, an error message is returned.\n\n2. **Request Validation**:  \nThe function checks if the required fields (`refTable`, `dataColumn`, and at least one `displayColumn`) are present in the request body.\n\n3. **Database Connection**:  \nA connection to the customer-specific database is established using the `custCursorConnection` function with the decoded `lscode` and `firmcode`.\n\n4. **Query Execution**:  \nThe function constructs and executes a SQL query to retrieve the values from the specified table and columns. If filters are provided, they are incorporated into the query.\n\n5. **Response Construction**:  \nThe query results are formatted into a list of dictionaries and returned as a JSON response.\n\n**Error Handling**:\n- **Invalid Customer Key**:  \nReturns an error if the decoded customer key is empty or incorrectly formatted.\n- **Request Validation Errors**:  \nReturns an error if required fields are missing from the request body.\n- **Database Errors**:  \nCatches exceptions during query execution and rolls back any transactions, logging the error details.\n\n**Response Fields**:\n- A list of dictionaries where each dictionary contains values from the specified columns.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Missing required fields in the request body.\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"Table not found\"\n    }\n}","operationId":"ValueList_api_mdm_value_list_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mdmValueList"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/search_list":{"post":{"tags":["MDM"],"summary":"Searchlist","description":"**Function**: `SearchList`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe function searches for a list of values based on specified conditions from a given table and column in the customer database.\n\n**URL**:  \n`POST /api/mdm/search_list`\n\n**Request Headers**:\n- `customer_key` (str, required): An encoded string that contains the `lscode` and `firmcode` for the customer, which must be decoded for further processing.\n\n**Request Body**:\n```json\n{\n    \"table\": \"<Table Name>\",\n    \"column\": \"<colName>\",\n    \"filter\": \"<filter>\",\n    \"condition\": \"<condition>\"\n}\n```\n\n**Response Example**:\n```json\n[\n    {\"Custom4\": \"<Customer>\"}\n]\n```\n\n**Steps**:\n1. **Log Creation**:  \nA unique log ID is generated based on the current date and time, ensuring traceability for each request.\n\n2. **Customer Key Decoding**:  \nThe `customer_key` is decoded using base64. If the decoded value is invalid or improperly formatted, the function returns an error response.\n\n3. **Request Body Parsing**:  \nThe function retrieves the `table`, `column`, `filter`, and `condition` from the request body to use in the SQL query.\n\n4. **Database Connection**:  \nUsing the decoded values, a connection to the customer-specific database is established with the `custCursorConnection` function.\n\n5. **SQL Query Construction**:  \nA SQL query is dynamically constructed based on the input parameters, including the specified table, column, filter, and condition. The query is executed to fetch the relevant records.\n\n6. **Response Construction**:  \nThe results from the query execution are formatted into a list of dictionaries and returned as a JSON response.\n\n**Error Handling**:\n- **Invalid Customer Key**:  \nIf the decoded customer key is empty or does not follow the expected format, an appropriate error message is returned.\n- **Invalid Request Body**:  \nIf any required fields in the request body are missing, an error response is returned.\n- **Database Errors**:  \nAny exceptions during query execution are caught, logged, and a `500` status response is returned with error details.\n\n**Security Considerations**:\n- The `customer_key` is encoded to protect sensitive information like `lscode` and `firmcode`.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid request body\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"SQL syntax error\"\n    }\n}\n```","operationId":"SearchList_api_mdm_search_list_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mdmSearchValues"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/delete":{"post":{"tags":["MDM"],"summary":"Delete","description":"**Function**: `Delete`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe function handles the deletion of records from the customer database based on the provided query and conditions. It ensures that records are backed up before deletion, maintaining a log of the operation.\n\n**URL**:  \n`POST /api/mdm/delete`\n\n**Request Headers**:\n- `customer_key` (str, required): An encoded string containing the `lscode` and `firmcode` for the customer. This must be decoded for database access.\n\n**Request Body**:\n```json\n{\n    \"query\": \"<query>\",\n    \"type\": <int>\n}\n```\n\n**Response Example**:\n```json\n{\n    \"status\": \"Success\",\n    \"message\": \"\"\n}\n```\n\n**Steps**:\n1. **Log Creation**:  \nA unique log ID is generated based on the current date and time, ensuring traceability for each request.\n\n2. **Customer Key Decoding**:  \nThe `customer_key` is decoded using base64. If the decoded value is invalid or improperly formatted, the function returns an error response.\n\n3. **Request Validation**:  \nThe function checks if the required fields (`query`) are present in the request body.\n\n4. **Database Connection**:  \nA connection to the customer-specific database is established using the `custCursorConnection` function with the decoded `lscode` and `firmcode`.\n\n5. **SQL Query Execution**:  \nA SQL query is executed to first back up the records to be deleted, then delete them from the main table, handling any exceptions that may occur.\n\n6. **Response Construction**:  \nThe results from the query execution are formatted and returned as a JSON response.\n\n**Error Handling**:\n- **Invalid Customer Key**:  \nIf the decoded customer key is empty or does not follow the expected format, an appropriate error message is returned.\n- **Invalid Request Body**:  \nIf any required fields in the request body are missing, an error response is returned.\n- **Database Errors**:  \nAny exceptions during query execution are caught, logged, and a `500` status response is returned with error details.\n\n**Security Considerations**:\n- The `customer_key` is encoded to protect sensitive information like `lscode` and `firmcode`.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Query should not be null\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"SQL syntax error\"\n    }\n}\n```","operationId":"Delete_api_mdm_delete_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer_key","in":"query","required":true,"schema":{"type":"string","title":"Customer Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mdmDeleteRecord"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/user_list":{"get":{"tags":["MDM"],"summary":"User List","description":"**Function**: `user_list`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function retrieves a paginated list of users who have MDM access for a specific `LSCode`. It decodes the `LSCode` from the request headers, queries the database for user details, and returns a JSON response containing the user information.\n\n**URL**:  \n`GET /api/mdm/user_list/?page=<page_num>&limit=<limit_num>`\n\n**Request Headers**:\n- **Customer_Key** (Header, required):  \n  A base64 encoded string that identifies the Customer_Key(LSCode|FirmCode).\n\n**Request Parameters**:\n- **page** (Query Parameter, optional):  \n  The page number for pagination (default is 1).\n- **limit** (Query Parameter, optional):  \n  The number of rows to fetch per page for pagination (default is 25).\n\n**Response Example**:\n```json\n{\n    \"users\": [\n        {\n            \"Name\": \"<First Name>\",\n            \"Email\": \"<Email>\",\n            \"Mobile\": \"<Mobile>\",\n            \"Role\": \"<User Group Name>\",\n            \"Status\": \"<Isactive>\",\n            \"UserCode\": \"<Encoded User Code>\",\n            \"groupCode\": \"<Encoded Group Code>\"\n        },\n        ...\n    ]\n}\n```\n\n**Error Handling**:\n- Raises HTTP 400 if `lscode` header is missing.\n- Raises HTTP 500 for any other exceptions encountered during execution.","operationId":"user_list_api_mdm_user_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/existing_user":{"get":{"tags":["MDM"],"summary":"Existing User","description":"**Function**: `existing_user`  \n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function retrieves existing user details, menu access, and table access for a given user based on the provided headers. It decodes the Customer_Key to identify the customer and database, fetches user-related information, and constructs a structured response.\n\n**URL**:  \n`GET /api/mdm/existing_user`\n\n**Headers**:\n- `Aad-Id` (str, required): A base64-encoded string representing the AAD ID of the user.  \n- `Customer-Key` (str, required): A base64-encoded string containing information to identify the customer and database.\n- `User-Code` (str, required): A base64-encoded string representing the user code.\n- `App-Code` (str, required): A base64-encoded string representing the application code.\n\n**Response Model**:  \nReturns an `ExistingUser` instance containing the user details, menu access, and table access information.\n\n**Response Example**:\n```json\n{\n    \"user\": {\n        \"first_name\": \"<first_name>\",\n        \"last_name\": \"<last_name>\",\n        \"email\": \"<email>\",\n        \"mobile\": \"<mobile>\",\n        \"user_group_code\": \"<user_group_code>\",\n        \"user_role\": \"<user_role>\",\n        \"active\": <active>\n    },\n    \"menu_access\": [\n        {\n            \"parent\": {\n                \"menu_code\": \"<menu_code>\",\n                \"menu_name\": \"<menu_name>\",\n                \"access\": <access>\n            },\n            \"children\": [\n                {\n                    \"menu_code\": \"<menu_code>\",\n                    \"menu_name\": \"<menu_name>\",\n                    \"access\": <access>\n                }\n            ]\n        }\n    ],\n    \"table_access\": [\n        {\n            \"table_name\": \"<table_name>\",\n            \"access\": <access>,\n            \"upload_download_access\": <upload_download_access>\n        }\n    ]\n}\n```\n\n**Error Handling**:\n- Returns HTTP 400 if `Customer_Key` is invalid.\n- Returns HTTP 404 if the user is not found.\n- Returns HTTP 500 for any unexpected server errors.\n\n**Steps**:\n1. Decode the `Customer_Key` header and validate its format.\n2. Extract and decode the `userCode` and `appCode`.\n3. Fetch user details, group details, menu access, and table access from the database.\n4. Construct and return the structured response.\n5. Log the API call with a unique log identifier for tracking.","operationId":"existing_user_api_mdm_existing_user_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExistingUser"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/update_access":{"put":{"tags":["MDM"],"summary":"Update Access","description":"**Function**: `update_access`\n**Type**: API Endpoint (PUT)\n\n**Purpose**:\nThis endpoint updates the access rights of a user for a specific application.\n\n**URL**:\n`PUT /api/mdm/update_access`\n\n**Request Parameters**:\n- `request` (Request): The request object.\n- `update_request` (UpdateAccessRequest): An object containing details about the user, menu, and table access to be updated.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode`.\n- `User_Code` (Header, required): A base64 encoded string containing the user code.\n- `App_Code` (Header, optional): A base64 encoded string containing the application code.\n- `db` (Session): The database session, obtained via dependency injection.\n\n**Process**:\n1. Decodes the `Customer_Key` to extract `lscode` and `firmcode`.\n2. Validates the `User_Code`.\n3. Updates the user details (email, mobile).\n4. Updates the menu access.\n5. Updates the table access.\n6. Fetches the updated user details, menu access, and table access.\n7. Constructs and returns a JSON response detailing the updated access rights.\n\n**Response**:\n- A JSON object containing the updated user details, menu access, and table access.\n- Indicates success or failure for each step, including any errors encountered.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"update_access_api_mdm_update_access_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccessRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExistingUser"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/activity_data":{"post":{"tags":["MDM"],"summary":"Activity Data","description":"**Function**: `activity_data`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe `activity_data` function serves as an API endpoint that fetches activity data for a specific user. The function retrieves data related to activities, triggers, or history records based on specified filters. It allows filtering by user, customer, application, and fetch type (status categories such as Success, Failure, In Progress, etc.).\n\n**URL**:  \n`POST /api/mdm/activity_data`\n\n**Request Headers**:\n- **User-Code** (Header, required): A base64-encoded string representing the user code.\n- **Customer-Key** (Header, required): A base64-encoded string containing `lscode` and `firmcode`, separated by a pipe (`|`), which helps identify the customer's firm and database code.\n- **App-Code** (Header, required): A base64-encoded string representing the application code.\n- **Fetch-Type** (Header, required): A string indicating the type of data to fetch:\n-Upload\n    - `0`: Pending\n    - `1`: Processed\n    - `2`: Not-Processed\n    - `3`: In-progress\n    \n-Download    \n    - `4`: In-progress\n    - `6`: Processed\n    - `7`: Not Processed\n    \n- **type** (Header, required): A string indicating the type of data to retrieve:\n    - `0`: Activity\n    - `1`: Trigger\n    - `2`: History\n\n**Response Model**:  \nReturns a JSON object containing:\n- **recordsTotal**: Total number of records retrieved.\n- **columns**: List of dictionaries defining column metadata for the output.\n- **data**: List of dictionaries with activity data.\n\n**Response Example**:\n```json\n{\n    \"recordsTotal\": 1,\n    \"columns\": [\n        {\"data\": \"batchid\", \"title\": \"ID\", \"target\": 0},\n        {\"data\": \"file_upload_on\", \"title\": \"Date\", \"target\": 1},\n        {\"data\": \"table_name\", \"title\": \"Table\", \"target\": 2},\n        {\"data\": \"file_name\", \"title\": \"File Name\", \"target\": 3},\n        {\"data\": \"created_user\", \"title\": \"User\", \"target\": 4},\n        {\"data\": \"message\", \"title\": \"Message\", \"target\": 5},\n        {\"data\": \"Url\", \"title\": \"View Error Details\", \"target\": 6}\n    ],\n    \"data\": [\n        {\n            \"batchid\": \"<batchid>\",\n            \"file_upload_on\": \"<file_upload_on>\",\n            \"table_name\": \"<table_name>\",\n            \"file_name\": \"<file_name>\",\n            \"created_user\": \"<created_user>\",\n            \"message\": \"<message>\",\n            \"Url\": \"<Url>\"\n        }\n    ]\n}","operationId":"activity_data_api_mdm_activity_data_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"Fetch-Type","in":"header","required":true,"schema":{"type":"string","title":"Fetch-Type"}},{"name":"type","in":"header","required":true,"schema":{"type":"string","title":"Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/delete_records":{"post":{"tags":["MDM"],"summary":"Delete Records List","description":"**Function**: `delete_records_list`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nDeletes records from a specified table in the customer database based on the provided query.\n\n**URL**:  \n`POST /api/mdm/delete_records`\n\n**Parameters**:\n- `Table_Name` (Header, required): The name of the table to be deleted from.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `request_data` (JSON Body, required): A JSON object containing the deletion details.\n\n**Request Body**:\n```\n    {\n        \"delPartialRecords\": <delPartialRecords>,\n        \"delFullRecords\": <delFullRecords>,\n        \"Customcol\": \"<Customcol>\",\n        \"Date_Of_Item_Created\": \"<Date_Of_Item_Created>\",\n    }\n```","operationId":"delete_records_list_api_mdm_delete_records_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRecordsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/delete_all_records":{"post":{"tags":["MDM"],"summary":"Delete All Records","description":"**Function**: `delete_all_records`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nMakes a specified table inactive or active in the customer database based on its current status.\n\n**URL**:  \n`POST /api/mdm/delete_all_records`\n\n**Parameters**:\n- `Table_Name` (Header, required): The name of the table to be made inactive.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n\n**Response**:\n- A JSON object containing a status message and a brief description of the operation result.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"delete_all_records_api_mdm_delete_all_records_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/on_demand_tables":{"post":{"tags":["MDM"],"summary":"On Demand Tables","description":"**Function**: `on_demand_tables`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nThis endpoint facilitates the creation and management of tables in the customer database.\nIt allows for the creation, alteration, and deletion of columns within a custom table based on the provided request data.\n\n**URL**:\n`POST /api/mdm/on_demand_tables`\n\n**Request Parameters**:\n- `request` (Request): The request object.\n- `table_request` (TableCreateRequest): An object containing details about the table and columns to be managed.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode`.\n- `current_user` (str): The current user performing the operation, obtained via dependency injection.\n\n**Process**:\n1. Decodes the `Customer_Key` to extract `lscode` and `firmcode`.\n2. Checks if the table exists in the metadata (`LS_Custom_Tables`). If not, it inserts a new entry.\n3. Iterates over the columns in `table_request` to perform create, alter, or drop operations:\n   - Creates a new column if it doesn't exist.\n   - Alters an existing column's details.\n   - Drops a column if specified.\n4. Constructs and executes a SQL query to create the actual database table based on the processed metadata.\n5. Commits the transaction and returns a response detailing the status of the operations.\n\n**Response**:\n- A JSON object containing a status message and details of each column operation performed.\n- Indicates success or failure for each step, including any errors encountered.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"on_demand_tables_api_mdm_on_demand_tables_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/table_dml":{"post":{"tags":["MDM"],"summary":"Table Dml","description":"**Function**: `table_dml`\n\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nExecutes data manipulation operations (insert, update, delete) on a specified table in the customer database based on the provided input data.\n\n**URL**:  \n`POST /api/mdm/table_dml`\n\n**Request Headers**:\n- `Customer_Key` (str, required): A base64 encoded string containing `lscode` and `firmcode` for the customer. This must be decoded for database access.\n\n**Request Body**:\n- `input_data` (TableDMLRequest, required): Contains the table name and lists of data for insert, update, and delete operations.\n\n**Response**:\n- Returns a JSON object with a success message if the operations are successful.\n\n**Exceptions**:\n- Handles exceptions related to invalid customer key format, missing `idx` for update/delete operations, and database errors, providing appropriate error messages.\n\n**Steps**:\n1. **Customer Key Decoding**:  \n   Decodes the `Customer_Key` to extract the `lscode` and `firmcode`. Raises an error if the format is invalid.\n\n2. **Input Validation**:  \n   Validates the presence of `table_name` and that the data for insert, update, and delete operations are in list format.\n\n3. **Database Connection**:  \n   Establishes a connection to the database using `custCursorConnection`.\n\n4. **Data Manipulation**:  \n   Executes insert, update, and delete operations on the specified table using the input data.\n\n5. **Transaction Handling**:  \n   Commits the transaction if all operations are successful, or rolls back in case of an error.\n\n6. **Logging**:  \n   Logs the API call with details of the operation.\n\n7. **Response Construction**:  \n   Returns a success message or error details based on the outcome of the operations.","operationId":"table_dml_api_mdm_table_dml_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableDMLRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Table Dml Api Mdm Table Dml Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/search":{"post":{"tags":["MDM"],"summary":"Search","description":"**Function**: `search`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nThis function searches for data in specified tables based on the provided search values. It first checks\nif the table exists in the actual database. Depending on the presence of specific columns and values,\nit queries the relevant data.\n\n**URL**:\n`POST /api/mdm/search`\n\n**Parameters**:\n- `request` (Request): The request object.\n- `search_values` (SearchValues): An object containing the table and optional columns to search.\n- `Customer_Key` (str, optional): A base64 encoded header string containing `lscode` and `firmcode`.\n\n**Returns**:\n- A JSON response indicating the success or failure of the operation.\n- If successful, returns the queried data.\n- If the Customer_Key is invalid or if the table is not found, it returns a failure message.\n\n**Exceptions**:\n- Handles exceptions during base64 decoding and database operations, returning an appropriate error message.","operationId":"search_api_mdm_search_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchValues"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/upload_excel_data":{"post":{"tags":["MDM"],"summary":"Upload Excel Data Endpoint","description":"**Function**: `upload_excel_data_endpoint`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nThis function uploads an Excel file to the specified container and sends a message to the service bus\nto trigger the import of the file into the specified table.\n\n**URL**:\n`POST /api/upload_excel_data`\n\n**Parameters**:\n- `App_Code` (str): Base64 encoded application code.\n- `Customer_Key` (str): Base64 encoded customer key.\n- `Table_Name` (str): The name of the table to import the file into.\n- `excel_file` (UploadFile): The Excel file to upload.\n\n**Returns**:\n- A JSON response indicating the success or failure of the operation.\n- If successful, returns the uploaded file details.\n- If the Customer_Key is invalid or if the table is not found, it returns a failure message.\n\n**Exceptions**:\n- Handles exceptions during base64 decoding and database operations, returning an appropriate error message.","operationId":"upload_excel_data_endpoint_api_mdm_upload_excel_data_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_excel_data_endpoint_api_mdm_upload_excel_data_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/download_excel_data":{"post":{"tags":["MDM"],"summary":"Download Excel Data Endpoint","description":"Endpoint to download Excel data for a given table in a customer's database.\n\nArgs:\n    request (Request): The incoming request.\n    App_Code (str): The application code.\n    Customer_Key (str): The customer key.\n    Table_Name (str): The name of the table to download.\n    split_column (str): The column to split the data based on.\n    db (Session): The database session.\n    current_user (str): The current user.\n\nReturns:\n    JSONResponse: A JSON response with a message indicating whether the request was successful or not.\n\nRaises:\n    HTTPException: If the customer key is invalid or if there is an error fetching the database name.","operationId":"download_excel_data_endpoint_api_mdm_download_excel_data_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"split_column","in":"query","required":true,"schema":{"type":"string","title":"Split Column"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/notifications":{"post":{"tags":["MDM"],"summary":"Handle Notifications","description":"**Function**: `handle_notifications`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nThis endpoint handles different types of notifications such as fetching notifications, setting read status, clearing notifications, etc.\n\n**URL**:\n`POST /api/notifications`\n\n**Request Parameters**:\n- `App_Code` (Header, required): Encoded application code.\n- `User_Code` (Header, required): Encoded user code.\n- `Customer_Key` (Header, required): Encoded customer key.\n- `data` (JSON, required): Data containing the type of notification action and other relevant details.\n\n**Process**:\n1. Decodes the `Customer_Key` to extract `lscode` and `firmcode`.\n2. Validates the customer key.\n3. Handles different types of notifications based on the `data.type` parameter:\n    - `getNotifications`: Fetches all notifications for the user and returns them in a JSON response.\n    - `setReadStatus`: Updates the status of a notification to 'read' (1).\n    - `clearone`: Updates the status of a notification to 'cleared' (2).\n    - `setAllReadStatus`: Updates the status of all notifications for the user to 'read' (1).\n    - `clearAll`: Updates the status of all notifications for the user to 'cleared' (2).\n\n**Request Body**:\n- **For Listing Notifications or Getting Count**:\n\n- `type` (string, required): Type of notification action (e.g., `getNotifications`, `getCount`).\n\n```json\n{\n    \"type\": \"<type>\"\n}\n```\n\n- **For Status Updations**:\n\n- `type` (string, required): Type of notification action (e.g., `setReadStatus`, `clearone`, `setAllReadStatus`, `clearAll`).\n- `id` (integer, optional): ID of the notification to be updated.\n\n```json\n{\n    \"type\": \"<type>\",\n    \"id\": <id>\n}\n```\n\n- **For create or update notofications**:\n\n```json\n{\n    \"flag\": 0 | 1,\n    \"values\": {\n        \"application_code\": \"<application_code>\",\n        \"LSCode\": \"<LSCode>\",\n        \"firm_code\": \"<firm_code>\",\n        \"Id\": \"<Id>\",\n        \"Trigger_Type\": <Trigger_Type>,\n        \"Status\": <Status>,\n        \"Action\": <Action>,\n        \"Created_User\": \"<Created_User>\",\n        \"Date_Of_Creation\": \"<Date_Of_Creation>\",\n        \"Modified_User\": \"<Modified_User>\",\n        \"Date_Of_Modification\": \"<Date_Of_Modification>\",\n        \"Parameter\": \"<Parameter>\",\n        \"Message\": \"<Message>\",\n        \"Button_Name_1\": \"<Button_Name_1>\",\n        \"Button_Value_1\": \"<Button_Value_1>\",\n        \"Button_Name_2\": \"<Button_Name_2>\",\n        \"Button_Value_2\": \"<Button_Value_2>\",\n        \"Button_Name_3\": \"<Button_Name_3>\",\n        \"Button_Value_3\": \"<Button_Value_3>\",\n        \"Icon\": \"<Icon>\",\n        \"Body_Image\": \"<Body_Image>\"\n    }\n}\n\n**Response**:\n- JSON response containing the list of notifications or the result of the notification action.\n- Indicates success or failure for each step, including any errors encountered.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"handle_notifications_api_mdm_notifications_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mdm/update_page_theme":{"put":{"tags":["MDM"],"summary":"Update Page Theme","description":"**Function**: `update_page_theme`\n\n**Type**: API Endpoint (PUT)\n\n**Purpose**:\nThis endpoint is used to update the page theme to light or dark, or to update the default firm.\n\n**URL**:\n`PUT /api/mdm/update_page_theme`\n\n**Request Parameters**:\n- `flag` (str): The flag to indicate whether to update the page theme or default firm.\n- `data` (PageOrFirm): The data to be updated.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode`.\n- `User_Code` (Header, required): A base64 encoded string containing the user code.\n- `db` (Session): The database session.\n- `current_user` (str): The current user performing the operation, obtained via dependency injection.\n\n**Process**:\n1. Validates the customer key.\n2. Checks if the flag is 0 or 1.\n3. If flag is 0, updates the page theme to light or dark based on the request body.\n4. If flag is 1, updates the default firm to the firm that is given in request body.\n5. Commits the transaction and returns a response detailing the status of the operations.\n\n**Response**:\n- A JSON object containing a status message and details of each column operation performed.\n- Indicates success or failure for each step, including any errors encountered.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"update_page_theme_api_mdm_update_page_theme_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"query","required":true,"schema":{"type":"string","title":"Flag"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageOrFirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/GetUserDetails":{"get":{"tags":["MobileApp"],"summary":"Userdetails","operationId":"userDetails_api_MobileApp_GetUserDetails_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"aadId","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aadid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/GetUserReportDetails":{"get":{"tags":["MobileApp"],"summary":"Userreportlist","operationId":"userReportList_api_MobileApp_GetUserReportDetails_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/InsertAppLog":{"post":{"tags":["MobileApp"],"summary":"Insertapplog","operationId":"InsertAppLog_api_MobileApp_InsertAppLog_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsertAppLog"}}},"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/MobileApp/Bookmarks":{"get":{"tags":["MobileApp"],"summary":"Bookmarklist","description":"**Function**: `Bookmark List`  \n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function retrieves a list of bookmarks or fetch specific bookmark associated with a specific user and report. The bookmarks are returned in JSON format and can be used to manage user preferences or quick access links.\n\n**Usage**:  \nThis API is used to fetch bookmarks for a particular user concerning a specific report. The user and report codes must be URL-encoded to ensure proper transmission of data.\n\n**Endpoint**:  \n`GET http://<baseURL>/api/MobileApp/Bookmarks?action=<action>&user=<Encoded User Code>&report=<Encoded Report Code>`\n\n**Headers**:  \n- `Customer-Key`: Required. An encoded string containing the `LSCode` and `FirmCode`, separated by a pipe (`|`).\n\n**Query Parameters**\n- `action` (string, required): `0` for `list` and `1` for `fetch`.\n- `user` (string, required): The encoded user code for which bookmarks are being retrieved.\n- `report` (string, required): The encoded report code related to the bookmarks.\n\n**Request Example**:  \n```\nGET /api/MobileApp/Bookmarks?action=<action>&user=Encoded User Code&report=Encoded Report Code\nHeaders:\nCustomer-Key: Encoded LSCode|Encoded FirmCode\n```\n\n**Response**:  \nA JSON object containing a list of bookmarks associated with the specified user and report.\n\n**Response Example**:  \n```json\n{\n    \"bookmarksList\": [\n        {\n            \"bookmark_id\": \"<\"Bookmark Id\">\",\n            \"bookmark_name\": \"<\"Bookmark Name\">\",\n            \"bookmark_state\": \"<\"bookmark state\">\",\n            \"is_default\": null\n        },\n        ...\n    ]\n}\n```\n\n**Notes**:  \n- The `bookmark_id` is a unique identifier for each bookmark.\n- The `bookmark_name` indicates the display name of the bookmark.\n- The `bookmark_state` may contain additional state information related to the bookmark.\n- The `is_default` field indicates whether the bookmark is a default bookmark (may return `null` if not applicable).\n\n**Error Handling**:  \nIf the request fails (e.g., due to invalid parameters or authentication issues), an appropriate error response will be returned.\n\n**Example Error Response**:  \n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid user code or report code\"\n}\n```\n\n**Important**:  \nEnsure that the user code and report code are properly encoded to prevent issues with special characters in the URL.","operationId":"BookmarkList_api_MobileApp_Bookmarks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","title":"Action"}},{"name":"user","in":"query","required":true,"schema":{"type":"string","title":"User"}},{"name":"report","in":"query","required":true,"schema":{"type":"string","title":"Report"}},{"name":"customer-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer-Key"}},{"name":"bookmark-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bookmark-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/DeviceSettings":{"post":{"tags":["MobileApp"],"summary":"Devicesettings","operationId":"deviceSettings_api_MobileApp_DeviceSettings_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSettings"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/EmbedToken":{"get":{"tags":["MobileApp"],"summary":"Embedtoken","operationId":"EmbedToken_api_MobileApp_EmbedToken_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user","in":"query","required":true,"schema":{"type":"string","title":"User"}},{"name":"report","in":"query","required":true,"schema":{"type":"string","title":"Report"}},{"name":"app_code","in":"query","required":true,"schema":{"type":"string","title":"App Code"}},{"name":"customer-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/AppAccess/{flag}":{"post":{"tags":["MobileApp"],"summary":"Appaccess","operationId":"appaccess_api_MobileApp_AppAccess__flag__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"path","required":true,"schema":{"type":"integer","title":"Flag"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileAppAccess"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/Otp/{flag}":{"get":{"tags":["MobileApp"],"summary":"Sendotp","operationId":"sendOTP_api_MobileApp_Otp__flag__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"path","required":true,"schema":{"type":"integer","title":"Flag"}},{"name":"user-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}},{"name":"key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/userdasboard":{"get":{"tags":["MobileApp"],"summary":"Userdasboarddata","operationId":"userDasboardData_api_MobileApp_userdasboard_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}},{"name":"lscode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}},{"name":"company-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company-Code"}},{"name":"app-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/useractivitydata":{"get":{"tags":["MobileApp"],"summary":"Useractivitydata","operationId":"userActivityData_api_MobileApp_useractivitydata_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"subuser-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subuser-Code"}},{"name":"lscode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}},{"name":"app-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/NotificationStatusUpdate":{"patch":{"tags":["MobileApp"],"summary":"Notificationstatusupdate","operationId":"NotificationStatusUpdate_api_MobileApp_NotificationStatusUpdate_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"messageId","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messageid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/UserNotificationList":{"get":{"tags":["MobileApp"],"summary":"Usernotificationlist","operationId":"userNotificationList_api_MobileApp_UserNotificationList_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"deviceId","in":"header","required":true,"schema":{"type":"string","title":"Deviceid"}},{"name":"time","in":"header","required":true,"schema":{"type":"string","title":"Time"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/profileimageupload":{"post":{"tags":["MobileApp"],"summary":"Profileimageupload","operationId":"profileImageUpload_api_MobileApp_profileimageupload_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}},{"name":"lscode","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_profileImageUpload_api_MobileApp_profileimageupload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/subscriptionexpirysendmail":{"get":{"tags":["MobileApp"],"summary":"Subscriptionexpiredmail","operationId":"subscriptionExpiredMail_api_MobileApp_subscriptionexpirysendmail_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/adduserfavorite":{"get":{"tags":["MobileApp"],"summary":"Adduserfavorite","operationId":"addUserFavorite_api_MobileApp_adduserfavorite_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"company-code","in":"header","required":true,"schema":{"type":"string","title":"Company-Code"}},{"name":"report-code","in":"header","required":true,"schema":{"type":"string","title":"Report-Code"}},{"name":"fav-flag","in":"header","required":true,"schema":{"type":"integer","title":"Fav-Flag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/getInfo":{"get":{"tags":["MobileApp"],"summary":"Getuserinformation","operationId":"getUserInformation_api_MobileApp_getInfo_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/bookmarkAction":{"post":{"tags":["MobileApp"],"summary":"Bookmark Action","description":"**Function**: `bookmark_action`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThis API endpoint allows the user to perform various actions on bookmarks, including creating, fetching, listing, setting as default, renaming, removing default, and deleting a bookmark.\n\n**Endpoint**:  \n`POST http://<baseURL>/api/MobileApp/bookmark_action`\n\n**Headers**:  \nThe request must include the following headers:\n- `User-Code`: Encoded user code to identify the user making the request.\n- `Customer-Key`: Encoded customer key used to verify the customer's identity.\n- `Report-Code`: Encoded user code to identify the report to bookmark.\n\n**Request Parameters**:  \nThe request should specify an `action` parameter to indicate the operation to be performed on the bookmark. The possible values and required fields in the JSON request body are:\n\n**Action Help Info**:\n- `0`: Create.\n- `1`: Set/Remove Default.\n- `2`: Rename.\n- `3`: Delete Bookmark.\n\n- **create**: Creates a new bookmark.\n- **Request Body Fields**:\n    - `bookmarkId`: Bookmark identifier.\n    - `bookmarkName`: User-friendly name for the bookmark.\n    - `bookmarkState`: State information for the bookmark.\n    - `isDefault`: Change the bookmark to default or not default.\n\n- **fetch**: Retrieves a specific bookmark’s state.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to be fetched.\n\n- **list**: Lists all bookmarks associated with a report.\n- **Request Body Fields**:\n    - `reportname`: Name of the report for which bookmarks should be listed.\n\n- **setdefault**: Sets a bookmark as the default or not default.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to set as default or not default.\n\n- **rename**: Renames a bookmark.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to rename.\n    - `bookmarkName`: New name for the bookmark.\n\n- **delete**: Deletes a bookmark.\n- **Request Body Fields**:\n    - `bookmarkId`: Identifier of the bookmark to delete.\n\n**Response**:  \nReturns a JSON response with a status message based on the result of the action.\n\n**Response Structure**:  \nThe response format varies based on the action:\n- **create**: Confirmation of bookmark creation.\n```json\n{\n    \"message\": \"Bookmark created successfully\"\n}\n```\n- **fetch**: Returns the state of the requested bookmark.\n```json\n{\n    \"data\": \"<Bookmark_State>\"\n}\n```\n- **list**: List of all bookmarks for a specific report.\n```json\n{\n    \"data\": [\n        {\n            \"Bookmark_Id\": \"<bookmark_id>\",\n            \"Bookmark_Name\": \"<bookmark_name>\",\n            \"Isdefault\": <default_status>\n        }\n    ]\n}\n```\n- **setdefault**: Confirmation of bookmark being set as default.\n```json\n{\n    \"message\": \"Bookmark set as default\"\n    \"message\": \"Bookmark default removed\"\n}\n```\n- **rename**: Confirmation of successful rename.\n```json\n{\n    \"message\": \"Bookmark renamed successfully\"\n}\n```\n- **delete**: Confirmation of deletion.\n```json\n{\n    \"message\": \"Bookmark deleted successfully\"\n}\n```\n\n**Notes**:  \n- Ensure `userCode`, `customerKey` and `reportCode` headers are valid and provided for the request to succeed.\n- Each action must be accompanied by the correct body fields, and missing fields will result in an error.\n- This endpoint is intended for managing user-specific bookmarks within the application.","operationId":"bookmark_action_api_MobileApp_bookmarkAction_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Report-Code","in":"header","required":true,"schema":{"type":"string","title":"Report-Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookmarkActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/login":{"get":{"tags":["MobileApp"],"summary":"Login","description":"**Function**: `login`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function verifies the user's credentials and returns a JSON response indicating whether the login was successful or not.\n\n**URL**:  \n`GET http://<baseURL>/api/MobileApp/login`\n\n**Request Headers**:\n- **Username** (Header, required):  \n  The email address of the user to log in.\n- **Password** (Header, required):  \n  The password of the user to log in.\n\n**Response**:  \nA JSON response containing the status of the login attempt.\nIf the login is successful, the response will contain a \"status\" key with the value \"success\" and either an \"mfa\" or \"message\" key depending on whether MFA is enabled or not.\nIf the login fails, the response will contain a \"status\" key with the value \"failed\" and a \"message\" key with the error message.\n\n**Error Handling**:\n- Raises HTTP 401 if the email or password is incorrect.\n- Raises HTTP 500 for any other exceptions encountered during execution.","operationId":"login_api_MobileApp_login_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Username","in":"header","required":true,"schema":{"type":"string","title":"Username"}},{"name":"Password","in":"header","required":true,"schema":{"type":"string","title":"Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/otp_send_and_verify":{"get":{"tags":["MobileApp"],"summary":"Send Or Verify Otp","description":"**Function**: `send_or_verify_otp`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function is used to send an OTP to the user's email address or to verify an OTP sent to the user. It is used for user authentication.\n\n**URL**:  \n`GET http://<baseURL>/api/MobileApp/otp_send_and_verify`\n\n**Request Headers**:\n- **Key** (Header, required):  \n  The email address or mobile number of the user to send the OTP to.\n- **otp** (Header, optional):  \n  The OTP sent to the user to verify.\n\n**Response**:  \nA JSON response containing the result of the OTP verification or a message indicating that the OTP has been sent to the user's email address.\n\n**Error Handling**:\n- Raises HTTP 404 if the user is not found.\n- Raises HTTP 400 if the OTP is invalid or has expired.\n- Raises HTTP 500 for any other exceptions encountered during execution.","operationId":"send_or_verify_otp_api_MobileApp_otp_send_and_verify_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string","title":"Key"}},{"name":"otp","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Otp"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/reset_password":{"post":{"tags":["MobileApp"],"summary":"Reset Password","description":"**Function**: `reset_password`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nResets the password of a user.\n\n**URL**:  \n`POST http://<baseURL>/api/MobileApp/reset_password`\n\n**Request Headers**:\n- **Email** (Header, required):  \n  The email address of the user to reset the password for.\n- **new_password** (Header, required):  \n  The new password to set for the user.\n\n**Response**:  \nA JSON response containing a message indicating that the password has been reset successfully.\n\n**Error Handling**:\n- Raises HTTP 404 if the user is not found.\n- Raises HTTP 500 for any other exceptions encountered during execution.","operationId":"reset_password_api_MobileApp_reset_password_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Email","in":"header","required":true,"schema":{"type":"string","title":"Email"}},{"name":"new-password","in":"header","required":true,"schema":{"type":"string","title":"New-Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/menu_access":{"post":{"tags":["MobileApp"],"summary":"Menu Access Fetch","description":"**Function**: `Menu Access Fetch`\n\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThis function fetches the menu list for a given user based on the application code and user code provided in the headers.\n\n**Headers**:  \n- `App_Code` (str, required): The application code to filter the menu items.\n- `User_Code` (str, required): The user code to filter the menu items.\n\n**Response**:  \nReturns a JSON response containing the menu list for the given user.\n\n**Exceptions**:  \n- `HTTPException`: If any exception occurs during the process, it raises an HTTPException with a 500 status code and the exception message.","operationId":"menu_access_fetch_api_MobileApp_menu_access_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/user_menu_details":{"get":{"tags":["MobileApp"],"summary":"Get User Menu Details","description":"**Function**: `get_user_menu_details`\n**Type**: API Endpoint (GET)\n\n**Purpose**:\nRetrieves the menu details for a specified user based on the provided `Customer_Key` and `user_code`.\n\n**Headers**:\n- `Customer_Key` (str, required): The customer key used for authentication.\n- `user_code` (str, required): The user code identifying the user to retrieve menu details for.\n- `App_Code` (str, optional): The application code to filter menus. Default is \"AP0001\".\n\n**Response**:\nA JSON response containing the menu details for the given user:\n- `menu_details`: A list of objects containing the menu details:\n    - `menu_id`: The menu code.\n    - `menu_name`: The menu name.\n    - `access`: The access level for the menu (0 = no access, 1 = view, 2 = manage).\n    - `icon`: The icon associated with the menu.\n\n**Exceptions**:\n- Raises `HTTPException` with a 500 status code for any internal server errors.\n- Returns a JSON response with a \"failed\" status if the customer key is invalid.","operationId":"get_user_menu_details_api_MobileApp_user_menu_details_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"App-Code","in":"header","required":false,"schema":{"type":"string","default":"AP0001","title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/update_user_menu_details":{"post":{"tags":["MobileApp"],"summary":"Update User Menu Details","description":"**Function**: `update_user_menu_details`\n**Type**: API Endpoint (post)\n\n**Purpose**:\nUpdates the menu access details for a specified user based on the provided `Customer_Key` and `User_Code`. \nIf the user belongs to a group, it ensures their menu access aligns with the group's access.\n\n**Headers**:\n- `Customer_Key` (str, required): The customer key used for authentication.\n- `User_Code` (str, required): The user code identifying the user to update.\n\n**Request Body**:\nA JSON object containing the update instructions, including menu details:\n```json\n{\n    \"menu_details\": [\n        {\n        \"menu_id\": \"string\",\n        \"access\": 0\n        }\n    ],\n    \"username\": \"string\"\n}\n```\n\n**Response**:\nA JSON response indicating the status of the update operation:\n- `status`: The outcome of the update operation (e.g., \"success\", \"failed\", \"no_changes\").\n- `message`: A detailed message regarding the operation result.\n\n**Exceptions**:\n- Raises `HTTPException` with a 500 status code for any internal server errors.\n- Returns a JSON response with a \"failed\" status if the customer key is invalid or no menu details are provided.","operationId":"update_user_menu_details_api_MobileApp_update_user_menu_details_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MenuDetails"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/MobileApp/get_customer_details":{"get":{"tags":["MobileApp"],"summary":"Get Customer Details","operationId":"get_customer_details_api_MobileApp_get_customer_details_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/Otp/{flag}":{"get":{"tags":["Mvibes"],"summary":"Sendotp","operationId":"sendOTP_api_Mvibes_Otp__flag__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"path","required":true,"schema":{"type":"integer","title":"Flag"}},{"name":"key","in":"header","required":true,"schema":{"type":"string","title":"Key"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/HomeDashboard":{"get":{"tags":["Mvibes"],"summary":"Homedashboard","operationId":"HomeDashboard_api_Mvibes_HomeDashboard_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lsCode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmCode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}},{"name":"fsCode","in":"header","required":true,"schema":{"type":"string","title":"Fscode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/Leaderboard":{"get":{"tags":["Mvibes"],"summary":"Getleaderboard","operationId":"getLeaderboard_api_Mvibes_Leaderboard_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/vibes":{"get":{"tags":["Mvibes"],"summary":"Mvibesdata","operationId":"MvibesData_api_Mvibes_vibes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}},{"name":"fsCode","in":"header","required":true,"schema":{"type":"string","title":"Fscode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/profile":{"get":{"tags":["Mvibes"],"summary":"Profile","operationId":"Profile_api_Mvibes_profile_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}},{"name":"fsCode","in":"header","required":true,"schema":{"type":"string","title":"Fscode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/eventscelebration":{"get":{"tags":["Mvibes"],"summary":"Eventscelebration","operationId":"eventsCelebration_api_Mvibes_eventscelebration_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/teamvibes":{"get":{"tags":["Mvibes"],"summary":"Teamvibes","operationId":"teamVibes_api_Mvibes_teamvibes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}},{"name":"fscode","in":"header","required":true,"schema":{"type":"string","title":"Fscode"}},{"name":"vibecode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vibecode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/teamlistwithvibes":{"get":{"tags":["Mvibes"],"summary":"Teamlistwithvibes","operationId":"teamListWithVibes_api_Mvibes_teamlistwithvibes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}},{"name":"fscode","in":"header","required":true,"schema":{"type":"string","title":"Fscode"}},{"name":"vibecode","in":"header","required":true,"schema":{"type":"string","title":"Vibecode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/showmoredoctorlist":{"get":{"tags":["Mvibes"],"summary":"Showmoredoctorlist","operationId":"showMoreDoctorList_api_Mvibes_showmoredoctorlist_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}},{"name":"fscode","in":"header","required":true,"schema":{"type":"string","title":"Fscode"}},{"name":"vibecode","in":"header","required":true,"schema":{"type":"string","title":"Vibecode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/nbalist":{"get":{"tags":["Mvibes"],"summary":"Nbalist","operationId":"nbaList_api_Mvibes_nbalist_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/Mvibes/nbadetaileddata":{"get":{"tags":["Mvibes"],"summary":"Nbadetaileddata","operationId":"nbaDetailedData_api_Mvibes_nbadetaileddata_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"header","required":true,"schema":{"type":"integer","title":"Flag"}},{"name":"lscode","in":"header","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"header","required":true,"schema":{"type":"string","title":"Firmcode"}},{"name":"fscode","in":"header","required":true,"schema":{"type":"string","title":"Fscode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/reference_table_list":{"get":{"tags":["MDM NEW"],"summary":"Referencetablelist","description":"**Function**: `ReferenceTableList`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nReturns a list of tables in the customer database.\n\n**URL**:  \n`GET /api/new_mdm/reference_table_list`\n\n**Parameters**:\n- `customer_key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `user_code` (Header, optional): The user code for access control (if applicable).\n\n**Request Body**: None\n\n**Response**:\nA JSON object containing an array of table objects, each with a `name` property.\n\n**Status Codes**:\n- 200: Success\n- 400: Invalid `customer_key`\n- 500: Internal Server Error","operationId":"ReferenceTableList_api_new_mdm_reference_table_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"user-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/reference_column_list/{TableName}":{"get":{"tags":["MDM NEW"],"summary":"Referencecolumnlist","description":"**Function**: `ReferenceColumnList`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nReturns a list of columns in a specified table in the customer database.\n\n**URL**:  \n`GET /api/new_mdm/reference_column_list/{TableName}`\n\n**Parameters**:\n- `customer_key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `TableName` (Path, required): The name of the table to retrieve columns from.\n\n**Request Body**: None\n\n**Response**:\nA JSON object containing an array of column objects, each with `colId` and `colName` properties.\n\n**Status Codes**:\n- 200: Success\n- 400: Invalid `customer_key`\n- 404: Table not found\n- 500: Internal Server Error","operationId":"ReferenceColumnList_api_new_mdm_reference_column_list__TableName__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"TableName","in":"path","required":true,"schema":{"type":"string","title":"Tablename"}},{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/table_list/":{"get":{"tags":["MDM NEW"],"summary":"Tablelist","description":"**Function**: `TableList`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe function retrieves a paginated list of tables and their additional fields from the customer database based on the provided `customer_key`. It also includes the count of 'In progress' uploads for each table.\n\n**URL**:  \n`POST /api/new_mdm/table_list/`\n\n**Request Parameters**:\n- **Customer-Key** (Header, required):  \nA base64 encoded string that contains `lscode` and `firmcode`, separated by a pipe (`|`).\n- **App-Code** (Header, required):  \nA base64 encoded string representing the application code.\n- **User-Code** (Header, optional):  \nA base64 encoded string representing the user code.\n\n**Request Example**:\n```http\nGET /api/new_mdm/table_list/?page=1&limit=25 HTTP/1.1\nHost: yourdomain.com\nContent-Type: application/json\nCustomer_Key: \"your customer key\"\n```\n\n**Response Example**:\n```json\n{\n    \"total_count\": <total_count>,\n    \"data\": [\n        {\n            \"Table Name\": \"<Table Name>\",\n            \"Description\": \"<Description>\",\n            \"Active Status\": <Active Status>,\n            \"Error Type\": \"<Error Type>\",\n            \"Delete Option\": \"<Delete Option>\",\n            \"In progress Uploads\": <In progress Uploads>,\n            \"Record count\": <Record count>\n        },\n        {\n            \"Table Name\": \"<Table Name>\",\n            \"Description\": \"<Description>\",\n            \"Active Status\": <Active Status>,\n            \"Error Type\": \"<Error Type>\",\n            \"Delete Option\": \"<Delete Option>\",\n            \"In progress Uploads\": <In progress Uploads>,\n            \"Record count\": <Record count>\n        },\n    ......\n]\n}\n```\n\n**Steps**:\n1. **Log Creation**:  \nA unique log ID is generated using the current timestamp for logging purposes.\n\n2. **Customer Key Decoding**:  \nThe `customer_key` is decoded from base64. It should contain `lscode` and `firmcode` separated by a pipe (`|`). If the key is empty, improperly formatted, or cannot be decoded, an error response is returned.\n\n3. **Database Connection**:  \nThe decoded `lscode` and `firmcode` are used to establish a connection to the customer’s database using the `custCursorConnection` function. If the connection fails, an error is raised.\n\n4. **Query Execution**:  \nA SQL query is prepared and executed to fetch a paginated list of tables from the `[dbo].[LS_Custom_Tables]` table. Only active tables (`[Active Flag] = 1`) are retrieved.  \nThe query results include table details like `Table Name`, `Delete Option`, `Error Type`, and `Description`.\n\n5. **In Progress Upload Count**:  \nFor each table, a query is made using SQLAlchemy to fetch the count of 'In progress' uploads from the `LSMDMFileUploadQueue` table based on the table name.\n\n6. **Response Construction**:  \nThe retrieved data is formatted into a list of dictionaries containing basic and additional table details. The result is logged and returned as a JSON response.\n\n**Error Handling**:\n- **Invalid Customer Key**:  \nIf the `customer_key` is invalid or incorrectly formatted, an error message is returned.\n- **Database Errors**:  \nAny issues during query execution or connection are caught, rolled back, logged, and returned as a 500 error response.\n\n**Security Considerations**:\n- The `customer_key` is encoded to protect sensitive data like `lscode` and `firmcode`.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"Connection failed\"\n    }\n}\n```","operationId":"TableList_api_new_mdm_table_list__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/data_list/":{"get":{"tags":["MDM NEW"],"summary":"Datalist","description":"**Function**: `DataList`\n**Type**: API Endpoint (GET)\n\n**Purpose**:\nRetrieves a paginated list of data from the specified table in the customer database. Supports searching.\n\n**URL**:\n`GET /api/new_mdm/data_list/`\n\n**Request Headers**:\n- `Customer-Key` (str, required): A base64-encoded string identifying the customer and database.\n- `Table-Name` (str, required): The name of the table to retrieve data from.\n\n**Request Parameters**:\n- `page` (int, optional): The page number for pagination (default is 1).\n- `limit` (int, optional): The number of rows to fetch per page (default is 25).\n- `search` (str, optional): A JSON string representing search parameters.\n\n**Response**:\nReturns a JSON object containing the requested data.\n\n**Exceptions**:\n- Raises a 400 HTTPException for invalid customer key or search format.\n- Raises a 500 HTTPException for server-side errors.","operationId":"DataList_api_new_mdm_data_list__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","title":"Search"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/data_count/":{"get":{"tags":["MDM NEW"],"summary":"Datacount","description":"**Function**: `DataCount`\n**Type**: API Endpoint (GET)\n\n**Purpose**:\nRetrieves the total count of data from the specified table in the customer database.\n\n**URL**:\n`GET /api/new_mdm/data_count/`\n\n**Request Headers**:\n- `Customer-Key` (str, required): A base64-encoded string identifying the customer and database.\n- `Table-Name` (str, required): The name of the table to retrieve data from.\n\n**Response**:\nReturns a JSON object containing the total count of data.\n\n**Exceptions**:\n- Raises a 400 HTTPException for invalid customer key.\n- Raises a 500 HTTPException for server-side errors.","operationId":"DataCount_api_new_mdm_data_count__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/column_list/":{"get":{"tags":["MDM NEW"],"summary":"Columnlist","description":"**Function**: `ColumnList`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis API endpoint retrieves a paginated list of columns from a specified table for a particular customer based on the provided `customer_key`.\n\n**URL**:  \n`GET /api/new_mdm/column_list/?page=<page_num>&limit=<limit_num>`\n\n**Request Headers**:\n- **Customer-Key** (Header, required):  \n    A base64 encoded string that contains `lscode` and `firmcode`, separated by a pipe (`|`).\n- **Table-Name** (Header, required):  \n    The name of the table from which to retrieve column details.\n\n**Steps**:\n1. **Log Creation**:  \n    Generates a unique log ID based on the current timestamp to track each request.\n2. **Customer Key Decoding**:  \n    The `Customer-Key` is decoded from base64 and split into `lscode` and `firmcode`. \n    If the format is invalid, an error message is returned.\n3. **Database Connection**:  \n    The `custCursorConnection` function uses `lscode` and `firmcode` to connect to the specific customer’s database.\n4. **Query Execution**:  \n    Retrieves the column data for the specified `Table_Name` from the `[dbo].[LS_Custom_Columns]` table. \n    Results are filtered by `Active Flag` and paginated based on `page` and `limit` parameters.\n5. **Result Processing**:  \n    The query results are formatted as a list of dictionaries, handling data types such as `Decimal` and `datetime` for JSON serialization.\n6. **Response Construction**:  \n    A JSON response is returned with the formatted list of column details.\n\n**Response Example**:\n```json\n[\n    \"total_count\": <total_count>,\n    \"table_details\": [\n        {\n            \"Table Name\": \"<Table Name>\",\n            \"Description\": \"<Description>\",\n            \"Error Type\": \"<Error Type>\",\n            \"Delete Option\": \"<Delete Option>\"\n        }\n    ],\n    \"columns\": [\n        {\n            \"LSCode\": \"<LSCode>\",\n            \"LSFirmCode\": \"<LSFirmCode>\",\n            \"Table\": \"<Table>\",\n            \"column_id\": \"<column_id>\",\n            \"Column Name\": \"<Column Name>\",\n            \"Data Type\": \"<Data Type>\",\n            \"Length\": \"<Length>\",\n            \"Scale\": \"<Scale>\",\n            \"Required\": \"<Required>\",\n            \"Column Type\": \"<Column Type>\",\n            \"Reference Type\": \"<Reference Type>\",\n            \"Description\": \"<Description>\",\n            \"Default Value\": \"<Default Value>\",\n            \"Compute Formula\": \"<Compute Formula>\",\n            \"Sequence\": \"<Sequence>\",\n            \"Active Flag\": \"<Active Flag>\",\n            \"Created By\": \"<Created By>\",\n            \"Date Of Item Created\": \"<Date Of Item Created>\",\n            \"Modified By\": \"<Modified By>\",\n            \"Date of Modification\": \"<Date of Modification>\",\n            \"Pkey\": \"<Date of Modification>\",\n            \"Delete_on\": \"<Delete_on>\"\n        },\n        {\n        .....\n        },\n        .....\n    {\n]\n```\n\n**Error Handling**:\n- **Invalid Customer Key**:  \n    If `customer_key` decoding fails, an error message with \"Invalid Customer Key\" is returned.\n- **Database Connection/Execution Errors**:  \n    Any issues during connection or query execution are caught, rolled back, logged, and returned with a 500 status.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"table does not exist\"\n    }\n}\n```\n\n**Security Considerations**:\n- Sensitive data in the `customer_key` (like `lscode` and `firmcode`) is encoded to provide security. \n- The database is accessed only if the `customer_key` is valid and properly formatted.","operationId":"ColumnList_api_new_mdm_column_list__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/value_list":{"post":{"tags":["MDM NEW"],"summary":"Valuelist","description":"**Function**: `ValueList`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe function retrieves a list of values from a specified table and column in the customer database. The specifics of the request are provided in the request body.\n\n**URL**:  \n`POST /api/new_mdm/value_list`\n\n**Request Headers**:\n- `customer_key` (str, required): An encoded string containing the `lscode` and `firmcode` for the customer. This must be decoded for database access.\n\n**Request Body**:\n```json\n{\n    \"refTable\": \"<Table Name>\",\n    \"dataColumn\": \"<colName>\",\n    \"displayColumn1\": \"<colName>\",\n    \"displayColumn2\": \"<colName>\",\n    \"displayColumn3\": \"<colName>\",\n    \"displayColumn4\": \"<colName>\",\n    \"displayColumn5\": \"<colName>\",\n    \"filter\": \"<filter>\"\n}\n```\n\n**Response Example**:\n```json\n[\n    [{\"Division Group\": \"<Division Group>\", \"division_code\": \"<division_code>\"},\n    {\"Division Group\": \"<Division Group>\", \"division_code\": \"<division_code>\"},\n    {\"Division Group\": \"<Division Group>\", \"division_code\": \"<division_code>\"}]\n]\n```\n\n**Steps**:\n1. **Customer Key Decoding**:  \nThe function decodes the `customer_key` from base64 to extract the `lscode` and `firmcode`. If decoding fails or the format is incorrect, an error message is returned.\n\n2. **Request Validation**:  \nThe function checks if the required fields (`refTable`, `dataColumn`, and at least one `displayColumn`) are present in the request body.\n\n3. **Database Connection**:  \nA connection to the customer-specific database is established using the `custCursorConnection` function with the decoded `lscode` and `firmcode`.\n\n4. **Query Execution**:  \nThe function constructs and executes a SQL query to retrieve the values from the specified table and columns. If filters are provided, they are incorporated into the query.\n\n5. **Response Construction**:  \nThe query results are formatted into a list of dictionaries and returned as a JSON response.\n\n**Error Handling**:\n- **Invalid Customer Key**:  \nReturns an error if the decoded customer key is empty or incorrectly formatted.\n- **Request Validation Errors**:  \nReturns an error if required fields are missing from the request body.\n- **Database Errors**:  \nCatches exceptions during query execution and rolls back any transactions, logging the error details.\n\n**Response Fields**:\n- A list of dictionaries where each dictionary contains values from the specified columns.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Missing required fields in the request body.\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"Table not found\"\n    }\n}","operationId":"ValueList_api_new_mdm_value_list_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mdmValueList"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/search_list":{"post":{"tags":["MDM NEW"],"summary":"Searchlist","description":"**Function**: `SearchList`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe function searches for a list of values based on specified conditions from a given table and column in the customer database.\n\n**URL**:  \n`POST /api/new_mdm/search_list`\n\n**Request Headers**:\n- `customer_key` (str, required): An encoded string that contains the `lscode` and `firmcode` for the customer, which must be decoded for further processing.\n\n**Request Body**:\n```json\n{\n    \"table\": \"<Table Name>\",\n    \"column\": \"<colName>\",\n    \"filter\": \"<filter>\",\n    \"condition\": \"<condition>\"\n}\n```\n\n**Response Example**:\n```json\n[\n    {\"Custom4\": \"<Customer>\"}\n]\n```\n\n**Steps**:\n1. **Log Creation**:  \nA unique log ID is generated based on the current date and time, ensuring traceability for each request.\n\n2. **Customer Key Decoding**:  \nThe `customer_key` is decoded using base64. If the decoded value is invalid or improperly formatted, the function returns an error response.\n\n3. **Request Body Parsing**:  \nThe function retrieves the `table`, `column`, `filter`, and `condition` from the request body to use in the SQL query.\n\n4. **Database Connection**:  \nUsing the decoded values, a connection to the customer-specific database is established with the `custCursorConnection` function.\n\n5. **SQL Query Construction**:  \nA SQL query is dynamically constructed based on the input parameters, including the specified table, column, filter, and condition. The query is executed to fetch the relevant records.\n\n6. **Response Construction**:  \nThe results from the query execution are formatted into a list of dictionaries and returned as a JSON response.\n\n**Error Handling**:\n- **Invalid Customer Key**:  \nIf the decoded customer key is empty or does not follow the expected format, an appropriate error message is returned.\n- **Invalid Request Body**:  \nIf any required fields in the request body are missing, an error response is returned.\n- **Database Errors**:  \nAny exceptions during query execution are caught, logged, and a `500` status response is returned with error details.\n\n**Security Considerations**:\n- The `customer_key` is encoded to protect sensitive information like `lscode` and `firmcode`.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid request body\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"SQL syntax error\"\n    }\n}\n```","operationId":"SearchList_api_new_mdm_search_list_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mdmSearchValues"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/delete":{"post":{"tags":["MDM NEW"],"summary":"Delete","description":"**Function**: `Delete`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThe function handles the deletion of records from the customer database based on the provided query and conditions. It ensures that records are backed up before deletion, maintaining a log of the operation.\n\n**URL**:  \n`POST /api/new_mdm/delete`\n\n**Request Headers**:\n- `customer_key` (str, required): An encoded string containing the `lscode` and `firmcode` for the customer. This must be decoded for database access.\n\n**Request Body**:\n```json\n{\n    \"query\": \"<query>\",\n    \"type\": <int>\n}\n```\n\n**Response Example**:\n```json\n{\n    \"status\": \"Success\",\n    \"message\": \"\"\n}\n```\n\n**Steps**:\n1. **Log Creation**:  \nA unique log ID is generated based on the current date and time, ensuring traceability for each request.\n\n2. **Customer Key Decoding**:  \nThe `customer_key` is decoded using base64. If the decoded value is invalid or improperly formatted, the function returns an error response.\n\n3. **Request Validation**:  \nThe function checks if the required fields (`query`) are present in the request body.\n\n4. **Database Connection**:  \nA connection to the customer-specific database is established using the `custCursorConnection` function with the decoded `lscode` and `firmcode`.\n\n5. **SQL Query Execution**:  \nA SQL query is executed to first back up the records to be deleted, then delete them from the main table, handling any exceptions that may occur.\n\n6. **Response Construction**:  \nThe results from the query execution are formatted and returned as a JSON response.\n\n**Error Handling**:\n- **Invalid Customer Key**:  \nIf the decoded customer key is empty or does not follow the expected format, an appropriate error message is returned.\n- **Invalid Request Body**:  \nIf any required fields in the request body are missing, an error response is returned.\n- **Database Errors**:  \nAny exceptions during query execution are caught, logged, and a `500` status response is returned with error details.\n\n**Security Considerations**:\n- The `customer_key` is encoded to protect sensitive information like `lscode` and `firmcode`.\n\n**Error Response Example**:\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Invalid Customer Key\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": \"Query should not be null\"\n}\n```\n\n```json\n{\n    \"status\": \"failed\",\n    \"message\": {\n        \"error_type\": \"OperationalError\",\n        \"message\": \"SQL syntax error\"\n    }\n}\n```","operationId":"Delete_api_new_mdm_delete_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer_key","in":"query","required":true,"schema":{"type":"string","title":"Customer Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mdmDeleteRecord"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/user_list":{"get":{"tags":["MDM NEW"],"summary":"User List","description":"**Function**: `user_list`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function retrieves a paginated list of users who have MDM access for a specific `LSCode`. It decodes the `LSCode` from the request headers, queries the database for user details, and returns a JSON response containing the user information.\n\n**URL**:  \n`GET /api/new_mdm/user_list/?page=<page_num>&limit=<limit_num>`\n\n**Request Headers**:\n- **Customer_Key** (Header, required):  \n  A base64 encoded string that identifies the Customer_Key(LSCode|FirmCode).\n\n**Response Example**:\n```json\n{\n    \"users\": [\n        {\n            \"Name\": \"<First Name>\",\n            \"Email\": \"<Email>\",\n            \"Mobile\": \"<Mobile>\",\n            \"Role\": \"<User Group Name>\",\n            \"Status\": \"<Isactive>\",\n            \"UserCode\": \"<Encoded User Code>\",\n            \"groupCode\": \"<Encoded Group Code>\"\n            \"isAdministrator\": \"<Is Administrator>\"\n        },\n        ...\n    ]\n}\n```\n\n**Error Handling**:\n- Raises HTTP 400 if `lscode` header is missing.\n- Raises HTTP 500 for any other exceptions encountered during execution.","operationId":"user_list_api_new_mdm_user_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/existing_user":{"get":{"tags":["MDM NEW"],"summary":"Existing User","description":"**Function**: `existing_user`  \n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nThis function retrieves existing user details, menu access, and table access for a given user based on the provided headers. It decodes the Customer_Key to identify the customer and database, fetches user-related information, and constructs a structured response.\n\n**URL**:  \n`GET /api/new_mdm/existing_user`\n\n**Headers**:\n- `Customer-Key` (str, required): A base64-encoded string containing information to identify the customer and database.\n- `User-Code` (str, required): A base64-encoded string representing the user code.\n- `App-Code` (str, required): A base64-encoded string representing the application code.\n\n**Response Model**:  \nReturns an `ExistingUser` instance containing the user details, menu access, and table access information.\n\n**Response Example**:\n```json\n{\n    \"user\": {\n        \"first_name\": \"<first_name>\",\n        \"last_name\": \"<last_name>\",\n        \"email\": \"<email>\",\n        \"mobile\": \"<mobile>\",\n        \"user_group_code\": \"<user_group_code>\",\n        \"user_role\": \"<user_role>\",\n        \"active\": <active>\n    },\n    \"menu_access\": [\n        {\n            \"parent\": {\n                \"menu_code\": \"<menu_code>\",\n                \"menu_name\": \"<menu_name>\",\n                \"access\": <access>\n            },\n            \"children\": [\n                {\n                    \"menu_code\": \"<menu_code>\",\n                    \"menu_name\": \"<menu_name>\",\n                    \"access\": <access>\n                }\n            ]\n        }\n    ],\n    \"table_access\": [\n        {\n            \"table_name\": \"<table_name>\",\n            \"access\": <access>,\n            \"upload_download_access\": <upload_download_access>\n        }\n    ]\n}\n```\n\n**Error Handling**:\n- Returns HTTP 400 if `Customer_Key` is invalid.\n- Returns HTTP 404 if the user is not found.\n- Returns HTTP 500 for any unexpected server errors.\n\n**Steps**:\n1. Decode the `Customer_Key` header and validate its format.\n2. Extract and decode the `userCode` and `appCode`.\n3. Fetch user details, group details, menu access, and table access from the database.\n4. Construct and return the structured response.\n5. Log the API call with a unique log identifier for tracking.","operationId":"existing_user_api_new_mdm_existing_user_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExistingUser"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/update_access":{"put":{"tags":["MDM NEW"],"summary":"Update Access","description":"**Function**: `update_access`\n**Type**: API Endpoint (PUT)\n\n**Purpose**:\nThis endpoint updates the access rights of a user for a specific application.\n\n**URL**:\n`PUT /api/new_mdm/update_access`\n\n**Request Parameters**:\n- `request` (Request): The request object.\n- `update_request` (UpdateAccessRequest): An object containing details about the user, menu, and table access to be updated.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode`.\n- `User_Code` (Header, required): A base64 encoded string containing the user code.\n- `App_Code` (Header, optional): A base64 encoded string containing the application code.\n- `db` (Session): The database session, obtained via dependency injection.\n\n**Process**:\n1. Decodes the `Customer_Key` to extract `lscode` and `firmcode`.\n2. Validates the `User_Code`.\n3. Updates the user details (email, mobile).\n4. Updates the menu access.\n5. Updates the table access.\n6. Fetches the updated user details, menu access, and table access.\n7. Constructs and returns a JSON response detailing the updated access rights.\n\n**Response**:\n- A JSON object containing the updated user details, menu access, and table access.\n- Indicates success or failure for each step, including any errors encountered.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"update_access_api_new_mdm_update_access_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccessRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExistingUser"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/activity_data":{"post":{"tags":["MDM NEW"],"summary":"Activity Data","description":"**Function**: `activity_data`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nRetrieves a paginated list of activity data for a specific user. The function retrieves data related to activities, triggers, or history records based on specified filters. It allows filtering by user, customer, application, and fetch type (status categories such as Success, Failure, In Progress, etc.).\n\n**URL**:\n`POST /api/new_mdm/activity_data`\n\n**Request Headers**:\n- `User-Code` (Header, required): A base64-encoded string representing the user code.\n- `Customer-Key` (Header, required): A base64-encoded string containing `lscode` and `firmcode`, separated by a pipe (`|`), which helps identify the customer's firm and database code.\n- `App-Code` (Header, required): A base64-encoded string representing the application code.\n- **Fetch-Type** (Header, required): A string indicating the type of data to fetch:\n\n- **Upload**\n    - `0`: Pending\n    - `1`: Processed\n    - `2`: Not-Processed\n    - `3`: In-progress\n  \n- **Download**    \n    - `4`: In-progress\n    - `6`: Processed\n    - `7`: Not Processed\n  \n- **type** (Header, required): A string indicating the type of data to retrieve:\n    - `0`: Activity\n    - `1`: Trigger\n    - `2`: History\n\n**Request Parameters**:\n- `page` (int, optional): The page number for pagination (default is 1).\n- `limit` (int, optional): The number of rows to fetch per page (default is 25).\n- `search` (str, optional): Global search term that will be applied across BatchId, Table_Name, File_Name, Created_User, and Message fields.\n\n**Response Model**:\nReturns a JSON object containing:\n- `recordsTotal`: Total number of records retrieved.\n- `columns`: List of dictionaries defining column metadata for the output.\n- `data`: List of dictionaries with activity data.","operationId":"activity_data_api_new_mdm_activity_data_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"Fetch-Type","in":"header","required":true,"schema":{"type":"string","title":"Fetch-Type"}},{"name":"type","in":"header","required":true,"schema":{"type":"string","title":"Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/delete_records":{"post":{"tags":["MDM NEW"],"summary":"Delete Records List","description":"**Function**: `delete_records_list`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nDeletes records from a specified table in the customer database based on the provided query.\n\n**URL**:  \n`POST /api/new_mdm/delete_records`\n\n**Parameters**:\n- `Table_Name` (Header, required): The name of the table to be deleted from.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `request_data` (JSON Body, required): A JSON object containing the deletion details.\n\n**Request Body**:\n```\n    {\n        \"delPartialRecords\": <delPartialRecords>,\n        \"delFullRecords\": <delFullRecords>,\n        \"Customcol\": \"<Customcol>\",\n        \"Date_Of_Item_Created\": \"<Date_Of_Item_Created>\",\n    }\n```","operationId":"delete_records_list_api_new_mdm_delete_records_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRecordsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/delete_all_records":{"post":{"tags":["MDM NEW"],"summary":"Delete All Records","description":"**Function**: `delete_all_records`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nMakes a specified table inactive or active in the customer database based on its current status.\n\n**URL**:  \n`POST /api/new_mdm/delete_all_records`\n\n**Parameters**:\n- `Table_Name` (Header, required): The name of the table to be made inactive.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n\n**Response**:\n- A JSON object containing a status message and a brief description of the operation result.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"delete_all_records_api_new_mdm_delete_all_records_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/on_demand_tables":{"post":{"tags":["MDM NEW"],"summary":"On Demand Tables","description":"**Function**: `on_demand_tables`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nThis endpoint facilitates the creation and management of tables in the customer database.\nIt allows for the creation, alteration, and deletion of columns within a custom table based on the provided request data.\n\n**URL**:\n`POST /api/new_mdm/on_demand_tables`\n\n**Request Parameters**:\n- `request` (Request): The request object.\n- `table_request` (TableCreateRequest): An object containing details about the table and columns to be managed.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode`.\n- `current_user` (str): The current user performing the operation, obtained via dependency injection.\n\n**Process**:\n1. Decodes the `Customer_Key` to extract `lscode` and `firmcode`.\n2. Checks if the table exists in the metadata (`LS_Custom_Tables`). If not, it inserts a new entry.\n3. Iterates over the columns in `table_request` to perform create, alter, or drop operations:\n   - Creates a new column if it doesn't exist.\n   - Alters an existing column's details.\n   - Drops a column if specified.\n4. Constructs and executes a SQL query to create the actual database table based on the processed metadata.\n5. Commits the transaction and returns a response detailing the status of the operations.\n\n**Response**:\n- A JSON object containing a status message and details of each column operation performed.\n- Indicates success or failure for each step, including any errors encountered.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"on_demand_tables_api_new_mdm_on_demand_tables_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"query","required":false,"schema":{"type":"string","default":0,"title":"Flag"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/update_column_names":{"post":{"tags":["MDM NEW"],"summary":"Update Column Names","description":"**Function**: `update_column_names`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nUpdate column names in a specified table in the customer database.\n\n**URL**:  \n`POST /api/new_mdm/update_column_names`\n\n**Request Parameters**:\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `Table_Name` (Header, required): The name of the table to update.\n- `input_data` (JSON Body, required): An array of column name change requests, each with `OldName` and `NewName` properties.\n\n**Response**:\nA JSON object containing an array of column name change results, each with `old_name`, `new_name`, `status`, and `message` properties.\n\n**Status Codes**:\n- 200: Success\n- 400: Invalid request or invalid column name\n- 500: Internal Server Error","operationId":"update_column_names_api_new_mdm_update_column_names_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UpdateColumnNameRequest"},"title":"Input Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Column Names Api New Mdm Update Column Names Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/table_dml":{"post":{"tags":["MDM NEW"],"summary":"Table Dml","description":"**Function**: `table_dml`\n\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nExecutes data manipulation operations (insert, update, delete) on a specified table in the customer database based on the provided input data.\n\n**URL**:  \n`POST /api/new_mdm/table_dml`\n\n**Request Headers**:\n- `Customer_Key` (str, required): A base64 encoded string containing `lscode` and `firmcode` for the customer. This must be decoded for database access.\n\n**Request Body**:\n- `input_data` (TableDMLRequest, required): Contains the table name and lists of data for insert, update, and delete operations.\n\n**Response**:\n- Returns a JSON object with a success message if the operations are successful.\n\n**Exceptions**:\n- Handles exceptions related to invalid customer key format, missing `idx` for update/delete operations, and database errors, providing appropriate error messages.\n\n**Steps**:\n1. **Customer Key Decoding**:  \n   Decodes the `Customer_Key` to extract the `lscode` and `firmcode`. Raises an error if the format is invalid.\n\n2. **Input Validation**:  \n   Validates the presence of `table_name` and that the data for insert, update, and delete operations are in list format.\n\n3. **Database Connection**:  \n   Establishes a connection to the database using `custCursorConnection`.\n\n4. **Data Manipulation**:  \n   Executes insert, update, and delete operations on the specified table using the input data.\n\n5. **Transaction Handling**:  \n   Commits the transaction if all operations are successful, or rolls back in case of an error.\n\n6. **Logging**:  \n   Logs the API call with details of the operation.\n\n7. **Response Construction**:  \n   Returns a success message or error details based on the outcome of the operations.","operationId":"table_dml_api_new_mdm_table_dml_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableDMLRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Table Dml Api New Mdm Table Dml Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/find_replace_column":{"post":{"tags":["MDM NEW"],"summary":"Find Replace Column","description":"**Function**: `find_replace_column`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThis endpoint facilitates finding and replacing column values in a specified table in the customer database.\n\n**URL**:  \n`POST /api/new_mdm/find_replace_column`\n\n**Request Parameters**:\n- `Customer_Key` (Header, required): An encoded string containing `lscode` and `firmcode` for the customer.\n- `Table_Name` (Header, required): The name of the table to update.\n- `input_data` (JSON Body, required): An object containing a list of column updates, each with `column_name`, `old_value`, and `new_value` properties.\n\n**Notes**:  \n- If `flag` is set to '1', the endpoint will return the distinct values of the column as specified in `input_data.updates[0].column_name`.\n- If `flag` is not set to '1', the endpoint will replace the values in the column as specified in `input_data.updates`.\n\n**Response**:  \nThe API returns a JSON object with the status of the operation.","operationId":"find_replace_column_api_new_mdm_find_replace_column_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"header","required":true,"schema":{"type":"string","title":"Flag"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindAndReplace"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Find Replace Column Api New Mdm Find Replace Column Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/delete_table_data":{"post":{"tags":["MDM NEW"],"summary":"Deletetabledata","description":"**Function**: `DeleteTableData`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThis function deletes all data from a specified table in the customer's database.\n\n**Endpoint**:  \n`POST http://<baseURL>/api/new_mdm/delete_table_data`\n\n**Headers**:  \nThe request must include the following headers:\n- `Customer-Key`: Encoded customer key used to verify the customer's identity.\n- `Table_Name`: The name of the table from which data is to be deleted.\n\n**Response**:  \nThe API returns a JSON object with the status of the operation.\n\n**Response Structure**:  \nThe response will be in the following format:","operationId":"DeleteTableData_api_new_mdm_delete_table_data_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/search":{"post":{"tags":["MDM NEW"],"summary":"Search","description":"**Function**: `search`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nThis function searches for data in specified tables based on the provided search values. It first checks\nif the table exists in the actual database. Depending on the presence of specific columns and values,\nit queries the relevant data.\n\n**URL**:\n`POST /api/new_mdm/search`\n\n**Parameters**:\n- `request` (Request): The request object.\n- `search_values` (SearchValues): An object containing the table and optional columns to search.\n- `Customer_Key` (str, optional): A base64 encoded header string containing `lscode` and `firmcode`.\n\n**Returns**:\n- A JSON response indicating the success or failure of the operation.\n- If successful, returns the queried data.\n- If the Customer_Key is invalid or if the table is not found, it returns a failure message.\n\n**Exceptions**:\n- Handles exceptions during base64 decoding and database operations, returning an appropriate error message.","operationId":"search_api_new_mdm_search_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchValues"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/upload_excel_data":{"post":{"tags":["MDM NEW"],"summary":"Upload Excel Data Endpoint","description":"**Function**: `upload_excel_data_endpoint`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nThis function uploads an Excel file to the specified container and sends a message to the service bus\nto trigger the import of the file into the specified table.\n\n**URL**:\n`POST /api/upload_excel_data`\n\n**Parameters**:\n- `App_Code` (str): Base64 encoded application code.\n- `Customer_Key` (str): Base64 encoded customer key.\n- `Table_Name` (str): The name of the table to import the file into.\n- `excel_file` (UploadFile): The Excel file to upload.\n\n**Returns**:\n- A JSON response indicating the success or failure of the operation.\n- If successful, returns the uploaded file details.\n- If the Customer_Key is invalid or if the table is not found, it returns a failure message.\n\n**Exceptions**:\n- Handles exceptions during base64 decoding and database operations, returning an appropriate error message.","operationId":"upload_excel_data_endpoint_api_new_mdm_upload_excel_data_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_excel_data_endpoint_api_new_mdm_upload_excel_data_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/download_excel_data":{"post":{"tags":["MDM NEW"],"summary":"Download Excel Data Endpoint","description":"Endpoint to download Excel data for a given table in a customer's database.\n\nArgs:\n    request (Request): The incoming request.\n    App_Code (str): The application code.\n    Customer_Key (str): The customer key.\n    Table_Name (str): The name of the table to download.\n    split_column (str): The column to split the data based on.\n    db (Session): The database session.\n    current_user (str): The current user.\n\nReturns:\n    JSONResponse: A JSON response with a message indicating whether the request was successful or not.\n\nRaises:\n    HTTPException: If the customer key is invalid or if there is an error fetching the database name.","operationId":"download_excel_data_endpoint_api_new_mdm_download_excel_data_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"split_column","in":"query","required":true,"schema":{"type":"string","title":"Split Column"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"Table-Name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/update_page_theme":{"put":{"tags":["MDM NEW"],"summary":"Update Page Theme","description":"**Function**: `update_page_theme`\n\n**Type**: API Endpoint (PUT)\n\n**Purpose**:\nThis endpoint is used to update the page theme to light or dark, or to update the default firm.\n\n**URL**:\n`PUT /api/new_mdm/update_page_theme`\n\n**Request Parameters**:\n- `flag` (str): The flag to indicate whether to update the page theme or default firm.\n- `data` (PageOrFirm): The data to be updated.\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode`.\n- `User_Code` (Header, required): A base64 encoded string containing the user code.\n- `db` (Session): The database session.\n- `current_user` (str): The current user performing the operation, obtained via dependency injection.\n\n**Process**:\n1. Validates the customer key.\n2. Checks if the flag is 0 or 1.\n3. If flag is 0, updates the page theme to light or dark based on the request body.\n4. If flag is 1, updates the default firm to the firm that is given in request body.\n5. Commits the transaction and returns a response detailing the status of the operations.\n\n**Response**:\n- A JSON object containing a status message and details of each column operation performed.\n- Indicates success or failure for each step, including any errors encountered.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"update_page_theme_api_new_mdm_update_page_theme_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"query","required":true,"schema":{"type":"string","title":"Flag"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageOrFirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/notifications":{"post":{"tags":["MDM NEW"],"summary":"Handle Notifications","description":"**Function**: `handle_notifications`\n**Type**: API Endpoint (POST)\n\n**Purpose**:\nThis endpoint handles different types of notifications such as fetching notifications, setting read status, clearing notifications, etc.\n\n**URL**:\n`POST /api/notifications`\n\n**Request Parameters**:\n- `App_Code` (Header, required): Encoded application code.\n- `User_Code` (Header, required): Encoded user code.\n- `Customer_Key` (Header, required): Encoded customer key.\n- `data` (JSON, required): Data containing the type of notification action and other relevant details.\n\n**Process**:\n1. Decodes the `Customer_Key` to extract `lscode` and `firmcode`.\n2. Validates the customer key.\n3. Handles different types of notifications based on the `data.type` parameter:\n    - `getNotifications`: Fetches all notifications for the user and returns them in a JSON response.\n    - `setReadStatus`: Updates the status of a notification to 'read' (1).\n    - `clearone`: Updates the status of a notification to 'cleared' (2).\n    - `setAllReadStatus`: Updates the status of all notifications for the user to 'read' (1).\n    - `clearAll`: Updates the status of all notifications for the user to 'cleared' (2).\n\n**Request Body**:\n- **For Listing Notifications or Getting Count**:\n\n- `type` (string, required): Type of notification action (e.g., `getNotifications`, `getCount`).\n\n```json\n{\n    \"type\": \"<type>\"\n}\n```\n\n- **For Status Updations**:\n\n- `type` (string, required): Type of notification action (e.g., `setReadStatus`, `clearone`, `setAllReadStatus`, `clearAll`).\n- `id` (integer, optional): ID of the notification to be updated.\n\n```json\n{\n    \"type\": \"<type>\",\n    \"id\": <id>\n}\n```\n\n- **For create or update notofications**:\n\n```json\n{\n    \"flag\": 0 | 1,\n    \"values\": {\n        \"application_code\": \"<application_code>\",\n        \"LSCode\": \"<LSCode>\",\n        \"firm_code\": \"<firm_code>\",\n        \"Id\": \"<Id>\",\n        \"Trigger_Type\": <Trigger_Type>,\n        \"Status\": <Status>,\n        \"Action\": <Action>,\n        \"Created_User\": \"<Created_User>\",\n        \"Date_Of_Creation\": \"<Date_Of_Creation>\",\n        \"Modified_User\": \"<Modified_User>\",\n        \"Date_Of_Modification\": \"<Date_Of_Modification>\",\n        \"Parameter\": \"<Parameter>\",\n        \"Message\": \"<Message>\",\n        \"Button_Name_1\": \"<Button_Name_1>\",\n        \"Button_Value_1\": \"<Button_Value_1>\",\n        \"Button_Name_2\": \"<Button_Name_2>\",\n        \"Button_Value_2\": \"<Button_Value_2>\",\n        \"Button_Name_3\": \"<Button_Name_3>\",\n        \"Button_Value_3\": \"<Button_Value_3>\",\n        \"Icon\": \"<Icon>\",\n        \"Body_Image\": \"<Body_Image>\"\n    }\n}\n\n**Response**:\n- JSON response containing the list of notifications or the result of the notification action.\n- Indicates success or failure for each step, including any errors encountered.\n\n**Exceptions**:\n- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.","operationId":"handle_notifications_api_new_mdm_notifications_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}},{"name":"User-Code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/api/v1/sendmail":{"post":{"tags":["MDM NEW"],"summary":"Send Email With To And Cc","description":"Send an email with to and cc fields, subject, and optional download link.","operationId":"send_email_with_to_and_cc_api_new_mdm_api_v1_sendmail_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailSchema"}}},"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/new_mdm/RefreshDataset":{"get":{"tags":["MDM NEW"],"summary":"Refresh Dataset","description":"Refreshes a Power BI dataset for a specific customer and firm.\n\nThis endpoint decodes the provided customer key and report code, retrieves relevant customer and \nworkspace details, and triggers a dataset refresh in Power BI using the specified report code.\n\nArgs:\n    request (Request): The HTTP request object.\n    customer_key (Annotated[Union[str], Header]): A base64 encoded string containing 'lscode' and 'firmcode'.\n    report_code (Annotated[Union[str], Header]): A base64 encoded report code.\n    db (Session): The database session dependency.\n\nReturns:\n    JSONResponse: A response indicating the success or failure of the dataset refresh operation. \n    It returns a success message if the refresh request is accepted by Power BI, otherwise an error message.\n\nRaises:\n    HTTPException: If settings could not be retrieved, customer or firm details are not found.\n    JSONResponse: For any other exceptions during the process with a 500 status code.","operationId":"refresh_dataset_api_new_mdm_RefreshDataset_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"dataset_object","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Object"}},{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"report-code","in":"header","required":true,"schema":{"type":"string","title":"Report-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/database_info":{"get":{"tags":["MDM NEW"],"summary":"Database Info","description":"**Function**: `database_info`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nRetrieves information about the database of the specified customer.\n\n**URL**:  \n`GET /api/new_mdm/database_info`\n\n**Request Headers**:\n- `Customer-Key` (str, required): A base64-encoded string identifying the customer and database.\n- `App-Code` (str, optional): A base64-encoded string identifying the application.\n- `User-Code` (str, optional): A base64-encoded string identifying the user.\n- `Firm-Code` (str, optional): A base64-encoded string identifying the firm.\n\n**Request Body**: None\n\n**Response**:\nA JSON object containing the status (`success` or `failed`) and a message.\n\n**Status Codes**:\n- 200: Success\n- 404: Failed to establish a database connection","operationId":"database_info_api_new_mdm_database_info_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Code"}},{"name":"firm_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Code"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"App-code","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/check_or_create_database":{"get":{"tags":["MDM NEW"],"summary":"Check Or Create Database","description":"**Function**: `check_or_create_database`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nChecks if a database exists and creates it if it doesn't, along with creating the dependency tables.\n\n**URL**:  \n`GET /api/new_mdm/check_or_create_database`\n\n**Request Headers**:\n- `Customer-Key` (str, required): A base64-encoded string identifying the customer and database.\n- `App-Code` (str, required): A base64-encoded string identifying the application.\n\n**Request Body**: None\n\n**Response**:\nA JSON object containing a status message and details of the database creation/check.\n\n**Status Codes**:\n- 200: Success\n- 404: Database not found\n- 500: Failed to create/check database","operationId":"check_or_create_database_api_new_mdm_check_or_create_database_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/initialize_dependency_tables":{"post":{"tags":["MDM NEW"],"summary":"Initialize Dependency Tables","description":"**Function**: `initialize_dependency_tables`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nInitializes dependency tables in the customer database based on the provided application code.\n\n**URL**:  \n`POST /api/new_mdm/initialize_dependency_tables`\n\n**Request Headers**:\n- `Customer-Key` (str, required): A base64-encoded string identifying the customer and database.\n- `App-Code` (str, required): A base64-encoded string identifying the application.\n\n**Request Body**: None\n\n**Response**:\nA JSON object containing a status message and details of the dependency table creation.\n\n**Status Codes**:\n- 200: Success\n- 500: Failed to initialize dependency tables","operationId":"initialize_dependency_tables_api_new_mdm_initialize_dependency_tables_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"App-Code","in":"header","required":true,"schema":{"type":"string","title":"App-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/dashboard_details":{"get":{"tags":["MDM NEW"],"summary":"Get Dashboard Details","operationId":"get_dashboard_details_api_new_mdm_dashboard_details_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/manage_table_access":{"post":{"tags":["MDM NEW"],"summary":"Manage Table Access","description":"**Function**: `manage_table_access`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nManages access details for a user in the database.\n\n**Parameters**:  \n- `request`: The HTTP request object.\n- `customer_key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `access_details` (Body, required): A dictionary containing access details for a user.\n- `current_user` (str): The current user performing the operation, obtained via dependency injection.\n\n**Request body**:\n  - BULK:\n    {\n      \"application_code\": \"...\",\n      \"user_code\": \"...\",\n      \"modified_by\": \"...\",\n      \"tables\": [\n        {\"table_name\":\"...\", \"access\":0/1, \"upload_download\":0/1}, ...\n      ]\n    }\n  - SINGLE (legacy):\n    {\n      \"table_name\":\"...\",\n      \"access\":0/1,\n      \"upload_download\":0/1,\n      \"modified_by\":\"...\",\n      \"application_code\":\"...\",\n      \"user_code\":\"...\"\n    }\n\n**Returns**:  \nA JSON response indicating the success or failure of the operation.\n\n**Exceptions**:  \n- `HTTPException`: If any exception occurs during the process, it raises an HTTPException with a 500 status code and the exception message.","operationId":"manage_table_access_api_new_mdm_manage_table_access_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Access Details"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/get_table_access_details":{"get":{"tags":["MDM NEW"],"summary":"Get Table Access Details","description":"**Function**: `get_table_access_details`\n**Type**: API Endpoint (GET)\n\n**Purpose**:  \nRetrieves access details for a user from the database.\n\n**Parameters**:  \n- `request`: The HTTP request object.\n- `customer_key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `user_code` (Header, required): The user code for whom access details are to be retrieved.\n- `current_user` (str): The current user performing the operation, obtained via dependency injection.\n\n**Returns**:  \nA JSON response containing the access details for a user.\n\n**Exceptions**:  \n- `HTTPException`: If any exception occurs during the process, it raises an HTTPException with a 500 status code and the exception message.","operationId":"get_table_access_details_api_new_mdm_get_table_access_details_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"user-code","in":"header","required":true,"schema":{"type":"string","title":"User-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/insert_custom_reference_table":{"post":{"tags":["MDM NEW"],"summary":"Insert Custom Reference Table","description":"**Function**: `insert_custom_reference_table`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nInserts custom reference table details into the database.\n\n**Parameters**:  \n- `request`: The HTTP request object.\n- `customer_key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `table_details`: The details of the custom reference table to be inserted.\n- `flag` (int, optional): The flag indicating whether to insert custom reference table details (1) or custom reference table reference details (2). Defaults to 1.\n- `current_user` (str): The current user performing the operation, obtained via dependency injection.\n\n**Returns**:  \nA JSON response containing the message \"Data inserted successfully\".\n\n**Exceptions**:  \n- `HTTPException`: If any exception occurs during the process, it raises an HTTPException with a 500 status code and the exception message.","operationId":"insert_custom_reference_table_api_new_mdm_insert_custom_reference_table_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"flag","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Flag"}},{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomReferenceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/new_mdm/reference_table_details":{"get":{"tags":["MDM NEW"],"summary":"Get Reference Table Details","description":"**Function**: `get_reference_table_details`\n**Type**: API Endpoint (GET)\n\n**Purpose**:\nReturns the reference table details for a given table and column.\n\n**URL**:\n`GET /api/new_mdm/reference_table_details`\n\n**Parameters**:\n- `page` (Query, optional): The page number for pagination (default is 1).\n- `limit` (Query, optional): The number of rows to fetch per page (default is 25).\n- `Customer_Key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.\n- `flag` (Query, required): A flag indicating whether to retrieve the reference table details (0) or the display column details (1).\n- `table_name` (Header, required): The name of the table to retrieve the reference table details for.\n- `column_name` (Header, required): The name of the column to retrieve the reference table details for.\n- `search_params` (Query, optional): Search parameters to filter the results.\n\n**Request Body**: None\n\n**Response**:\nA JSON object containing the reference table details or the display column details.\n\n**Status Codes**:\n- 200: Success\n- 400: Invalid `customer_key`\n- 404: Table or column not found\n- 500: Internal Server Error","operationId":"get_reference_table_details_api_new_mdm_reference_table_details_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"integer","title":"Page"}},{"name":"limit","in":"query","required":true,"schema":{"type":"integer","title":"Limit"}},{"name":"flag","in":"query","required":true,"schema":{"type":"integer","title":"Flag"}},{"name":"search_params","in":"query","required":false,"schema":{"type":"string","title":"Search Params"}},{"name":"Customer-Key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"table-name","in":"header","required":true,"schema":{"type":"string","title":"Table-Name"}},{"name":"column-name","in":"header","required":true,"schema":{"type":"string","title":"Column-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/PowerBiApp/TriggerSerivceBus/{lscode}/{firmcode}/{table}":{"get":{"tags":["PowerBiApp"],"summary":"Trigger Serivce Bus","operationId":"trigger_serivce_bus_api_PowerBiApp_TriggerSerivceBus__lscode___firmcode___table__get","parameters":[{"name":"lscode","in":"path","required":true,"schema":{"type":"string","title":"Lscode"}},{"name":"firmcode","in":"path","required":true,"schema":{"type":"string","title":"Firmcode"}},{"name":"table","in":"path","required":true,"schema":{"type":"string","title":"Table"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/PowerBiApp/ServiceBusMail":{"get":{"tags":["PowerBiApp"],"summary":"Triggermail","operationId":"triggermail_api_PowerBiApp_ServiceBusMail_get","parameters":[{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},{"name":"mobileNo","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mobileno"}},{"name":"lsCode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lscode"}},{"name":"string1","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"String1"}},{"name":"value1","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value1"}},{"name":"string2","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"String2"}},{"name":"value2","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value2"}},{"name":"string3","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"String3"}},{"name":"value3","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value3"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/PowerBiApp/RefreshDataset":{"get":{"tags":["PowerBiApp"],"summary":"Refresh Dataset","description":"Refreshes a Power BI dataset for a specific customer and firm.\n\nThis endpoint decodes the provided customer key and report code, retrieves relevant customer and \nworkspace details, and triggers a dataset refresh in Power BI using the specified report code.\n\nArgs:\n    request (Request): The HTTP request object.\n    customer_key (Annotated[Union[str], Header]): A base64 encoded string containing 'lscode' and 'firmcode'.\n    report_code (Annotated[Union[str], Header]): A base64 encoded report code.\n    db (Session): The database session dependency.\n\nReturns:\n    JSONResponse: A response indicating the success or failure of the dataset refresh operation. \n    It returns a success message if the refresh request is accepted by Power BI, otherwise an error message.\n\nRaises:\n    HTTPException: If settings could not be retrieved, customer or firm details are not found.\n    JSONResponse: For any other exceptions during the process with a 500 status code.","operationId":"refresh_dataset_api_PowerBiApp_RefreshDataset_get","parameters":[{"name":"customer-key","in":"header","required":true,"schema":{"type":"string","title":"Customer-Key"}},{"name":"report-code","in":"header","required":true,"schema":{"type":"string","title":"Report-Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/registration/admin/create/":{"post":{"tags":["Sign Up"],"summary":"Create Admin User","description":"**Function**: `CreateAdminUser`  \n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThis function is used to create a new administrator user with the provided details, ensuring unique email addresses and securely storing user credentials.\n\n**URL**:  \n`POST /api/admin/create/`\n\n**Request Example**:  \n```json\n{\n    \"user_name\": \"<user_name>\",      // Administrator's full name\n    \"email\": \"<email>\", // Administrator's email\n    \"mobile\": \"<mobile>\",      // Administrator's mobile number\n    \"password\": \"<password>\", // Password for the new user\n    \"active\": <active>,                  // User status (1 for active, 0 for inactive)\n    \"lscode\": \"<lscode>\"        // LSCode for the administrator\n}\n```\n\n**Steps**:\n1. **Email Check**:  \nThe function first checks if an administrator with the provided email already exists in the system. If the email is already in use, the function raises an HTTP exception with a status code of 400, indicating a conflict.\n\n2. **User Code & LSCode Generation**:  \nThe function then generates a unique `user_code` and `lscode` for the new user using the `code_generator` function. These codes ensure each user has distinct identification values.\n\n3. **Password Hashing**:  \nThe provided password is securely hashed using a hashing function before being stored in the database.\n\n4. **User Creation**:  \nA new `LSAPIUserCredential` entry is created with the provided details, including the generated codes, email, mobile number, hashed password, and the current user's email as the creator.\n\n5. **Database Commit**:  \nThe new user is added to the database, committed, and the newly created user's details are refreshed for further use if needed.\n\n**Response**:\nIf the user is successfully created, the response contains a success message and the details of the newly created user.\n\n**Response Example**:\n```json\n{\n    \"message\": \"Administrator user created successfully\",\n    \"user\": {\n        \"user_code\": \"<user_code>\",\n        \"LSCode\": \"<LSCode>\",\n        \"user_name\": \"<user_name>\",\n        \"email\": \"<email>\",\n        \"mobile\": \"<mobile>\",\n        \"active\": 0 | 1,\n        \"date_of_creation\": \"<date_of_creation>\",\n        \"created_user\": \"<created_user>\",\n        \"date_of_modification\": \"<date_of_modification>\",\n        \"modified_user\": \"<modified_user>\"\n    }\n}\n```\n\n**Security**:\n- This function ensures that only authenticated users can create new administrator accounts by depending on `get_current_user`.\n- Passwords are securely hashed before being stored in the database, preventing plaintext passwords from being exposed.\n\n**Error Handling**:\n- If a user with the provided email already exists, the function raises an `HTTPException` with a `400` status code and an error message.\n- If any other error occurs during database operations, appropriate rollback mechanisms should be applied.\n\n**Notes**:\n- The user and LS codes are generated using the `code_generator` function, ensuring uniqueness and adherence to the required format.\n- The `current_user` is captured from the session to ensure that only authorized users perform administrative actions.","operationId":"create_admin_user_api_registration_admin_create__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserCreate"}}},"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/registration/create_user":{"post":{"tags":["Sign Up"],"summary":"Create User","description":"**Function**: `create_user`\n**Type**: API Endpoint (POST)\n\n**Purpose**:  \nThis function creates a new user in the database. It generates a unique user code based on the provided LSCode and other parameters, checks if the user email already exists, encrypts the password, and adds the new user to the database.\n\n**URL**:  \n`POST /api/registration/create_user`\n\n**Request Body**:\n- **application_code** (string, required):  \n  The application code for the user.\n- **lscode** (string, required):  \n  The LSCode for the user.\n- **email** (string, required):  \n  The email address of the user.\n- **mobile** (string, required):  \n  The mobile number of the user.\n- **password** (string, required):  \n  The password for the user.\n- **is_administrator** (boolean, optional):  \n  Whether the user is an administrator or not (default is False).\n- **user_group_code** (string, required):  \n  The user group code for the user.\n- **default_firm** (string, required):  \n  The default firm for the user.\n- **is_license** (boolean, optional):  \n  Whether the user is a licensed user or not (default is True).\n- **is_support_admin** (boolean, optional):  \n  Whether the user is a support administrator or not (default is False).\n- **created_by** (string, required):  \n  The user who created the user.\n\n**Response**:\n- **message** (string):  \n  A success message if the user is created successfully.\n- **user** (object):  \n  The newly created user object.\n\n**Error Handling**:\n- If a user with the provided email already exists, the function raises an `HTTPException` with a `400` status code and an error message.\n- If any other error occurs during database operations, the function returns a `500` error with the error message.","operationId":"create_user_api_registration_create_user_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"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/RLS/{customer_key}/TableList":{"get":{"tags":["RLS"],"summary":"Tablelist","operationId":"TableList_api_RLS__customer_key__TableList_get","parameters":[{"name":"customer_key","in":"path","required":true,"schema":{"type":"string","title":"Customer Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/RLS/{customer_key}/ColumnList/{TableName}":{"get":{"tags":["RLS"],"summary":"Columnlist","operationId":"ColumnList_api_RLS__customer_key__ColumnList__TableName__get","parameters":[{"name":"customer_key","in":"path","required":true,"schema":{"type":"string","title":"Customer Key"}},{"name":"TableName","in":"path","required":true,"schema":{"type":"string","title":"Tablename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/RLS/{customer_key}/ValueList":{"post":{"tags":["RLS"],"summary":"Valuelist","operationId":"ValueList_api_RLS__customer_key__ValueList_post","parameters":[{"name":"customer_key","in":"path","required":true,"schema":{"type":"string","title":"Customer Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/rlsValueList"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/RLS/{customer_key}/insertRLS/{flag}":{"post":{"tags":["RLS"],"summary":"Insertrls","operationId":"insertRLS_api_RLS__customer_key__insertRLS__flag__post","parameters":[{"name":"customer_key","in":"path","required":true,"schema":{"type":"string","title":"Customer Key"}},{"name":"flag","in":"path","required":true,"schema":{"type":"string","title":"Flag"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/insertRLS"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leapsurgebi/SSO/token":{"post":{"tags":["SSO"],"summary":"Authenticate Leapsurgebi User","operationId":"authenticate_leapsurgebi_user_api_leapsurgebi_SSO_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_authenticate_leapsurgebi_user_api_leapsurgebi_SSO_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leapsurgebi/SSO/initial-login-set-password":{"get":{"tags":["SSO"],"summary":"Forgot Password","operationId":"forgot_password_api_leapsurgebi_SSO_initial_login_set_password_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["SSO"],"summary":"Set Password","operationId":"set_password_api_leapsurgebi_SSO_initial_login_set_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_set_password_api_leapsurgebi_SSO_initial_login_set_password_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leapsurgebi/SSO/forgot-password":{"get":{"tags":["SSO"],"summary":"Forgot Password","operationId":"forgot_password_api_leapsurgebi_SSO_forgot_password_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["SSO"],"summary":"Forgot Password Submit","operationId":"forgot_password_submit_api_leapsurgebi_SSO_forgot_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_forgot_password_submit_api_leapsurgebi_SSO_forgot_password_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leapsurgebi/SSO/verify-otp-password":{"get":{"tags":["SSO"],"summary":"Verify Otp Password","operationId":"verify_otp_password_api_leapsurgebi_SSO_verify_otp_password_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["SSO"],"summary":"Verify Otp Password","operationId":"verify_otp_password_api_leapsurgebi_SSO_verify_otp_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_verify_otp_password_api_leapsurgebi_SSO_verify_otp_password_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leapsurgebi/SSO/resend-otp":{"post":{"tags":["SSO"],"summary":"Resend Otp","operationId":"resend_otp_api_leapsurgebi_SSO_resend_otp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/leapsurgebi/SSO/reset-password":{"post":{"tags":["SSO"],"summary":"Reset Password Submit","operationId":"reset_password_submit_api_leapsurgebi_SSO_reset_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_reset_password_submit_api_leapsurgebi_SSO_reset_password_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leapsurgebi/SSO/desktopToken":{"post":{"tags":["SSO"],"summary":"Authenticate Desktop User","operationId":"authenticate_desktop_user_api_leapsurgebi_SSO_desktopToken_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_authenticate_desktop_user_api_leapsurgebi_SSO_desktopToken_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leapsurgebi/SSO/desktopRefresh":{"post":{"tags":["SSO"],"summary":"Refresh Desktop Access Token","operationId":"refresh_desktop_access_token_api_leapsurgebi_SSO_desktopRefresh_post","parameters":[{"name":"refresh-token","in":"header","required":true,"schema":{"type":"string","title":"Refresh-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AdminUserCreate":{"properties":{"lscode":{"type":"string","title":"Lscode"},"user_name":{"type":"string","title":"User Name"},"email":{"type":"string","format":"email","title":"Email"},"mobile":{"type":"string","title":"Mobile"},"password":{"type":"string","title":"Password"},"active":{"type":"integer","title":"Active","default":1}},"type":"object","required":["lscode","user_name","email","mobile","password"],"title":"AdminUserCreate"},"Body_authenticate_bestbi_user_api_bestbi_SSO_token_post":{"properties":{"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_authenticate_bestbi_user_api_bestbi_SSO_token_post"},"Body_authenticate_desktop_user_api_bestbi_SSO_desktopToken_post":{"properties":{"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_authenticate_desktop_user_api_bestbi_SSO_desktopToken_post"},"Body_authenticate_desktop_user_api_leapsurgebi_SSO_desktopToken_post":{"properties":{"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_authenticate_desktop_user_api_leapsurgebi_SSO_desktopToken_post"},"Body_authenticate_leapsurgebi_user_api_leapsurgebi_SSO_token_post":{"properties":{"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_authenticate_leapsurgebi_user_api_leapsurgebi_SSO_token_post"},"Body_authenticate_user_auth_token_post":{"properties":{"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_authenticate_user_auth_token_post"},"Body_forgot_password_submit_api_bestbi_SSO_forgot_password_post":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","title":"Body_forgot_password_submit_api_bestbi_SSO_forgot_password_post"},"Body_forgot_password_submit_api_leapsurgebi_SSO_forgot_password_post":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","title":"Body_forgot_password_submit_api_leapsurgebi_SSO_forgot_password_post"},"Body_profileImageUpload_api_BestBi_MobileApp_profileimageupload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_profileImageUpload_api_BestBi_MobileApp_profileimageupload_post"},"Body_profileImageUpload_api_MobileApp_profileimageupload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_profileImageUpload_api_MobileApp_profileimageupload_post"},"Body_reset_password_submit_api_bestbi_SSO_reset_password_post":{"properties":{"redirect_uri":{"type":"string","title":"Redirect Uri"},"password":{"type":"string","title":"Password"}},"type":"object","required":["redirect_uri","password"],"title":"Body_reset_password_submit_api_bestbi_SSO_reset_password_post"},"Body_reset_password_submit_api_leapsurgebi_SSO_reset_password_post":{"properties":{"redirect_uri":{"type":"string","title":"Redirect Uri"},"password":{"type":"string","title":"Password"}},"type":"object","required":["redirect_uri","password"],"title":"Body_reset_password_submit_api_leapsurgebi_SSO_reset_password_post"},"Body_set_password_api_bestbi_SSO_initial_login_set_password_post":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","title":"Body_set_password_api_bestbi_SSO_initial_login_set_password_post"},"Body_set_password_api_leapsurgebi_SSO_initial_login_set_password_post":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","title":"Body_set_password_api_leapsurgebi_SSO_initial_login_set_password_post"},"Body_upload_excel_data_endpoint_api_mdm_upload_excel_data_post":{"properties":{"excel_file":{"type":"string","contentMediaType":"application/octet-stream","title":"Excel File"}},"type":"object","required":["excel_file"],"title":"Body_upload_excel_data_endpoint_api_mdm_upload_excel_data_post"},"Body_upload_excel_data_endpoint_api_new_mdm_upload_excel_data_post":{"properties":{"excel_file":{"type":"string","contentMediaType":"application/octet-stream","title":"Excel File"}},"type":"object","required":["excel_file"],"title":"Body_upload_excel_data_endpoint_api_new_mdm_upload_excel_data_post"},"Body_verify_otp_password_api_bestbi_SSO_verify_otp_password_post":{"properties":{"otp":{"type":"string","title":"Otp"}},"type":"object","required":["otp"],"title":"Body_verify_otp_password_api_bestbi_SSO_verify_otp_password_post"},"Body_verify_otp_password_api_leapsurgebi_SSO_verify_otp_password_post":{"properties":{"otp":{"type":"string","title":"Otp"}},"type":"object","required":["otp"],"title":"Body_verify_otp_password_api_leapsurgebi_SSO_verify_otp_password_post"},"BookmarkActionRequest":{"properties":{"action":{"type":"integer","title":"Action"},"bookmarkId":{"type":"string","title":"Bookmarkid"},"bookmarkName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bookmarkname"},"bookmarkState":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bookmarkstate"},"isDefault":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isdefault"}},"type":"object","required":["action","bookmarkId"],"title":"BookmarkActionRequest"},"ChatRequest":{"properties":{"messages":{"additionalProperties":true,"type":"object","title":"Messages"},"modelId":{"type":"string","title":"Modelid","default":"llama"},"db_type":{"type":"string","title":"Db Type","default":"sqlserver"},"user_code":{"type":"string","title":"User Code","description":"Base64 encoded "},"firm_code":{"type":"string","title":"Firm Code","description":"Base64 encoded "},"app_code":{"type":"string","title":"App Code"},"systemPrompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Systemprompt"},"workspaceContext":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspacecontext"},"fileContent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filecontent"},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"imageData":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imagedata"},"imageMediaType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imagemediatype"}},"type":"object","required":["messages","user_code","firm_code","app_code"],"title":"ChatRequest"},"Column":{"properties":{"columnName":{"type":"string","title":"Columnname"},"dataType":{"type":"string","title":"Datatype"},"length":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Length"},"scale":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Scale"},"pKey":{"type":"boolean","title":"Pkey"},"isRequired":{"type":"boolean","title":"Isrequired"},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Defaultvalue","default":""},"colType":{"type":"integer","title":"Coltype"},"referenceType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referencetype","default":""},"columnType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Columntype","default":"Column"},"oldColumnName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oldcolumnname","default":""}},"type":"object","required":["columnName","dataType","pKey","isRequired","colType"],"title":"Column"},"ColumnUpdate":{"properties":{"column_name":{"type":"string","title":"Column Name"},"values":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"string"}]},"type":"object"},{"type":"null"}],"title":"Values"},"replace_all":{"anyOf":[{"type":"integer"},{"type":"string"},{"type":"null"}],"title":"Replace All"}},"type":"object","required":["column_name"],"title":"ColumnUpdate"},"CustomReferenceData":{"properties":{"table":{"type":"string","title":"Table"},"column_id":{"type":"string","title":"Column Id"},"values":{"items":{"$ref":"#/components/schemas/ValueData"},"type":"array","title":"Values"},"modified_by":{"type":"string","title":"Modified By"}},"type":"object","required":["table","column_id","values","modified_by"],"title":"CustomReferenceData"},"CustomReferenceRequest":{"properties":{"reference":{"anyOf":[{"items":{"$ref":"#/components/schemas/CustomReferenceData"},"type":"array"},{"type":"null"}],"title":"Reference"},"reference_table":{"anyOf":[{"items":{"$ref":"#/components/schemas/CustomTableReferenceData"},"type":"array"},{"type":"null"}],"title":"Reference Table"}},"type":"object","title":"CustomReferenceRequest"},"CustomTableReferenceData":{"properties":{"table":{"type":"string","title":"Table"},"column":{"type":"string","title":"Column"},"reference_table":{"type":"string","title":"Reference Table"},"data_column":{"type":"string","title":"Data Column"},"display_column1":{"type":"string","title":"Display Column1"},"display_column2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Column2"},"display_column3":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Column3"},"display_column4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Column4"},"display_column5":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Column5"},"modified_by":{"type":"string","title":"Modified By"}},"type":"object","required":["table","column","reference_table","data_column","display_column1","modified_by"],"title":"CustomTableReferenceData"},"DeleteRecordsRequest":{"properties":{"delFullRecords":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delfullrecords","description":"If true, delete all records."},"delPartialRecords":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delpartialrecords","description":"If true, delete records based on specific conditions."},"Customcol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customcol","description":"The column to filter for partial deletions."},"Date_Of_Item_Created":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Of Item Created","description":"Date range for partial deletion (e.g., '2023-01-01, 2023-12-31')."}},"type":"object","title":"DeleteRecordsRequest"},"DeviceSettings":{"properties":{"application_code":{"type":"string","title":"Application Code"},"device_id":{"type":"string","title":"Device Id"},"lscode":{"type":"string","title":"Lscode"},"signoutflag":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Signoutflag","default":0}},"type":"object","required":["application_code","device_id","lscode"],"title":"DeviceSettings"},"ExistingUser":{"properties":{"user":{"$ref":"#/components/schemas/UserResponse"},"menu_access":{"items":{"$ref":"#/components/schemas/MenuAccessParentChild"},"type":"array","title":"Menu Access"},"user_firm_details":{"items":{"$ref":"#/components/schemas/FirmDetail"},"type":"array","title":"User Firm Details"},"user_subscription_details":{"items":{"$ref":"#/components/schemas/SubscriptionDetail"},"type":"array","title":"User Subscription Details"}},"type":"object","required":["user","menu_access","user_firm_details","user_subscription_details"],"title":"ExistingUser"},"FindAndReplace":{"properties":{"updates":{"items":{"$ref":"#/components/schemas/ColumnUpdate"},"type":"array","title":"Updates"}},"type":"object","required":["updates"],"title":"FindAndReplace"},"FirebaseSendNotification":{"properties":{"application_code":{"type":"string","title":"Application Code"},"message_target":{"type":"string","title":"Message Target"},"user_code":{"type":"string","title":"User Code"},"device_id":{"type":"string","title":"Device Id"},"notification_type":{"type":"string","title":"Notification Type"},"notification_doc_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Doc Type"},"notification_title":{"type":"string","title":"Notification Title"},"notification_body":{"type":"string","title":"Notification Body"},"notification_img_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Img Url"},"notification_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Url"},"notification_report_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Report Code"},"push_type":{"type":"string","title":"Push Type"}},"type":"object","required":["application_code","message_target","user_code","device_id","notification_type","notification_title","notification_body","push_type"],"title":"FirebaseSendNotification"},"FirmAccessItem":{"properties":{"firm_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Code"},"active":{"type":"integer","title":"Active","default":1}},"type":"object","title":"FirmAccessItem"},"FirmDetail":{"properties":{"lscode":{"type":"string","title":"Lscode"},"Firm_Name":{"type":"string","title":"Firm Name"},"firm_code":{"type":"string","title":"Firm Code"},"firm_logo":{"type":"string","title":"Firm Logo"}},"type":"object","required":["lscode","Firm_Name","firm_code","firm_logo"],"title":"FirmDetail"},"GroupCrudSchema":{"properties":{"group_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Code"},"group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Name"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","default":true},"modified_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modified User"},"application_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Application Code"},"report_list":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Report List"},"menu_list":{"anyOf":[{"items":{"$ref":"#/components/schemas/MenuItem"},"type":"array"},{"type":"null"}],"title":"Menu List"},"firm_access":{"anyOf":[{"items":{"$ref":"#/components/schemas/FirmAccessItem"},"type":"array"},{"type":"null"}],"title":"Firm Access"},"rls_details":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rls Details"}},"type":"object","title":"GroupCrudSchema"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InsertAppLog":{"properties":{"lscode":{"type":"string","title":"Lscode"},"log_id":{"type":"string","title":"Log Id"},"user_id":{"type":"string","title":"User Id"},"page":{"type":"string","title":"Page"},"event_type":{"type":"string","title":"Event Type"},"event_name":{"type":"string","title":"Event Name"},"sub_event_name":{"type":"string","title":"Sub Event Name"},"description":{"type":"string","title":"Description"},"event_date":{"type":"string","format":"date-time","title":"Event Date"},"load_duration":{"type":"string","title":"Load Duration"},"render_duration":{"type":"string","title":"Render Duration"},"system_user":{"type":"string","title":"System User"},"system_ip":{"type":"string","title":"System Ip"},"browser":{"type":"string","title":"Browser"},"device_type":{"type":"string","title":"Device Type"},"geo_location":{"type":"string","title":"Geo Location"},"application_code":{"type":"string","title":"Application Code"},"device_id":{"type":"string","title":"Device Id"},"firm_code":{"type":"string","title":"Firm Code"}},"type":"object","required":["lscode","log_id","user_id","page","event_type","event_name","sub_event_name","description","event_date","load_duration","render_duration","system_user","system_ip","browser","device_type","geo_location","application_code","device_id","firm_code"],"title":"InsertAppLog"},"MCPRequest":{"properties":{"jsonrpc":{"type":"string","title":"Jsonrpc","description":"JSON-RPC version. Always '2.0'","default":"2.0"},"method":{"type":"string","title":"Method","description":"MCP method: initialize | tools/list | tools/call","default":"tools/list"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params","description":"Method parameters. For tools/call: { name, arguments }"},"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id","description":"Request ID. Echoed back in response.","default":1}},"type":"object","title":"MCPRequest"},"MenuAccessParentChild":{"properties":{"parent":{"$ref":"#/components/schemas/MenuAccessResponse"},"children":{"anyOf":[{"items":{"$ref":"#/components/schemas/MenuAccessResponse"},"type":"array"},{"type":"null"}],"title":"Children"}},"type":"object","required":["parent"],"title":"MenuAccessParentChild"},"MenuAccessResponse":{"properties":{"menu_name":{"type":"string","title":"Menu Name"},"access":{"type":"integer","title":"Access"}},"type":"object","required":["menu_name","access"],"title":"MenuAccessResponse"},"MenuDetails":{"properties":{"menu_details":{"items":{"$ref":"#/components/schemas/MenuUpdate"},"type":"array","title":"Menu Details"},"username":{"type":"string","title":"Username"}},"type":"object","required":["menu_details","username"],"title":"MenuDetails"},"MenuItem":{"properties":{"menuCode":{"type":"string","title":"Menucode"},"access":{"type":"integer","title":"Access"}},"type":"object","required":["menuCode","access"],"title":"MenuItem"},"MenuUpdate":{"properties":{"menu_id":{"type":"string","title":"Menu Id"},"access":{"type":"integer","title":"Access"}},"type":"object","required":["menu_id","access"],"title":"MenuUpdate"},"MobileAppAccess":{"properties":{"session_key":{"type":"string","title":"Session Key"},"aad_user_id":{"type":"string","title":"Aad User Id"},"device_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Type"},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"},"application_code":{"type":"string","title":"Application Code"},"is_report":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Report","default":0},"device_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Name"},"device_loc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Loc"}},"type":"object","required":["session_key","aad_user_id","application_code"],"title":"MobileAppAccess"},"NotificationRequest":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"values":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Values"},"flag":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Flag"}},"type":"object","title":"NotificationRequest"},"PageOrFirm":{"properties":{"theme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme"},"firm":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm"}},"type":"object","title":"PageOrFirm"},"SearchValues":{"properties":{"table":{"type":"string","title":"Table"},"column":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Column"}},"type":"object","required":["table"],"title":"SearchValues"},"SendEmailSchema":{"properties":{"name":{"type":"string","title":"Name"},"to_list":{"items":{"type":"string","format":"email"},"type":"array","title":"To List"},"cc_list":{"anyOf":[{"items":{"type":"string","format":"email"},"type":"array"},{"type":"null"}],"title":"Cc List"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"download_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Link"},"importance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Importance"}},"type":"object","required":["name","to_list","subject","body"],"title":"SendEmailSchema"},"SubscriptionDetail":{"properties":{"lscode":{"type":"string","title":"Lscode"},"eligibleDays":{"type":"integer","title":"Eligibledays"},"eligibleGraceDays":{"type":"integer","title":"Eligiblegracedays"},"subscriptionStatus":{"type":"integer","title":"Subscriptionstatus"},"SubcriptionStart":{"type":"string","title":"Subcriptionstart"},"SubcriptionExpiry":{"type":"string","title":"Subcriptionexpiry"}},"type":"object","required":["lscode","eligibleDays","eligibleGraceDays","subscriptionStatus","SubcriptionStart","SubcriptionExpiry"],"title":"SubscriptionDetail"},"TableAccess":{"properties":{"table_name":{"type":"string","title":"Table Name"},"access":{"type":"integer","title":"Access"},"upload_download_access":{"type":"integer","title":"Upload Download Access"}},"type":"object","required":["table_name","access","upload_download_access"],"title":"TableAccess"},"TableCreateRequest":{"properties":{"tableName":{"type":"string","title":"Tablename"},"deleteOption":{"type":"string","title":"Deleteoption"},"errorOption":{"type":"string","title":"Erroroption","default":"Do not process"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"columnList":{"items":{"$ref":"#/components/schemas/Column"},"type":"array","title":"Columnlist"}},"type":"object","required":["tableName","deleteOption","columnList"],"title":"TableCreateRequest"},"TableDMLRequest":{"properties":{"user":{"type":"string","title":"User","description":"The user performing the operation"},"time":{"type":"string","title":"Time","description":"The time of the operation"},"table_name":{"type":"string","title":"Table Name","description":"The name of the table to perform operations on"},"insertValue":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Insertvalue","description":"List of records to insert"},"updateValue":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Updatevalue","description":"List of records to update"},"deleteValue":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Deletevalue","description":"List of records to delete"}},"type":"object","required":["user","time","table_name"],"title":"TableDMLRequest"},"UpdateAccessRequest":{"properties":{"user":{"$ref":"#/components/schemas/UserResponse"},"menu_access":{"items":{"$ref":"#/components/schemas/MenuAccessParentChild"},"type":"array","title":"Menu Access"},"table_access":{"items":{"$ref":"#/components/schemas/TableAccess"},"type":"array","title":"Table Access"}},"type":"object","required":["user","menu_access","table_access"],"title":"UpdateAccessRequest"},"UpdateColumnNameRequest":{"properties":{"OldName":{"type":"string","title":"Oldname"},"NewName":{"type":"string","title":"Newname"}},"type":"object","required":["OldName","NewName"],"title":"UpdateColumnNameRequest"},"UserCreate":{"properties":{"application_code":{"type":"string","title":"Application Code"},"lscode":{"type":"string","title":"Lscode"},"send_notification":{"type":"boolean","title":"Send Notification","default":true},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"email":{"type":"string","title":"Email"},"mobile":{"type":"string","title":"Mobile"},"password":{"type":"string","title":"Password"},"is_administrator":{"type":"boolean","title":"Is Administrator","default":false},"is_license":{"type":"boolean","title":"Is License","default":true},"two_factor_auth":{"type":"boolean","title":"Two Factor Auth","default":true},"is_support_admin":{"type":"boolean","title":"Is Support Admin","default":false},"user_group_code":{"type":"string","title":"User Group Code"},"created_by":{"type":"string","title":"Created By"},"default_firm":{"type":"string","title":"Default Firm","default":"0001"},"is_group":{"type":"integer","title":"Is Group","default":0},"user_active":{"type":"boolean","title":"User Active","default":true},"access_sync_app":{"type":"boolean","title":"Access Sync App","default":false}},"type":"object","required":["application_code","lscode","first_name","last_name","email","mobile","password","user_group_code","created_by"],"title":"UserCreate"},"UserCrudSchema":{"properties":{"user_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Code"},"user_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Details"},"report_details":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Report Details"},"menu_details":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Menu Details"},"firm_access":{"anyOf":[{"items":{"$ref":"#/components/schemas/FirmAccessItem"},"type":"array"},{"type":"null"}],"title":"Firm Access"},"rls_details":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rls Details"},"modified_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modified User"}},"type":"object","title":"UserCrudSchema"},"UserResponse":{"properties":{"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"email":{"type":"string","title":"Email"},"mobile":{"type":"string","title":"Mobile"},"user_group_code":{"type":"string","title":"User Group Code"},"user_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Role"},"active":{"type":"boolean","title":"Active"},"access_mdm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Access Mdm"}},"type":"object","required":["first_name","last_name","email","mobile","user_group_code","active"],"title":"UserResponse"},"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"},"ValueData":{"properties":{"key":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Key"},"value":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Value"}},"type":"object","required":["key","value"],"title":"ValueData"},"chatInsert":{"properties":{"application_code":{"type":"string","title":"Application Code"},"LSCode":{"type":"string","title":"Lscode"},"from_user_code":{"type":"string","title":"From User Code"},"to_user_code":{"type":"string","title":"To User Code"},"chat_id":{"type":"string","title":"Chat Id"},"Message":{"type":"string","title":"Message"},"Status":{"type":"integer","title":"Status"}},"type":"object","required":["application_code","LSCode","from_user_code","to_user_code","chat_id","Message","Status"],"title":"chatInsert"},"chatUpdate":{"properties":{"message_id":{"type":"integer","title":"Message Id"}},"type":"object","required":["message_id"],"title":"chatUpdate"},"generateToken":{"properties":{"c":{"type":"string","title":"C"},"cf":{"type":"string","title":"Cf"},"dv":{"type":"string","title":"Dv"},"u":{"type":"string","title":"U"}},"type":"object","required":["c","cf","dv","u"],"title":"generateToken"},"getAdminCodes":{"properties":{"userCode":{"type":"string","title":"Usercode"},"codes":{"items":{"type":"string"},"type":"array","title":"Codes"}},"type":"object","required":["userCode","codes"],"title":"getAdminCodes"},"insertRLS":{"properties":{"rlsName":{"type":"string","title":"Rlsname"},"reportName":{"type":"string","title":"Reportname"},"data":{"type":"string","title":"Data"},"user":{"type":"string","title":"User"},"remark":{"type":"string","title":"Remark"},"group":{"type":"string","title":"Group"},"emailId":{"items":{"type":"string"},"type":"array","title":"Emailid"}},"type":"object","required":["rlsName","reportName","data","user","remark","group","emailId"],"title":"insertRLS"},"mdmDeleteRecord":{"properties":{"query":{"type":"string","title":"Query"},"type":{"type":"integer","title":"Type"}},"type":"object","required":["query","type"],"title":"mdmDeleteRecord"},"mdmSearchValues":{"properties":{"table":{"type":"string","title":"Table"},"column":{"type":"string","title":"Column"},"filter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter"},"condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition"}},"type":"object","required":["table","column","filter","condition"],"title":"mdmSearchValues"},"mdmValueList":{"properties":{"refTable":{"type":"string","title":"Reftable"},"dataColumn":{"type":"string","title":"Datacolumn"},"displayColumn1":{"type":"string","title":"Displaycolumn1"},"displayColumn2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Displaycolumn2"},"displayColumn3":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Displaycolumn3"},"displayColumn4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Displaycolumn4"},"displayColumn5":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Displaycolumn5"},"filter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter"}},"type":"object","required":["refTable","dataColumn","displayColumn1","displayColumn2","displayColumn3","displayColumn4","displayColumn5","filter"],"title":"mdmValueList"},"query":{"type":"string","title":"query"},"rlsValueList":{"properties":{"tableName":{"type":"string","title":"Tablename"},"dataColumn":{"type":"string","title":"Datacolumn"},"displayColumn":{"type":"string","title":"Displaycolumn"},"rlsName":{"type":"string","title":"Rlsname"},"reportName":{"type":"string","title":"Reportname"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"type":"object","required":["tableName","dataColumn","displayColumn","rlsName","reportName"],"title":"rlsValueList"},"triggerData":{"properties":{"appCode":{"type":"string","title":"Appcode"},"lsCode":{"type":"string","title":"Lscode"},"firmCode":{"type":"string","title":"Firmcode"},"id":{"type":"string","title":"Id"},"parameter":{"type":"string","title":"Parameter"},"message":{"type":"string","title":"Message"},"triggerType":{"type":"string","title":"Triggertype"},"buttonName1":{"type":"string","title":"Buttonname1"},"buttonValue1":{"type":"string","title":"Buttonvalue1"},"buttonName2":{"type":"string","title":"Buttonname2"},"buttonValue2":{"type":"string","title":"Buttonvalue2"},"buttonName3":{"type":"string","title":"Buttonname3"},"buttonValue3":{"type":"string","title":"Buttonvalue3"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Createdby"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},"type":"object","required":["appCode","lsCode","firmCode","id","parameter","message","triggerType","buttonName1","buttonValue1","buttonName2","buttonValue2","buttonName3","buttonValue3"],"title":"triggerData"},"updateCustCode":{"properties":{"oldCode":{"type":"string","title":"Oldcode"},"newCode":{"type":"string","title":"Newcode"},"tableName":{"type":"string","title":"Tablename"},"columnName":{"type":"string","title":"Columnname"},"prefix":{"type":"string","title":"Prefix"}},"type":"object","required":["oldCode","newCode","tableName","columnName","prefix"],"title":"updateCustCode"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/auth/token"}}}}}}