wip: currently rewriting the project as a full stack application tangled.org/kacaii.dev/sigo
gleam
at main 125 lines 2.0 kB view raw view rendered
1## /user 2 3### POST /user/login 4 5#### Request 6 7```json 8{ 9 "matricula": "000", 10 "senha": "wibble" 11} 12``` 13 14#### Response 15 16`set-cookie: SESSION=SFM1MTI.eyJ1c2VyX2lkIjoiMDE5YjZiMjgtZDc0YS03ZjBiLTg3N;` 17 18```json 19{ 20 "access_level": "developer" 21} 22``` 23 24### PUT /user/password 25 26#### Request 27 28```json 29{ 30 "senhaAtual": "wibble", 31 "novaSenha": "wobble", 32 "confirmarSenha": "wobble" 33} 34``` 35 36#### Response 37 38```txt 39Senha atualizada com sucesso! 40``` 41 42### GET /user/profile 43 44#### Response 45 46```json 47{ 48 "id": "b2c3d4e5-f6g7-8901-bcde-f23456789012", 49 "full_name": "Maria Oliveira Costa", 50 "registration": "000000", 51 "user_role": "Desenvolvedor", 52 "email": "maria.oliveira@empresa.com.br", 53 "phone": "+55 (81) 9 8888-8888" 54} 55``` 56 57### PUT /user/profile 58 59#### Request 60 61```json 62{ 63 "full_name": "Fulaninho Moreira", 64 "email": "email.novo@email.com", 65 "phone": "+55 (81) 9 8888-8888" 66} 67``` 68 69#### Response 70 71```json 72{ 73 "full_name": "Fulaninho Moreira", 74 "email": "email.novo@email.com", 75 "phone": "+55 (81) 9 8888-8888" 76} 77``` 78 79### GET /user/roles 80 81#### Response 82 83```json 84["desenvolvedor", "bombeiro", "capitão", "analista"] 85``` 86 87### GET /user/{{id}}/occurrences 88 89#### Response 90 91```jsonc 92[ 93 { 94 "id": "uuid-string", 95 "status": "em andamento" // | "Finalizada", 96 "prioridade": "alta" // | "Média" | "Baixa", 97 "chamado": { 98 "tipo": "acidente de trânsito" // | "Incêndio" | "Emergência Médica" | "Outro", 99 "detalhes": "something something", 100 "solicitante": { 101 "nome": "Drop Table da Silva" 102 } 103 }, 104 "coordenadas": [-123, 124] // | null, 105 "timestamps": { 106 "abertura": 1700000000.0, 107 "chegadaNoLocal": 1700000050.0 // | null, 108 "finalizacao": 1700000100.0 // | null 109 }, 110 "metadata": { 111 "nomeUsuario": "Drop Table da Silva", 112 "matriculaUsuario": "001", 113 "usuarioId": "uuid-string" 114 }, 115 "equipes": [ 116 { 117 "id": "brigade-uuid", 118 "nomeEquipe": "TEAM-ABC", 119 "lider": "Drop Table da Silva", 120 "codigoViatura": "VHC-789" 121 } 122 ] 123 } 124] 125```