@ExecuteOn(TaskExecutors.IO)
    @Post(uri = "executions/latest/group-by-flow")
    @Operation(tags = {"Stats"}, summary = "Get latest execution by flows")
    public List<Execution> lastExecutions(
        @Parameter(description = "A list of flows filter") @Body @Valid LastExecutionsRequest lastExecutionsRequest
    ) {
        return executionRepository.lastExecutions(
            tenantService.resolveTenant(),
            lastExecutionsRequest.flows() != null && lastExecutionsRequest.flows().getFirst().getNamespace() != null && lastExecutionsRequest.flows().getFirst().getId() != null ? lastExecutionsRequest.flows() : null
        );
    }
@Test
    void lastExecutions() {
        var dailyStatistics = client.toBlocking().retrieve(
            HttpRequest
                .POST("/api/v1/stats/executions/latest/group-by-flow", new StatsController.LastExecutionsRequest(List.of(ExecutionRepositoryInterface.FlowFilter.builder().namespace("io.kestra.test").id("logs").build())))
                .contentType(MediaType.APPLICATION_JSON),
            Argument.listOf(Execution.class)
        );

        assertThat(dailyStatistics, notNullValue());
    }