Merge branch 'dev/gio' of https://gitlab.com/mbugroup/lti-api into dev/teguh

This commit is contained in:
aguhh18
2025-12-28 19:16:53 +07:00
7 changed files with 977 additions and 1 deletions
@@ -0,0 +1,123 @@
package dto
type HppPerKandangFiltersDTO struct {
AreaID string `json:"area_id"`
LocationID string `json:"location_id"`
KandangID string `json:"kandang_id"`
WeightMin string `json:"weight_min"`
WeightMax string `json:"weight_max"`
Period string `json:"period"`
ShowUnrecorded string `json:"show_unrecorded"`
}
type HppPerKandangMetaDTO struct {
Page int `json:"page"`
Limit int `json:"limit"`
TotalPages int64 `json:"total_pages"`
TotalResults int64 `json:"total_results"`
Filters HppPerKandangFiltersDTO `json:"filters"`
}
type HppPerKandangResponseData struct {
Period string `json:"period"`
Rows []HppPerKandangRowDTO `json:"rows"`
Summary HppPerKandangSummaryDTO `json:"summary"`
}
type HppPerKandangRowDTO struct {
ID int `json:"id"`
Kandang HppPerKandangRowKandangDTO `json:"kandang"`
WeightRange HppPerKandangWeightRangeDTO `json:"weight_range"`
RemainingChickenBirds int64 `json:"remaining_chicken_birds"`
RemainingChickenWeightKg float64 `json:"remaining_chicken_weight_kg"`
AvgWeightKg float64 `json:"avg_weight_kg"`
EggProductionPieces int64 `json:"egg_production_pieces"`
EggProductionKg float64 `json:"egg_production_kg"`
// FeedCostRp float64 `json:"feed_cost_rp"`
// OvkCostRp float64 `json:"ovk_cost_rp"`
EggHppRpPerKg float64 `json:"egg_hpp_rp_per_kg"`
EggValueRp int64 `json:"egg_value_rp"`
FeedSuppliers []HppPerKandangSupplierDTO `json:"feed_suppliers"`
DocSuppliers []HppPerKandangSupplierDTO `json:"doc_suppliers"`
AverageDocPriceRp int64 `json:"average_doc_price_rp"`
HppRp float64 `json:"hpp_rp"`
RemainingValueRp int64 `json:"remaining_value_rp"`
}
type HppPerKandangRowKandangDTO struct {
ID int64 `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Location HppPerKandangLocationDTO `json:"location"`
Pic HppPerKandangPICDTO `json:"pic"`
}
type HppPerKandangLocationDTO struct {
ID int64 `json:"id"`
Name string `json:"name"`
}
type HppPerKandangPICDTO struct {
ID int64 `json:"id"`
Name string `json:"name"`
}
type HppPerKandangWeightRangeDTO struct {
WeightMin float64 `json:"weight_min"`
WeightMax float64 `json:"weight_max"`
}
type HppPerKandangSupplierDTO struct {
ID int64 `json:"id"`
Name string `json:"name"`
Alias string `json:"alias"`
Category string `json:"category"`
}
type HppPerKandangSummaryDTO struct {
PerWeightRange []HppPerKandangSummaryWeightRangeDTO `json:"per_weight_range"`
Total HppPerKandangSummaryTotalDTO `json:"total"`
}
type HppPerKandangSummaryWeightRangeDTO struct {
ID int `json:"id"`
WeightRange HppPerKandangWeightRangeDTO `json:"weight_range"`
Label string `json:"label"`
RemainingChickenBirds int64 `json:"remaining_chicken_birds"`
RemainingChickenWeightKg float64 `json:"remaining_chicken_weight_kg"`
AvgWeightKg float64 `json:"avg_weight_kg"`
EggProductionPieces int64 `json:"egg_production_pieces"`
EggProductionKg float64 `json:"egg_production_kg"`
EggHppRpPerKg float64 `json:"egg_hpp_rp_per_kg"`
EggValueRp int64 `json:"egg_value_rp"`
FeedSuppliers []HppPerKandangSupplierDTO `json:"feed_suppliers"`
DocSuppliers []HppPerKandangSupplierDTO `json:"doc_suppliers"`
AverageDocPriceRp float64 `json:"average_doc_price_rp"`
HppRp float64 `json:"hpp_rp"`
RemainingValueRp int64 `json:"remaining_value_rp"`
}
type HppPerKandangSummaryTotalDTO struct {
TotalRemainingChickenBirds int64 `json:"total_remaining_chicken_birds"`
TotalRemainingChickenWeightKg float64 `json:"total_remaining_chicken_weight_kg"`
AverageWeightKg float64 `json:"average_weight_kg"`
TotalRemainingValueRp int64 `json:"total_remaining_value_rp"`
TotalEggProductionPieces int64 `json:"total_egg_production_pieces"`
TotalEggProductionKg float64 `json:"total_egg_production_kg"`
AverageEggHppRpPerKg float64 `json:"average_egg_hpp_rp_per_kg"`
TotalEggValueRp int64 `json:"total_egg_value_rp"`
TotalHppRp float64 `json:"total_hpp_rp"`
TotalAverageDocPriceRp float64 `json:"total_average_doc_price_rp"`
}
func NewHppPerKandangFiltersDTO(area, location, kandang, weightMin, weightMax, period, showUnrecorded string) HppPerKandangFiltersDTO {
return HppPerKandangFiltersDTO{
AreaID: area,
LocationID: location,
KandangID: kandang,
WeightMin: weightMin,
WeightMax: weightMax,
Period: period,
ShowUnrecorded: showUnrecorded,
}
}