package validation

type ProductionStandardDetailItem struct {
	TargetHenDayProduction   *float64 `json:"target_hen_day_production" validate:"omitempty,gte=0"`
	TargetHenHouseProduction *float64 `json:"target_hen_house_production" validate:"omitempty,gte=0"`
	TargetEggWeight          *float64 `json:"target_egg_weight" validate:"omitempty,gte=0"`
	TargetEggMass            *float64 `json:"target_egg_mass" validate:"omitempty,gte=0"`
	StandardFCR              *float64 `json:"standard_fcr" validate:"omitempty,gte=0"`
}

type StandardGrowthDetailItem struct {
	TargetMeanBw  *float64 `json:"target_mean_bw" validate:"omitempty,gte=0"`
	MaxDepletion  *float64 `json:"max_depletion" validate:"omitempty,gte=0,lte=100"`
	MinUniformity float64  `json:"min_uniformity" validate:"required,gte=0,lte=100"`
	FeedIntake    *float64 `json:"feed_intake" validate:"omitempty,gte=0"`
}

type DetailItem struct {
	Week                                int                           `json:"week" validate:"required,gte=1"`
	ProductionStandardDetails           *ProductionStandardDetailItem  `json:"production_standard_details,omitempty"`
	ProductionStandardUniformityDetails *StandardGrowthDetailItem     `json:"production_standard_uniformity_details" validate:"required"`
}


type Create struct {
	Name            string       `json:"name" validate:"required,min=3"`
	ProjectCategory string       `json:"project_category" validate:"required,oneof=GROWING LAYING"`
	Details         []DetailItem `json:"details" validate:"required,min=1,dive"`
}

type Update struct {
	Name            *string     `json:"name,omitempty" validate:"omitempty,min=3"`
	ProjectCategory *string     `json:"project_category,omitempty" validate:"omitempty,oneof=GROWING LAYING"`
	Details         []DetailItem `json:"details,omitempty"`
}

type Query struct {
	Page            int    `query:"page" validate:"omitempty,number,min=1,gt=0"`
	Limit           int    `query:"limit" validate:"omitempty,number,min=1,max=100,gt=0"`
	Search          string `query:"search" validate:"omitempty,max=50"`
	ProjectCategory string `query:"project_category" validate:"omitempty,oneof=GROWING LAYING"`
}
