Conversation
|
SonarCloud Quality Gate failed. |
|
The sonar analysis is failed, no test coverage 😞 |
| } | ||
|
|
||
| @GetMapping("/productos/reporte") | ||
| public ResponseEntity<byte[]> getListaProductosSeleccionados( |
There was a problem hiding this comment.
The response should be sent by email
There was a problem hiding this comment.
The use case doesn't require the response to be send by email, the requirement is obtain a report of the chosen products the same way that others like Factura and Pedidos do, the email one it's beacause usualy whitout a product selection the list is to big and the request take to long
There was a problem hiding this comment.
What if the user selects X (a very big number) products and sends the request? It's gonna crush. We need to cover all possible scenarios
There was a problem hiding this comment.
Happens that the access to the business email account it's only to very few people, and the new feature it's to vendedor use as "Presupuesto". Now I notice a problem, to use this as a vendedor we have to let it access to the product administration list, then the real solution it's to have a real "Presupuesto" report, this do not solve the original problem and carry a new one.
| @GetMapping("/productos/reporte") | ||
| public ResponseEntity<byte[]> getListaProductosSeleccionados( | ||
| @RequestParam long[] idProducto) { | ||
| HttpHeaders headers = new HttpHeaders(); |
| headers.setContentType(MediaType.APPLICATION_PDF); | ||
| headers.add("content-disposition", "inline; filename=ProductList.pdf"); | ||
| headers.setCacheControl("must-revalidate, post-check=0, pre-check=0"); | ||
| byte[] reportePDF = |
There was a problem hiding this comment.
Could use "var" instead, and all in one line
| public byte[] getListaDePreciosEnPdf(long[] idProductos) { | ||
| var productos = new ArrayList<Producto>(); | ||
| for (long idProducto : idProductos) { | ||
| productos.add(this.getProductoNoEliminadoPorId(idProducto)); |
There was a problem hiding this comment.
This is very inefficient. The query should be something like SELECT xxxx FROM xxxx WHERE IN .....
|
Kudos, SonarCloud Quality Gate passed!
|










No description provided.