mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 07:45:44 +00:00
Feat[BE]: implement max target quantity retrieval for kandangs and update routes
This commit is contained in:
@@ -94,6 +94,18 @@ type AvailableQtyForTransferDTO struct {
|
||||
Kandangs []KandangAvailableQtyDTO `json:"kandangs"`
|
||||
}
|
||||
|
||||
// === Max Target Quantity DTOs ===
|
||||
|
||||
type KandangMaxTargetQtyDTO struct {
|
||||
ProjectFlockKandangId uint `json:"project_flock_kandang_id"`
|
||||
MaxTargetQty float64 `json:"max_target_qty"`
|
||||
}
|
||||
|
||||
type MaxTargetQtyForTransferDTO struct {
|
||||
ProjectFlockId uint `json:"project_flock_id"`
|
||||
ProjectFlockKandangs []KandangMaxTargetQtyDTO `json:"project_flock_kandangs"`
|
||||
}
|
||||
|
||||
// === Mapper Functions ===
|
||||
|
||||
func ToProjectFlockSummaryDTO(pf *entity.ProjectFlock) *ProjectFlockSummaryDTO {
|
||||
@@ -285,3 +297,17 @@ func ToTransferLayingListDTOs(items []entity.LayingTransfer) []TransferLayingLis
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func ToKandangMaxTargetQtyDTO(pfkId uint, maxTargetQTY float64) KandangMaxTargetQtyDTO {
|
||||
return KandangMaxTargetQtyDTO{
|
||||
ProjectFlockKandangId: uint(pfkId),
|
||||
MaxTargetQty: maxTargetQTY,
|
||||
}
|
||||
}
|
||||
|
||||
func ToMaxTargetQtyForTransferDTO(pfId uint, kandangs []KandangMaxTargetQtyDTO) MaxTargetQtyForTransferDTO {
|
||||
return MaxTargetQtyForTransferDTO{
|
||||
ProjectFlockId: pfId,
|
||||
ProjectFlockKandangs: kandangs,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user