package validation

type Create struct {
	FlockName            string          `json:"flock_name" validate:"required_strict"`
	AreaId               uint            `json:"area_id" validate:"required_strict,number,gt=0"`
	Category             string          `json:"category" validate:"required_strict"`
	ProductionStandardId uint            `json:"production_standard_id" validate:"required_strict,number,gt=0"`
	LocationId           uint            `json:"location_id" validate:"required_strict,number,gt=0"`
	KandangIds           []uint          `json:"kandang_ids" validate:"required,min=1,dive,gt=0"`
	ProjectBudgets       []ProjectBudget `json:"project_budgets" validate:"required,min=1,dive"`
}

type Query struct {
	Page            int    `query:"page" validate:"omitempty,number,min=1"`
	Limit           int    `query:"limit" validate:"omitempty,number,min=1,max=100"`
	Search          string `query:"search" validate:"omitempty,max=50"`
	SortBy          string `query:"sort_by" validate:"omitempty"`
	SortOrder       string `query:"sort_order" validate:"omitempty,oneof=asc desc"`
	AreaId          uint   `query:"area_id" validate:"omitempty,number,gt=0"`
	LocationId      uint   `query:"location_id" validate:"omitempty,number,gt=0"`
	Period          int    `query:"period" validate:"omitempty,number,gt=0"`
	Category        string `query:"category" validate:"omitempty"`
	Status          string `query:"status" validate:"omitempty,oneof=Pengajuan Aktif Selesai"`
	KandangIds      []uint `query:"kandang_id" validate:"omitempty,dive,gt=0"`
	TransferContext string `query:"transfer_context" validate:"omitempty,oneof=transfer_to_laying"`
}

type Approve struct {
	Action        string  `json:"action" validate:"required_strict"`
	ApprovableIds []uint  `json:"approvable_ids" validate:"required_strict,min=1,dive,gt=0"`
	Notes         *string `json:"notes,omitempty" validate:"omitempty,max=500"`
}

type ProjectBudget struct {
	NonstockId uint    `json:"nonstock_id" validate:"required_strict,number,gt=0"`
	Price      float64 `json:"price" validate:"required_strict,number,gt=0"`
	Qty        float64 `json:"qty" validate:"required_strict,number,gt=0"`
}

type Resubmit struct {
	KandangIds     []uint          `json:"kandang_ids" validate:"required_strict,min=1,dive,gt=0"`
	ProjectBudgets []ProjectBudget `json:"project_budgets" validate:"required_strict,min=1,dive"`
}
