package fr.titionfire.ffsaf.rest.data;

import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

@Data
@RegisterForReflection
public class LicenceStats {
    private ConcurrentHashMap<Integer, YearStats> licences = new ConcurrentHashMap<>();
    private List<CategoriesStats> categories = new ArrayList<>();

    @Data
    @RegisterForReflection
    public static class CategoriesStats {
        private String name;
        private int count = 0;
    }

    @Data
    @RegisterForReflection
    public static class YearStats {
        private int h = 0;
        private int f = 0;
        private int na = 0;
        private int not_valid = 0;

        public void addH() {
            this.h++;
        }

        public void addF() {
            this.f++;
        }

        public void addNa() {
            this.na++;
        }

        public void addNotValid() {
            this.not_valid++;
        }

    }
}
