Skip to content

Commit

Permalink
Merge pull request #13482 from transcom/B-20723
Browse files Browse the repository at this point in the history
B-20723 / B-20726
  • Loading branch information
r-mettler authored Aug 16, 2024
2 parents 61690c1 + af33158 commit 10a42c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions pkg/handlers/ghcapi/mto_shipment.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ func (h CreateMTOShipmentHandler) Handle(params mtoshipmentops.CreateMTOShipment

mtoShipment := payloads.MTOShipmentModelFromCreate(payload)

if mtoShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTSDom && mtoShipment.NTSRecordedWeight != nil {
previouslyRecordedWeight := *mtoShipment.NTSRecordedWeight
mtoShipment.PrimeEstimatedWeight = &previouslyRecordedWeight
}

var err error
mtoShipment, err = h.shipmentCreator.CreateShipment(appCtx, mtoShipment)

Expand Down Expand Up @@ -338,6 +343,12 @@ func (h UpdateShipmentHandler) Handle(params mtoshipmentops.UpdateMTOShipmentPar
), err
}
}

if mtoShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTSDom && mtoShipment.NTSRecordedWeight != nil {
previouslyRecordedWeight := *mtoShipment.NTSRecordedWeight
mtoShipment.PrimeEstimatedWeight = &previouslyRecordedWeight
}

updatedMtoShipment, err := h.ShipmentUpdater.UpdateShipment(appCtx, mtoShipment, params.IfMatch, "ghc")
if err != nil {
return handleError(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/mto_shipment/shipment_billable_weight.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (f *shipmentBillableWeightCalculator) CalculateShipmentBillableWeight(shipm
if shipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTSDom && shipment.NTSRecordedWeight != nil {
adjustedRecordedWeight := unit.Pound(shipment.NTSRecordedWeight.Float64() * float64(1.1))
if adjustedRecordedWeight < *shipment.PrimeActualWeight {
calculatedWeight = shipment.NTSRecordedWeight
calculatedWeight = &adjustedRecordedWeight
}
}
}
Expand Down

0 comments on commit 10a42c5

Please sign in to comment.