@Delete(uri = "{namespace}/{id}")
    @ExecuteOn(TaskExecutors.IO)
    @Operation(tags = {"Flows"}, summary = "Delete a flow")
    @ApiResponse(responseCode = "204", description = "On success")
    public HttpResponse<Void> delete(
        @Parameter(description = "The flow namespace") @PathVariable String namespace,
        @Parameter(description = "The flow id") @PathVariable String id
    ) {
        Optional<Flow> flow = flowRepository.findById(tenantService.resolveTenant(), namespace, id);
        if (flow.isPresent()) {
            flowRepository.delete(flow.get());
            return HttpResponse.status(HttpStatus.NO_CONTENT);
        } else {
            return HttpResponse.status(HttpStatus.NOT_FOUND);
        }
    }
@Test
    void importFlowsWithZip() throws IOException {
        // create a ZIP file using the extract endpoint
        byte[] zip = client.toBlocking().retrieve(HttpRequest.GET("/api/v1/flows/export/by-query?namespace=io.kestra.tests"),
            Argument.of(byte[].class));
        File temp = File.createTempFile("flows", ".zip");
        Files.write(temp.toPath(), zip);

        var body = MultipartBody.builder()
            .addPart("fileUpload", "flows.zip", temp)
            .build();
        var response = client.toBlocking().exchange(POST("/api/v1/flows/import", body).contentType(MediaType.MULTIPART_FORM_DATA));

        assertThat(response.getStatus(), is(NO_CONTENT));
        temp.delete();
    }