(request, response)
| 30 | }; |
| 31 | |
| 32 | const action = async (request, response) => { |
| 33 | try { |
| 34 | const pixParticipantsList = await obtainPixParticipantList(); |
| 35 | |
| 36 | const parsedData = formatCsvFile(pixParticipantsList); |
| 37 | |
| 38 | return response.status(200).json(parsedData); |
| 39 | } catch (error) { |
| 40 | if (error instanceof BaseError) { |
| 41 | throw error; |
| 42 | } |
| 43 | |
| 44 | throw new InternalError({ |
| 45 | status: 500, |
| 46 | message: `Erro ao obter as informações do BCB`, |
| 47 | name: 'PIX_LIST_ERROR', |
| 48 | type: 'PIX_LIST_ERROR', |
| 49 | }); |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | /** |
| 54 | * Cache de 21600s (6 horas) devido a não saber que horas os dados são gerados pelo BCB. |
nothing calls this directly
no test coverage detected