{"openapi":"3.1.0","info":{"title":"Marshal Management API","version":"1.1.0"},"paths":{"/api/v1/incidents/":{"post":{"tags":["Incident Register"],"summary":"Create Incident","description":"Create a new Incident record (C4W10 - Incident Recording)","operationId":"create_incident_api_v1_incidents__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIncidentRegisterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIncidentRegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Incident Register"],"summary":"List Incidents","description":"List all Incident records with pagination (C4W11 - Incident Register)","operationId":"list_incidents_api_v1_incidents__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Category Id"}},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIncidentRegisterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/incidents/{incident_id}":{"get":{"tags":["Incident Register"],"summary":"Get Incident","operationId":"get_incident_api_v1_incidents__incident_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"integer","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIncidentRegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Incident Register"],"summary":"Update Incident","operationId":"update_incident_api_v1_incidents__incident_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"integer","title":"Incident Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIncidentRegisterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIncidentRegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Incident Register"],"summary":"Delete Incident","operationId":"delete_incident_api_v1_incidents__incident_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"integer","title":"Incident Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["Authentication"],"summary":"Login","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/token":{"post":{"tags":["Authentication"],"summary":"Login For Access Token","operationId":"login_for_access_token_api_v1_auth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_for_access_token_api_v1_auth_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/refresh":{"post":{"tags":["Authentication"],"summary":"Refresh Token","operationId":"refresh_token_api_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["Authentication"],"summary":"Register New User","description":"Register a new user and automatically assign 'cm-user' role.","operationId":"register_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegister"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/change-password":{"post":{"tags":["Authentication"],"summary":"Change Password","operationId":"change_password_api_v1_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChange"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChangeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"JWT":[]}]}},"/api/v1/auth/me":{"get":{"tags":["Authentication"],"summary":"Get Me","operationId":"get_me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentUserResponse"}}}}},"security":[{"JWT":[]}]}},"/api/v1/auth/logout":{"post":{"tags":["Authentication"],"summary":"Logout","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutResponse"}}}}},"security":[{"JWT":[]}]}},"/api/v1/auth/verify":{"get":{"tags":["Authentication"],"summary":"Verify Token Endpoint","operationId":"verify_token_endpoint_api_v1_auth_verify_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"JWT":[]}]}},"/api/v1/auth/cp/login":{"post":{"tags":["Authentication","CP Authentication"],"summary":"Client Portal User Login","description":"Login endpoint specifically for Client Portal users.\n\n- Authenticates against cp_user_master table only\n- Returns JWT token with user_type: \"cp\"\n- Use this token for all /client-dashboard/* endpoints\n\n**Request Body:**\n- username: Username or email\n- password: User password","operationId":"cp_login_api_v1_auth_cp_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/cp/register":{"post":{"tags":["Authentication","CP Authentication"],"summary":"Register New Client Portal User","description":"Register a new Client Portal user.\n\n- Creates a new user in the cp_user_master table\n- Links user to specified client_id\n- Automatically assigns default CP role (cp-user)\n\n**Note:** This endpoint can be used by admins to create CP users\nor during client onboarding process.","operationId":"register_cp_user_api_v1_auth_cp_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPUserRegister"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPUserRegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/cp/me":{"get":{"tags":["Authentication","CP Authentication"],"summary":"Get Current CP User Profile","description":"Get the current authenticated CP user's profile.\n\nReturns user information including:\n- User details (name, email, phone)\n- Associated client information\n- Assigned roles","operationId":"get_cp_me_api_v1_auth_cp_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPCurrentUserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/cp/change-password":{"post":{"tags":["Authentication","CP Authentication"],"summary":"Change CP User Password","description":"Change the current CP user's password.\n\nRequires:\n- Current password for verification\n- New password meeting security requirements","operationId":"change_cp_password_api_v1_auth_cp_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPPasswordChange"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChangeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/cp/verify":{"get":{"tags":["Authentication","CP Authentication"],"summary":"Verify CP User Token","description":"Verify if the current CP user's token is valid.\n\nReturns user_id, username, and client_id if valid.","operationId":"verify_cp_token_api_v1_auth_cp_verify_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/cp/logout":{"post":{"tags":["Authentication","CP Authentication"],"summary":"Logout CP User","description":"Logout the current CP user.\n\nNote: Since we use JWT tokens, this endpoint is mainly for client-side\ntoken clearing. Server-side token invalidation would require a token\nblacklist implementation.","operationId":"cp_logout_api_v1_auth_cp_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/cp/reset-password":{"post":{"tags":["Authentication","CP Authentication"],"summary":"Client User Reset Password","description":"Reset password for a client portal user using the temporary password sent via email.\n\nThis is an **unauthenticated** endpoint. The client user provides:\n- **email**: The client user's email address\n- **tenant_id**: The client's tenant ID (for verification)\n- **old_password**: The temporary password received via email\n- **new_password**: The new password to set\n\nOn success, returns a **bearer token** with client_id embedded that can be used\nto download the CSV data allocated for the client.","operationId":"client_reset_password_api_v1_auth_cp_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientResetPasswordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/functions/":{"post":{"tags":["Functions"],"summary":"Create Function","description":"Create a new function/department","operationId":"create_function_api_v1_functions__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPFunctionMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPFunctionMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Functions"],"summary":"List Functions","description":"Get list of all functions with pagination","operationId":"list_functions_api_v1_functions__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name","title":"Search"},"description":"Search by name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPFunctionMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/functions/{function_id}":{"get":{"tags":["Functions"],"summary":"Get Function","description":"Get a single function by ID","operationId":"get_function_api_v1_functions__function_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"function_id","in":"path","required":true,"schema":{"type":"integer","title":"Function Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPFunctionMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Functions"],"summary":"Update Function","description":"Update an existing function","operationId":"update_function_api_v1_functions__function_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"function_id","in":"path","required":true,"schema":{"type":"integer","title":"Function Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPFunctionMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPFunctionMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Functions"],"summary":"Delete Function","description":"Delete a function by ID","operationId":"delete_function_api_v1_functions__function_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"function_id","in":"path","required":true,"schema":{"type":"integer","title":"Function Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/roles/":{"post":{"tags":["Roles"],"summary":"Create Role","description":"Create a new role","operationId":"create_role_api_v1_roles__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Roles"],"summary":"List Roles","description":"List all roles with pagination","operationId":"list_roles_api_v1_roles__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/roles/{role_id}":{"get":{"tags":["Roles"],"summary":"Get Role","description":"Get a single role by ID","operationId":"get_role_api_v1_roles__role_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Roles"],"summary":"Update Role","description":"Update a role","operationId":"update_role_api_v1_roles__role_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Roles"],"summary":"Delete Role","description":"Delete a role","operationId":"delete_role_api_v1_roles__role_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/":{"post":{"tags":["Users"],"summary":"Create User","description":"Create a new user","operationId":"create_user_api_v1_users__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPUserMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPUserMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Users"],"summary":"List Users","description":"List all users with pagination","operationId":"list_users_api_v1_users__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPUserMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}":{"get":{"tags":["Users"],"summary":"Get User","description":"Get a single user by ID","operationId":"get_user_api_v1_users__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPUserMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Users"],"summary":"Update User","description":"Update a user","operationId":"update_user_api_v1_users__user_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPUserMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPUserMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Users"],"summary":"Delete User","description":"Delete a user (soft delete - sets is_active to False)","operationId":"delete_user_api_v1_users__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/reset-password":{"post":{"tags":["Users"],"summary":"Reset User Password","description":"Reset a user's password (admin function)","operationId":"reset_user_password_api_v1_users__user_id__reset_password_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"new_password","in":"query","required":true,"schema":{"type":"string","minLength":8,"title":"New Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Reset User Password Api V1 Users  User Id  Reset Password Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/me/storage-preference":{"get":{"tags":["Users"],"summary":"Get My Storage Preference","description":"Get current user's storage preference\n\nReturns the user's preferred storage configuration.\nIf no preference is set, returns null with a message.","operationId":"get_my_storage_preference_api_v1_users_me_storage_preference_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoragePreferenceResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["Users"],"summary":"Set My Storage Preference","description":"Set current user's storage preference\n\nAllows the user to choose their preferred storage configuration\nfrom the available active storage settings.","operationId":"set_my_storage_preference_api_v1_users_me_storage_preference_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoragePreferenceUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoragePreferenceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["Users"],"summary":"Clear My Storage Preference","description":"Clear current user's storage preference\n\nRemoves the user's storage preference, reverting to the default\nstorage configuration (global or client-specific).","operationId":"clear_my_storage_preference_api_v1_users_me_storage_preference_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoragePreferenceResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/users/me/available-storages":{"get":{"tags":["Users"],"summary":"Get Available Storages","description":"Get list of available storage configurations\n\nReturns all active storage configurations that the user can choose from.","operationId":"get_available_storages_api_v1_users_me_available_storages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response Get Available Storages Api V1 Users Me Available Storages Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/role-mappings/":{"post":{"tags":["Role Mappings"],"summary":"Create Mapping","description":"Assign a role to a user","operationId":"create_mapping_api_v1_role_mappings__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleUserMappingCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleUserMappingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Role Mappings"],"summary":"List Mappings","description":"List all role-user mappings","operationId":"list_mappings_api_v1_role_mappings__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},{"name":"role_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Role Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPRoleUserMappingListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/role-mappings/{mapping_id}":{"delete":{"tags":["Role Mappings"],"summary":"Delete Mapping","description":"Remove a role from a user","operationId":"delete_mapping_api_v1_role_mappings__mapping_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"mapping_id","in":"path","required":true,"schema":{"type":"integer","title":"Mapping Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/":{"post":{"tags":["Client Master"],"summary":"Create Client","description":"Create a new client - follows workflow process.\n\nClient is created with status 'Pending Review' and must be approved by CM-Sup.\nWorkflow: Create (CM_User) -> Pending Review -> Supervisor Approval (CM-Sup) -> Approved","operationId":"create_client_api_v1_clients__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Client Master"],"summary":"List Clients","description":"List all clients with pagination - Admin Only (Client Database Management)","operationId":"list_clients_api_v1_clients__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}":{"get":{"tags":["Client Master"],"summary":"Get Client","description":"Get a single client by ID - Admin Only (Client Database Management)","operationId":"get_client_api_v1_clients__client_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Client Master"],"summary":"Update Client","description":"Update a client - Admin Only (Client Database Management)","operationId":"update_client_api_v1_clients__client_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Client Master"],"summary":"Delete Client","description":"Delete a client - Admin Only (Client Database Management)","operationId":"delete_client_api_v1_clients__client_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/draft":{"post":{"tags":["Client Master"],"summary":"Create Client Draft","description":"MW1.3-MW1.6: Create a new client as draft (not submitted for review)\n\nCM_User can create drafts and later submit for review using /submit-for-review endpoint.","operationId":"create_client_draft_api_v1_clients_draft_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/clients/{client_id}/submit-for-review":{"post":{"tags":["Client Master"],"summary":"Submit For Review","description":"MW1.7: Submit client for CM-Sup review\n\nCM_User submits clients for CM-Sup approval.\nCan only submit clients with status: Draft or Review Failed","operationId":"submit_for_review_api_v1_clients__client_id__submit_for_review_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/workflow/pending-review":{"get":{"tags":["Client Master"],"summary":"Get Pending Review Clients","description":"MW1.9: Get all clients pending supervisor review\n\nAccessible by CM-Sup (Client Management Supervisor) only.","operationId":"get_pending_review_clients_api_v1_clients_workflow_pending_review_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingReviewListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/clients/workflow/my-failed-reviews":{"get":{"tags":["Client Master"],"summary":"Get My Failed Reviews","description":"MW1.13: Get clients that failed review for correction\n\nShows clients created by CM_User that need correction.","operationId":"get_my_failed_reviews_api_v1_clients_workflow_my_failed_reviews_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedReviewListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/clients/{client_id}/review":{"post":{"tags":["Client Master"],"summary":"Review Client","description":"MW1.10-MW1.12: CM-Sup reviews and approves client\n\nActions:\n- approve: Approves the client (MW1.12)\n  - Creates CP user with generated credentials\n  - Sends tenant onboarding email with access code and client details\n- reject: Rejects the client permanently (MW1.11)\n- request_correction: Sends back for correction (MW1.10)\n\nOnly CM-Sup (Client Management Supervisor) can review/approve clients.","operationId":"review_client_api_v1_clients__client_id__review_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientReviewAction"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/correct":{"put":{"tags":["Client Master"],"summary":"Correct Client","description":"MW1.14: CM_User corrects client data and resubmits for CM-Sup review\n\nCan only correct clients with status: Review Failed","operationId":"correct_client_api_v1_clients__client_id__correct_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCorrection"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/create-package":{"post":{"tags":["Client Master"],"summary":"Create Client Package","description":"M6W3: Create client installation package (database schema)\n\nRequires approved license allocations. Creates:\n- Base schema with supporting tables\n- Governance-specific tables per allocation (cp_risk_register_{gov}, etc.)\n- Filtered CSV exports scoped to allocated governance/standards\n\nWorkflow order: Client Approved → License Created → Allocation Approved → Package Creation","operationId":"create_client_package_api_v1_clients__client_id__create_package_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__mp_client_master__schema__SchemaCreationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/package-status":{"get":{"tags":["Client Master"],"summary":"Get Client Package Status","description":"M6W4: Get client package (schema) status\n\nReturns the current status of the client schema including:\n- Schema name\n- Whether schema has been created\n- List of tables in the schema","operationId":"get_client_package_status_api_v1_clients__client_id__package_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__mp_client_master__schema__SchemaCreationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/approved":{"get":{"tags":["Client Master"],"summary":"List Approved Clients","description":"List all approved clients (for license allocation dropdown)\n\nReturns only clients with status = Approved and is_active = True","operationId":"list_approved_clients_api_v1_clients_approved_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/companies/":{"post":{"tags":["Companies"],"summary":"Create Company","description":"Create a new company with background color choice (black/blue/green)\n- Restricted to Admin","operationId":"create_company_api_v1_companies__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPCompanyMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPCompanyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Companies"],"summary":"List Companies","description":"List all companies with optional search","operationId":"list_companies_api_v1_companies__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPCompanyMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/companies/{company_id}":{"get":{"tags":["Companies"],"summary":"Get Company","description":"Get a single company by ID","operationId":"get_company_api_v1_companies__company_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPCompanyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Companies"],"summary":"Update Company","description":"Update a company - Restricted to Admin","operationId":"update_company_api_v1_companies__company_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPCompanyMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPCompanyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Companies"],"summary":"Delete Company","description":"Delete a company (soft delete) - Restricted to Admin","operationId":"delete_company_api_v1_companies__company_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/":{"post":{"tags":["Purchase Orders"],"summary":"Create Po","operationId":"create_po_api_v1_purchase_orders__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPOMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPOMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Purchase Orders"],"summary":"List Pos","operationId":"list_pos_api_v1_purchase_orders__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPOMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{po_id}":{"get":{"tags":["Purchase Orders"],"summary":"Get Po","operationId":"get_po_api_v1_purchase_orders__po_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"po_id","in":"path","required":true,"schema":{"type":"integer","title":"Po Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPOMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Purchase Orders"],"summary":"Update Po","operationId":"update_po_api_v1_purchase_orders__po_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"po_id","in":"path","required":true,"schema":{"type":"integer","title":"Po Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPOMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPOMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Purchase Orders"],"summary":"Delete Po","operationId":"delete_po_api_v1_purchase_orders__po_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"po_id","in":"path","required":true,"schema":{"type":"integer","title":"Po Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/purchase-orders/{po_id}/governances":{"get":{"tags":["Purchase Orders"],"summary":"Get Po Governances","description":"Governance domains purchased on this PO — drives the License Allocation picker.","operationId":"get_po_governances_api_v1_purchase_orders__po_id__governances_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"po_id","in":"path","required":true,"schema":{"type":"integer","title":"Po Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/POGovernanceItem-Output"},"title":"Response Get Po Governances Api V1 Purchase Orders  Po Id  Governances Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/po-details/":{"post":{"tags":["PO Details"],"summary":"Create Po Detail","operationId":"create_po_detail_api_v1_po_details__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPODetailsCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPODetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["PO Details"],"summary":"List Po Details","operationId":"list_po_details_api_v1_po_details__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"po_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id"}},{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPODetailsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/po-details/{sl_no}":{"get":{"tags":["PO Details"],"summary":"Get Po Detail","operationId":"get_po_detail_api_v1_po_details__sl_no__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sl_no","in":"path","required":true,"schema":{"type":"integer","title":"Sl No"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPODetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["PO Details"],"summary":"Update Po Detail","operationId":"update_po_detail_api_v1_po_details__sl_no__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sl_no","in":"path","required":true,"schema":{"type":"integer","title":"Sl No"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPODetailsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPPODetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["PO Details"],"summary":"Delete Po Detail","operationId":"delete_po_detail_api_v1_po_details__sl_no__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sl_no","in":"path","required":true,"schema":{"type":"integer","title":"Sl No"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/licenses/":{"get":{"tags":["Licenses"],"summary":"List Licenses","description":"List all licenses with filters","operationId":"list_licenses_api_v1_licenses__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},{"name":"standard_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"}},{"name":"activation_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activation Status"}},{"name":"expiry_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiry Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPLicenseMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/licenses/{license_id}":{"get":{"tags":["Licenses"],"summary":"Get License","description":"Get a single license by ID","operationId":"get_license_api_v1_licenses__license_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPLicenseMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Licenses"],"summary":"Update License","description":"Update a license","operationId":"update_license_api_v1_licenses__license_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPLicenseMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPLicenseMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Licenses"],"summary":"Delete License","description":"Soft delete a license","operationId":"delete_license_api_v1_licenses__license_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/licenses/{license_id}/activate":{"post":{"tags":["Licenses"],"summary":"Activate License","description":"M5W1: Activate a license","operationId":"activate_license_api_v1_licenses__license_id__activate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseActivateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/licenses/{license_id}/cancel":{"post":{"tags":["Licenses"],"summary":"Cancel License","description":"M5W2: Cancel a license","operationId":"cancel_license_api_v1_licenses__license_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/licenses/{license_id}/renew":{"post":{"tags":["Licenses"],"summary":"Renew License","description":"M5W2: Renew a license with new end date","operationId":"renew_license_api_v1_licenses__license_id__renew_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseRenewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/licenses/{license_id}/upgrade":{"post":{"tags":["Licenses"],"summary":"Upgrade License","description":"M5W4: Upgrade license to a new standard","operationId":"upgrade_license_api_v1_licenses__license_id__upgrade_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseUpgradeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/":{"post":{"tags":["License Allocation"],"summary":"Create Allocation","description":"MW4.3-MW4.7: Create new license allocation for ONE governance domain\n\nLicense ID and license key are auto-generated.\nProvide governance_id (required), po_id and admin_email (optional).\n\n- MW4.3: Client must be Approved\n- MW4.5: Governance selected\n- MW4.6: Start and End date provided (inside the PO window)\n- MW4.7: Save with status Pending Review\n\nNOTE: A client can have MULTIPLE allocations for DIFFERENT governances.\nUse POST /bulk to allocate several governances from one PO at once.","operationId":"create_allocation_api_v1_license_allocations__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"auto_submit","in":"query","required":false,"schema":{"type":"boolean","description":"Auto-submit for review","default":true,"title":"Auto Submit"},"description":"Auto-submit for review"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["License Allocation"],"summary":"List Allocations","description":"List all allocations with filters","operationId":"list_allocations_api_v1_license_allocations__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},{"name":"standard_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/draft":{"post":{"tags":["License Allocation"],"summary":"Create Allocation Draft","description":"Create allocation as draft (not submitted for review).\n\nLicense ID and license key are auto-generated.","operationId":"create_allocation_draft_api_v1_license_allocations_draft_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/license-allocations/bulk":{"post":{"tags":["License Allocation"],"summary":"Create Allocations Bulk","description":"Allocate several governances from one Purchase Order in a single submit.\n\nOne license — and one license key — is created per governance, each with its\nown admin email. Each governance is committed on its own, so one failure\n(e.g. a duplicate) doesn't discard the ones that already succeeded; the\nresponse lists what was created and what was skipped. If nothing could be\ncreated the whole request fails so the caller sees the reason.","operationId":"create_allocations_bulk_api_v1_license_allocations_bulk_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"auto_submit","in":"query","required":false,"schema":{"type":"boolean","description":"Auto-submit each allocation for review","default":true,"title":"Auto Submit"},"description":"Auto-submit each allocation for review"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationBulkCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationBulkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/payment-status":{"patch":{"tags":["License Allocation"],"summary":"Update Payment Status","description":"Set the payment status on a Draft or Pending Review allocation.\n\nSeparate from the Draft-only PUT because a reviewer needs to mark payment\nCompleted while the allocation sits in Pending Review — approval is blocked\nuntil then.","operationId":"update_payment_status_api_v1_license_allocations__allocation_id__payment_status_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/my-drafts":{"get":{"tags":["License Allocation"],"summary":"List My Draft Allocations","description":"List current user's draft allocations","operationId":"list_my_draft_allocations_api_v1_license_allocations_my_drafts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/license-allocations/client/{client_id}":{"get":{"tags":["License Allocation"],"summary":"Get Client Licenses","description":"Get ALL license allocations for a specific client\n\nShows all governance domains allocated to this client with their status","operationId":"get_client_licenses_api_v1_license_allocations_client__client_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientLicenseSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/workflow/pending-review":{"get":{"tags":["License Allocation"],"summary":"Get Pending Review Allocations","description":"MW4.9: Get all allocations pending supervisor review","operationId":"get_pending_review_allocations_api_v1_license_allocations_workflow_pending_review_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingAllocationListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/license-allocations/workflow/my-failed-reviews":{"get":{"tags":["License Allocation"],"summary":"Get My Failed Reviews","description":"MW4.13: Get allocations that failed review","operationId":"get_my_failed_reviews_api_v1_license_allocations_workflow_my_failed_reviews_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedAllocationListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/license-allocations/{allocation_id}":{"get":{"tags":["License Allocation"],"summary":"Get Allocation","description":"Get allocation by ID","operationId":"get_allocation_api_v1_license_allocations__allocation_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["License Allocation"],"summary":"Update Allocation","description":"Update allocation (only Draft status)","operationId":"update_allocation_api_v1_license_allocations__allocation_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAllocationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["License Allocation"],"summary":"Delete Allocation","description":"Soft delete an allocation (only Draft or Rejected)","operationId":"delete_allocation_api_v1_license_allocations__allocation_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/submit-for-review":{"post":{"tags":["License Allocation"],"summary":"Submit For Review","description":"MW4.7: Submit allocation for supervisor review","operationId":"submit_for_review_api_v1_license_allocations__allocation_id__submit_for_review_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocationWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/review":{"post":{"tags":["License Allocation"],"summary":"Review Allocation","description":"MW4.10, MW4.11, MW4.12: Supervisor reviews allocation\n\n- approve: Updates status to Approved, creates/updates client schema for\n  EVERY standard under the allocation's governance, then emails the license\n  key to that governance's admin. Requires payment status 'Completed'.\n- request_correction: Sends back for correction (Review Failed)\n- reject: Rejects the allocation","operationId":"review_allocation_api_v1_license_allocations__allocation_id__review_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocationReviewAction"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocationWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/correct":{"put":{"tags":["License Allocation"],"summary":"Correct Allocation","description":"MW4.14: User corrects allocation and resubmits","operationId":"correct_allocation_api_v1_license_allocations__allocation_id__correct_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocationCorrection"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocationWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/schema-info":{"get":{"tags":["License Allocation"],"summary":"Get Schema Info","description":"Get information about the client schema created for this allocation","operationId":"get_schema_info_api_v1_license_allocations__allocation_id__schema_info_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__license_allocation__schema__SchemaCreationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/populate-activities":{"post":{"tags":["License Allocation"],"summary":"Populate Cp Activities","description":"Populate cp_control_hierarchy and cp_control_activities tables in the client schema.\n\n1. cp_control_hierarchy — full control tree (Requirements → Controls → Sub-Controls)\n2. cp_control_activities — activities linked to each applicable control\n\nThis is also triggered automatically when an allocation is approved.","operationId":"populate_cp_activities_api_v1_license_allocations__allocation_id__populate_activities_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PopulateActivitiesRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulateActivitiesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/activity-diagnostics":{"get":{"tags":["License Allocation"],"summary":"Activity Diagnostics","description":"Diagnostic endpoint: returns row counts from every activity source for this allocation.\nUse this to understand why populate-activities returns 0 activities.","operationId":"activity_diagnostics_api_v1_license_allocations__allocation_id__activity_diagnostics_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/structure-detail":{"get":{"tags":["License Allocation"],"summary":"Get Structure Detail","description":"Get hierarchical structure view of controls with attached CP_Activities.\n\nShows the same hierarchical structure as the hierarchy module, but with\nthe CP_Activity records attached to each control from the client schema.\n\nArgs:\n    allocation_id: License allocation ID\n    std_id: Standard ID from cp_standards_master\n    include_not_applicable: Whether to include non-applicable controls","operationId":"get_structure_detail_api_v1_license_allocations__allocation_id__structure_detail_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}},{"name":"std_id","in":"query","required":true,"schema":{"type":"integer","description":"Standard ID from hierarchy module","title":"Std Id"},"description":"Standard ID from hierarchy module"},{"name":"include_not_applicable","in":"query","required":false,"schema":{"type":"boolean","description":"Include not applicable controls","default":true,"title":"Include Not Applicable"},"description":"Include not applicable controls"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructureDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/controls/applicability":{"put":{"tags":["License Allocation"],"summary":"Update Control Applicability","description":"Update control applicability status in client schema with cascading.\n\nWhen is_applicable is set to FALSE:\n- The control is marked as not applicable\n- All child controls are also marked as not applicable (if cascade_to_children=True)\n- Activities linked to non-applicable controls are removed\n\nArgs:\n    allocation_id: License allocation ID\n    request: Contains control_code, is_applicable, justification, cascade_to_children","operationId":"update_control_applicability_api_v1_license_allocations__allocation_id__controls_applicability_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateControlApplicabilityRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateControlApplicabilityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/maintenance/backfill-license-history":{"post":{"tags":["License Allocation"],"summary":"Backfill License History","description":"Retrofit existing client tenant schemas for the License History view.\n\nFor every client schema: adds cp_license_records.tier if missing, creates\nthe cp_license_history view, and backfills tier from the matching\nmanagement allocation (by license_key). Idempotent — safe to re-run.\n\nRequires mp-admin role.","operationId":"backfill_license_history_api_v1_license_allocations_maintenance_backfill_license_history_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/license-allocations/maintenance/backfill-standard-level-names":{"post":{"tags":["License Allocation"],"summary":"Backfill Standard Level Names","description":"Retrofit existing client tenant schemas with hierarchy level names.\n\nFor every client schema: adds the level_no / level_names / level_name\ncolumns to cp_standards_master if missing, and backfills them from the\nmatching management standard (by std_id). Idempotent — safe to re-run.\n\nRequires mp-admin role.","operationId":"backfill_standard_level_names_api_v1_license_allocations_maintenance_backfill_standard_level_names_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/license-allocations/{allocation_id}/regenerate-license-key":{"post":{"tags":["License Allocation"],"summary":"Regenerate License Key","description":"Generate a new license key for an approved allocation and optionally\nsend it to the client admin's registered email.\n\n- Replaces the existing license key on the allocation record.\n- Updates the key in the client's tenant schema `cp_license_records` table.\n- Sends a license key email to this governance's admin email, falling back\n  to the client contact email (unless send_email=false).\n\nRequires mp-admin role and a paid, approved allocation.","operationId":"regenerate_license_key_api_v1_license_allocations__allocation_id__regenerate_license_key_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}},{"name":"send_email","in":"query","required":false,"schema":{"type":"boolean","description":"Send the new key to the client's email","default":true,"title":"Send Email"},"description":"Send the new key to the client's email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/license-allocations/{allocation_id}/resend-email":{"post":{"tags":["License Allocation"],"summary":"Resend License Email","description":"Resend the existing license key email for an approved, paid allocation.\nDoes NOT regenerate the key — sends the current key as-is.\n\nGoes to this governance's admin email, falling back to the client contact\nemail. An email_override is saved as THIS allocation's admin email — it no\nlonger overwrites the client-wide contact email.","operationId":"resend_license_email_api_v1_license_allocations__allocation_id__resend_email_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}},{"name":"email_override","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Send to this email instead of the governance admin / client contact email","title":"Email Override"},"description":"Send to this email instead of the governance admin / client contact email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/frequencies/":{"post":{"tags":["Frequency Master"],"summary":"Create Cp Frequency Master","description":"Create a new Frequency Master record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_frequency_master_api_v1_frequencies__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPFrequencyMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPFrequencyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Frequency Master"],"summary":"List Cp Frequency Master","description":"List all Frequency Master records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_frequency_master_api_v1_frequencies__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPFrequencyMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/frequencies/{freq_id}":{"get":{"tags":["Frequency Master"],"summary":"Get Cp Frequency Master","description":"Get a single Frequency Master record by ID\n\n- Returns 404 if not found","operationId":"get_cp_frequency_master_api_v1_frequencies__freq_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"freq_id","in":"path","required":true,"schema":{"type":"integer","title":"Freq Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPFrequencyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Frequency Master"],"summary":"Update Cp Frequency Master","description":"Update a Frequency Master record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_frequency_master_api_v1_frequencies__freq_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"freq_id","in":"path","required":true,"schema":{"type":"integer","title":"Freq Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPFrequencyMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPFrequencyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Frequency Master"],"summary":"Delete Cp Frequency Master","description":"Delete a Frequency Master record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_frequency_master_api_v1_frequencies__freq_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"freq_id","in":"path","required":true,"schema":{"type":"integer","title":"Freq Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/geographies/":{"post":{"tags":["Geography Master"],"summary":"Create Cp Geography Master","description":"Create a new Geography Master record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_geography_master_api_v1_geographies__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGeographyMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGeographyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Geography Master"],"summary":"List Cp Geography Master","description":"List all Geography Master records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_geography_master_api_v1_geographies__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGeographyMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/geographies/{geography_id}":{"get":{"tags":["Geography Master"],"summary":"Get Cp Geography Master","description":"Get a single Geography Master record by ID\n\n- Returns 404 if not found","operationId":"get_cp_geography_master_api_v1_geographies__geography_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"geography_id","in":"path","required":true,"schema":{"type":"integer","title":"Geography Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGeographyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Geography Master"],"summary":"Update Cp Geography Master","description":"Update a Geography Master record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_geography_master_api_v1_geographies__geography_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"geography_id","in":"path","required":true,"schema":{"type":"integer","title":"Geography Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGeographyMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGeographyMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Geography Master"],"summary":"Delete Cp Geography Master","description":"Delete a Geography Master record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_geography_master_api_v1_geographies__geography_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"geography_id","in":"path","required":true,"schema":{"type":"integer","title":"Geography Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/governance/":{"post":{"tags":["Governance Master"],"summary":"Create Cp Governance Master","description":"Create a new Governance Master record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_governance_master_api_v1_governance__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGovernanceMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGovernanceMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Governance Master"],"summary":"List Cp Governance Master","description":"List all Governance Master records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_governance_master_api_v1_governance__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGovernanceMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/governance/{gov_id}":{"get":{"tags":["Governance Master"],"summary":"Get Cp Governance Master","description":"Get a single Governance Master record by ID\n\n- Returns 404 if not found","operationId":"get_cp_governance_master_api_v1_governance__gov_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"gov_id","in":"path","required":true,"schema":{"type":"integer","title":"Gov Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGovernanceMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Governance Master"],"summary":"Update Cp Governance Master","description":"Update a Governance Master record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_governance_master_api_v1_governance__gov_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"gov_id","in":"path","required":true,"schema":{"type":"integer","title":"Gov Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGovernanceMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPGovernanceMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Governance Master"],"summary":"Delete Cp Governance Master","description":"Delete a Governance Master record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_governance_master_api_v1_governance__gov_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"gov_id","in":"path","required":true,"schema":{"type":"integer","title":"Gov Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/standards/":{"post":{"tags":["Standards Master"],"summary":"Create Cp Standards Master","description":"Create a new Standards Master record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_standards_master_api_v1_standards__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPStandardsMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPStandardsMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Standards Master"],"summary":"List Cp Standards Master","description":"List all Standards Master records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_standards_master_api_v1_standards__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPStandardsMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/standards/{std_id}":{"get":{"tags":["Standards Master"],"summary":"Get Cp Standards Master","description":"Get a single Standards Master record by ID\n\n- Returns 404 if not found","operationId":"get_cp_standards_master_api_v1_standards__std_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPStandardsMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Standards Master"],"summary":"Update Cp Standards Master","description":"Update a Standards Master record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_standards_master_api_v1_standards__std_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPStandardsMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPStandardsMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Standards Master"],"summary":"Delete Cp Standards Master","description":"Delete a Standards Master record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_standards_master_api_v1_standards__std_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/standards/{std_id}/level-config":{"patch":{"tags":["Standards Master"],"summary":"Update Level Config","description":"Update the hierarchy level configuration for a standard.\n\nSets the number of levels and their display names.\n\n- **level_no**: Total number of levels (e.g. 3 for Requirements → Controls → Activities)\n- **level_names**: Ordered list of level names (e.g. [\"Requirements\", \"Controls\", \"Activities\"])\n\nThe `level_names` list is stored internally as a comma-separated string and must have\nexactly `level_no` entries.","operationId":"update_level_config_api_v1_standards__std_id__level_config_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPLevelConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPLevelConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/standards/{std_id}/levels/{level}/data":{"get":{"tags":["Standard Level Data"],"summary":"List Level Data","description":"List all data entries for a given standard at a specific hierarchy level.\n\n- Supports search, parent filtering, and pagination.","operationId":"list_level_data_api_v1_standards__std_id__levels__level__data_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"level","in":"path","required":true,"schema":{"type":"integer","title":"Level"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Items per page","default":50,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in code or title","title":"Search"},"description":"Search in code or title"},{"name":"parent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by parent_control_id","title":"Parent Id"},"description":"Filter by parent_control_id"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active status","title":"Is Active"},"description":"Filter by active status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPControlMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Standard Level Data"],"summary":"Create Level Data","description":"Create a new data entry for a standard at a specific hierarchy level.\n\n- parent_control_id is optional (null for root-level entries).\n- If provided, the parent must belong to the same standard and be one level above.","operationId":"create_level_data_api_v1_standards__std_id__levels__level__data_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"level","in":"path","required":true,"schema":{"type":"integer","title":"Level"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPControlMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPControlMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/standards/{std_id}/levels/{level}/data/{control_id}":{"get":{"tags":["Standard Level Data"],"summary":"Get Level Data","description":"Get a single data entry by control_id, scoped to standard and level.","operationId":"get_level_data_api_v1_standards__std_id__levels__level__data__control_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"level","in":"path","required":true,"schema":{"type":"integer","title":"Level"}},{"name":"control_id","in":"path","required":true,"schema":{"type":"integer","title":"Control Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPControlMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Standard Level Data"],"summary":"Update Level Data","description":"Update a data entry by control_id, scoped to standard and level.\n\n- Only updates provided (non-null) fields.","operationId":"update_level_data_api_v1_standards__std_id__levels__level__data__control_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"level","in":"path","required":true,"schema":{"type":"integer","title":"Level"}},{"name":"control_id","in":"path","required":true,"schema":{"type":"integer","title":"Control Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPControlMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPControlMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Standard Level Data"],"summary":"Delete Level Data","description":"Delete a data entry by control_id, scoped to standard and level.\n\n- Also deletes all child entries (cascading via FK).\n- Returns 204 on success.","operationId":"delete_level_data_api_v1_standards__std_id__levels__level__data__control_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"level","in":"path","required":true,"schema":{"type":"integer","title":"Level"}},{"name":"control_id","in":"path","required":true,"schema":{"type":"integer","title":"Control Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/standards/{std_id}/hierarchy":{"get":{"tags":["Standard Hierarchy Tree"],"summary":"Get Standard Hierarchy Tree","description":"Get the full hierarchy tree for a standard.\n\nReturns all levels nested as a tree: L1 → L2 → L3 → ...\nEach node contains its children recursively.","operationId":"get_standard_hierarchy_tree_api_v1_standards__std_id__hierarchy_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","description":"Include inactive entries","default":false,"title":"Include Inactive"},"description":"Include inactive entries"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHierarchyTreeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cp-roles/":{"post":{"tags":["CP Roles"],"summary":"Create Cp Role Master","description":"Create a new CP Roles record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_role_master_api_v1_cp_roles__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["CP Roles"],"summary":"List Cp Role Master","description":"List all CP Roles records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_role_master_api_v1_cp_roles__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cp-roles/{role_id}":{"get":{"tags":["CP Roles"],"summary":"Get Cp Role Master","description":"Get a single CP Roles record by ID\n\n- Returns 404 if not found","operationId":"get_cp_role_master_api_v1_cp_roles__role_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["CP Roles"],"summary":"Update Cp Role Master","description":"Update a CP Roles record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_role_master_api_v1_cp_roles__role_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["CP Roles"],"summary":"Delete Cp Role Master","description":"Delete a CP Roles record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_role_master_api_v1_cp_roles__role_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"integer","title":"Role Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cp-users/":{"post":{"tags":["CP Users"],"summary":"Create Cp User Master","description":"Create a new CP Users record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_user_master_api_v1_cp_users__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPUserMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPUserMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["CP Users"],"summary":"List Cp User Master","description":"List all CP Users records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_user_master_api_v1_cp_users__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPUserMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cp-users/{user_id}":{"get":{"tags":["CP Users"],"summary":"Get Cp User Master","description":"Get a single CP Users record by ID\n\n- Returns 404 if not found","operationId":"get_cp_user_master_api_v1_cp_users__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPUserMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["CP Users"],"summary":"Update Cp User Master","description":"Update a CP Users record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_user_master_api_v1_cp_users__user_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPUserMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPUserMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["CP Users"],"summary":"Delete Cp User Master","description":"Delete a CP Users record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_user_master_api_v1_cp_users__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cp-users/my-licenses":{"get":{"tags":["CP Users"],"summary":"Get My Licenses","description":"Get the logged-in CP user's licenses\n\n- Requires CP user authentication\n- Returns licenses for the user's client","operationId":"get_my_licenses_api_v1_cp_users_my_licenses_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientLicenseResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/cp-role-mappings/":{"post":{"tags":["CP Role User Mapping"],"summary":"Create Cp Role User Mapping","description":"Create a new CP Role User Mapping record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_role_user_mapping_api_v1_cp_role_mappings__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleUserMappingCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleUserMappingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["CP Role User Mapping"],"summary":"List Cp Role User Mapping","description":"List all CP Role User Mapping records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_role_user_mapping_api_v1_cp_role_mappings__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleUserMappingListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cp-role-mappings/{sl_no}":{"get":{"tags":["CP Role User Mapping"],"summary":"Get Cp Role User Mapping","description":"Get a single CP Role User Mapping record by ID\n\n- Returns 404 if not found","operationId":"get_cp_role_user_mapping_api_v1_cp_role_mappings__sl_no__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sl_no","in":"path","required":true,"schema":{"type":"integer","title":"Sl No"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleUserMappingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["CP Role User Mapping"],"summary":"Update Cp Role User Mapping","description":"Update a CP Role User Mapping record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_role_user_mapping_api_v1_cp_role_mappings__sl_no__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sl_no","in":"path","required":true,"schema":{"type":"integer","title":"Sl No"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleUserMappingUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPRoleUserMappingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["CP Role User Mapping"],"summary":"Delete Cp Role User Mapping","description":"Delete a CP Role User Mapping record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_role_user_mapping_api_v1_cp_role_mappings__sl_no__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sl_no","in":"path","required":true,"schema":{"type":"integer","title":"Sl No"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/":{"post":{"tags":["Standards Hierarchy"],"summary":"Create Standard","description":"Create a new compliance standard","operationId":"create_standard_api_v1_hierarchy__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Standards Hierarchy"],"summary":"List Standards","description":"List all standards with pagination","operationId":"list_standards_api_v1_hierarchy__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"title":"Is Active"}},{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/{std_id}":{"get":{"tags":["Standards Hierarchy"],"summary":"Get Standard","description":"Get a single standard by ID","operationId":"get_standard_api_v1_hierarchy__std_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Standards Hierarchy"],"summary":"Update Standard","description":"Update a standard","operationId":"update_standard_api_v1_hierarchy__std_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Standards Hierarchy"],"summary":"Delete Standard","description":"Soft delete a standard","operationId":"delete_standard_api_v1_hierarchy__std_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/{std_id}/levels":{"post":{"tags":["Standards Hierarchy"],"summary":"Create Level Name","description":"Add a level name to a standard (e.g., Level 1 = Domain, Level 2 = Sub-domain)","operationId":"create_level_name_api_v1_hierarchy__std_id__levels_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardLevelNameCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardLevelNameResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Standards Hierarchy"],"summary":"Get Level Names","description":"Get all level names for a standard","operationId":"get_level_names_api_v1_hierarchy__std_id__levels_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardLevelNameListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Standards Hierarchy"],"summary":"Delete All Level Names","description":"Delete all level names for a standard","operationId":"delete_all_level_names_api_v1_hierarchy__std_id__levels_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/{std_id}/levels/bulk":{"post":{"tags":["Standards Hierarchy"],"summary":"Create Level Names Bulk","description":"Add multiple level names to a standard at once","operationId":"create_level_names_bulk_api_v1_hierarchy__std_id__levels_bulk_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardLevelNameBulkCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardLevelNameListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/{std_id}/levels/{level_no}":{"get":{"tags":["Standards Hierarchy"],"summary":"Get Level Name","description":"Get a specific level name by level number","operationId":"get_level_name_api_v1_hierarchy__std_id__levels__level_no__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"level_no","in":"path","required":true,"schema":{"type":"integer","title":"Level No"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardLevelNameResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Standards Hierarchy"],"summary":"Update Level Name","description":"Update a level name","operationId":"update_level_name_api_v1_hierarchy__std_id__levels__level_no__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"level_no","in":"path","required":true,"schema":{"type":"integer","title":"Level No"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardLevelNameUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardLevelNameResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Standards Hierarchy"],"summary":"Delete Level Name","description":"Delete a specific level name","operationId":"delete_level_name_api_v1_hierarchy__std_id__levels__level_no__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}},{"name":"level_no","in":"path","required":true,"schema":{"type":"integer","title":"Level No"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/controls":{"post":{"tags":["Standards Hierarchy"],"summary":"Create Control","description":"Create a new control","operationId":"create_control_api_v1_hierarchy_controls_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Standards Hierarchy"],"summary":"List Controls","description":"List controls with filters","operationId":"list_controls_api_v1_hierarchy_controls_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"std_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Std Id"}},{"name":"parent_control_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id"}},{"name":"hierarchy_level","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Hierarchy Level"}},{"name":"is_applicable","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Applicable"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"title":"Is Active"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/controls/root":{"get":{"tags":["Standards Hierarchy"],"summary":"Get Root Controls","description":"Get all root controls (controls without parent) for a standard","operationId":"get_root_controls_api_v1_hierarchy_controls_root_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"query","required":true,"schema":{"type":"integer","description":"Standard ID","title":"Std Id"},"description":"Standard ID"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/controls/{control_id}":{"get":{"tags":["Standards Hierarchy"],"summary":"Get Control","description":"Get a single control by ID","operationId":"get_control_api_v1_hierarchy_controls__control_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"control_id","in":"path","required":true,"schema":{"type":"integer","title":"Control Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Standards Hierarchy"],"summary":"Update Control","description":"Update a control","operationId":"update_control_api_v1_hierarchy_controls__control_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"control_id","in":"path","required":true,"schema":{"type":"integer","title":"Control Id"}},{"name":"cascade_to_children","in":"query","required":false,"schema":{"type":"boolean","description":"Cascade applicability to children","default":false,"title":"Cascade To Children"},"description":"Cascade applicability to children"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Standards Hierarchy"],"summary":"Delete Control","description":"Soft delete a control","operationId":"delete_control_api_v1_hierarchy_controls__control_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"control_id","in":"path","required":true,"schema":{"type":"integer","title":"Control Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/controls/{control_id}/cascade-applicability":{"post":{"tags":["Standards Hierarchy"],"summary":"Cascade Control Applicability","description":"Explicitly cascade applicability to all children","operationId":"cascade_control_applicability_api_v1_hierarchy_controls__control_id__cascade_applicability_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"control_id","in":"path","required":true,"schema":{"type":"integer","title":"Control Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CascadeApplicabilityRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CascadeApplicabilityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/hierarchy/tree":{"get":{"tags":["Standards Hierarchy"],"summary":"Get Hierarchy Tree","description":"Get complete hierarchical tree for a standard","operationId":"get_hierarchy_tree_api_v1_hierarchy_hierarchy_tree_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"query","required":true,"schema":{"type":"integer","description":"Standard ID","title":"Std Id"},"description":"Standard ID"},{"name":"include_not_applicable","in":"query","required":false,"schema":{"type":"boolean","description":"Include not applicable items","default":true,"title":"Include Not Applicable"},"description":"Include not applicable items"},{"name":"is_active","in":"query","required":false,"schema":{"type":"boolean","description":"Only active items","default":true,"title":"Is Active"},"description":"Only active items"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HierarchyTreeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/hierarchy/stats":{"get":{"tags":["Standards Hierarchy"],"summary":"Get Hierarchy Stats","description":"Get statistics about hierarchy","operationId":"get_hierarchy_stats_api_v1_hierarchy_hierarchy_stats_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by standard ID","title":"Std Id"},"description":"Filter by standard ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HierarchyStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/controls/{control_id}/depth-info":{"get":{"tags":["Standards Hierarchy"],"summary":"Get Control Depth Info","description":"Get detailed depth and path information for a control","operationId":"get_control_depth_info_api_v1_hierarchy_controls__control_id__depth_info_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"control_id","in":"path","required":true,"schema":{"type":"integer","title":"Control Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlDepthInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/import/excel":{"post":{"tags":["Standards Hierarchy"],"summary":"Import Hierarchy From Excel","description":"Import hierarchy data from an Excel file.\n\nEXPECTED EXCEL STRUCTURE:\n\nRequirements Sheet (Level 1 - Root):\n- Column A: Requirement ID/Code\n- Column B: Requirement Title/Name\n- Column C: Requirement Description\n- Column D: Applicability (Yes/No)\n\nControls Sheet (Level 2+):\n- Column A: Control ID/Code\n- Column B: Control Title/Name\n- Column C: Control Description\n- Column D: Parent ID (can be Requirement ID or another Control ID for sub-controls)\n- Column E: Applicability (Yes/No)\n- Column F: Remarks\n\nActivities Sheet (Level 3):\n- Column A: Activity Code\n- Column B: Control Code (parent)\n- Column C: External Activity ID / Description\n- Column D: Applicability (Yes/No)\n- Column E: Remarks\n\nCASCADING APPLICABILITY:\nIf any parent is marked as \"not applicable\", all its children will automatically\nbecome \"not applicable\".","operationId":"import_hierarchy_from_excel_api_v1_hierarchy_import_excel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_code","in":"query","required":true,"schema":{"type":"string","description":"Standard code (e.g., ISO27K, SOC2, NCA_ECC)","title":"Std Code"},"description":"Standard code (e.g., ISO27K, SOC2, NCA_ECC)"},{"name":"std_name","in":"query","required":true,"schema":{"type":"string","description":"Standard full name","title":"Std Name"},"description":"Standard full name"},{"name":"std_version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Standard version","title":"Std Version"},"description":"Standard version"},{"name":"requirements_sheet","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Requirements sheet name (auto-detect if not provided)","title":"Requirements Sheet"},"description":"Requirements sheet name (auto-detect if not provided)"},{"name":"controls_sheet","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Controls sheet name (auto-detect if not provided)","title":"Controls Sheet"},"description":"Controls sheet name (auto-detect if not provided)"},{"name":"activities_sheet","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Activities sheet name (auto-detect if not provided)","title":"Activities Sheet"},"description":"Activities sheet name (auto-detect if not provided)"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_hierarchy_from_excel_api_v1_hierarchy_import_excel_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkImportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/hierarchy/import/template-info":{"get":{"tags":["Standards Hierarchy"],"summary":"Get Import Template Info","description":"Get information about the expected Excel template structure for importing hierarchy data.","operationId":"get_import_template_info_api_v1_hierarchy_import_template_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/cram/import/excel":{"post":{"tags":["Control Risk Activity Master"],"summary":"Import Cram Excel","description":"Upload the CRAM workbook. Rows are upserted on GRC_CRA_ID.\n\nThe upload is all-or-nothing: an unknown domain code, a missing or\nduplicated GRC_CRA_ID, or a bad number rejects the whole file with the\noffending rows listed, and nothing is written. A half-applied master would\nhand clients a mix of old and new activities.\n\nRows already stored but absent from the file are left untouched and\nreported under not_in_file.","operationId":"import_cram_excel_api_v1_cram_import_excel_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_cram_excel_api_v1_cram_import_excel_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/cram/summary":{"get":{"tags":["Control Risk Activity Master"],"summary":"Cram Summary","description":"Active activity counts per domain, with the governance each maps to.","operationId":"cram_summary_api_v1_cram_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/cram/by-standard/{std_id}":{"get":{"tags":["Control Risk Activity Master"],"summary":"List Cram For Standard","description":"Active CRAM rows of a standard's governance domain, for the structure\npages. CRAM is not tied to individual controls, so this is every activity\nof the domain the standard belongs to.","operationId":"list_cram_for_standard_api_v1_cram_by_standard__std_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"std_id","in":"path","required":true,"schema":{"type":"integer","title":"Std Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cram/":{"get":{"tags":["Control Risk Activity Master"],"summary":"List Cram","operationId":"list_cram_api_v1_cram__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Page Size"}},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"GRC_Gov_Domain code, e.g. CYSE","title":"Domain"},"description":"GRC_Gov_Domain code, e.g. CYSE"},{"name":"gov_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gov Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcontent-types/":{"post":{"tags":["Help Content Types"],"summary":"Create Cp Helpcontent Type Master","description":"Create a new Help Content Types record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_helpcontent_type_master_api_v1_helpcontent_types__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentTypeMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentTypeMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Help Content Types"],"summary":"List Cp Helpcontent Type Master","description":"List all Help Content Types records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_helpcontent_type_master_api_v1_helpcontent_types__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentTypeMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcontent-types/{helpcontent_type_id}":{"get":{"tags":["Help Content Types"],"summary":"Get Cp Helpcontent Type Master","description":"Get a single Help Content Types record by ID\n\n- Returns 404 if not found","operationId":"get_cp_helpcontent_type_master_api_v1_helpcontent_types__helpcontent_type_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"helpcontent_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Helpcontent Type Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentTypeMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Help Content Types"],"summary":"Update Cp Helpcontent Type Master","description":"Update a Help Content Types record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_helpcontent_type_master_api_v1_helpcontent_types__helpcontent_type_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"helpcontent_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Helpcontent Type Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentTypeMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentTypeMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Help Content Types"],"summary":"Delete Cp Helpcontent Type Master","description":"Delete a Help Content Types record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_helpcontent_type_master_api_v1_helpcontent_types__helpcontent_type_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"helpcontent_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Helpcontent Type Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcontent/":{"post":{"tags":["Help Content"],"summary":"Create Cp Helpcontent Master","description":"Create a new Help Content record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_helpcontent_master_api_v1_helpcontent__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Help Content"],"summary":"List Cp Helpcontent Master","description":"List all Help Content records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_helpcontent_master_api_v1_helpcontent__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcontent/{helpcontent_id}":{"get":{"tags":["Help Content"],"summary":"Get Cp Helpcontent Master","description":"Get a single Help Content record by ID\n\n- Returns 404 if not found","operationId":"get_cp_helpcontent_master_api_v1_helpcontent__helpcontent_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"helpcontent_id","in":"path","required":true,"schema":{"type":"integer","title":"Helpcontent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Help Content"],"summary":"Update Cp Helpcontent Master","description":"Update a Help Content record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_helpcontent_master_api_v1_helpcontent__helpcontent_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"helpcontent_id","in":"path","required":true,"schema":{"type":"integer","title":"Helpcontent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPHelpContentMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Help Content"],"summary":"Delete Cp Helpcontent Master","description":"Delete a Help Content record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_helpcontent_master_api_v1_helpcontent__helpcontent_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"helpcontent_id","in":"path","required":true,"schema":{"type":"integer","title":"Helpcontent Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-types/":{"post":{"tags":["Document Types"],"summary":"Create Cp Document Type Master","description":"Create a new Document Types record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_document_type_master_api_v1_document_types__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentTypeMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentTypeMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Document Types"],"summary":"List Cp Document Type Master","description":"List all Document Types records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_document_type_master_api_v1_document_types__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentTypeMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-types/{document_type_id}":{"get":{"tags":["Document Types"],"summary":"Get Cp Document Type Master","description":"Get a single Document Types record by ID\n\n- Returns 404 if not found","operationId":"get_cp_document_type_master_api_v1_document_types__document_type_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Type Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentTypeMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Document Types"],"summary":"Update Cp Document Type Master","description":"Update a Document Types record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_document_type_master_api_v1_document_types__document_type_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Type Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentTypeMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentTypeMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Document Types"],"summary":"Delete Cp Document Type Master","description":"Delete a Document Types record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_document_type_master_api_v1_document_types__document_type_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Type Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/":{"post":{"tags":["Documents"],"summary":"Create Cp Document Master","description":"Create a new Documents record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_document_master_api_v1_documents__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Documents"],"summary":"List Cp Document Master","description":"List all Documents records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_document_master_api_v1_documents__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/{document_id}":{"get":{"tags":["Documents"],"summary":"Get Cp Document Master","description":"Get a single Documents record by ID\n\n- Returns 404 if not found","operationId":"get_cp_document_master_api_v1_documents__document_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Documents"],"summary":"Update Cp Document Master","description":"Update a Documents record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_document_master_api_v1_documents__document_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Documents"],"summary":"Delete Cp Document Master","description":"Delete a Documents record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_document_master_api_v1_documents__document_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-history/":{"post":{"tags":["Document History"],"summary":"Create Cp Document History","description":"Create a new Document History record\n\n- Requires authentication\n- Returns the created record","operationId":"create_cp_document_history_api_v1_document_history__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentHistoryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Document History"],"summary":"List Cp Document History","description":"List all Document History records with pagination\n\n- Supports search filtering\n- Returns paginated results","operationId":"list_cp_document_history_api_v1_document_history__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentHistoryListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document-history/{doc_history_id}":{"get":{"tags":["Document History"],"summary":"Get Cp Document History","description":"Get a single Document History record by ID\n\n- Returns 404 if not found","operationId":"get_cp_document_history_api_v1_document_history__doc_history_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"doc_history_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc History Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Document History"],"summary":"Update Cp Document History","description":"Update a Document History record\n\n- Only updates provided fields\n- Returns 404 if not found","operationId":"update_cp_document_history_api_v1_document_history__doc_history_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"doc_history_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc History Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentHistoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPDocumentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Document History"],"summary":"Delete Cp Document History","description":"Delete a Document History record\n\n- Returns 404 if not found\n- Returns 204 on success","operationId":"delete_cp_document_history_api_v1_document_history__doc_history_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"doc_history_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc History Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/objectives/":{"post":{"tags":["Objectives Master (M3W4)"],"summary":"Create Objective","description":"M3W4: Create a new Objective\n\nObjectives are used in Performance Management workflows (C4W1-C4W3).\nEach objective can be linked to a governance domain and standard.","operationId":"create_objective_api_v1_objectives__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPObjectivesMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPObjectivesMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Objectives Master (M3W4)"],"summary":"List Objectives","description":"List all Objectives with pagination and filters\n\nSupports filtering by:\n- governance_id: Filter by governance domain\n- objective_type: Filter by type (Strategic, Operational, Compliance)\n- is_active: Filter by active status\n- search: Search in code and title","operationId":"list_objectives_api_v1_objectives__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"},{"name":"governance_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by governance domain","title":"Governance Id"},"description":"Filter by governance domain"},{"name":"objective_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by type","title":"Objective Type"},"description":"Filter by type"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active status","title":"Is Active"},"description":"Filter by active status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPObjectivesMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/objectives/{objective_id}":{"get":{"tags":["Objectives Master (M3W4)"],"summary":"Get Objective","description":"Get a single Objective by ID","operationId":"get_objective_api_v1_objectives__objective_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"objective_id","in":"path","required":true,"schema":{"type":"integer","title":"Objective Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPObjectivesMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Objectives Master (M3W4)"],"summary":"Update Objective","description":"Update an Objective\n\nOnly updates provided fields.","operationId":"update_objective_api_v1_objectives__objective_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"objective_id","in":"path","required":true,"schema":{"type":"integer","title":"Objective Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPObjectivesMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPObjectivesMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Objectives Master (M3W4)"],"summary":"Delete Objective","description":"Soft delete an Objective\n\nSets is_active = False instead of permanently deleting.","operationId":"delete_objective_api_v1_objectives__objective_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"objective_id","in":"path","required":true,"schema":{"type":"integer","title":"Objective Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/objectives/by-governance/{governance_id}":{"get":{"tags":["Objectives Master (M3W4)"],"summary":"Get Objectives By Governance","description":"Get all objectives for a specific governance domain","operationId":"get_objectives_by_governance_api_v1_objectives_by_governance__governance_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"governance_id","in":"path","required":true,"schema":{"type":"integer","title":"Governance Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPObjectivesMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance-periods/":{"post":{"tags":["Compliance Periods (M3W5)"],"summary":"Create Compliance Period","description":"M3W5/C9W3: Create a new Compliance Period\n\nCompliance periods define the timeframe for compliance activities.\nCan be linked to a specific license allocation.","operationId":"create_compliance_period_api_v1_compliance_periods__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPCompliancePeriodsCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPCompliancePeriodsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Compliance Periods (M3W5)"],"summary":"List Compliance Periods","description":"List all Compliance Periods with pagination and filters","operationId":"list_compliance_periods_api_v1_compliance_periods__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"},{"name":"allocation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by allocation","title":"Allocation Id"},"description":"Filter by allocation"},{"name":"standard_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by standard","title":"Standard Id"},"description":"Filter by standard"},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status Filter"},"description":"Filter by status"},{"name":"is_closed","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by closed status","title":"Is Closed"},"description":"Filter by closed status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPCompliancePeriodsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance-periods/{comp_period_id}":{"get":{"tags":["Compliance Periods (M3W5)"],"summary":"Get Compliance Period","description":"Get a single Compliance Period by ID","operationId":"get_compliance_period_api_v1_compliance_periods__comp_period_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"comp_period_id","in":"path","required":true,"schema":{"type":"integer","title":"Comp Period Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPCompliancePeriodsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Compliance Periods (M3W5)"],"summary":"Update Compliance Period","description":"Update a Compliance Period\n\nCan only update periods that are not closed.","operationId":"update_compliance_period_api_v1_compliance_periods__comp_period_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"comp_period_id","in":"path","required":true,"schema":{"type":"integer","title":"Comp Period Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPCompliancePeriodsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPCompliancePeriodsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Compliance Periods (M3W5)"],"summary":"Delete Compliance Period","description":"Delete a Compliance Period\n\nCan only delete periods in Draft status.","operationId":"delete_compliance_period_api_v1_compliance_periods__comp_period_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"comp_period_id","in":"path","required":true,"schema":{"type":"integer","title":"Comp Period Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance-periods/{comp_period_id}/activate":{"post":{"tags":["Compliance Periods (M3W5)"],"summary":"Activate Compliance Period","description":"C9W4: Activate a Compliance Period\n\nChanges status from Draft to Active.\nOptionally generates assignments for all applicable activities.","operationId":"activate_compliance_period_api_v1_compliance_periods__comp_period_id__activate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"comp_period_id","in":"path","required":true,"schema":{"type":"integer","title":"Comp Period Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivatePeriodRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance-periods/{comp_period_id}/close":{"post":{"tags":["Compliance Periods (M3W5)"],"summary":"Close Compliance Period","description":"C9W5: Close a Compliance Period\n\nChanges status to Closed. Requires all assignments to be completed\nunless force_close is True.","operationId":"close_compliance_period_api_v1_compliance_periods__comp_period_id__close_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"comp_period_id","in":"path","required":true,"schema":{"type":"integer","title":"Comp Period Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClosePeriodRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodWorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance-periods/{comp_period_id}/generate-assignments":{"post":{"tags":["Compliance Periods (M3W5)"],"summary":"Generate Assignments","description":"Generate assignments for a compliance period\n\nCreates assignment records in the client schema for all applicable activities.\nPeriod must be Active and have a valid allocation.","operationId":"generate_assignments_api_v1_compliance_periods__comp_period_id__generate_assignments_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"comp_period_id","in":"path","required":true,"schema":{"type":"integer","title":"Comp Period Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssignmentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance-periods/by-allocation/{allocation_id}":{"get":{"tags":["Compliance Periods (M3W5)"],"summary":"Get Periods By Allocation","description":"Get all compliance periods for a specific license allocation","operationId":"get_periods_by_allocation_api_v1_compliance_periods_by_allocation__allocation_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPCompliancePeriodsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/indicators/":{"post":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"Create Indicator","description":"M3W4/C4W2: Create a new KPI or KRI\n\nKPIs (Key Performance Indicators) measure performance against objectives.\nKRIs (Key Risk Indicators) measure risk levels and thresholds.","operationId":"create_indicator_api_v1_indicators__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"List Indicators","description":"List all KPIs/KRIs with pagination and filters","operationId":"list_indicators_api_v1_indicators__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":10,"title":"Limit"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term","title":"Search"},"description":"Search term"},{"name":"indicator_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by type (KPI or KRI)","title":"Indicator Type"},"description":"Filter by type (KPI or KRI)"},{"name":"objective_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by objective","title":"Objective Id"},"description":"Filter by objective"},{"name":"governance_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by governance domain","title":"Governance Id"},"description":"Filter by governance domain"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active status","title":"Is Active"},"description":"Filter by active status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/indicators/{indicator_id}":{"get":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"Get Indicator","description":"Get a single Indicator by ID","operationId":"get_indicator_api_v1_indicators__indicator_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"indicator_id","in":"path","required":true,"schema":{"type":"integer","title":"Indicator Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"Update Indicator","description":"Update an Indicator\n\nOnly updates provided fields.","operationId":"update_indicator_api_v1_indicators__indicator_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"indicator_id","in":"path","required":true,"schema":{"type":"integer","title":"Indicator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"Delete Indicator","description":"Soft delete an Indicator\n\nSets is_active = False instead of permanently deleting.","operationId":"delete_indicator_api_v1_indicators__indicator_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"indicator_id","in":"path","required":true,"schema":{"type":"integer","title":"Indicator Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/indicators/{indicator_id}/update-value":{"post":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"Update Indicator Value","description":"C4W3: Update indicator current value\n\nUpdates the current measured value and calculates status.","operationId":"update_indicator_value_api_v1_indicators__indicator_id__update_value_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"indicator_id","in":"path","required":true,"schema":{"type":"integer","title":"Indicator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateIndicatorValueRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateIndicatorValueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/indicators/by-objective/{objective_id}":{"get":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"Get Kpis By Objective","description":"Get all KPIs linked to a specific objective","operationId":"get_kpis_by_objective_api_v1_indicators_by_objective__objective_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"objective_id","in":"path","required":true,"schema":{"type":"integer","title":"Objective Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/indicators/type/kpi":{"get":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"Get All Kpis","description":"Get all KPIs (Key Performance Indicators)","operationId":"get_all_kpis_api_v1_indicators_type_kpi_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/indicators/type/kri":{"get":{"tags":["KPI/KRI Indicators (M3W4)"],"summary":"Get All Kris","description":"Get all KRIs (Key Risk Indicators)","operationId":"get_all_kris_api_v1_indicators_type_kri_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CPIndicatorMasterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/email/config-status":{"get":{"tags":["Email Service"],"summary":"Get Email Config Status","description":"Get current email configuration status\n\n- Checks if SMTP is configured\n- Returns configuration details (excluding password)\n- **Admin Only**","operationId":"get_email_config_status_api_v1_email_config_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailConfigStatusResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/email/send-portal-access":{"post":{"tags":["Email Service"],"summary":"Send Portal Access Email","description":"Send client portal access email to a registered client\n\n- Generates a secure access link with JWT token\n- Link expires after configured hours (default: 72 hours)\n- **Admin Only**\n\n**Request Body:**\n- `client_id`: ID of the client to send email\n- `custom_message`: Optional custom message to include","operationId":"send_portal_access_email_api_v1_email_send_portal_access_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPortalAccessRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/email/send-portal-access/bulk":{"post":{"tags":["Email Service"],"summary":"Send Portal Access Bulk","description":"Send client portal access emails to multiple clients\n\n- Processes each client and sends individual emails\n- Returns detailed results for each client\n- **Admin Only**\n\n**Request Body:**\n- `client_ids`: List of client IDs to send emails\n- `custom_message`: Optional custom message to include in all emails","operationId":"send_portal_access_bulk_api_v1_email_send_portal_access_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPortalAccessBulkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendBulkEmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/email/verify-access-token":{"post":{"tags":["Email Service"],"summary":"Verify Access Token","description":"Verify a client portal access token\n\n- Used by the client portal to validate access links\n- Returns client details if token is valid\n- **Public endpoint** (no authentication required)\n\n**Request Body:**\n- `token`: JWT token from the access link","operationId":"verify_access_token_api_v1_email_verify_access_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAccessTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/email/resend-portal-access/{client_id}":{"post":{"tags":["Email Service"],"summary":"Resend Portal Access","description":"Resend client portal access email (convenience endpoint)\n\n- Quick way to resend access email without request body\n- **Admin Only**\n\n**Path Parameters:**\n- `client_id`: ID of the client to resend email","operationId":"resend_portal_access_api_v1_email_resend_portal_access__client_id__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/email/send-license-key":{"post":{"tags":["Email Service"],"summary":"Send License Key Email","description":"Send license key email to the client's contact email\n\nLooks up the license, retrieves the client's tenant_id, and sends\nan email containing: mp_license_id, client_id (tenant_id), license_key, standard_id.\n- **Admin Only**\n\n**Request Body:**\n- `license_id`: ID of the license in mp_license_master","operationId":"send_license_key_email_api_v1_email_send_license_key_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendLicenseKeyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/email/clients-pending-access":{"get":{"tags":["Email Service"],"summary":"Get Clients Pending Access","description":"Get list of active clients with email addresses\n\n- Returns clients that can receive portal access emails\n- Useful for bulk sending operations\n- **Admin Only**","operationId":"get_clients_pending_access_api_v1_email_clients_pending_access_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/storage-settings/supported-file-types":{"get":{"tags":["Storage Settings"],"summary":"Get Supported File Types","description":"Get list of supported file types\n\n- Returns categorized file types (images, videos, documents)\n- **Public endpoint**","operationId":"get_supported_file_types_api_v1_storage_settings_supported_file_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportedFileTypesResponse"}}}}}}},"/api/v1/storage-settings/test-connection":{"post":{"tags":["Storage Settings"],"summary":"Test Storage Connection","description":"Test storage connection without saving\n\n- Tests connectivity to the specified storage provider\n- Does not save any configuration\n- **Admin Only**","operationId":"test_storage_connection_api_v1_storage_settings_test_connection_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/storage-settings/":{"post":{"tags":["Storage Settings"],"summary":"Create Storage Settings","description":"Create new storage configuration\n\n- Creates storage settings for global (client_id=None) or specific client\n- Only one active configuration per client/global is recommended\n- **Admin Only**","operationId":"create_storage_settings_api_v1_storage_settings__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettingsCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Storage Settings"],"summary":"List Storage Settings","description":"List all storage configurations\n\n- Filter by client_id or get all\n- Option to include inactive configurations\n- **Admin Only**","operationId":"list_storage_settings_api_v1_storage_settings__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by client ID","title":"Client Id"},"description":"Filter by client ID"},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only return active settings","default":true,"title":"Active Only"},"description":"Only return active settings"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettingsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/storage-settings/active":{"get":{"tags":["Storage Settings"],"summary":"Get Active Storage Settings","description":"Get the active storage configuration\n\n- Returns active settings for specified client or global default\n- **Admin Only**","operationId":"get_active_storage_settings_api_v1_storage_settings_active_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Client ID (NULL for global)","title":"Client Id"},"description":"Client ID (NULL for global)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/storage-settings/{setting_id}":{"get":{"tags":["Storage Settings"],"summary":"Get Storage Settings","description":"Get storage configuration by ID\n\n- **Admin Only**","operationId":"get_storage_settings_api_v1_storage_settings__setting_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"setting_id","in":"path","required":true,"schema":{"type":"integer","title":"Setting Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Storage Settings"],"summary":"Update Storage Settings","description":"Update storage configuration\n\n- **Admin Only**","operationId":"update_storage_settings_api_v1_storage_settings__setting_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"setting_id","in":"path","required":true,"schema":{"type":"integer","title":"Setting Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Storage Settings"],"summary":"Delete Storage Settings","description":"Delete storage configuration\n\n- **Admin Only**","operationId":"delete_storage_settings_api_v1_storage_settings__setting_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"setting_id","in":"path","required":true,"schema":{"type":"integer","title":"Setting Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/storage-settings/{setting_id}/test":{"post":{"tags":["Storage Settings"],"summary":"Test Existing Configuration","description":"Test an existing storage configuration\n\n- Tests saved configuration without exposing credentials\n- **Admin Only**","operationId":"test_existing_configuration_api_v1_storage_settings__setting_id__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"setting_id","in":"path","required":true,"schema":{"type":"integer","title":"Setting Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/storage-settings/{setting_id}/files":{"get":{"tags":["Storage Settings"],"summary":"List Storage Files","description":"List files in a storage configuration\n\n- Lists all files in the configured storage\n- Optional prefix to filter by folder/path\n- **Any authenticated user can list files from their preferred storage**","operationId":"list_storage_files_api_v1_storage_settings__setting_id__files_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"setting_id","in":"path","required":true,"schema":{"type":"integer","title":"Setting Id"}},{"name":"prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Path prefix/subfolder to filter files","default":"","title":"Prefix"},"description":"Path prefix/subfolder to filter files"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Storage Files Api V1 Storage Settings  Setting Id  Files Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/storage-settings/{setting_id}/files/download":{"get":{"tags":["Storage Settings"],"summary":"Download File","description":"Download a file from storage\n\n- Downloads a file from the configured storage\n- Returns the file as a streaming response\n- **Any authenticated user can download files**","operationId":"download_file_api_v1_storage_settings__setting_id__files_download_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"setting_id","in":"path","required":true,"schema":{"type":"integer","title":"Setting Id"}},{"name":"file_path","in":"query","required":true,"schema":{"type":"string","description":"Path/key of the file to download","title":"File Path"},"description":"Path/key of the file to download"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/storage-settings/my-storage/files/download":{"get":{"tags":["Storage Settings"],"summary":"Download From My Storage","description":"Download a file using user's preferred storage\n\n- Uses the current user's storage preference\n- Falls back to global storage if no preference set\n- **Any authenticated user**","operationId":"download_from_my_storage_api_v1_storage_settings_my_storage_files_download_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"file_path","in":"query","required":true,"schema":{"type":"string","description":"Path/key of the file to download","title":"File Path"},"description":"Path/key of the file to download"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/storage-settings/my-storage/files":{"get":{"tags":["Storage Settings"],"summary":"List My Storage Files","description":"List files using user's preferred storage\n\n- Uses the current user's storage preference\n- Falls back to global storage if no preference set\n- **Any authenticated user**","operationId":"list_my_storage_files_api_v1_storage_settings_my_storage_files_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Path prefix/subfolder to filter files","default":"","title":"Prefix"},"description":"Path prefix/subfolder to filter files"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List My Storage Files Api V1 Storage Settings My Storage Files Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-dashboard/":{"get":{"tags":["Client Dashboard"],"summary":"Get Dashboard Overview","description":"Get complete dashboard overview for the logged-in client user.\n\nReturns:\n- User information (name, email for welcome message)\n- Client/Company information\n- All active licenses with details\n- Summary counts (total, active, expiring soon)\n\n**Access**: Client Portal Users only","operationId":"get_dashboard_overview_api_v1_client_dashboard__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardOverviewResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/client-dashboard/licenses":{"get":{"tags":["Client Dashboard"],"summary":"Get License List","description":"Get condensed list of all licenses for the logged-in client user.\n\nReturns summary information for each license:\n- Standard name\n- Tier level\n- Days remaining\n- Activation/Expiry status\n\n**Access**: Client Portal Users only","operationId":"get_license_list_api_v1_client_dashboard_licenses_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientLicenseListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/client-dashboard/licenses/{allocation_id}":{"get":{"tags":["Client Dashboard"],"summary":"Get License Detail","description":"Get detailed information for a specific license allocation.\n\n**Path Parameters:**\n- allocation_id: The license allocation ID\n\nReturns:\n- User and client information\n- Standard details (name, description)\n- License information (IDs, dates, status, license key)\n- Time remaining calculation\n- Plan details (tier, pricing)\n- Included features list\n\n**Access**: Client Portal Users only (can only view their own licenses)","operationId":"get_license_detail_api_v1_client_dashboard_licenses__allocation_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-dashboard/me":{"get":{"tags":["Client Dashboard"],"summary":"Get My Profile","description":"Get the logged-in client user's profile information.\n\nReturns:\n- User details (name, email, phone)\n- Associated client information\n- Total active licenses count\n\n**Access**: Client Portal Users only","operationId":"get_my_profile_api_v1_client_dashboard_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/client-dashboard/licenses/{allocation_id}/report":{"get":{"tags":["Client Dashboard"],"summary":"Download License Report","description":"Download a report for a specific license.\n\n**Path Parameters:**\n- allocation_id: The license allocation ID\n\n**Query Parameters:**\n- format: Report format (pdf, csv, json). Default: pdf\n\n**Access**: Client Portal Users only\n\n**Note**: This is a placeholder endpoint. Full report generation\nrequires integration with a reporting library.","operationId":"download_license_report_api_v1_client_dashboard_licenses__allocation_id__report_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"allocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Allocation Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"pdf","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/export-csv-to-local":{"post":{"tags":["Client CSV Exports"],"summary":"Export Csv To Local","description":"Export all master data tables to CSV and store the raw CSV content\nin the management database (mp_client_csv_exports table).\n\nRequires mp-admin role.","operationId":"export_csv_to_local_api_v1_clients__client_id__export_csv_to_local_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportCSVToLocalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/export-allocation-csv":{"post":{"tags":["Client CSV Exports"],"summary":"Export Csv For Allocations","description":"Export master data CSVs scoped to a client's approved license allocations.\n\n- Governance CSVs: one per unique governance_id across allocations\n- Standards CSVs: one per unique standard_id across allocations\n- All other reference/default data: exported once (full tables)\n\nRequires mp-admin role.","operationId":"export_csv_for_allocations_api_v1_clients__client_id__export_allocation_csv_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocationExportCSVResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/csv-exports":{"get":{"tags":["Client CSV Exports"],"summary":"List Csv Exports","description":"List all stored CSV exports for a client (metadata only, no csv_content).\n\nRequires mp-admin role.","operationId":"list_csv_exports_api_v1_clients__client_id__csv_exports_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSVExportListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/csv-exports/{export_id}":{"get":{"tags":["Client CSV Exports"],"summary":"Get Csv Export","description":"Get a specific CSV export record.\n\n- Default: Returns JSON with metadata + csv_content\n- ?download=true: Returns the CSV as a downloadable file\n\nRequires mp-admin role.","operationId":"get_csv_export_api_v1_clients__client_id__csv_exports__export_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}},{"name":"export_id","in":"path","required":true,"schema":{"type":"integer","title":"Export Id"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Set to true to download as CSV file","default":false,"title":"Download"},"description":"Set to true to download as CSV file"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/csv-exports/download-all":{"get":{"tags":["Client CSV Exports"],"summary":"Download All Csv Exports Zip","description":"Download all stored CSV exports for a client as a single ZIP file.\nData is filtered by the client's approved license allocations.\n\nRequires mp-admin role.","operationId":"download_all_csv_exports_zip_api_v1_clients__client_id__csv_exports_download_all_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/csv-exports/upload-to-storage":{"post":{"tags":["Client CSV Exports"],"summary":"Upload Csv Exports To Storage","description":"Upload all stored CSV exports for a client to the client's configured storage.\n\n1. Fetches all CSV exports for the client from mp_client_csv_exports.\n2. Resolves the client's active storage config (client-specific, fallback to global).\n3. Uploads each CSV file to storage via StorageService.upload_file().\n4. Returns per-file success/failure results.\n\nRequires mp-admin role.","operationId":"upload_csv_exports_to_storage_api_v1_clients__client_id__csv_exports_upload_to_storage_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadCSVToStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/tenant-tables":{"get":{"tags":["Client CSV Exports"],"summary":"List Tenant Tables","description":"List all tables in a client's tenant schema with row counts.\n\nRequires mp-admin role.","operationId":"list_tenant_tables_api_v1_clients__client_id__tenant_tables_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/tenant-tables/{table_name}/download":{"get":{"tags":["Client CSV Exports"],"summary":"Download Tenant Table Csv","description":"Download a specific table from the client's tenant schema as a CSV file.\n\nRequires mp-admin role.","operationId":"download_tenant_table_csv_api_v1_clients__client_id__tenant_tables__table_name__download_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}},{"name":"table_name","in":"path","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/v1/clients/{client_id}/tenant-tables/download-all":{"get":{"tags":["Client CSV Exports"],"summary":"Download All Tenant Tables Zip","description":"Download ALL tables from the client's tenant schema as a single ZIP\nfile containing individual CSV files.\n\nRequires mp-admin role.","operationId":"download_all_tenant_tables_zip_api_v1_clients__client_id__tenant_tables_download_all_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/{client_id}/resync-hierarchy":{"post":{"tags":["Client CSV Exports"],"summary":"Resync Client Hierarchy","description":"Re-sync cp_control_master and the dedicated hierarchy table(s) for a client.\n\nSafe to call multiple times — uses UPSERT so existing data is refreshed, not duplicated.\nActivities are not copied: they live in CRAM.\n\nUse this after seeding new controls into the management schema, or to fix\nclients whose tenant schema was created before controls were seeded.\n\nRequires mp-admin role.","operationId":"resync_client_hierarchy_api_v1_clients__client_id__resync_hierarchy_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/clients/resync-all-hierarchies":{"post":{"tags":["Client CSV Exports"],"summary":"Resync All Client Hierarchies","description":"Re-sync cp_control_master and hierarchy tables for ALL clients that have\nat least one approved allocation and a tenant schema.\n\nSafe to call on already-populated schemas — UPSERT ensures no duplicates.\nRun this after bulk-seeding controls into the management schema.\n\nRequires mp-admin role.","operationId":"resync_all_client_hierarchies_api_v1_clients_resync_all_hierarchies_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/client-tenant-access/":{"get":{"tags":["Client Tenant Access"],"summary":"List Tenant Access Records","description":"List all tenant access records.","operationId":"list_tenant_access_records_api_v1_client_tenant_access__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientTenantAccessListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/client-tenant-access/{tenant_id}":{"get":{"tags":["Client Tenant Access"],"summary":"Get Tenant Access By Tenant Id","description":"Get a tenant access record by tenant_id.","operationId":"get_tenant_access_by_tenant_id_api_v1_client_tenant_access__tenant_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MPClientTenantAccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-tenant-access/{client_id}/resend-activation-link":{"post":{"tags":["Client Tenant Access"],"summary":"Resend Access Code","description":"Regenerate the single-use activation link and dispatch the onboarding email.\n\nThe old /resend-access-code path is kept as an undocumented alias so a\nmanagement portal build deployed before this change keeps working.\n\n- tenant_id and entity_id stay the same (permanent identifiers).\n- A new single-use link token is generated; the record is updated (72h expiry).\n- The email is sent in a BACKGROUND task so this request returns\n  immediately and cannot hang into an nginx/Cloudflare 502. The actual\n  send result is logged with a [RESEND-EMAIL] marker.","operationId":"resend_access_code_api_v1_client_tenant_access__client_id__resend_activation_link_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendAccessCodeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-portal/download-csv":{"get":{"tags":["Client Portal Downloads","Client Portal Downloads"],"summary":"Download allocated CSV data as ZIP","description":"Download tables from the client's tenant schema as a ZIP file.\n\n**Requires** the license key that was sent to the client's registered email.\n\nOnly tables with actual data rows are included (blank tables are skipped).\nFor each approved gov-standard licence allocation, a dedicated controls CSV is\ngenerated inside a 'licenses/' folder, named after the governance and standard.\nAll other non-empty common tables are included at the root of the ZIP.","operationId":"download_client_csv_api_v1_client_portal_download_csv_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_key","in":"query","required":true,"schema":{"type":"string","description":"License key sent to your registered email","title":"License Key"},"description":"License key sent to your registered email"},{"name":"std_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated std_id list to restrict the package to. Omit for everything this licence covers.","title":"Std Ids"},"description":"Comma-separated std_id list to restrict the package to. Omit for everything this licence covers."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-portal/download-csv/{table_name}":{"get":{"tags":["Client Portal Downloads","Client Portal Downloads"],"summary":"Download a specific CSV file by table name","description":"Download a specific table from the client's tenant schema as a CSV file.\n\n**Requires** the license key that was sent to the client's registered email.\nStandards and governance tables are filtered by approved allocations.\nReturns 404 if the table is empty.","operationId":"download_single_csv_api_v1_client_portal_download_csv__table_name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"table_name","in":"path","required":true,"schema":{"type":"string","title":"Table Name"}},{"name":"license_key","in":"query","required":true,"schema":{"type":"string","description":"License key sent to your registered email","title":"License Key"},"description":"License key sent to your registered email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-portal/csv-list":{"get":{"tags":["Client Portal Downloads","Client Portal Downloads"],"summary":"List available CSV files","description":"List all available tables in the client's tenant schema with row counts.\nOnly tables with data are listed. Hierarchy tables are grouped under 'licenses'.\n\n**Requires** the license key that was sent to the client's registered email.","operationId":"list_client_csv_files_api_v1_client_portal_csv_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_key","in":"query","required":true,"schema":{"type":"string","description":"License key sent to your registered email","title":"License Key"},"description":"License key sent to your registered email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-portal/available-standards":{"get":{"tags":["Client Portal Downloads","Client Portal Downloads"],"summary":"List the standards this licence covers, to choose from","description":"The standards covered by this licence's governance domain - the menu the\nclient chooses from before any hierarchy is generated.\n\n`selected` marks what has already been chosen; `selection_made` is false\nuntil the first POST to /client-portal/selected-standards.","operationId":"list_available_standards_api_v1_client_portal_available_standards_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_key","in":"query","required":true,"schema":{"type":"string","description":"License key sent to your registered email","title":"License Key"},"description":"License key sent to your registered email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-portal/license-standards":{"get":{"tags":["Client Portal Downloads","Client Portal Downloads"],"summary":"List the standards this licence covers (client portal contract)","description":"The same menu as /available-standards, in the shape the client portal asks\nfor. Its activation page calls this path and expects a nested `governance`\nobject; /available-standards returns a flat governance_id and is what the\nselection flow here uses. Rather than break either caller, this serves both\noff one query.\n\nlevel_names is stored in the management schema as a comma-joined string but\nthe portal types it as Record<string, string>, so it is converted here -\nkeyed by level number, the same shape the tenant copy uses.","operationId":"list_license_standards_api_v1_client_portal_license_standards_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"license_key","in":"query","required":true,"schema":{"type":"string","description":"License key sent to your registered email","title":"License Key"},"description":"License key sent to your registered email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/client-portal/selected-standards":{"post":{"tags":["Client Portal Downloads","Client Portal Downloads"],"summary":"Submit chosen standards and get their hierarchy CSVs","description":"Record the client's standard selection and return the hierarchy CSVs for\nexactly those standards.\n\nThe selection is stored on the allocation, so a later regeneration rebuilds\nthe same set rather than every standard the governance covers. Re-posting\nreplaces the previous selection and rebuilds accordingly.\n\n**Requires** the license key that was sent to the client's registered email.","operationId":"submit_selected_standards_api_v1_client_portal_selected_standards_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectedStandardsRequest"}}},"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":[]}]}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ActivatePeriodRequest":{"properties":{"generate_assignments":{"type":"boolean","title":"Generate Assignments","description":"Generate assignments when activating","default":true}},"type":"object","title":"ActivatePeriodRequest","description":"Request to activate a compliance period"},"ActivationStatus":{"type":"string","enum":["Pending","Activated","Suspended","Deactivated"],"title":"ActivationStatus","description":"License Activation Status"},"ActivityDetailNode":{"properties":{"std_activity_id":{"type":"integer","title":"Std Activity Id"},"cs_activity_id":{"type":"integer","title":"Cs Activity Id"},"cs_activity_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cs Activity Title"},"cs_activity_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cs Activity Detail"},"is_applicable":{"type":"boolean","title":"Is Applicable","default":true},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"}},"type":"object","required":["std_activity_id","cs_activity_id"],"title":"ActivityDetailNode","description":"Activity node in hierarchical view"},"ActivityTreeNode":{"properties":{"activity_id":{"type":"integer","title":"Activity Id"},"activity_code":{"type":"string","title":"Activity Code"},"external_activity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Activity Id"},"activity_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activity Title"},"activity_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activity Detail"},"level_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Name"},"cp_activity_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cp Activity Id"},"doer_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doer Role"},"reviewer_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Role"},"frequency_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frequency Id"},"is_review":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Review"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"helpcontent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpcontent Id"},"input_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Detail"},"output_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Detail"},"is_applicable":{"type":"boolean","title":"Is Applicable"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["activity_id","activity_code","is_applicable","is_active"],"title":"ActivityTreeNode","description":"Leaf node of the control tree (the standard's last level).\n\nBuilt from leaf rows of cp_control_master. The enrichment fields below\nare always null: activities live in CRAM and are not tied to controls.\nThey are kept so the response shape does not change."},"AllocationCorrection":{"properties":{"subscription_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Subscription Start"},"subscription_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Subscription End"},"payment_status":{"anyOf":[{"$ref":"#/components/schemas/PaymentStatus"},{"type":"null"}]},"po_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id"},"admin_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Admin Email"},"resubmit":{"type":"boolean","title":"Resubmit","description":"Resubmit for review after correction","default":true}},"type":"object","title":"AllocationCorrection","description":"User correction for failed review"},"AllocationExportCSVResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"client_id":{"type":"integer","title":"Client Id"},"allocations_found":{"type":"integer","title":"Allocations Found"},"governance_ids":{"items":{"type":"integer"},"type":"array","title":"Governance Ids"},"standard_ids":{"items":{"type":"integer"},"type":"array","title":"Standard Ids"},"total_tables":{"type":"integer","title":"Total Tables"},"total_rows":{"type":"integer","title":"Total Rows"},"exports":{"items":{"$ref":"#/components/schemas/CSVExportStoredItem"},"type":"array","title":"Exports"}},"type":"object","required":["success","message","client_id","allocations_found","governance_ids","standard_ids","total_tables","total_rows","exports"],"title":"AllocationExportCSVResponse","description":"POST response for license-scoped CSV export."},"AllocationInfo":{"properties":{"allocation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Allocation Id"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"schema_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"}},"type":"object","title":"AllocationInfo","description":"Nested allocation info for response"},"AllocationReviewAction":{"properties":{"action":{"type":"string","title":"Action","description":"approve, reject, or request_correction"},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments","description":"Supervisor comments"}},"type":"object","required":["action"],"title":"AllocationReviewAction","description":"Supervisor review action"},"AllocationWorkflowResponse":{"properties":{"message":{"type":"string","title":"Message"},"allocation_id":{"type":"integer","title":"Allocation Id"},"previous_status":{"type":"string","title":"Previous Status"},"new_status":{"type":"string","title":"New Status"},"action_by":{"type":"integer","title":"Action By"},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments"},"license_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Key"},"schema_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"},"schema_created":{"type":"boolean","title":"Schema Created","default":false}},"type":"object","required":["message","allocation_id","previous_status","new_status","action_by"],"title":"AllocationWorkflowResponse","description":"Response for workflow actions"},"BackgroundColor":{"type":"string","enum":["black","blue","green"],"title":"BackgroundColor","description":"Background color options for company"},"Body_import_cram_excel_api_v1_cram_import_excel_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"Marshal_Control_Risk_Activity_Master workbook"}},"type":"object","required":["file"],"title":"Body_import_cram_excel_api_v1_cram_import_excel_post"},"Body_import_hierarchy_from_excel_api_v1_hierarchy_import_excel_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"Excel file with hierarchy data"}},"type":"object","required":["file"],"title":"Body_import_hierarchy_from_excel_api_v1_hierarchy_import_excel_post"},"Body_login_for_access_token_api_v1_auth_token_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"password"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","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"}],"title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_for_access_token_api_v1_auth_token_post"},"BulkEmailResultItem":{"properties":{"client_id":{"type":"integer","title":"Client Id"},"client_name":{"type":"string","title":"Client Name"},"email":{"type":"string","title":"Email"},"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["client_id","client_name","email","success","message"],"title":"BulkEmailResultItem","description":"Individual result for bulk email send"},"BulkImportResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"imported_counts":{"type":"object","title":"Imported Counts","description":"Count of imported records","example":{"activities":303,"controls":123,"standards":1}},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"type":"object","required":["success","message","imported_counts"],"title":"BulkImportResponse","description":"Response from bulk import"},"CPActivityItem":{"properties":{"std_activity_id":{"type":"integer","title":"Std Activity Id"},"control_id":{"type":"integer","title":"Control Id"},"control_code":{"type":"string","title":"Control Code"},"control_title":{"type":"string","title":"Control Title"},"cs_activity_id":{"type":"integer","title":"Cs Activity Id"},"cs_activity_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cs Activity Title"},"is_applicable":{"type":"boolean","title":"Is Applicable","default":true},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"}},"type":"object","required":["std_activity_id","control_id","control_code","control_title","cs_activity_id"],"title":"CPActivityItem","description":"Single CP Activity item"},"CPActivityTreeNode":{"properties":{"activity_id":{"type":"integer","title":"Activity Id"},"activity_code":{"type":"string","title":"Activity Code"},"external_activity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Activity Id"},"activity_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activity Title"},"level_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Name"},"is_applicable":{"type":"boolean","title":"Is Applicable","default":true},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["activity_id","activity_code"],"title":"CPActivityTreeNode","description":"Activity leaf node within a hierarchy tree"},"CPCompliancePeriodsCreate":{"properties":{"period_code":{"type":"string","maxLength":50,"title":"Period Code","description":"Period code (e.g., CP-2024-Q1)"},"period_title":{"type":"string","maxLength":255,"title":"Period Title","description":"Period name"},"period_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Description","description":"Description"},"allocation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Allocation Id","description":"License allocation ID"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id","description":"Standard ID"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id","description":"Governance domain ID"},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Period start date"},"end_date":{"type":"string","format":"date","title":"End Date","description":"Period end date"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks","description":"Additional notes"}},"type":"object","required":["period_code","period_title","start_date","end_date"],"title":"CPCompliancePeriodsCreate","description":"Schema for creating a new Compliance Period"},"CPCompliancePeriodsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPCompliancePeriodsResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPCompliancePeriodsListResponse","description":"Paginated list response"},"CPCompliancePeriodsResponse":{"properties":{"comp_period_id":{"type":"integer","title":"Comp Period Id"},"period_code":{"type":"string","title":"Period Code"},"period_title":{"type":"string","title":"Period Title"},"period_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Description"},"allocation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Allocation Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"status":{"type":"string","title":"Status","default":"Draft"},"is_closed":{"type":"boolean","title":"Is Closed","default":false},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At"},"closed_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Closed By"},"assignments_generated":{"type":"boolean","title":"Assignments Generated","default":false},"total_assignments":{"type":"integer","title":"Total Assignments","default":0},"completed_assignments":{"type":"integer","title":"Completed Assignments","default":0},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By"},"allocation":{"anyOf":[{"$ref":"#/components/schemas/AllocationInfo"},{"type":"null"}]}},"type":"object","required":["comp_period_id","period_code","period_title","start_date","end_date"],"title":"CPCompliancePeriodsResponse","description":"Schema for Compliance Period response"},"CPCompliancePeriodsUpdate":{"properties":{"period_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Period Code"},"period_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Period Title"},"period_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Description"},"allocation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Allocation Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Period status"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"}},"type":"object","title":"CPCompliancePeriodsUpdate","description":"Schema for updating a Compliance Period"},"CPControlMasterCreate":{"properties":{"control_code":{"type":"string","maxLength":50,"title":"Control Code"},"control_title":{"type":"string","maxLength":500,"title":"Control Title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail"},"parent_control_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id"},"is_applicable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Applicable","default":true},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},"type":"object","required":["control_code","control_title"],"title":"CPControlMasterCreate","description":"Schema for creating a control record at a specific standard level"},"CPControlMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPControlMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPControlMasterListResponse","description":"Paginated list response"},"CPControlMasterResponse":{"properties":{"control_id":{"type":"integer","title":"Control Id"},"control_code":{"type":"string","title":"Control Code"},"control_title":{"type":"string","title":"Control Title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail"},"std_id":{"type":"integer","title":"Std Id"},"parent_control_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id"},"hierarchy_level":{"type":"integer","title":"Hierarchy Level"},"level_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Name"},"is_applicable":{"type":"boolean","title":"Is Applicable","default":true},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"is_active":{"type":"boolean","title":"Is Active","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["control_id","control_code","control_title","std_id","hierarchy_level"],"title":"CPControlMasterResponse","description":"Schema for control master response"},"CPControlMasterUpdate":{"properties":{"control_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Control Code"},"control_title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Control Title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail"},"parent_control_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id"},"is_applicable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Applicable"},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},"type":"object","title":"CPControlMasterUpdate","description":"Schema for updating a control record - all fields optional"},"CPControlTreeNode":{"properties":{"control_id":{"type":"integer","title":"Control Id"},"control_code":{"type":"string","title":"Control Code"},"control_title":{"type":"string","title":"Control Title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail"},"hierarchy_level":{"type":"integer","title":"Hierarchy Level"},"level_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Name"},"is_applicable":{"type":"boolean","title":"Is Applicable","default":true},"is_active":{"type":"boolean","title":"Is Active","default":true},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"children":{"items":{"$ref":"#/components/schemas/CPControlTreeNode"},"type":"array","title":"Children","default":[]},"activities":{"items":{"$ref":"#/components/schemas/CPActivityTreeNode"},"type":"array","title":"Activities","default":[]}},"type":"object","required":["control_id","control_code","control_title","hierarchy_level"],"title":"CPControlTreeNode","description":"Recursive tree node for hierarchy display"},"CPCurrentUserResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"username":{"type":"string","title":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"is_active":{"type":"boolean","title":"Is Active","default":true},"roles":{"items":{"type":"string"},"type":"array","title":"Roles","default":[]},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"}},"type":"object","required":["user_id","username"],"title":"CPCurrentUserResponse","description":"Response model for current CP user profile."},"CPDocumentHistoryCreate":{"properties":{"document_id":{"type":"integer","title":"Document Id"},"doc_version":{"type":"string","maxLength":50,"title":"Doc Version"},"is_current":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Current"},"doc_release_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Doc Release Date"},"doc_retire_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Doc Retire Date"}},"type":"object","required":["document_id","doc_version"],"title":"CPDocumentHistoryCreate","description":"Schema for creating a new Document History record"},"CPDocumentHistoryListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPDocumentHistoryResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPDocumentHistoryListResponse","description":"Paginated list response"},"CPDocumentHistoryResponse":{"properties":{"doc_history_id":{"type":"integer","title":"Doc History Id"},"document_id":{"type":"integer","title":"Document Id"},"doc_version":{"type":"string","title":"Doc Version"},"is_current":{"type":"boolean","title":"Is Current","default":true},"doc_release_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Doc Release Date"},"doc_retire_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Doc Retire Date"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["doc_history_id","document_id","doc_version"],"title":"CPDocumentHistoryResponse","description":"Schema for Document History response - excludes sensitive fields"},"CPDocumentHistoryUpdate":{"properties":{"document_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Document Id"},"doc_version":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Doc Version"},"is_current":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Current"},"doc_release_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Doc Release Date"},"doc_retire_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Doc Retire Date"}},"type":"object","title":"CPDocumentHistoryUpdate","description":"Schema for updating a Document History record - all fields optional"},"CPDocumentMasterCreate":{"properties":{"document_title":{"type":"string","maxLength":255,"title":"Document Title"},"document_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Detail"},"doc_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Type Id"},"doc_owner":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Owner"},"doc_approver":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Approver"}},"type":"object","required":["document_title"],"title":"CPDocumentMasterCreate","description":"Schema for creating a new Documents record"},"CPDocumentMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPDocumentMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPDocumentMasterListResponse","description":"Paginated list response"},"CPDocumentMasterResponse":{"properties":{"document_id":{"type":"integer","title":"Document Id"},"document_title":{"type":"string","title":"Document Title"},"document_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Detail"},"doc_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Type Id"},"doc_owner":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Owner"},"doc_approver":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Approver"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["document_id","document_title"],"title":"CPDocumentMasterResponse","description":"Schema for Documents response - excludes sensitive fields"},"CPDocumentMasterUpdate":{"properties":{"document_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Document Title"},"document_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Detail"},"doc_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Type Id"},"doc_owner":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Owner"},"doc_approver":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Approver"}},"type":"object","title":"CPDocumentMasterUpdate","description":"Schema for updating a Documents record - all fields optional"},"CPDocumentTypeMasterCreate":{"properties":{"document_type_title":{"type":"string","maxLength":255,"title":"Document Type Title"},"document_type_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type Detail"}},"type":"object","required":["document_type_title"],"title":"CPDocumentTypeMasterCreate","description":"Schema for creating a new Document Types record"},"CPDocumentTypeMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPDocumentTypeMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPDocumentTypeMasterListResponse","description":"Paginated list response"},"CPDocumentTypeMasterResponse":{"properties":{"document_type_id":{"type":"integer","title":"Document Type Id"},"document_type_title":{"type":"string","title":"Document Type Title"},"document_type_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type Detail"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["document_type_id","document_type_title"],"title":"CPDocumentTypeMasterResponse","description":"Schema for Document Types response - excludes sensitive fields"},"CPDocumentTypeMasterUpdate":{"properties":{"document_type_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Document Type Title"},"document_type_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type Detail"}},"type":"object","title":"CPDocumentTypeMasterUpdate","description":"Schema for updating a Document Types record - all fields optional"},"CPFrequencyMasterCreate":{"properties":{"freq_title":{"type":"string","maxLength":100,"title":"Freq Title"},"freq_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Freq Detail"}},"type":"object","required":["freq_title"],"title":"CPFrequencyMasterCreate","description":"Schema for creating a new Frequency Master record"},"CPFrequencyMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPFrequencyMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPFrequencyMasterListResponse","description":"Paginated list response"},"CPFrequencyMasterResponse":{"properties":{"freq_id":{"type":"integer","title":"Freq Id"},"freq_title":{"type":"string","title":"Freq Title"},"freq_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Freq Detail"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["freq_id","freq_title"],"title":"CPFrequencyMasterResponse","description":"Schema for Frequency Master response - excludes sensitive fields"},"CPFrequencyMasterUpdate":{"properties":{"freq_title":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Freq Title"},"freq_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Freq Detail"}},"type":"object","title":"CPFrequencyMasterUpdate","description":"Schema for updating a Frequency Master record - all fields optional"},"CPGeographyMasterCreate":{"properties":{"geography_title":{"type":"string","maxLength":255,"title":"Geography Title"},"geography_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geography Detail"}},"type":"object","required":["geography_title"],"title":"CPGeographyMasterCreate","description":"Schema for creating a new Geography Master record"},"CPGeographyMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPGeographyMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPGeographyMasterListResponse","description":"Paginated list response"},"CPGeographyMasterResponse":{"properties":{"geography_id":{"type":"integer","title":"Geography Id"},"geography_title":{"type":"string","title":"Geography Title"},"geography_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geography Detail"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["geography_id","geography_title"],"title":"CPGeographyMasterResponse","description":"Schema for Geography Master response - excludes sensitive fields"},"CPGeographyMasterUpdate":{"properties":{"geography_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Geography Title"},"geography_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geography Detail"}},"type":"object","title":"CPGeographyMasterUpdate","description":"Schema for updating a Geography Master record - all fields optional"},"CPGovernanceMasterCreate":{"properties":{"gov_title":{"type":"string","maxLength":255,"title":"Gov Title"},"gov_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gov Detail"}},"type":"object","required":["gov_title"],"title":"CPGovernanceMasterCreate","description":"Schema for creating a new Governance Master record"},"CPGovernanceMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPGovernanceMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPGovernanceMasterListResponse","description":"Paginated list response"},"CPGovernanceMasterResponse":{"properties":{"gov_id":{"type":"integer","title":"Gov Id"},"gov_title":{"type":"string","title":"Gov Title"},"gov_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gov Detail"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["gov_id","gov_title"],"title":"CPGovernanceMasterResponse","description":"Schema for Governance Master response - excludes sensitive fields"},"CPGovernanceMasterUpdate":{"properties":{"gov_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Gov Title"},"gov_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gov Detail"}},"type":"object","title":"CPGovernanceMasterUpdate","description":"Schema for updating a Governance Master record - all fields optional"},"CPHelpContentMasterCreate":{"properties":{"helpcontent_title":{"type":"string","maxLength":255,"title":"Helpcontent Title"},"helpcontent_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpcontent Detail"},"helpcontent_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Helpcontent Type Id"}},"type":"object","required":["helpcontent_title"],"title":"CPHelpContentMasterCreate","description":"Schema for creating a new Help Content record"},"CPHelpContentMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPHelpContentMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPHelpContentMasterListResponse","description":"Paginated list response"},"CPHelpContentMasterResponse":{"properties":{"helpcontent_id":{"type":"integer","title":"Helpcontent Id"},"helpcontent_title":{"type":"string","title":"Helpcontent Title"},"helpcontent_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpcontent Detail"},"helpcontent_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Helpcontent Type Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["helpcontent_id","helpcontent_title"],"title":"CPHelpContentMasterResponse","description":"Schema for Help Content response - excludes sensitive fields"},"CPHelpContentMasterUpdate":{"properties":{"helpcontent_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Helpcontent Title"},"helpcontent_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpcontent Detail"},"helpcontent_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Helpcontent Type Id"}},"type":"object","title":"CPHelpContentMasterUpdate","description":"Schema for updating a Help Content record - all fields optional"},"CPHelpContentTypeMasterCreate":{"properties":{"helpcontent_type_title":{"type":"string","maxLength":255,"title":"Helpcontent Type Title"},"helpcontent_type_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpcontent Type Detail"}},"type":"object","required":["helpcontent_type_title"],"title":"CPHelpContentTypeMasterCreate","description":"Schema for creating a new Help Content Types record"},"CPHelpContentTypeMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPHelpContentTypeMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPHelpContentTypeMasterListResponse","description":"Paginated list response"},"CPHelpContentTypeMasterResponse":{"properties":{"helpcontent_type_id":{"type":"integer","title":"Helpcontent Type Id"},"helpcontent_type_title":{"type":"string","title":"Helpcontent Type Title"},"helpcontent_type_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpcontent Type Detail"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["helpcontent_type_id","helpcontent_type_title"],"title":"CPHelpContentTypeMasterResponse","description":"Schema for Help Content Types response - excludes sensitive fields"},"CPHelpContentTypeMasterUpdate":{"properties":{"helpcontent_type_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Helpcontent Type Title"},"helpcontent_type_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpcontent Type Detail"}},"type":"object","title":"CPHelpContentTypeMasterUpdate","description":"Schema for updating a Help Content Types record - all fields optional"},"CPHierarchyTreeResponse":{"properties":{"std_id":{"type":"integer","title":"Std Id"},"std_title":{"type":"string","title":"Std Title"},"std_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Code"},"level_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level No"},"level_names":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Names"},"root_nodes":{"items":{"$ref":"#/components/schemas/CPControlTreeNode"},"type":"array","title":"Root Nodes"},"total_controls":{"type":"integer","title":"Total Controls"}},"type":"object","required":["std_id","std_title","root_nodes","total_controls"],"title":"CPHierarchyTreeResponse","description":"Full hierarchy tree for a standard"},"CPIncidentRegisterCreate":{"properties":{"incident_title":{"type":"string","maxLength":255,"title":"Incident Title"},"incident_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Incident Description"},"incident_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Incident Category Id"},"incident_rating_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Incident Rating Id"},"incident_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Incident Date"},"reported_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Reported Date"},"resolved_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Resolved Date"},"reported_by":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Reported By"},"assigned_to":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Assigned To"},"department":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Department"},"status":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Status"},"impact_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Impact Description"},"root_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause"},"corrective_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrective Action"},"preventive_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preventive Action"},"is_recurring":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Recurring","default":false},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"}},"type":"object","required":["incident_title"],"title":"CPIncidentRegisterCreate"},"CPIncidentRegisterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPIncidentRegisterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPIncidentRegisterListResponse"},"CPIncidentRegisterResponse":{"properties":{"incident_id":{"type":"integer","title":"Incident Id"},"incident_title":{"type":"string","title":"Incident Title"},"incident_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Incident Description"},"incident_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Incident Category Id"},"incident_rating_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Incident Rating Id"},"incident_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Incident Date"},"reported_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Reported Date"},"resolved_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Resolved Date"},"reported_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reported By"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"impact_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Impact Description"},"root_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause"},"corrective_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrective Action"},"preventive_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preventive Action"},"is_recurring":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Recurring"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["incident_id","incident_title"],"title":"CPIncidentRegisterResponse"},"CPIncidentRegisterUpdate":{"properties":{"incident_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Incident Title"},"incident_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Incident Description"},"incident_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Incident Category Id"},"incident_rating_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Incident Rating Id"},"incident_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Incident Date"},"reported_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Reported Date"},"resolved_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Resolved Date"},"reported_by":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Reported By"},"assigned_to":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Assigned To"},"department":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Department"},"status":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Status"},"impact_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Impact Description"},"root_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause"},"corrective_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrective Action"},"preventive_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preventive Action"},"is_recurring":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Recurring"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"}},"type":"object","title":"CPIncidentRegisterUpdate"},"CPIndicatorMasterCreate":{"properties":{"indicator_code":{"type":"string","maxLength":50,"title":"Indicator Code","description":"Indicator code (e.g., KPI-001)"},"indicator_title":{"type":"string","maxLength":255,"title":"Indicator Title","description":"Indicator name"},"indicator_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Indicator Detail","description":"Detailed description"},"indicator_type":{"type":"string","title":"Indicator Type","description":"Type: KPI or KRI"},"objective_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Objective Id","description":"Linked objective ID (for KPIs)"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id","description":"Governance domain ID"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id","description":"Department/Function ID"},"unit_of_measure":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Unit Of Measure","description":"Unit (%, count, days)"},"target_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Value","description":"Target value"},"threshold_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold Value","description":"Warning threshold"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value","description":"Current measured value"},"frequency":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Frequency","description":"Measurement frequency"},"data_source":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Data Source","description":"Source of data"},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner User Id","description":"Owner user ID"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks","description":"Additional notes"}},"type":"object","required":["indicator_code","indicator_title","indicator_type"],"title":"CPIndicatorMasterCreate","description":"Schema for creating a new Indicator"},"CPIndicatorMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPIndicatorMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPIndicatorMasterListResponse","description":"Paginated list response"},"CPIndicatorMasterResponse":{"properties":{"indicator_id":{"type":"integer","title":"Indicator Id"},"indicator_code":{"type":"string","title":"Indicator Code"},"indicator_title":{"type":"string","title":"Indicator Title"},"indicator_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Indicator Detail"},"indicator_type":{"type":"string","title":"Indicator Type"},"objective_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Objective Id"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id"},"unit_of_measure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Of Measure"},"target_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Value"},"threshold_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold Value"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value"},"frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frequency"},"data_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Source"},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner User Id"},"is_active":{"type":"boolean","title":"Is Active","default":true},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By"},"objective":{"anyOf":[{"$ref":"#/components/schemas/ObjectiveInfo"},{"type":"null"}]},"governance":{"anyOf":[{"$ref":"#/components/schemas/GovernanceInfo"},{"type":"null"}]},"calculated_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calculated Status"}},"type":"object","required":["indicator_id","indicator_code","indicator_title","indicator_type"],"title":"CPIndicatorMasterResponse","description":"Schema for Indicator response"},"CPIndicatorMasterUpdate":{"properties":{"indicator_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Indicator Code"},"indicator_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Indicator Title"},"indicator_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Indicator Detail"},"indicator_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Indicator Type"},"objective_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Objective Id"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id"},"unit_of_measure":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Unit Of Measure"},"target_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Value"},"threshold_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold Value"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value"},"frequency":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Frequency"},"data_source":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Data Source"},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner User Id"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"}},"type":"object","title":"CPIndicatorMasterUpdate","description":"Schema for updating an Indicator"},"CPLevelConfigResponse":{"properties":{"std_id":{"type":"integer","title":"Std Id"},"std_title":{"type":"string","title":"Std Title"},"std_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Code"},"level_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level No"},"level_names":{"items":{"type":"string"},"type":"array","title":"Level Names","default":[]}},"type":"object","required":["std_id","std_title"],"title":"CPLevelConfigResponse","description":"Response after updating level configuration."},"CPLevelConfigUpdate":{"properties":{"level_no":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Level No","description":"Total number of hierarchy levels"},"level_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Level Names","description":"Ordered level names, e.g. [\"Requirements\", \"Controls\", \"Activities\"]"}},"type":"object","title":"CPLevelConfigUpdate","description":"Schema for updating hierarchy level configuration only."},"CPObjectivesMasterCreate":{"properties":{"objective_code":{"type":"string","maxLength":50,"title":"Objective Code","description":"Objective code (e.g., OBJ-001)"},"objective_title":{"type":"string","maxLength":255,"title":"Objective Title","description":"Objective name"},"objective_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective Detail","description":"Detailed description"},"objective_type":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Objective Type","description":"Type: Strategic, Operational, Compliance"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id","description":"Governance domain ID"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id","description":"Standard ID"},"priority":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Priority","description":"Priority: High, Medium, Low"},"target_value":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Target Value","description":"Target value/metric"},"current_value":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Current Value","description":"Current value/metric"},"target_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Target Date","description":"Target completion date"},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner User Id","description":"Owner user ID"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks","description":"Additional notes"}},"type":"object","required":["objective_code","objective_title"],"title":"CPObjectivesMasterCreate","description":"Schema for creating a new Objectives Master record"},"CPObjectivesMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPObjectivesMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPObjectivesMasterListResponse","description":"Paginated list response"},"CPObjectivesMasterResponse":{"properties":{"objective_id":{"type":"integer","title":"Objective Id"},"objective_code":{"type":"string","title":"Objective Code"},"objective_title":{"type":"string","title":"Objective Title"},"objective_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective Detail"},"objective_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective Type"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"target_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Value"},"current_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Value"},"target_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Target Date"},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner User Id"},"is_active":{"type":"boolean","title":"Is Active","default":true},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By"},"governance":{"anyOf":[{"$ref":"#/components/schemas/GovernanceInfo"},{"type":"null"}]}},"type":"object","required":["objective_id","objective_code","objective_title"],"title":"CPObjectivesMasterResponse","description":"Schema for Objectives Master response"},"CPObjectivesMasterUpdate":{"properties":{"objective_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Objective Code"},"objective_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Objective Title"},"objective_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective Detail"},"objective_type":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Objective Type"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"priority":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Priority"},"target_value":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Target Value"},"current_value":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Current Value"},"target_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Target Date"},"owner_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner User Id"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"}},"type":"object","title":"CPObjectivesMasterUpdate","description":"Schema for updating an Objectives Master record"},"CPPasswordChange":{"properties":{"current_password":{"type":"string","title":"Current Password","description":"Current password"},"new_password":{"type":"string","minLength":8,"title":"New Password","description":"New password"},"confirm_password":{"type":"string","minLength":8,"title":"Confirm Password","description":"Confirm new password"}},"type":"object","required":["current_password","new_password","confirm_password"],"title":"CPPasswordChange","description":"Request model for CP user password change."},"CPRoleMasterCreate":{"properties":{"role_short_name":{"type":"string","maxLength":50,"title":"Role Short Name"},"role_full_name":{"type":"string","maxLength":255,"title":"Role Full Name"},"gov_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gov Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["role_short_name","role_full_name"],"title":"CPRoleMasterCreate","description":"Schema for creating a new CP Roles record"},"CPRoleMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPRoleMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPRoleMasterListResponse","description":"Paginated list response"},"CPRoleMasterResponse":{"properties":{"role_id":{"type":"integer","title":"Role Id"},"role_short_name":{"type":"string","title":"Role Short Name"},"role_full_name":{"type":"string","title":"Role Full Name"},"gov_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gov Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["role_id","role_short_name","role_full_name"],"title":"CPRoleMasterResponse","description":"Schema for CP Roles response - excludes sensitive fields"},"CPRoleMasterUpdate":{"properties":{"role_short_name":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Role Short Name"},"role_full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Role Full Name"},"gov_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gov Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"CPRoleMasterUpdate","description":"Schema for updating a CP Roles record - all fields optional"},"CPRoleUserMappingCreate":{"properties":{"mapping_id":{"type":"integer","title":"Mapping Id"},"user_id":{"type":"integer","title":"User Id"},"role_id":{"type":"integer","title":"Role Id"}},"type":"object","required":["mapping_id","user_id","role_id"],"title":"CPRoleUserMappingCreate","description":"Schema for creating a new CP Role User Mapping record"},"CPRoleUserMappingListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPRoleUserMappingResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPRoleUserMappingListResponse","description":"Paginated list response"},"CPRoleUserMappingResponse":{"properties":{"sl_no":{"type":"integer","title":"Sl No"},"mapping_id":{"type":"integer","title":"Mapping Id"},"user_id":{"type":"integer","title":"User Id"},"role_id":{"type":"integer","title":"Role Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["sl_no","mapping_id","user_id","role_id"],"title":"CPRoleUserMappingResponse","description":"Schema for CP Role User Mapping response - excludes sensitive fields"},"CPRoleUserMappingUpdate":{"properties":{"mapping_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mapping Id"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"role_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Role Id"}},"type":"object","title":"CPRoleUserMappingUpdate","description":"Schema for updating a CP Role User Mapping record - all fields optional"},"CPStandardsMasterCreate":{"properties":{"std_title":{"type":"string","maxLength":255,"title":"Std Title"},"std_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Detail"},"gov_id":{"type":"integer","title":"Gov Id","description":"Governance domain ID (required)"},"geography_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Geography Id"},"release_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Release Date"},"level_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level No"},"level_names":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Level Names"},"level_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Level Name"},"is_current":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Current"},"is_latest":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Latest"}},"type":"object","required":["std_title","gov_id"],"title":"CPStandardsMasterCreate","description":"Schema for creating a new Standards Master record"},"CPStandardsMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPStandardsMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPStandardsMasterListResponse","description":"Paginated list response"},"CPStandardsMasterResponse":{"properties":{"std_id":{"type":"integer","title":"Std Id"},"std_title":{"type":"string","title":"Std Title"},"std_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Detail"},"gov_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gov Id"},"geography_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Geography Id"},"release_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Release Date"},"level_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level No"},"level_names":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Names"},"level_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Name"},"is_current":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Current","default":true},"is_latest":{"type":"boolean","title":"Is Latest","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["std_id","std_title"],"title":"CPStandardsMasterResponse","description":"Schema for Standards Master response - excludes sensitive fields"},"CPStandardsMasterUpdate":{"properties":{"std_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Std Title"},"std_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Detail"},"gov_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gov Id"},"geography_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Geography Id"},"release_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Release Date"},"level_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level No"},"level_names":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Level Names"},"level_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Level Name"},"is_current":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Current"},"is_latest":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Latest"}},"type":"object","title":"CPStandardsMasterUpdate","description":"Schema for updating a Standards Master record - all fields optional"},"CPUserMasterCreate":{"properties":{"user_name":{"type":"string","maxLength":255,"title":"User Name"},"email_id":{"type":"string","maxLength":255,"title":"Email Id"},"phone_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone Number"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"reporting_mgr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reporting Mgr"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"password":{"type":"string","minLength":8,"title":"Password","description":"Password (min 8 chars)"}},"type":"object","required":["user_name","email_id","password"],"title":"CPUserMasterCreate","description":"Schema for creating a new CP Users record"},"CPUserMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CPUserMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"CPUserMasterListResponse","description":"Paginated list response"},"CPUserMasterResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"user_name":{"type":"string","title":"User Name"},"email_id":{"type":"string","title":"Email Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"reporting_mgr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reporting Mgr"},"is_active":{"type":"boolean","title":"Is Active","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["user_id","user_name","email_id"],"title":"CPUserMasterResponse","description":"Schema for CP Users response - excludes sensitive fields"},"CPUserMasterUpdate":{"properties":{"user_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"User Name"},"email_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email Id"},"phone_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone Number"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"reporting_mgr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reporting Mgr"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"CPUserMasterUpdate","description":"Schema for updating a CP Users record - all fields optional"},"CPUserRegister":{"properties":{"username":{"type":"string","maxLength":50,"minLength":3,"title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":100,"minLength":8,"title":"Password"},"confirm_password":{"type":"string","maxLength":100,"minLength":8,"title":"Confirm Password"},"full_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Full Name"},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone"},"client_id":{"type":"integer","title":"Client Id","description":"Client ID the user belongs to"}},"type":"object","required":["username","email","password","confirm_password","client_id"],"title":"CPUserRegister","description":"Request model for CP (Client Portal) user registration.","example":{"client_id":1,"confirm_password":"SecurePass123","email":"sarah@techcorp.com","full_name":"Sarah Johnson","password":"SecurePass123","phone":"+1234567890","username":"sarah_johnson"}},"CPUserRegisterResponse":{"properties":{"message":{"type":"string","title":"Message","default":"Client portal user registered successfully"},"user_id":{"type":"integer","title":"User Id"},"username":{"type":"string","title":"Username"},"email":{"type":"string","title":"Email"},"client_id":{"type":"integer","title":"Client Id"}},"type":"object","required":["user_id","username","email","client_id"],"title":"CPUserRegisterResponse","description":"Response model for successful CP user registration."},"CSVExportListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CSVExportStoredItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"client_id":{"type":"integer","title":"Client Id"}},"type":"object","required":["items","total","client_id"],"title":"CSVExportListResponse","description":"GET list response."},"CSVExportResult":{"properties":{"table_name":{"type":"string","title":"Table Name"},"filename":{"type":"string","title":"Filename"},"row_count":{"type":"integer","title":"Row Count"},"saved_to_schema":{"type":"boolean","title":"Saved To Schema"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["table_name","filename","row_count","saved_to_schema"],"title":"CSVExportResult","description":"Result of a single CSV export"},"CSVExportStoredItem":{"properties":{"export_id":{"type":"integer","title":"Export Id"},"client_id":{"type":"integer","title":"Client Id"},"table_name":{"type":"string","title":"Table Name"},"filename":{"type":"string","title":"Filename"},"row_count":{"type":"integer","title":"Row Count"},"export_type":{"type":"string","title":"Export Type"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["export_id","client_id","table_name","filename","row_count","export_type"],"title":"CSVExportStoredItem","description":"Response for list endpoint - metadata only, no csv_content."},"CSVUploadResult":{"properties":{"table_name":{"type":"string","title":"Table Name"},"filename":{"type":"string","title":"Filename"},"uploaded":{"type":"boolean","title":"Uploaded"},"storage_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storage Path"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["table_name","filename","uploaded"],"title":"CSVUploadResult","description":"Result for a single CSV file upload to storage."},"CascadeApplicabilityRequest":{"properties":{"control_id":{"type":"integer","title":"Control Id","description":"Control ID to cascade from"},"is_applicable":{"type":"boolean","title":"Is Applicable","description":"Applicability to cascade"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason for change"}},"type":"object","required":["control_id","is_applicable"],"title":"CascadeApplicabilityRequest","description":"Request to cascade applicability to children"},"CascadeApplicabilityResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"control_id":{"type":"integer","title":"Control Id"},"affected_controls":{"items":{"type":"integer"},"type":"array","title":"Affected Controls","description":"Child controls affected"},"affected_activities":{"items":{"type":"integer"},"type":"array","title":"Affected Activities","description":"Activities affected"},"total_affected":{"type":"integer","title":"Total Affected"}},"type":"object","required":["success","message","control_id","total_affected"],"title":"CascadeApplicabilityResponse","description":"Response showing what was cascaded"},"ClientCorrection":{"properties":{"client_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Client Name"},"contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Contact Phone"},"client_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Address"},"client_website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Client Website"},"resubmit":{"type":"boolean","title":"Resubmit","description":"Resubmit for review after correction","default":true}},"type":"object","title":"ClientCorrection","description":"Schema for user correcting client data"},"ClientInfoSchema":{"properties":{"client_id":{"type":"integer","title":"Client Id","description":"Client ID"},"client_name":{"type":"string","title":"Client Name","description":"Client/Company name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email","description":"Contact email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone","description":"Contact phone"}},"type":"object","required":["client_id","client_name"],"title":"ClientInfoSchema","description":"Client information"},"ClientLicenseInfo":{"properties":{"allocation_id":{"type":"integer","title":"Allocation Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id"},"governance_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governance Title"},"subscription_start":{"type":"string","title":"Subscription Start"},"subscription_end":{"type":"string","title":"Subscription End"},"payment_status":{"type":"string","title":"Payment Status"},"status":{"type":"string","title":"Status"},"schema_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"}},"type":"object","required":["allocation_id","subscription_start","subscription_end","payment_status","status"],"title":"ClientLicenseInfo","description":"Schema for license allocation information"},"ClientLicenseListResponse":{"properties":{"user_name":{"type":"string","title":"User Name","description":"User's name"},"client_name":{"type":"string","title":"Client Name","description":"Client name"},"licenses":{"items":{"$ref":"#/components/schemas/LicenseSummarySchema"},"type":"array","title":"Licenses","description":"License summaries"},"total":{"type":"integer","title":"Total","description":"Total licenses","default":0}},"type":"object","required":["user_name","client_name"],"title":"ClientLicenseListResponse","description":"List of client's licenses"},"ClientLicenseResponse":{"properties":{"licenses":{"items":{"$ref":"#/components/schemas/ClientLicenseInfo"},"type":"array","title":"Licenses"}},"type":"object","required":["licenses"],"title":"ClientLicenseResponse","description":"Response schema for client licenses"},"ClientLicenseSummary":{"properties":{"client_id":{"type":"integer","title":"Client Id"},"client_name":{"type":"string","title":"Client Name"},"total_allocations":{"type":"integer","title":"Total Allocations"},"approved_count":{"type":"integer","title":"Approved Count"},"pending_count":{"type":"integer","title":"Pending Count"},"allocations":{"items":{"$ref":"#/components/schemas/LicenseAllocationResponse"},"type":"array","title":"Allocations"}},"type":"object","required":["client_id","client_name","total_allocations","approved_count","pending_count","allocations"],"title":"ClientLicenseSummary","description":"Summary of ALL licenses allocated to a client\n\nA client can have multiple license allocations for different governances"},"ClientResetPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Client user email address"},"tenant_id":{"type":"string","title":"Tenant Id","description":"Tenant ID of the client"},"old_password":{"type":"string","title":"Old Password","description":"Temporary password sent via email"},"new_password":{"type":"string","minLength":8,"title":"New Password","description":"New password"},"confirm_password":{"type":"string","minLength":8,"title":"Confirm Password","description":"Confirm new password"}},"type":"object","required":["email","tenant_id","old_password","new_password","confirm_password"],"title":"ClientResetPasswordRequest","description":"Request model for client user password reset using the emailed temporary password.","example":{"confirm_password":"NewSecure123","email":"sarah@techcorp.com","new_password":"NewSecure123","old_password":"TempPass123","tenant_id":"T001"}},"ClientResetPasswordResponse":{"properties":{"message":{"type":"string","title":"Message","default":"Password reset successfully"},"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"},"client_id":{"type":"integer","title":"Client Id"}},"type":"object","required":["access_token","expires_in","client_id"],"title":"ClientResetPasswordResponse","description":"Response model for successful client password reset with bearer token."},"ClientReviewAction":{"properties":{"action":{"type":"string","title":"Action","description":"approve, reject, or request_correction"},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments","description":"Supervisor comments"}},"type":"object","required":["action"],"title":"ClientReviewAction","description":"Schema for supervisor review action"},"ClientWorkflowResponse":{"properties":{"message":{"type":"string","title":"Message"},"client_id":{"type":"integer","title":"Client Id"},"previous_status":{"type":"string","title":"Previous Status"},"new_status":{"type":"string","title":"New Status"},"action_by":{"type":"integer","title":"Action By"},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments"}},"type":"object","required":["message","client_id","previous_status","new_status","action_by"],"title":"ClientWorkflowResponse","description":"Response for workflow actions"},"ClosePeriodRequest":{"properties":{"force_close":{"type":"boolean","title":"Force Close","description":"Force close even if assignments incomplete","default":false},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks","description":"Closure remarks"}},"type":"object","title":"ClosePeriodRequest","description":"Request to close a compliance period"},"ControlCreate":{"properties":{"control_code":{"type":"string","maxLength":50,"title":"Control Code","description":"Control code"},"control_title":{"type":"string","maxLength":500,"title":"Control Title","description":"Control title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail","description":"Detailed description"},"std_id":{"type":"integer","title":"Std Id","description":"Standard ID"},"parent_control_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id","description":"Parent control ID (NULL for root)"},"hierarchy_level":{"type":"integer","minimum":1.0,"title":"Hierarchy Level","description":"Level in hierarchy","default":1},"is_applicable":{"type":"boolean","title":"Is Applicable","description":"Whether control is applicable","default":true},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification","description":"Justification for applicability"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks","description":"Additional remarks"},"doer_role":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Doer Role"},"reviewer_role":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Reviewer Role"},"frequency_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Frequency Id"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"position_value":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Position Value"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},"type":"object","required":["control_code","control_title","std_id"],"title":"ControlCreate","description":"Schema for creating a control"},"ControlDepthInfo":{"properties":{"control_id":{"type":"integer","title":"Control Id"},"control_code":{"type":"string","title":"Control Code"},"control_title":{"type":"string","title":"Control Title"},"hierarchy_level":{"type":"integer","title":"Hierarchy Level"},"parent_control_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id"},"children_count":{"type":"integer","title":"Children Count"},"activities_count":{"type":"integer","title":"Activities Count"},"path":{"type":"string","title":"Path"}},"type":"object","required":["control_id","control_code","control_title","hierarchy_level","children_count","activities_count","path"],"title":"ControlDepthInfo","description":"Information about control depth in hierarchy"},"ControlDetailNode":{"properties":{"control_id":{"type":"integer","title":"Control Id"},"control_code":{"type":"string","title":"Control Code"},"control_title":{"type":"string","title":"Control Title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail"},"hierarchy_level":{"type":"integer","title":"Hierarchy Level","default":1},"is_applicable":{"type":"boolean","title":"Is Applicable","default":true},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"},"activities":{"items":{"$ref":"#/components/schemas/ActivityDetailNode"},"type":"array","title":"Activities","default":[]},"children":{"items":{"$ref":"#/components/schemas/ControlDetailNode"},"type":"array","title":"Children","default":[]}},"type":"object","required":["control_id","control_code","control_title"],"title":"ControlDetailNode","description":"Control node with attached activities"},"ControlListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ControlResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"ControlListResponse","description":"List response with pagination"},"ControlResponse":{"properties":{"control_id":{"type":"integer","title":"Control Id"},"control_code":{"type":"string","title":"Control Code"},"control_title":{"type":"string","title":"Control Title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail"},"std_id":{"type":"integer","title":"Std Id"},"parent_control_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id"},"hierarchy_level":{"type":"integer","title":"Hierarchy Level"},"is_applicable":{"type":"boolean","title":"Is Applicable"},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"doer_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doer Role"},"reviewer_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Role"},"frequency_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Frequency Id"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"position_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Value"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["control_id","control_code","control_title","std_id","hierarchy_level","is_applicable","is_active"],"title":"ControlResponse","description":"Response schema for control"},"ControlTreeNode":{"properties":{"control_id":{"type":"integer","title":"Control Id"},"control_code":{"type":"string","title":"Control Code"},"control_title":{"type":"string","title":"Control Title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail"},"hierarchy_level":{"type":"integer","title":"Hierarchy Level"},"level_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Name"},"parent_control_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id"},"is_applicable":{"type":"boolean","title":"Is Applicable"},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"},"is_active":{"type":"boolean","title":"Is Active"},"children":{"items":{"$ref":"#/components/schemas/ControlTreeNode"},"type":"array","title":"Children","default":[]},"activities":{"items":{"$ref":"#/components/schemas/ActivityTreeNode"},"type":"array","title":"Activities","default":[]}},"type":"object","required":["control_id","control_code","control_title","hierarchy_level","is_applicable","is_active"],"title":"ControlTreeNode","description":"Control node in tree (branch) - Recursive structure"},"ControlUpdate":{"properties":{"control_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Control Code"},"control_title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Control Title"},"control_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Detail"},"std_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Std Id"},"parent_control_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Control Id"},"hierarchy_level":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Hierarchy Level"},"is_applicable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Applicable"},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"},"remarks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remarks"},"doer_role":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Doer Role"},"reviewer_role":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Reviewer Role"},"frequency_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Frequency Id"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"position_value":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Position Value"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"ControlUpdate","description":"Schema for updating a control"},"CurrentUserResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"username":{"type":"string","title":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"is_active":{"type":"boolean","title":"Is Active","default":true},"roles":{"items":{"type":"string"},"type":"array","title":"Roles","default":[]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"}},"type":"object","required":["user_id","username"],"title":"CurrentUserResponse","description":"Response model for current user profile."},"DashboardOverviewResponse":{"properties":{"user_info":{"allOf":[{"$ref":"#/components/schemas/UserInfoSchema"}],"description":"Logged-in user information"},"client_info":{"allOf":[{"$ref":"#/components/schemas/ClientInfoSchema"}],"description":"Client/company information"},"licenses":{"items":{"$ref":"#/components/schemas/LicenseDetailResponse"},"type":"array","title":"Licenses","description":"All licenses for this client"},"total_licenses":{"type":"integer","title":"Total Licenses","description":"Total number of active licenses","default":0},"active_licenses":{"type":"integer","title":"Active Licenses","description":"Number of active (non-expired) licenses","default":0},"expiring_soon":{"type":"integer","title":"Expiring Soon","description":"Number of licenses expiring within 30 days","default":0}},"type":"object","required":["user_info","client_info"],"title":"DashboardOverviewResponse","description":"Dashboard overview with multiple licenses"},"EmailConfigStatusResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"smtp_host":{"type":"string","title":"Smtp Host"},"smtp_port":{"type":"integer","title":"Smtp Port"},"from_email":{"type":"string","title":"From Email"},"portal_base_url":{"type":"string","title":"Portal Base Url"},"link_expire_hours":{"type":"integer","title":"Link Expire Hours"},"message":{"type":"string","title":"Message"}},"type":"object","required":["configured","smtp_host","smtp_port","from_email","portal_base_url","link_expire_hours","message"],"title":"EmailConfigStatusResponse","description":"Response schema for email configuration status","example":{"configured":true,"from_email":"noreply@example.com","link_expire_hours":72,"message":"Email service is configured","portal_base_url":"http://localhost:3000","smtp_host":"smtp.gmail.com","smtp_port":587}},"ExpiryStatus":{"type":"string","enum":["Active","Expiring Soon","Expired","Renewed"],"title":"ExpiryStatus","description":"License Expiry Status"},"ExportCSVToLocalResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"client_id":{"type":"integer","title":"Client Id"},"total_tables":{"type":"integer","title":"Total Tables"},"total_rows":{"type":"integer","title":"Total Rows"},"exports":{"items":{"$ref":"#/components/schemas/CSVExportStoredItem"},"type":"array","title":"Exports"}},"type":"object","required":["success","message","client_id","total_tables","total_rows","exports"],"title":"ExportCSVToLocalResponse","description":"POST response with summary + list of stored exports."},"FailedAllocationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LicenseAllocationResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"FailedAllocationListResponse","description":"List of allocations with failed review"},"FailedReviewListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPClientMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"FailedReviewListResponse","description":"List of clients with failed review"},"FeatureSchema":{"properties":{"feature_id":{"type":"integer","title":"Feature Id","description":"Feature ID"},"feature_name":{"type":"string","title":"Feature Name","description":"Feature name"},"feature_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feature Description","description":"Feature description"},"is_included":{"type":"boolean","title":"Is Included","description":"Whether feature is included in plan","default":true}},"type":"object","required":["feature_id","feature_name"],"title":"FeatureSchema","description":"Individual feature schema"},"GenerateAssignmentsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"comp_period_id":{"type":"integer","title":"Comp Period Id"},"total_activities":{"type":"integer","title":"Total Activities"},"assignments_created":{"type":"integer","title":"Assignments Created"},"schema_name":{"type":"string","title":"Schema Name"}},"type":"object","required":["success","message","comp_period_id","total_activities","assignments_created","schema_name"],"title":"GenerateAssignmentsResponse","description":"Response for assignment generation"},"GovernanceAllocationItem":{"properties":{"governance_id":{"type":"integer","title":"Governance Id","description":"Governance Domain ID"},"admin_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Admin Email","description":"Admin receiving this governance's license key"}},"type":"object","required":["governance_id"],"title":"GovernanceAllocationItem","description":"One governance to allocate, with its own admin email."},"GovernanceInfo":{"properties":{"Gov_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gov Id"},"Gov_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gov Title"}},"type":"object","title":"GovernanceInfo","description":"Nested governance info for response"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HierarchyStats":{"properties":{"total_standards":{"type":"integer","title":"Total Standards"},"total_controls":{"type":"integer","title":"Total Controls"},"total_activities":{"type":"integer","title":"Total Activities"},"applicable_controls":{"type":"integer","title":"Applicable Controls"},"not_applicable_controls":{"type":"integer","title":"Not Applicable Controls"},"applicable_activities":{"type":"integer","title":"Applicable Activities"},"not_applicable_activities":{"type":"integer","title":"Not Applicable Activities"},"root_controls":{"type":"integer","title":"Root Controls"},"max_hierarchy_depth":{"type":"integer","title":"Max Hierarchy Depth"},"active_records":{"type":"integer","title":"Active Records"},"inactive_records":{"type":"integer","title":"Inactive Records"}},"type":"object","required":["total_standards","total_controls","total_activities","applicable_controls","not_applicable_controls","applicable_activities","not_applicable_activities","root_controls","max_hierarchy_depth","active_records","inactive_records"],"title":"HierarchyStats","description":"Statistics about hierarchy"},"HierarchyTreeResponse":{"properties":{"standard":{"$ref":"#/components/schemas/StandardResponse"},"root_controls":{"items":{"$ref":"#/components/schemas/ControlTreeNode"},"type":"array","title":"Root Controls"},"total_controls":{"type":"integer","title":"Total Controls"},"total_activities":{"type":"integer","title":"Total Activities"}},"type":"object","required":["standard","root_controls","total_controls","total_activities"],"title":"HierarchyTreeResponse","description":"Complete hierarchy tree response"},"LevelNameDetail":{"properties":{"id":{"type":"integer","title":"Id"},"level_no":{"type":"integer","title":"Level No"},"level_name":{"type":"string","title":"Level Name"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","level_no","level_name"],"title":"LevelNameDetail","description":"Level name detail in response"},"LevelNameInput":{"properties":{"level_no":{"type":"integer","minimum":1.0,"title":"Level No","description":"Level number (1, 2, 3...)"},"level_name":{"type":"string","maxLength":255,"title":"Level Name","description":"Name for this level (e.g., Domain, Sub-domain, Control)"}},"type":"object","required":["level_no","level_name"],"title":"LevelNameInput","description":"Level name input for create/update"},"LicenseActivateRequest":{"properties":{"license_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Key","description":"License key to activate"}},"type":"object","title":"LicenseActivateRequest","description":"M5W1: Activate a license"},"LicenseAllocationBulkCreate":{"properties":{"client_id":{"type":"integer","title":"Client Id","description":"Client ID (must be Approved)"},"po_id":{"type":"integer","title":"Po Id","description":"Purchase Order the governances were bought on"},"subscription_start":{"type":"string","format":"date","title":"Subscription Start","description":"Subscription start date"},"subscription_end":{"type":"string","format":"date","title":"Subscription End","description":"Subscription end date"},"payment_status":{"anyOf":[{"$ref":"#/components/schemas/PaymentStatus"},{"type":"null"}],"description":"Payment status","default":"Pending"},"governances":{"items":{"$ref":"#/components/schemas/GovernanceAllocationItem"},"type":"array","minItems":1,"title":"Governances","description":"Governances to allocate"}},"type":"object","required":["client_id","po_id","subscription_start","subscription_end","governances"],"title":"LicenseAllocationBulkCreate","description":"Allocate several governances from one PO in a single submit.\n\nOne license (and one key) is created per governance."},"LicenseAllocationBulkResponse":{"properties":{"created":{"items":{"$ref":"#/components/schemas/LicenseAllocationResponse"},"type":"array","title":"Created","default":[]},"failed":{"items":{"type":"object"},"type":"array","title":"Failed","description":"[{governance_id, governance_title, reason}]"},"message":{"type":"string","title":"Message","default":""}},"type":"object","title":"LicenseAllocationBulkResponse","description":"Result of a multi-governance allocation submit"},"LicenseAllocationCreate":{"properties":{"client_id":{"type":"integer","title":"Client Id","description":"Client ID (must be Approved)"},"governance_id":{"type":"integer","title":"Governance Id","description":"Governance Domain ID (e.g. Cybersecurity, BC-DR)"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id","description":"Legacy standard-level allocations only"},"po_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id","description":"Purchase Order ID (bounds the subscription dates)"},"admin_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Admin Email","description":"Admin receiving this governance's license key (defaults to the client contact email)"},"subscription_start":{"type":"string","format":"date","title":"Subscription Start","description":"Subscription start date"},"subscription_end":{"type":"string","format":"date","title":"Subscription End","description":"Subscription end date"},"payment_status":{"anyOf":[{"$ref":"#/components/schemas/PaymentStatus"},{"type":"null"}],"description":"Payment status","default":"Pending"}},"type":"object","required":["client_id","governance_id","subscription_start","subscription_end"],"title":"LicenseAllocationCreate","description":"Create new license allocation\n\nLicenses are allocated per GOVERNANCE domain; approving one provisions\nevery standard under that governance. License is auto-created with an\nauto-generated key."},"LicenseAllocationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LicenseAllocationResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"LicenseAllocationListResponse","description":"Paginated list response"},"LicenseAllocationResponse":{"properties":{"allocation_id":{"type":"integer","title":"Allocation Id"},"client_id":{"type":"integer","title":"Client Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"governance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Governance Id"},"governance_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governance Title"},"po_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id"},"admin_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Email"},"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"license_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Key"},"subscription_start":{"type":"string","format":"date","title":"Subscription Start"},"subscription_end":{"type":"string","format":"date","title":"Subscription End"},"allocation_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Allocation Date"},"payment_status":{"type":"string","title":"Payment Status","default":"Pending"},"schema_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"},"schema_created":{"type":"boolean","title":"Schema Created","default":false},"status":{"type":"string","title":"Status","default":"Draft"},"approval_comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Comments"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By"},"approved_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approved By"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"is_active":{"type":"boolean","title":"Is Active","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["allocation_id","client_id","subscription_start","subscription_end"],"title":"LicenseAllocationResponse","description":"Full allocation response"},"LicenseAllocationUpdate":{"properties":{"subscription_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Subscription Start"},"subscription_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Subscription End"},"payment_status":{"anyOf":[{"$ref":"#/components/schemas/PaymentStatus"},{"type":"null"}]},"po_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id"},"admin_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Admin Email"}},"type":"object","title":"LicenseAllocationUpdate","description":"Update allocation details"},"LicenseCancelRequest":{"properties":{"reason":{"type":"string","title":"Reason","description":"Reason for cancellation"}},"type":"object","required":["reason"],"title":"LicenseCancelRequest","description":"M5W2: Cancel a license"},"LicenseDetailResponse":{"properties":{"user_info":{"allOf":[{"$ref":"#/components/schemas/UserInfoSchema"}],"description":"Logged-in user information"},"client_info":{"allOf":[{"$ref":"#/components/schemas/ClientInfoSchema"}],"description":"Client/company information"},"standard_info":{"allOf":[{"$ref":"#/components/schemas/StandardInfoSchema"}],"description":"Standard details"},"license_info":{"allOf":[{"$ref":"#/components/schemas/LicenseInfoSchema"}],"description":"License details"},"time_remaining":{"allOf":[{"$ref":"#/components/schemas/TimeRemainingSchema"}],"description":"Days remaining calculation"},"plan_details":{"allOf":[{"$ref":"#/components/schemas/PlanDetailsSchema"}],"description":"Plan tier and pricing"},"included_features":{"items":{"$ref":"#/components/schemas/FeatureSchema"},"type":"array","title":"Included Features","description":"List of included features"}},"type":"object","required":["user_info","client_info","standard_info","license_info","time_remaining","plan_details"],"title":"LicenseDetailResponse","description":"Complete license detail for dashboard view"},"LicenseInfoSchema":{"properties":{"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id","description":"License ID (e.g., LIC-2024-007)"},"license_display_id":{"type":"string","title":"License Display Id","description":"Display format: LIC-YYYY-NNN"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id","description":"Standard ID (NULL for governance-level licenses)"},"standard_display_id":{"type":"string","title":"Standard Display Id","description":"Display format: STD-ISOXXXXX"},"client_id":{"type":"integer","title":"Client Id","description":"Client ID"},"client_display_id":{"type":"string","title":"Client Display Id","description":"Display format: CLT-CLIENTNAME-NNN"},"po_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id","description":"PO ID"},"po_display_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Display Id","description":"Display format: PO-YYYY-NNNNN"},"start_date":{"type":"string","format":"date","title":"Start Date","description":"License start date"},"end_date":{"type":"string","format":"date","title":"End Date","description":"License end date"},"activation_status":{"type":"string","title":"Activation Status","description":"Activation status: activated/pending/suspended"},"expiry_status":{"type":"string","title":"Expiry Status","description":"Expiry status: active/expired/expiring_soon"},"license_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Key","description":"License key for copy"}},"type":"object","required":["license_display_id","standard_display_id","client_id","client_display_id","start_date","end_date","activation_status","expiry_status"],"title":"LicenseInfoSchema","description":"License information displayed on dashboard"},"LicenseRenewRequest":{"properties":{"new_end_date":{"type":"string","format":"date","title":"New End Date","description":"New end date for the license"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["new_end_date"],"title":"LicenseRenewRequest","description":"M5W2: Renew a license"},"LicenseSummarySchema":{"properties":{"allocation_id":{"type":"integer","title":"Allocation Id","description":"Allocation ID"},"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id","description":"License ID"},"standard_title":{"type":"string","title":"Standard Title","description":"Standard title"},"tier":{"type":"string","title":"Tier","description":"Plan tier"},"days_remaining":{"type":"integer","title":"Days Remaining","description":"Days until expiry"},"activation_status":{"type":"string","title":"Activation Status","description":"Activation status"},"expiry_status":{"type":"string","title":"Expiry Status","description":"Expiry status"}},"type":"object","required":["allocation_id","standard_title","tier","days_remaining","activation_status","expiry_status"],"title":"LicenseSummarySchema","description":"Condensed license summary for list views"},"LicenseUpgradeRequest":{"properties":{"new_standard_id":{"type":"integer","title":"New Standard Id","description":"New standard to upgrade to"},"new_end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"New End Date","description":"Optional new end date"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["new_standard_id"],"title":"LicenseUpgradeRequest","description":"M5W4: Upgrade a license"},"LicenseWorkflowResponse":{"properties":{"message":{"type":"string","title":"Message"},"license_id":{"type":"integer","title":"License Id"},"previous_status":{"type":"string","title":"Previous Status"},"new_status":{"type":"string","title":"New Status"},"action_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Action By"}},"type":"object","required":["message","license_id","previous_status","new_status"],"title":"LicenseWorkflowResponse","description":"Response for license workflow actions"},"LocalMethodEnum":{"type":"string","enum":["local_path","cifs_smb","nfs"],"title":"LocalMethodEnum"},"LoginRequest":{"properties":{"username":{"type":"string","maxLength":100,"minLength":3,"title":"Username","description":"Username or email"},"password":{"type":"string","minLength":1,"title":"Password","description":"User password"}},"type":"object","required":["username","password"],"title":"LoginRequest","description":"Request model for user login.\n\nAccepts either username or email for login.","example":{"password":"password123","username":"admin"}},"LoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"},"user":{"$ref":"#/components/schemas/UserInfo"}},"type":"object","required":["access_token","refresh_token","expires_in","user"],"title":"LoginResponse","description":"Response model for successful login."},"LogoutResponse":{"properties":{"message":{"type":"string","title":"Message","default":"Successfully logged out"}},"type":"object","title":"LogoutResponse","description":"Response model for logout."},"MPClientMasterCreate":{"properties":{"client_name":{"type":"string","maxLength":255,"minLength":1,"title":"Client Name"},"contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Contact Phone"},"client_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Address"},"client_website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Client Website"},"portal_username":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Portal Username"}},"type":"object","required":["client_name"],"title":"MPClientMasterCreate","description":"Schema for creating a new client"},"MPClientMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPClientMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPClientMasterListResponse","description":"Paginated list response"},"MPClientMasterResponse":{"properties":{"client_id":{"type":"integer","title":"Client Id"},"client_name":{"type":"string","title":"Client Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"client_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Address"},"client_website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Website"},"portal_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Portal Username"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","default":"Approved"},"approval_comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Comments"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By"},"approved_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approved By"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","default":true},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"schema_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"},"schema_created":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Schema Created","default":false},"schema_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Schema Created At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["client_id","client_name"],"title":"MPClientMasterResponse","description":"Response schema with workflow fields"},"MPClientMasterUpdate":{"properties":{"client_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Client Name"},"contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Contact Phone"},"client_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Address"},"client_website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Client Website"}},"type":"object","title":"MPClientMasterUpdate","description":"Schema for updating a client"},"MPClientTenantAccessListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPClientTenantAccessResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"MPClientTenantAccessListResponse"},"MPClientTenantAccessResponse":{"properties":{"id":{"type":"integer","title":"Id"},"client_id":{"type":"integer","title":"Client Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"email":{"type":"string","title":"Email"},"is_used":{"type":"boolean","title":"Is Used"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","client_id","tenant_id","email","is_used","expires_at"],"title":"MPClientTenantAccessResponse"},"MPCompanyMasterCreate":{"properties":{"company_name":{"type":"string","maxLength":255,"minLength":1,"title":"Company Name"},"background_color":{"allOf":[{"$ref":"#/components/schemas/BackgroundColor"}],"default":"black"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["company_name"],"title":"MPCompanyMasterCreate","description":"Schema for creating a new company"},"MPCompanyMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPCompanyMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPCompanyMasterListResponse","description":"Paginated list response"},"MPCompanyMasterResponse":{"properties":{"company_id":{"type":"integer","title":"Company Id"},"company_name":{"type":"string","title":"Company Name"},"background_color":{"type":"string","title":"Background Color"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["company_id","company_name","background_color"],"title":"MPCompanyMasterResponse","description":"Response schema for company"},"MPCompanyMasterUpdate":{"properties":{"company_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Company Name"},"background_color":{"anyOf":[{"$ref":"#/components/schemas/BackgroundColor"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"MPCompanyMasterUpdate","description":"Schema for updating a company"},"MPFunctionMasterCreate":{"properties":{"function_name":{"type":"string","maxLength":255,"minLength":1,"title":"Function Name","description":"Name of the function/department","examples":["IT Department","Human Resources","Finance"]},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Detailed description of the function","examples":["Handles all IT infrastructure and support"]}},"type":"object","required":["function_name"],"title":"MPFunctionMasterCreate","description":"Create Schema for Function Master\n\nUsed when creating a new function.\nInherits all fields from Base schema.\n\nREQUIRED FIELDS:\n- function_name (from Base)\n\nOPTIONAL FIELDS:\n- description (from Base)\n\nUSAGE:\n    POST /api/v1/functions/\n    Body: {\n        \"function_name\": \"IT Department\",\n        \"description\": \"Handles IT\"\n    }"},"MPFunctionMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPFunctionMasterResponse"},"type":"array","title":"Items","description":"List of function records"},"total":{"type":"integer","title":"Total","description":"Total number of records","examples":[50]},"page":{"type":"integer","title":"Page","description":"Current page number","examples":[1]},"limit":{"type":"integer","title":"Limit","description":"Items per page","examples":[10]},"pages":{"type":"integer","title":"Pages","description":"Total number of pages","examples":[5]}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPFunctionMasterListResponse","description":"List Response Schema\n\nUsed when returning a list of functions with pagination info.\n\nFIELDS:\n- items: List of function objects\n- total: Total number of records\n- page: Current page number\n- limit: Items per page\n- pages: Total number of pages\n\nUSAGE:\n    GET /api/v1/functions/?page=1&limit=10\n    Response: {\n        \"items\": [...],\n        \"total\": 50,\n        \"page\": 1,\n        \"limit\": 10,\n        \"pages\": 5\n    }"},"MPFunctionMasterResponse":{"properties":{"function_id":{"type":"integer","title":"Function Id","description":"Unique identifier","examples":[1,2,3]},"function_name":{"type":"string","title":"Function Name","description":"Name of the function"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the function"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the record was created"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When the record was last updated"}},"type":"object","required":["function_id","function_name"],"title":"MPFunctionMasterResponse","description":"Response Schema for Function Master\n\nDefines what data is returned when querying functions.\n\nFIELDS RETURNED:\n- function_id: Unique identifier\n- function_name: Name of the function\n- description: Description text\n- created_at: When it was created\n- updated_at: When it was last modified\n\nCONFIG:\n- from_attributes = True: Allows converting SQLAlchemy models directly"},"MPFunctionMasterUpdate":{"properties":{"function_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Function Name","description":"New name for the function"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"New description for the function"}},"type":"object","title":"MPFunctionMasterUpdate","description":"Update Schema for Function Master\n\nUsed when updating an existing function.\nALL FIELDS ARE OPTIONAL - only update what you send.\n\nOPTIONAL FIELDS:\n- function_name\n- description\n\nUSAGE:\n    PUT /api/v1/functions/1\n    Body: {\n        \"description\": \"Updated description only\"\n    }\n\nNOTE: Only the fields you include will be updated."},"MPLicenseMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPLicenseMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPLicenseMasterListResponse","description":"Paginated list response"},"MPLicenseMasterResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"client_id":{"type":"integer","title":"Client Id"},"po_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"activation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activation Status","default":"Pending"},"expiry_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiry Status","default":"Active"},"license_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Key"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["license_id","client_id"],"title":"MPLicenseMasterResponse","description":"Response schema with all fields from screenshot"},"MPLicenseMasterUpdate":{"properties":{"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"standard_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Standard Id"},"po_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"activation_status":{"anyOf":[{"$ref":"#/components/schemas/ActivationStatus"},{"type":"null"}]},"expiry_status":{"anyOf":[{"$ref":"#/components/schemas/ExpiryStatus"},{"type":"null"}]},"license_key":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"License Key"},"license_type":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"License Type"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"MPLicenseMasterUpdate","description":"Update License - all fields optional"},"MPPODetailsCreate":{"properties":{"PO_id":{"type":"integer","title":"Po Id"},"Client_id":{"type":"integer","title":"Client Id"},"License_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"Amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount"},"Payment_Status":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Payment Status"}},"type":"object","required":["PO_id","Client_id"],"title":"MPPODetailsCreate"},"MPPODetailsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPPODetailsResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPPODetailsListResponse"},"MPPODetailsResponse":{"properties":{"Sl_No":{"type":"integer","title":"Sl No"},"PO_id":{"type":"integer","title":"Po Id"},"Client_id":{"type":"integer","title":"Client Id"},"License_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"Amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount"},"Payment_Status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Status"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["Sl_No","PO_id","Client_id"],"title":"MPPODetailsResponse"},"MPPODetailsUpdate":{"properties":{"PO_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Id"},"Client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"License_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"Amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount"},"Payment_Status":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Payment Status"}},"type":"object","title":"MPPODetailsUpdate"},"MPPOMasterCreate":{"properties":{"client_id":{"type":"integer","title":"Client Id"},"po_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Po Date"},"po_start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Po Start Date"},"po_end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Po End Date"},"product_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Description"},"qty":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Qty"},"unit_price":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Unit Price"},"total_amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Total Amount"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","default":"USD"},"tax_rate":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Tax Rate","default":"18.0"},"tax_amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Tax Amount"},"billing_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Address"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"governances":{"anyOf":[{"items":{"$ref":"#/components/schemas/POGovernanceItem-Input"},"type":"array"},{"type":"null"}],"title":"Governances"}},"type":"object","required":["client_id"],"title":"MPPOMasterCreate"},"MPPOMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPPOMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPPOMasterListResponse"},"MPPOMasterResponse":{"properties":{"po_id":{"type":"integer","title":"Po Id"},"client_id":{"type":"integer","title":"Client Id"},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"po_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Po Date"},"po_start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Po Start Date"},"po_end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Po End Date"},"product_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Description"},"qty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qty"},"unit_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Price"},"total_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Amount"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"tax_rate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Rate"},"tax_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Amount"},"billing_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Address"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"governances":{"items":{"$ref":"#/components/schemas/POGovernanceItem-Output"},"type":"array","title":"Governances","default":[]},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"client_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Phone"},"client_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Address"}},"type":"object","required":["po_id","client_id"],"title":"MPPOMasterResponse"},"MPPOMasterUpdate":{"properties":{"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"po_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Po Date"},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"po_start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Po Start Date"},"po_end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Po End Date"},"product_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Description"},"qty":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Qty"},"unit_price":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Unit Price"},"total_amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Total Amount"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"tax_rate":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Tax Rate"},"tax_amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Tax Amount"},"billing_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Address"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"governances":{"anyOf":[{"items":{"$ref":"#/components/schemas/POGovernanceItem-Input"},"type":"array"},{"type":"null"}],"title":"Governances"}},"type":"object","title":"MPPOMasterUpdate"},"MPRoleMasterCreate":{"properties":{"role_title":{"type":"string","maxLength":50,"minLength":1,"title":"Role Title"},"role_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Detail"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id"}},"type":"object","required":["role_title"],"title":"MPRoleMasterCreate"},"MPRoleMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPRoleMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPRoleMasterListResponse"},"MPRoleMasterResponse":{"properties":{"role_id":{"type":"integer","title":"Role Id"},"role_title":{"type":"string","title":"Role Title"},"role_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Detail"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["role_id","role_title"],"title":"MPRoleMasterResponse"},"MPRoleMasterUpdate":{"properties":{"role_title":{"anyOf":[{"type":"string","maxLength":50,"minLength":1},{"type":"null"}],"title":"Role Title"},"role_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Detail"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id"}},"type":"object","title":"MPRoleMasterUpdate"},"MPRoleUserMappingCreate":{"properties":{"user_id":{"type":"integer","title":"User Id","description":"User ID"},"role_id":{"type":"integer","title":"Role Id","description":"Role ID"}},"type":"object","required":["user_id","role_id"],"title":"MPRoleUserMappingCreate"},"MPRoleUserMappingListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPRoleUserMappingResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPRoleUserMappingListResponse"},"MPRoleUserMappingResponse":{"properties":{"mapping_id":{"type":"integer","title":"Mapping Id"},"user_id":{"type":"integer","title":"User Id"},"role_id":{"type":"integer","title":"Role Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["mapping_id","user_id","role_id"],"title":"MPRoleUserMappingResponse"},"MPUserMasterCreate":{"properties":{"user_name":{"type":"string","maxLength":255,"minLength":1,"title":"User Name"},"email_id":{"type":"string","format":"email","title":"Email Id"},"phone_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone Number"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"reporting_mgr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reporting Mgr"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id"},"password":{"type":"string","minLength":8,"title":"Password","description":"Password (min 8 chars)"}},"type":"object","required":["user_name","email_id","password"],"title":"MPUserMasterCreate","description":"Create schema - includes password"},"MPUserMasterListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPUserMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"MPUserMasterListResponse"},"MPUserMasterResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"user_name":{"type":"string","title":"User Name"},"email_id":{"type":"string","title":"Email Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"reporting_mgr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reporting Mgr"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id"},"is_active":{"type":"boolean","title":"Is Active","default":true},"preferred_storage_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Preferred Storage Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["user_id","user_name","email_id"],"title":"MPUserMasterResponse","description":"Response schema - NO password field!"},"MPUserMasterUpdate":{"properties":{"user_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"User Name"},"email_id":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email Id"},"phone_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone Number"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"reporting_mgr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reporting Mgr"},"function_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Function Id"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"MPUserMasterUpdate","description":"Update schema - all fields optional, no password"},"ObjectiveInfo":{"properties":{"objective_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Objective Id"},"objective_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective Code"},"objective_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective Title"}},"type":"object","title":"ObjectiveInfo","description":"Nested objective info for response"},"POGovernanceItem-Input":{"properties":{"gov_id":{"type":"integer","title":"Gov Id"},"gov_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gov Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"qty":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Qty"},"unit_price":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Unit Price"},"amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount"}},"type":"object","required":["gov_id"],"title":"POGovernanceItem","description":"A governance domain purchased on this PO.\n\nLicenses are allocated per governance, so these rows drive the governance\npicker on the License Allocation page."},"POGovernanceItem-Output":{"properties":{"gov_id":{"type":"integer","title":"Gov Id"},"gov_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gov Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"qty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qty"},"unit_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Price"},"amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount"}},"type":"object","required":["gov_id"],"title":"POGovernanceItem","description":"A governance domain purchased on this PO.\n\nLicenses are allocated per governance, so these rows drive the governance\npicker on the License Allocation page."},"PasswordChange":{"properties":{"current_password":{"type":"string","title":"Current Password","description":"Current password"},"new_password":{"type":"string","minLength":8,"title":"New Password","description":"New password"},"confirm_password":{"type":"string","minLength":8,"title":"Confirm Password","description":"Confirm new password"}},"type":"object","required":["current_password","new_password","confirm_password"],"title":"PasswordChange","description":"Request model for password change (authenticated user)."},"PasswordChangeResponse":{"properties":{"message":{"type":"string","title":"Message","default":"Password changed successfully"}},"type":"object","title":"PasswordChangeResponse","description":"Response model for successful password change."},"PaymentStatus":{"type":"string","enum":["Pending","Partial","Completed","Failed"],"title":"PaymentStatus","description":"Payment Status"},"PaymentStatusUpdate":{"properties":{"payment_status":{"allOf":[{"$ref":"#/components/schemas/PaymentStatus"}],"description":"New payment status"}},"type":"object","required":["payment_status"],"title":"PaymentStatusUpdate","description":"Set the payment status on a Draft / Pending Review allocation."},"PendingAllocationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LicenseAllocationResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"PendingAllocationListResponse","description":"List of allocations pending review"},"PendingReviewListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MPClientMasterResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"PendingReviewListResponse","description":"List of clients pending supervisor review"},"PeriodWorkflowResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"comp_period_id":{"type":"integer","title":"Comp Period Id"},"previous_status":{"type":"string","title":"Previous Status"},"new_status":{"type":"string","title":"New Status"},"action_by":{"type":"integer","title":"Action By"},"assignments_generated":{"type":"integer","title":"Assignments Generated","default":0},"assignments_completed":{"type":"integer","title":"Assignments Completed","default":0}},"type":"object","required":["success","message","comp_period_id","previous_status","new_status","action_by"],"title":"PeriodWorkflowResponse","description":"Response for period workflow actions"},"PlanDetailsSchema":{"properties":{"tier":{"type":"string","title":"Tier","description":"Plan tier: Basic/Professional/Enterprise"},"yearly_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Yearly Price","description":"Yearly subscription price"},"currency":{"type":"string","title":"Currency","description":"Currency code","default":"USD"}},"type":"object","required":["tier"],"title":"PlanDetailsSchema","description":"Plan/tier details"},"PopulateActivitiesRequest":{"properties":{"std_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Std Id","description":"Standard ID (defaults to allocation's standard_id)"},"control_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Control Ids","description":"Specific control IDs to process (None/empty = all controls)"}},"type":"object","title":"PopulateActivitiesRequest","description":"Request to populate CP_Activities from hierarchy controls.\nBoth fields are optional — if omitted, std_id is taken from the allocation's own\nstandard_id, and all controls for that standard are processed."},"PopulateActivitiesResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"allocation_id":{"type":"integer","title":"Allocation Id"},"schema_name":{"type":"string","title":"Schema Name"},"std_id":{"type":"integer","title":"Std Id"},"controls_processed":{"type":"integer","title":"Controls Processed"},"activities_created":{"type":"integer","title":"Activities Created"},"activities":{"items":{"$ref":"#/components/schemas/CPActivityItem"},"type":"array","title":"Activities","default":[]}},"type":"object","required":["success","message","allocation_id","schema_name","std_id","controls_processed","activities_created"],"title":"PopulateActivitiesResponse","description":"Response after populating CP_Activities"},"RefreshTokenRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token","description":"The refresh token"}},"type":"object","required":["refresh_token"],"title":"RefreshTokenRequest","description":"Request model for token refresh."},"ResendAccessCodeResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"client_id":{"type":"integer","title":"Client Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"email":{"type":"string","title":"Email"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["success","message","client_id","tenant_id","email","expires_at"],"title":"ResendAccessCodeResponse"},"SelectedStandardsRequest":{"properties":{"license_key":{"type":"string","title":"License Key","description":"License key sent to your registered email"},"std_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Std Ids","description":"std_id values chosen from GET /client-portal/available-standards"}},"type":"object","required":["license_key","std_ids"],"title":"SelectedStandardsRequest","description":"Standards the client picked from the ones its governance licence covers."},"SendBulkEmailResponse":{"properties":{"total_requested":{"type":"integer","title":"Total Requested"},"successful":{"type":"integer","title":"Successful"},"failed":{"type":"integer","title":"Failed"},"results":{"items":{"$ref":"#/components/schemas/BulkEmailResultItem"},"type":"array","title":"Results"}},"type":"object","required":["total_requested","successful","failed","results"],"title":"SendBulkEmailResponse","description":"Response schema for bulk email send","example":{"failed":1,"results":[{"client_id":1,"client_name":"Acme Corp","email":"client1@example.com","message":"Email sent successfully","success":true},{"client_id":2,"client_name":"Tech Inc","email":"client2@example.com","message":"Email sent successfully","success":true},{"client_id":3,"client_name":"No Email Client","email":"","message":"Client has no email address","success":false}],"successful":2,"total_requested":3}},"SendEmailResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"link_expires_in_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Link Expires In Hours"}},"type":"object","required":["success","message"],"title":"SendEmailResponse","description":"Response schema for single email send","example":{"client_id":1,"email":"client@example.com","link_expires_in_hours":72,"message":"Access email sent successfully to client@example.com","success":true}},"SendLicenseKeyEmailRequest":{"properties":{"license_id":{"type":"integer","title":"License Id","description":"License ID from mp_license_master"}},"type":"object","required":["license_id"],"title":"SendLicenseKeyEmailRequest","description":"Request schema for sending license key email to a client","example":{"license_id":1}},"SendPortalAccessBulkRequest":{"properties":{"client_ids":{"items":{"type":"integer"},"type":"array","title":"Client Ids","description":"List of client IDs to send access emails"},"custom_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Message","description":"Optional custom message to include"}},"type":"object","required":["client_ids"],"title":"SendPortalAccessBulkRequest","description":"Request schema for sending portal access to multiple clients","example":{"client_ids":[1,2,3],"custom_message":"Welcome to our platform!"}},"SendPortalAccessRequest":{"properties":{"client_id":{"type":"integer","title":"Client Id","description":"Client ID to send access email"},"custom_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Message","description":"Optional custom message to include"}},"type":"object","required":["client_id"],"title":"SendPortalAccessRequest","description":"Request schema for sending portal access to a single client","example":{"client_id":1,"custom_message":"Welcome to our platform!"}},"StandardCreate":{"properties":{"std_code":{"type":"string","maxLength":50,"title":"Std Code","description":"Standard code"},"std_name":{"type":"string","maxLength":200,"title":"Std Name","description":"Standard full name"},"std_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Description","description":"Description"},"std_version":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Std Version","description":"Version"},"level_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level No","description":"Number of hierarchy levels"},"level_names":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Level Names","description":"Comma-separated level names (e.g., Domain,Sub-domain,Control)"},"levels":{"anyOf":[{"items":{"$ref":"#/components/schemas/LevelNameInput"},"type":"array"},{"type":"null"}],"title":"Levels","description":"Level names to create with this standard"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},"type":"object","required":["std_code","std_name"],"title":"StandardCreate","description":"Schema for creating a standard"},"StandardInfoSchema":{"properties":{"std_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Std Id","description":"Standard ID (NULL for governance-level licenses)"},"std_title":{"type":"string","title":"Std Title","description":"Standard title (e.g., ISO 22301)"},"std_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Detail","description":"Standard description"},"governance_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governance Name","description":"Governance domain name"}},"type":"object","required":["std_title"],"title":"StandardInfoSchema","description":"Standard information"},"StandardLevelNameBulkCreate":{"properties":{"levels":{"items":{"$ref":"#/components/schemas/StandardLevelNameCreate"},"type":"array","title":"Levels","description":"List of level names to add"}},"type":"object","required":["levels"],"title":"StandardLevelNameBulkCreate","description":"Schema for bulk creating level names"},"StandardLevelNameCreate":{"properties":{"level_no":{"type":"integer","minimum":1.0,"title":"Level No","description":"Level number (1, 2, 3...)"},"level_name":{"type":"string","maxLength":255,"title":"Level Name","description":"Name for this level (e.g., Domain, Sub-domain, Control)"}},"type":"object","required":["level_no","level_name"],"title":"StandardLevelNameCreate","description":"Schema for creating a level name"},"StandardLevelNameListResponse":{"properties":{"std_id":{"type":"integer","title":"Std Id"},"items":{"items":{"$ref":"#/components/schemas/StandardLevelNameResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["std_id","items","total"],"title":"StandardLevelNameListResponse","description":"List response for level names"},"StandardLevelNameResponse":{"properties":{"id":{"type":"integer","title":"Id"},"std_id":{"type":"integer","title":"Std Id"},"level_no":{"type":"integer","title":"Level No"},"level_name":{"type":"string","title":"Level Name"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","std_id","level_no","level_name"],"title":"StandardLevelNameResponse","description":"Response schema for level name"},"StandardLevelNameUpdate":{"properties":{"level_name":{"type":"string","maxLength":255,"title":"Level Name","description":"Updated level name"}},"type":"object","required":["level_name"],"title":"StandardLevelNameUpdate","description":"Schema for updating a level name"},"StandardListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StandardResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["items","total","page","limit","pages"],"title":"StandardListResponse","description":"List response with pagination"},"StandardResponse":{"properties":{"std_id":{"type":"integer","title":"Std Id"},"std_code":{"type":"string","title":"Std Code"},"std_name":{"type":"string","title":"Std Name"},"std_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Description"},"std_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Version"},"level_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level No"},"level_names":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level Names"},"levels":{"items":{"$ref":"#/components/schemas/LevelNameDetail"},"type":"array","title":"Levels","description":"Level name details"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["std_id","std_code","std_name","is_active"],"title":"StandardResponse","description":"Response schema for standard"},"StandardUpdate":{"properties":{"std_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Std Code"},"std_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Std Name"},"std_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Description"},"std_version":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Std Version"},"level_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Level No"},"level_names":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Level Names"},"levels":{"anyOf":[{"items":{"$ref":"#/components/schemas/LevelNameInput"},"type":"array"},{"type":"null"}],"title":"Levels","description":"Level names to replace (deletes existing and creates new)"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"StandardUpdate","description":"Schema for updating a standard"},"StoragePreferenceResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"preferred_storage_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Preferred Storage Id"},"storage_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storage Type"},"storage_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storage Name"},"message":{"type":"string","title":"Message"}},"type":"object","required":["user_id","message"],"title":"StoragePreferenceResponse","description":"Response schema for storage preference"},"StoragePreferenceUpdate":{"properties":{"storage_setting_id":{"type":"integer","title":"Storage Setting Id","description":"ID of the storage setting to use"}},"type":"object","required":["storage_setting_id"],"title":"StoragePreferenceUpdate","description":"Schema for updating user's storage preference"},"StorageSettingsCreate":{"properties":{"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id","description":"Client ID (NULL for global default)"},"storage_type":{"allOf":[{"$ref":"#/components/schemas/StorageTypeEnum"}],"description":"Storage type"},"local_method":{"anyOf":[{"$ref":"#/components/schemas/LocalMethodEnum"},{"type":"null"}]},"local_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Local Path"},"smb_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Host"},"smb_share":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Share"},"smb_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Username"},"smb_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Password"},"nfs_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nfs Host"},"nfs_export":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nfs Export"},"aws_access_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Access Key Id"},"aws_secret_access_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Secret Access Key"},"aws_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Region"},"aws_bucket_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Bucket Name"},"aws_endpoint_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Endpoint Url"},"azure_account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Account Name"},"azure_account_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Account Key"},"azure_container_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Container Name"},"azure_connection_string":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Connection String"},"gcs_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Project Id"},"gcs_bucket_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Bucket Name"},"gcs_key_file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Key File Path"},"gcs_credentials_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Credentials Json"},"allowed_file_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed File Types","description":"List of allowed file extensions","default":["png","jpg","jpeg","gif","webp","mp4","webm","mov","pdf","docx","xlsx"]},"max_file_size_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max File Size Mb","description":"Maximum file size in MB","default":50}},"type":"object","required":["storage_type"],"title":"StorageSettingsCreate","description":"Create storage settings - specify type and corresponding config","example":{"allowed_file_types":["png","jpg","pdf","docx"],"local_method":"local_path","local_path":"/var/marshal/storage","max_file_size_mb":50,"storage_type":"local"}},"StorageSettingsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StorageSettingsResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"StorageSettingsListResponse","description":"Response for list of storage settings"},"StorageSettingsResponse":{"properties":{"setting_id":{"type":"integer","title":"Setting Id"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"storage_type":{"type":"string","title":"Storage Type"},"is_active":{"type":"boolean","title":"Is Active"},"local_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Local Method"},"local_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Local Path"},"smb_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Host"},"smb_share":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Share"},"smb_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Username"},"nfs_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nfs Host"},"nfs_export":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nfs Export"},"aws_access_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Access Key Id"},"aws_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Region"},"aws_bucket_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Bucket Name"},"aws_endpoint_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Endpoint Url"},"azure_account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Account Name"},"azure_container_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Container Name"},"gcs_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Project Id"},"gcs_bucket_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Bucket Name"},"gcs_key_file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Key File Path"},"allowed_file_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed File Types"},"max_file_size_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max File Size Mb"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["setting_id","storage_type","is_active"],"title":"StorageSettingsResponse","description":"Response schema for storage settings"},"StorageSettingsUpdate":{"properties":{"storage_type":{"anyOf":[{"$ref":"#/components/schemas/StorageTypeEnum"},{"type":"null"}]},"local_method":{"anyOf":[{"$ref":"#/components/schemas/LocalMethodEnum"},{"type":"null"}]},"local_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Local Path"},"smb_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Host"},"smb_share":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Share"},"smb_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Username"},"smb_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Password"},"nfs_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nfs Host"},"nfs_export":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nfs Export"},"aws_access_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Access Key Id"},"aws_secret_access_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Secret Access Key"},"aws_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Region"},"aws_bucket_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Bucket Name"},"aws_endpoint_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Endpoint Url"},"azure_account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Account Name"},"azure_account_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Account Key"},"azure_container_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Container Name"},"azure_connection_string":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Connection String"},"gcs_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Project Id"},"gcs_bucket_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Bucket Name"},"gcs_key_file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Key File Path"},"gcs_credentials_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Credentials Json"},"allowed_file_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed File Types"},"max_file_size_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max File Size Mb"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"StorageSettingsUpdate","description":"Update storage settings"},"StorageTypeEnum":{"type":"string","enum":["local","aws_s3","azure_blob","google_cloud"],"title":"StorageTypeEnum"},"StructureDetailResponse":{"properties":{"allocation_id":{"type":"integer","title":"Allocation Id"},"client_id":{"type":"integer","title":"Client Id"},"schema_name":{"type":"string","title":"Schema Name"},"std_id":{"type":"integer","title":"Std Id"},"std_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Code"},"std_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Std Name"},"total_controls":{"type":"integer","title":"Total Controls"},"total_activities":{"type":"integer","title":"Total Activities"},"applicable_controls":{"type":"integer","title":"Applicable Controls"},"applicable_activities":{"type":"integer","title":"Applicable Activities"},"root_controls":{"items":{"$ref":"#/components/schemas/ControlDetailNode"},"type":"array","title":"Root Controls","default":[]}},"type":"object","required":["allocation_id","client_id","schema_name","std_id","total_controls","total_activities","applicable_controls","applicable_activities"],"title":"StructureDetailResponse","description":"Hierarchical structure detail response"},"SupportedFileTypesResponse":{"properties":{"images":{"items":{"type":"string"},"type":"array","title":"Images","default":["png","jpg","jpeg","gif","webp"]},"videos":{"items":{"type":"string"},"type":"array","title":"Videos","default":["mp4","webm","mov"]},"documents":{"items":{"type":"string"},"type":"array","title":"Documents","default":["pdf","docx","xlsx"]},"all_types":{"items":{"type":"string"},"type":"array","title":"All Types","default":["png","jpg","jpeg","gif","webp","mp4","webm","mov","pdf","docx","xlsx"]}},"type":"object","title":"SupportedFileTypesResponse","description":"Response showing supported file types"},"TestConnectionRequest":{"properties":{"storage_type":{"allOf":[{"$ref":"#/components/schemas/StorageTypeEnum"}],"description":"Storage type to test"},"local_method":{"anyOf":[{"$ref":"#/components/schemas/LocalMethodEnum"},{"type":"null"}]},"local_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Local Path"},"smb_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Host"},"smb_share":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Share"},"smb_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Username"},"smb_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smb Password"},"nfs_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nfs Host"},"nfs_export":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nfs Export"},"aws_access_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Access Key Id"},"aws_secret_access_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Secret Access Key"},"aws_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Region"},"aws_bucket_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Bucket Name"},"aws_endpoint_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Endpoint Url"},"azure_account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Account Name"},"azure_account_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Account Key"},"azure_container_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Container Name"},"azure_connection_string":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Connection String"},"gcs_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Project Id"},"gcs_bucket_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Bucket Name"},"gcs_key_file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Key File Path"},"gcs_credentials_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Credentials Json"}},"type":"object","required":["storage_type"],"title":"TestConnectionRequest","description":"Request to test storage connection"},"TestConnectionResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"storage_type":{"type":"string","title":"Storage Type"},"details":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Details"}},"type":"object","required":["success","message","storage_type"],"title":"TestConnectionResponse","description":"Response for connection test","example":{"details":{"bucket":"marshal-files","region":"us-east-1"},"message":"Connection successful","storage_type":"aws_s3","success":true}},"TimeRemainingSchema":{"properties":{"days_remaining":{"type":"integer","title":"Days Remaining","description":"Days until expiry (negative if expired)"},"is_expired":{"type":"boolean","title":"Is Expired","description":"Whether license has expired"},"is_expiring_soon":{"type":"boolean","title":"Is Expiring Soon","description":"True if less than 30 days remaining"},"end_date":{"type":"string","format":"date","title":"End Date","description":"License end date"}},"type":"object","required":["days_remaining","is_expired","is_expiring_soon","end_date"],"title":"TimeRemainingSchema","description":"Time remaining calculation"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In","description":"Access token expiration in seconds"}},"type":"object","required":["access_token","refresh_token","expires_in"],"title":"Token","description":"Response model for successful authentication."},"UpdateControlApplicabilityRequest":{"properties":{"control_code":{"type":"string","title":"Control Code","description":"Control code to update (e.g., ISO_27k_S3)"},"is_applicable":{"type":"boolean","title":"Is Applicable","description":"New applicability status"},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification","description":"Reason for the change"},"cascade_to_children":{"type":"boolean","title":"Cascade To Children","description":"Cascade to all child controls","default":true}},"type":"object","required":["control_code","is_applicable"],"title":"UpdateControlApplicabilityRequest","description":"Request to update control applicability in client schema"},"UpdateControlApplicabilityResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"control_code":{"type":"string","title":"Control Code"},"is_applicable":{"type":"boolean","title":"Is Applicable"},"controls_updated":{"type":"integer","title":"Controls Updated"},"activities_removed":{"type":"integer","title":"Activities Removed","default":0}},"type":"object","required":["success","message","control_code","is_applicable","controls_updated"],"title":"UpdateControlApplicabilityResponse","description":"Response after updating control applicability"},"UpdateIndicatorValueRequest":{"properties":{"current_value":{"type":"number","title":"Current Value","description":"New current value"},"measurement_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Measurement Date","description":"Date of measurement"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes about this measurement"}},"type":"object","required":["current_value"],"title":"UpdateIndicatorValueRequest","description":"Request to update indicator current value"},"UpdateIndicatorValueResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"indicator_id":{"type":"integer","title":"Indicator Id"},"indicator_code":{"type":"string","title":"Indicator Code"},"previous_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Previous Value"},"new_value":{"type":"number","title":"New Value"},"status":{"type":"string","title":"Status"}},"type":"object","required":["success","message","indicator_id","indicator_code","previous_value","new_value","status"],"title":"UpdateIndicatorValueResponse","description":"Response for value update"},"UploadCSVToStorageResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"client_id":{"type":"integer","title":"Client Id"},"storage_type":{"type":"string","title":"Storage Type"},"total_uploaded":{"type":"integer","title":"Total Uploaded"},"total_failed":{"type":"integer","title":"Total Failed"},"uploads":{"items":{"$ref":"#/components/schemas/CSVUploadResult"},"type":"array","title":"Uploads"}},"type":"object","required":["success","message","client_id","storage_type","total_uploaded","total_failed","uploads"],"title":"UploadCSVToStorageResponse","description":"POST response for uploading stored CSVs to client storage."},"UserInfo":{"properties":{"user_id":{"type":"integer","title":"User Id"},"username":{"type":"string","title":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"is_active":{"type":"boolean","title":"Is Active","default":true},"roles":{"items":{"type":"string"},"type":"array","title":"Roles","default":[]},"user_type":{"type":"string","title":"User Type","default":"mp"}},"type":"object","required":["user_id","username"],"title":"UserInfo","description":"Basic user information returned after login."},"UserInfoSchema":{"properties":{"user_id":{"type":"integer","title":"User Id","description":"User ID"},"user_name":{"type":"string","title":"User Name","description":"User's full name"},"first_name":{"type":"string","title":"First Name","description":"First name for welcome message"},"email_id":{"type":"string","title":"Email Id","description":"Email address"}},"type":"object","required":["user_id","user_name","first_name","email_id"],"title":"UserInfoSchema","description":"User information for welcome message"},"UserRegister":{"properties":{"username":{"type":"string","maxLength":50,"minLength":3,"title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":100,"minLength":8,"title":"Password"},"confirm_password":{"type":"string","maxLength":100,"minLength":8,"title":"Confirm Password"},"full_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Full Name"},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone"}},"type":"object","required":["username","email","password","confirm_password"],"title":"UserRegister","description":"Request model for user registration.","example":{"confirm_password":"SecurePass123","email":"john@example.com","full_name":"John Doe","password":"SecurePass123","phone":"+1234567890","username":"johndoe"}},"UserRegisterResponse":{"properties":{"message":{"type":"string","title":"Message","default":"User registered successfully"},"user_id":{"type":"integer","title":"User Id"},"username":{"type":"string","title":"Username"},"email":{"type":"string","title":"Email"}},"type":"object","required":["user_id","username","email"],"title":"UserRegisterResponse","description":"Response model for successful registration."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyAccessTokenRequest":{"properties":{"token":{"type":"string","title":"Token","description":"Access token from the portal link"}},"type":"object","required":["token"],"title":"VerifyAccessTokenRequest","description":"Request schema for verifying access token","example":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}},"VerifyTokenResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["valid"],"title":"VerifyTokenResponse","description":"Response schema for token verification","example":{"client_id":1,"email":"client@example.com","expires_at":"2024-01-15T12:00:00","valid":true}},"app__license_allocation__schema__SchemaCreationResponse":{"properties":{"message":{"type":"string","title":"Message"},"allocation_id":{"type":"integer","title":"Allocation Id"},"client_id":{"type":"integer","title":"Client Id"},"schema_name":{"type":"string","title":"Schema Name"},"tables_created":{"items":{"type":"string"},"type":"array","title":"Tables Created"},"standard_data_copied":{"type":"boolean","title":"Standard Data Copied"}},"type":"object","required":["message","allocation_id","client_id","schema_name","tables_created","standard_data_copied"],"title":"SchemaCreationResponse","description":"Response when client schema is created"},"app__mp_client_master__schema__SchemaCreationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"client_id":{"type":"integer","title":"Client Id"},"client_name":{"type":"string","title":"Client Name"},"schema_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"},"tables_created":{"items":{"type":"string"},"type":"array","title":"Tables Created","default":[]},"allocations_used":{"type":"integer","title":"Allocations Used","default":0},"governance_tables_created":{"items":{"type":"string"},"type":"array","title":"Governance Tables Created","default":[]},"csv_exports":{"items":{"$ref":"#/components/schemas/CSVExportResult"},"type":"array","title":"Csv Exports","default":[]},"csv_export_count":{"type":"integer","title":"Csv Export Count","default":0},"csv_save_success":{"type":"boolean","title":"Csv Save Success","default":false}},"type":"object","required":["success","message","client_id","client_name"],"title":"SchemaCreationResponse","description":"Response for client schema creation (M6W3, M6W4)"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/auth/token"}}},"JWT":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/auth/token"}}}}}}