diff --git a/Monitoramento Orius.json b/Monitoramento Orius.json new file mode 100644 index 0000000..9beb6d6 --- /dev/null +++ b/Monitoramento Orius.json @@ -0,0 +1,1056 @@ +{ + "info": { + "_postman_id": "2b33c208-e7da-4385-be8d-11875f6867e4", + "name": "Monitoramento Orius", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "32142370" + }, + "item": [ + { + "name": "User", + "item": [ + { + "name": "Autenticação", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\": \"dev@oriustecnologia.com.br\",\r\n \"password\": \"123123\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user/authenticate", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user", + "authenticate" + ] + } + }, + "response": [] + }, + { + "name": "Meus dados", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user/me", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user", + "me" + ] + } + }, + "response": [] + }, + { + "name": "Lista usuários", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user/", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user", + "" + ] + } + }, + "response": [] + }, + { + "name": "Cadastra usuário", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const response = pm.response.json();\r", + "\r", + "// Salvando em variáveis da *collection*\r", + "pm.collectionVariables.set(\"userId\", response.data.id);" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"email\": \"{{$randomEmail}}\",\r\n \"password\": \"{{password}}\",\r\n \"position\": \"string\",\r\n \"team\": \"{{team}}\",\r\n \"status\": \"\",\r\n \"user_id_create\": 0\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user" + ] + } + }, + "response": [] + }, + { + "name": "Buscar e-mail", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user/email?email=Cooper1@gmail.com", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user", + "email" + ], + "query": [ + { + "key": "email", + "value": "Cooper1@gmail.com" + } + ] + } + }, + "response": [] + }, + { + "name": "Buscar ID", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user/{{userId}}", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user", + "{{userId}}" + ] + } + }, + "response": [] + }, + { + "name": "Atualiza usuário", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"email\": \"{{$randomEmail}}\",\r\n \"password\": \"{{password}}\",\r\n \"position\": \"string\",\r\n \"team\": \"{{team}}\",\r\n \"status\": \"\",\r\n \"user_id_create\": 0\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user/{{userId}}", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user", + "{{userId}}" + ] + } + }, + "response": [] + }, + { + "name": "Excluir usuário", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"email\": \"{{$randomEmail}}\",\r\n \"password\": \"{{password}}\",\r\n \"position\": \"string\",\r\n \"team\": \"{{team}}\",\r\n \"status\": \"\",\r\n \"user_id_create\": 0\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user/{{userId}}", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user", + "{{userId}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Client", + "item": [ + { + "name": "Lista clientes", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/client/?first=1&skip=0", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "client", + "" + ], + "query": [ + { + "key": "first", + "value": "1" + }, + { + "key": "skip", + "value": "0" + } + ] + } + }, + "response": [ + { + "name": "Lista usuários", + "originalRequest": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/user", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "user" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Content-Length", + "value": "735" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Date", + "value": "Wed, 15 Oct 2025 19:00:26 GMT" + }, + { + "key": "Server", + "value": "uvicorn" + } + ], + "cookie": [], + "body": "{\n \"message\": \"Usuários localizados com sucesso\",\n \"data\": [\n {\n \"user_id\": 1,\n \"name\": \"Orius Tecnologia\",\n \"email\": \"dev@oriustecnologia.com.br\",\n \"password\": \"$2b$12$mSqkyIkK3ven9gjLejwcKOqqJDOv5sRtRkcQBEsHO0Kh2vOI2Nr5.\",\n \"password_temp\": \"N\",\n \"password_temp_confirm\": \"N\",\n \"position\": null,\n \"team\": \"Dev\",\n \"status\": \"A\",\n \"date_register\": \"2025-10-07T17:11:58\",\n \"date_update\": null,\n \"user_id_create\": null,\n \"user_id_update\": null\n },\n {\n \"user_id\": 2,\n \"name\": \"Jonathon Emmerich\",\n \"email\": \"Evan75@hotmail.com\",\n \"password\": \"$2b$12$gkZN87GQJjo7uYzNkSYfW.iKJFnuDZhpbTiWG1OWoa3j1z9Hk8wAC\",\n \"password_temp\": null,\n \"password_temp_confirm\": \"N\",\n \"position\": \"string\",\n \"team\": \"Dev\",\n \"status\": \"A\",\n \"date_register\": \"2025-10-07T17:12:28\",\n \"date_update\": null,\n \"user_id_create\": 0,\n \"user_id_update\": null\n }\n ]\n}" + } + ] + }, + { + "name": "Cadastra clientes", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const response = pm.response.json();\r", + "\r", + "// Salvando em variáveis da *collection*\r", + "pm.collectionVariables.set(\"clientId\", response.data.id);" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"cns\": \"9209250\",\r\n \"state\": \"GO\",\r\n \"city\": \"Qualquer Uma\",\r\n \"responsible\": \"O Mario\",\r\n \"consultant\": \"{{$randomFullName}}\",\r\n \"type_contract\": \"1\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/client/", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "client", + "" + ] + } + }, + "response": [] + }, + { + "name": "Buscar CNS", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/client/cns/026385", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "client", + "cns", + "026385" + ] + } + }, + "response": [] + }, + { + "name": "Buscar ID", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/client/{{clientId}}", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "client", + "{{clientId}}" + ] + } + }, + "response": [] + }, + { + "name": "Atualiza cliente", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"cns\": \"9209250\",\r\n \"state\": \"GO\",\r\n \"city\": \"Qualquer Uma\",\r\n \"responsible\": \"O Mario\",\r\n \"consultant\": \"{{$randomFullName}}\",\r\n \"type_contract\": \"1\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/client/{{clientId}}", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "client", + "{{clientId}}" + ] + } + }, + "response": [] + }, + { + "name": "Excluir usuário", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"email\": \"{{$randomEmail}}\",\r\n \"password\": \"{{password}}\",\r\n \"position\": \"string\",\r\n \"team\": \"{{team}}\",\r\n \"status\": \"\",\r\n \"user_id_create\": 0\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/client/{{clientId}", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "client", + "{{clientId}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Log", + "item": [ + { + "name": "Lista log's", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/log/?first=20&skip=80", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "log", + "" + ], + "query": [ + { + "key": "first", + "value": "20" + }, + { + "key": "skip", + "value": "80" + } + ] + } + }, + "response": [] + }, + { + "name": "Lista log's Clientes", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/log/client/3", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "log", + "client", + "3" + ] + } + }, + "response": [] + }, + { + "name": "Lista GED", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/log/ged/3", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "log", + "ged", + "3" + ] + } + }, + "response": [] + }, + { + "name": "Lista Server", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/log/server/3", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "log", + "server", + "3" + ] + } + }, + "response": [] + }, + { + "name": "Lista Database", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/log/database/3", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "log", + "database", + "3" + ] + } + }, + "response": [] + }, + { + "name": "Lista Backup", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/log/backup/3", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "log", + "backup", + "3" + ] + } + }, + "response": [] + }, + { + "name": "Lista Discos", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/log/disk/3", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "log", + "disk", + "3" + ] + } + }, + "response": [] + }, + { + "name": "Lista Warning", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{BearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BaseUrlV1}}administrativo/log/warning/3", + "host": [ + "{{BaseUrlV1}}administrativo" + ], + "path": [ + "log", + "warning", + "3" + ] + } + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "requests": {}, + "exec": [ + "// Lista de valores possíveis\r", + "const passList = [1,2,3,4,5,6];\r", + "\r", + "// Escolhe um valor aleatório\r", + "const randomPassList = passList[Math.floor(Math.random() * passList.length)];\r", + "\r", + "// Armazena como variável da collection\r", + "pm.collectionVariables.set(\"password\", randomPassList);\r", + "\r", + "\r", + "\r", + "// Lista de valores possíveis\r", + "const teamList = [\"Dev\", \"Support\"];\r", + "\r", + "// Escolhe um valor aleatório\r", + "const randomTeamList = teamList[Math.floor(Math.random() * teamList.length)];\r", + "\r", + "// Armazena como variável da collection\r", + "pm.collectionVariables.set(\"team\", randomTeamList);" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "requests": {}, + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "BaseUrlV1", + "value": "" + }, + { + "key": "BearerToken", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "team", + "value": "" + }, + { + "key": "userId", + "value": "" + }, + { + "key": "clientId", + "value": "" + } + ] +} \ No newline at end of file diff --git a/Monitoramento Orius.postman_collection.json b/Monitoramento Orius.postman_collection.json index 37fbd36..7347a0a 100644 --- a/Monitoramento Orius.postman_collection.json +++ b/Monitoramento Orius.postman_collection.json @@ -11,36 +11,6 @@ "item": [ { "name": "Autenticação", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const response = pm.response.json();\r", - "\r", - "// Salvando em variáveis da *collection*\r", - "pm.collectionVariables.set(\"BearerToken\", response.data.token);\r", - "\r", - "pm.test(\"Status code é 201 ou 200\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201]);\r", - "});\r", - "\r", - "pm.test(\"Resposta contém ID ou confirmação\", function () {\r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.have.any.keys(\"id\", \"message\", \"status\");\r", - "});\r", - "\r", - "pm.test(\"Mensagem indica sucesso\", function () {\r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData.message || \"\").to.match(/sucesso|criado|registrado/i);\r", - "});" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - } - ], "request": { "method": "POST", "header": [], @@ -144,56 +114,7 @@ ] } }, - "response": [ - { - "name": "Lista usuários", - "originalRequest": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{BaseUrlV1}}administrativo/user", - "host": [ - "{{BaseUrlV1}}administrativo" - ], - "path": [ - "user" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": null, - "header": [ - { - "key": "Content-Length", - "value": "735" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Date", - "value": "Wed, 15 Oct 2025 19:00:26 GMT" - }, - { - "key": "Server", - "value": "uvicorn" - } - ], - "cookie": [], - "body": "{\n \"message\": \"Usuários localizados com sucesso\",\n \"data\": [\n {\n \"user_id\": 1,\n \"name\": \"Orius Tecnologia\",\n \"email\": \"dev@oriustecnologia.com.br\",\n \"password\": \"$2b$12$mSqkyIkK3ven9gjLejwcKOqqJDOv5sRtRkcQBEsHO0Kh2vOI2Nr5.\",\n \"password_temp\": \"N\",\n \"password_temp_confirm\": \"N\",\n \"position\": null,\n \"team\": \"Dev\",\n \"status\": \"A\",\n \"date_register\": \"2025-10-07T17:11:58\",\n \"date_update\": null,\n \"user_id_create\": null,\n \"user_id_update\": null\n },\n {\n \"user_id\": 2,\n \"name\": \"Jonathon Emmerich\",\n \"email\": \"Evan75@hotmail.com\",\n \"password\": \"$2b$12$gkZN87GQJjo7uYzNkSYfW.iKJFnuDZhpbTiWG1OWoa3j1z9Hk8wAC\",\n \"password_temp\": null,\n \"password_temp_confirm\": \"N\",\n \"position\": \"string\",\n \"team\": \"Dev\",\n \"status\": \"A\",\n \"date_register\": \"2025-10-07T17:12:28\",\n \"date_update\": null,\n \"user_id_create\": 0,\n \"user_id_update\": null\n }\n ]\n}" - } - ] + "response": [] }, { "name": "Cadastra usuário", diff --git a/packages/v1/administrativo/repositories/client/client_index_repository.py b/packages/v1/administrativo/repositories/client/client_index_repository.py index 5dd9b7d..825ce14 100644 --- a/packages/v1/administrativo/repositories/client/client_index_repository.py +++ b/packages/v1/administrativo/repositories/client/client_index_repository.py @@ -40,6 +40,7 @@ class IndexRepository(BaseRepository): c.responsible, c.consultant, c.type_contract + c.status FROM client c LIMIT {first} OFFSET {skip} """ diff --git a/packages/v1/administrativo/schemas/client_schema.py b/packages/v1/administrativo/schemas/client_schema.py index ca2e2c8..9b552f0 100644 --- a/packages/v1/administrativo/schemas/client_schema.py +++ b/packages/v1/administrativo/schemas/client_schema.py @@ -21,6 +21,7 @@ class ClientSchema(BaseModel): responsible: Optional[str] = None consultant: Optional[str] = None type_contract: Optional[str] = None + status: Optional[str] = None class Config: # Permite que o Pydantic mapeie campos vindos do banco (ex: via ORM) @@ -82,6 +83,7 @@ class ClientSaveSchema(BaseModel): responsible: Optional[str] = None consultant: Optional[str] = None type_contract: Optional[str] = None + status: Optional[str] = None # Sanitiza os inputs de string @field_validator('cns', 'name', 'state', 'city', 'responsible', 'consultant', 'type_contract') @@ -103,6 +105,7 @@ class ClientUpdateSchema(BaseModel): responsible: Optional[str] = None consultant: Optional[str] = None type_contract: Optional[str] = None + status: Optional[str] = None # Sanitiza os inputs de string @field_validator('cns', 'name', 'state', 'city', 'responsible', 'consultant', 'type_contract')