package service

type HppV2DateWindow struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type HppV2Proration struct {
	Basis       string  `json:"basis"`
	Numerator   float64 `json:"numerator"`
	Denominator float64 `json:"denominator"`
	Ratio       float64 `json:"ratio"`
}

type HppV2Reference struct {
	Type                  string  `json:"type"`
	ID                    uint    `json:"id"`
	StockableType         string  `json:"stockable_type,omitempty"`
	ProjectFlockKandangID *uint   `json:"project_flock_kandang_id,omitempty"`
	ProductID             uint    `json:"product_id,omitempty"`
	ProductName           string  `json:"product_name,omitempty"`
	Date                  string  `json:"date,omitempty"`
	Qty                   float64 `json:"qty"`
	UnitPrice             float64 `json:"unit_price"`
	Total                 float64 `json:"total"`
	AppliedTotal          float64 `json:"applied_total"`
}

type HppV2ComponentPart struct {
	Code       string           `json:"code"`
	Title      string           `json:"title"`
	Scopes     []string         `json:"scopes,omitempty"`
	Total      float64          `json:"total"`
	Proration  *HppV2Proration  `json:"proration,omitempty"`
	Details    map[string]any   `json:"details,omitempty"`
	References []HppV2Reference `json:"references,omitempty"`
}

type HppV2Component struct {
	Code   string               `json:"code"`
	Title  string               `json:"title"`
	Scopes []string             `json:"scopes,omitempty"`
	Total  float64              `json:"total"`
	Parts  []HppV2ComponentPart `json:"parts"`
}

type HppCostDebugValues struct {
	RecordingEggQty     float64 `json:"recording_egg_qty"`
	RecordingEggWeight  float64 `json:"recording_egg_weight"`
	AdjustmentEggQty    float64 `json:"adjustment_egg_qty"`
	AdjustmentEggWeight float64 `json:"adjustment_egg_weight"`
	SoldEggQty          float64 `json:"sold_egg_qty"`
	SoldEggWeight       float64 `json:"sold_egg_weight"`
}

type HppV2Breakdown struct {
	ProjectFlockKandangID uint             `json:"project_flock_kandang_id"`
	ProjectFlockID        uint             `json:"project_flock_id"`
	ProjectFlockCategory  string           `json:"project_flock_category,omitempty"`
	HouseType             string           `json:"house_type,omitempty"`
	KandangID             uint             `json:"kandang_id,omitempty"`
	KandangName           string           `json:"kandang_name,omitempty"`
	LocationID            uint             `json:"location_id,omitempty"`
	PeriodDate            string           `json:"period_date"`
	Window                HppV2DateWindow  `json:"window"`
	TotalPulletCost       float64          `json:"total_pullet_cost"`
	TotalProductionCost   float64          `json:"total_production_cost"`
	Components            []HppV2Component `json:"components"`
	Hpp                   HppCostResponse  `json:"hpp"`
}
