package fr.titionfire.ffsaf.rest;

import fr.titionfire.ffsaf.domain.service.StatsService;
import fr.titionfire.ffsaf.rest.data.LicenceStats;
import io.smallrye.mutiny.Uni;
import jakarta.annotation.security.RolesAllowed;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("api/stats")
public class StatsEndpoints {

    @Inject
    StatsService service;

    @GET
    @RolesAllowed("federation_admin")
    @Produces(MediaType.APPLICATION_JSON)
    public Uni<LicenceStats> getStats() {
        return service.getStats();
    }
}
