{"openapi":"3.0.1","info":{"title":"MS Login Central — Comtecsa","description":"Centralized authentication microservice for Comtecsa. Manages users, user types, permissions, and JWT-based authentication.","version":"1.0.0"},"servers":[{"url":"https://securemsloginq.comtecsa.mx","description":"Public"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"User Type Permissions","description":"Assign semantic permissions to user types"},{"name":"Permissions","description":"Manage system permissions"},{"name":"Modules","description":"Manage application modules"},{"name":"User Types","description":"Manage user roles and types"},{"name":"User Type Module Defaults","description":"Default CRUD per role per module"},{"name":"Authentication","description":"Login and token management"},{"name":"Users","description":"Manage system users"},{"name":"User Module Permissions","description":"Per-user CRUD overrides"}],"paths":{"/api/v1/users/{id}":{"get":{"tags":["Users"],"summary":"Get user by ID","operationId":"findById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Users"],"summary":"Full update of user","operationId":"update","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Users"],"summary":"Delete user","operationId":"delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"patch":{"tags":["Users"],"summary":"Partial update of user","operationId":"patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-types/{id}":{"get":{"tags":["User Types"],"summary":"Get user type by ID","operationId":"findById_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["User Types"],"summary":"Full update of user type","operationId":"update_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTypeRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["User Types"],"summary":"Delete user type","operationId":"delete_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"patch":{"tags":["User Types"],"summary":"Partial update of user type","operationId":"patch_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTypePatchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-type-module-defaults/{id}":{"get":{"tags":["User Type Module Defaults"],"summary":"Get default by ID","operationId":"findById_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["User Type Module Defaults"],"summary":"Update default","operationId":"update_2","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTypeModuleDefaultRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["User Type Module Defaults"],"summary":"Delete default","operationId":"delete_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-module-permissions/{id}":{"get":{"tags":["User Module Permissions"],"summary":"Get override by ID","operationId":"findById_4","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["User Module Permissions"],"summary":"Update override","operationId":"update_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModulePermissionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["User Module Permissions"],"summary":"Delete override","operationId":"delete_4","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/permissions/{id}":{"get":{"tags":["Permissions"],"summary":"Get permission by ID","operationId":"findById_5","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Permissions"],"summary":"Full update of permission","operationId":"update_4","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Permissions"],"summary":"Delete permission","operationId":"delete_5","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"patch":{"tags":["Permissions"],"summary":"Partial update of permission","operationId":"patch_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionPatchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/modules/{id}":{"get":{"tags":["Modules"],"summary":"Get module by ID","operationId":"findById_6","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Modules"],"summary":"Update module","operationId":"update_5","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Modules"],"summary":"Delete module","operationId":"delete_6","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users":{"get":{"tags":["Users"],"summary":"List all users","operationId":"findAll","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Users"],"summary":"Create user","operationId":"create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/{id}/reset-module-permissions":{"post":{"tags":["Users"],"summary":"Reset individual module permission overrides for a user","operationId":"resetModulePermissions","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-types":{"get":{"tags":["User Types"],"summary":"List user types","description":"Optional filter by active status.","operationId":"findAll_1","parameters":[{"name":"active","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["User Types"],"summary":"Create user type","operationId":"create_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTypeRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-type-permissions":{"get":{"tags":["User Type Permissions"],"summary":"List all user type permission assignments","operationId":"findAll_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["User Type Permissions"],"summary":"Assign permission to user type","operationId":"create_2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTypePermissionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-type-module-defaults":{"post":{"tags":["User Type Module Defaults"],"summary":"Create or upsert role module default","operationId":"create_3","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTypeModuleDefaultRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-module-permissions":{"post":{"tags":["User Module Permissions"],"summary":"Create or upsert user module override","operationId":"create_4","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModulePermissionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/permissions":{"get":{"tags":["Permissions"],"summary":"List permissions","description":"Optional filter by active status.","operationId":"findAll_3","parameters":[{"name":"active","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Permissions"],"summary":"Create permission","operationId":"create_5","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/modules":{"get":{"tags":["Modules"],"summary":"List modules","description":"Optional filter by active status.","operationId":"findAll_4","parameters":[{"name":"active","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Modules"],"summary":"Create module","operationId":"create_6","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/auth/login":{"post":{"tags":["Authentication"],"summary":"Login","description":"Authenticate with username and password. Returns a JWT Bearer token.","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}}}},"/api/v1/user-type-permissions/{id}":{"get":{"tags":["User Type Permissions"],"summary":"Get assignment by ID","operationId":"findById_2","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["User Type Permissions"],"summary":"Delete assignment","operationId":"delete_2","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]},"patch":{"tags":["User Type Permissions"],"summary":"Patch assignment active flag","operationId":"patch_2","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTypePermissionPatchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/{id}/effective-module-access":{"get":{"tags":["Users"],"summary":"Effective CRUD access per module for a user","operationId":"effectiveModuleAccess","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/report":{"get":{"tags":["Users"],"summary":"User report with filters","description":"Filter users by user type and/or active status. Both params are optional.","operationId":"report","parameters":[{"name":"userTypeId","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"active","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-type-permissions/user-type/{userTypeId}":{"get":{"tags":["User Type Permissions"],"summary":"List assignments for a user type","operationId":"findByUserTypeId","parameters":[{"name":"userTypeId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-type-module-defaults/user-type/{userTypeId}":{"get":{"tags":["User Type Module Defaults"],"summary":"List defaults for a user type","operationId":"findByUserTypeId_1","parameters":[{"name":"userTypeId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/user-module-permissions/user/{userId}":{"get":{"tags":["User Module Permissions"],"summary":"List overrides for a user","operationId":"findByUserId","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/modules/code/{code}":{"get":{"tags":["Modules"],"summary":"Get module by code","operationId":"findByCode","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/auth/me":{"get":{"tags":["Authentication"],"summary":"Current user profile","description":"Returns the authenticated user's profile from the JWT.","operationId":"me","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseObject"}}}}}}}},"components":{"schemas":{"UserRequest":{"required":["email","firstName","lastName","password","userTypeId","username"],"type":"object","properties":{"username":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"userTypeId":{"type":"integer","format":"int32"}}},"ApiResponseObject":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"type":"object"}}},"UserTypeRequest":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}}},"UserTypeModuleDefaultRequest":{"required":["moduleId","userTypeId"],"type":"object","properties":{"userTypeId":{"type":"integer","format":"int32"},"moduleId":{"type":"integer","format":"int32"},"canSelect":{"type":"boolean"},"canInsert":{"type":"boolean"},"canUpdate":{"type":"boolean"},"canDelete":{"type":"boolean"}}},"UserModulePermissionRequest":{"required":["moduleId","userId"],"type":"object","properties":{"userId":{"type":"integer","format":"int32"},"moduleId":{"type":"integer","format":"int32"},"canSelect":{"type":"boolean"},"canInsert":{"type":"boolean"},"canUpdate":{"type":"boolean"},"canDelete":{"type":"boolean"},"active":{"type":"boolean"}}},"PermissionRequest":{"required":["code","name"],"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"active":{"type":"boolean"}}},"ModuleRequest":{"required":["code","name"],"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"route":{"type":"string"},"active":{"type":"boolean"}}},"UserTypePermissionRequest":{"required":["permissionId","userTypeId"],"type":"object","properties":{"userTypeId":{"type":"integer","format":"int32"},"permissionId":{"type":"integer","format":"int32"}}},"LoginRequest":{"required":["password","username"],"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}},"UserPatchRequest":{"type":"object","properties":{"username":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"userTypeId":{"type":"integer","format":"int32"},"active":{"type":"boolean"}}},"UserTypePatchRequest":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"active":{"type":"boolean"}}},"UserTypePermissionPatchRequest":{"type":"object","properties":{"active":{"type":"boolean"}}},"PermissionPatchRequest":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"active":{"type":"boolean"}}}},"securitySchemes":{"bearerAuth":{"type":"http","name":"bearerAuth","scheme":"bearer","bearerFormat":"JWT"}}}}