package validation

type Create struct {
	ProjectFlockId uint `json:"project_flock_id" validate:"required"`
	KandangId      uint `json:"kandang_id" validate:"required"`
}

type Update struct {
	ProjectFlockId *uint `json:"project_flock_id,omitempty" validate:"omitempty"`
	KandangId      *uint `json:"kandang_id,omitempty" validate:"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"`
	NameWithPeriode bool   `query:"name_with_periode"`
	ProjectFlockId  uint   `query:"project_flock_id" validate:"omitempty"`
	KandangId       uint   `query:"kandang_id" validate:"omitempty"`
	Category        string `query:"category" validate:"omitempty,oneof=Growing Laying"`
	AreaId          uint   `query:"area_id" validate:"omitempty"`
	LocationId      uint   `query:"location_id" validate:"omitempty,number,gt=0"`
	SortBy          string `query:"sort_by" validate:"omitempty,oneof=created_at period"`
	SortOrder       string `query:"sort_order" validate:"omitempty,oneof=ASC DESC"`
	StepName        string `query:"step_name" validate:"omitempty,max=50"`
}

type Closing struct {
	Action     string  `json:"action" validate:"required,oneof=close unclose"`
	ClosedDate *string `json:"closed_date,omitempty"`
}
