package types

type UniformityDetailItem struct {
	Id     int
	Weight float64
	Range  string
}

type UniformityCalculation struct {
	ChickQtyOfWeight float64
	MeanWeight       float64
	MeanDown         float64
	MeanUp           float64
	UniformQty       float64
	OutsideQty       float64
	Uniformity       float64
	Cv               float64
	Details          []UniformityDetailItem
}

type UniformityStandard struct {
	MeanWeight *float64
	Uniformity *float64
}

type UniformityChartRange struct {
	Range        string  `json:"range"`
	MinWeight    float64 `json:"min_weight"`
	MaxWeight    float64 `json:"max_weight"`
	BirdCount    float64 `json:"bird_count"`
	IsIdealRange bool    `json:"is_ideal_range"`
	IdealRange   string  `json:"ideal_range,omitempty"`
	OutsideRange string  `json:"outside_range,omitempty"`
}

type UniformityChartIdealRange struct {
	MinWeight       float64 `json:"min_weight"`
	MaxWeight       float64 `json:"max_weight"`
	TotalIdealBirds float64 `json:"total_ideal_birds"`
}

type UniformityChartStatistics struct {
	MinWeight          float64 `json:"min_weight"`
	MaxWeight          float64 `json:"max_weight"`
	AverageWeight      float64 `json:"average_weight"`
	TotalBirdsMeasured float64 `json:"total_birds_measured"`
}

type UniformityChartWeek struct {
	HasData            bool                       `json:"has_data"`
	WeightDistribution []UniformityChartRange     `json:"weight_distribution"`
	IdealRange         *UniformityChartIdealRange `json:"ideal_range"`
	Statistics         *UniformityChartStatistics `json:"statistics"`
}

type UniformityChartBar struct {
	CurrentWeek int                         `json:"current_week"`
	AllWeeks    map[int]UniformityChartWeek `json:"all_weeks"`
}

type UniformityChartGaugeWeek struct {
	Week              int     `json:"week"`
	UniformityPercent float64 `json:"uniformity_percentage"`
	IdealCount        float64 `json:"ideal_count"`
	OutsideIdealCount float64 `json:"outside_ideal_count"`
	TotalCount        float64 `json:"total_count"`
	HasData           bool    `json:"has_data"`
}

type UniformityChartWeekInfo struct {
	TotalWeeks       int  `json:"total_weeks"`
	WeeksWithData    int  `json:"weeks_with_data"`
	CurrentWeekIndex int  `json:"current_week_index"`
	HasPrevWeek      bool `json:"has_prev_week"`
	HasNextWeek      bool `json:"has_next_week"`
}

type UniformityChartGauge struct {
	CurrentWeek    int                        `json:"current_week"`
	AvailableWeeks []UniformityChartGaugeWeek `json:"available_weeks"`
	WeekInfo       UniformityChartWeekInfo    `json:"week_info"`
}

type UniformityChartData struct {
	BarChart   UniformityChartBar   `json:"bar_chart"`
	GaugeChart UniformityChartGauge `json:"gauge_chart"`
}