Skip to content

Commit

Permalink
- Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nwithan8 committed Jul 16, 2024
1 parent ca4b942 commit deccbab
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions shipment.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ type EstimatedDeliveryDate struct {

// RecommendShipDateForShipmentResult is the result of the RecommendShipDateForShipment method.
type RecommendShipDateForShipmentResult struct {
Rate *SmartRate `json:"rate,omitempty"`
TimeInTransitDetails *TimeInTransitDetailsForShipDate `json:"easypost_time_in_transit_data,omitempty"`
Rate *SmartRate `json:"rate,omitempty"`
EasyPostTimeInTransitData *TimeInTransitDetailsForShipDate `json:"easypost_time_in_transit_data,omitempty"`
}

// CreateShipment creates a new Shipment object. The ToAddress, FromAddress and
Expand Down
12 changes: 6 additions & 6 deletions smart_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ type TimeInTransitDetailsForDeliveryDate struct {

// DeliveryDateForZipPairEstimate is a single zip-pair-based delivery date estimate for a carrier-service level combination.
type DeliveryDateForZipPairEstimate struct {
Carrier string `json:"carrier,omitempty"`
Service string `json:"service,omitempty"`
TimeInTransitDetails *TimeInTransitDetailsForDeliveryDate `json:"easypost_time_in_transit_data,omitempty"`
Carrier string `json:"carrier,omitempty"`
Service string `json:"service,omitempty"`
EasyPostTimeInTransitData *TimeInTransitDetailsForDeliveryDate `json:"easypost_time_in_transit_data,omitempty"`
}

// EstimateDeliveryDateForZipPairResult is the result of the EstimateDeliveryDateForZipPair method, containing the estimated delivery date of each carrier-service level combination and additional metadata.
Expand Down Expand Up @@ -48,9 +48,9 @@ type TimeInTransitDetailsForShipDate struct {

// ShipDateForZipPairRecommendation is a single zip-pair-based ship date recommendation for a carrier-service level combination.
type ShipDateForZipPairRecommendation struct {
Carrier string `json:"carrier,omitempty"`
Service string `json:"service,omitempty"`
TimeInTransitDetails *TimeInTransitDetailsForShipDate `json:"easypost_time_in_transit_data,omitempty"`
Carrier string `json:"carrier,omitempty"`
Service string `json:"service,omitempty"`
EasyPostTimeInTransitData *TimeInTransitDetailsForShipDate `json:"easypost_time_in_transit_data,omitempty"`
}

// RecommendShipDateForZipPairResult is the result of the RecommendShipDateForZipPair method, containing the recommended ship date of each carrier-service level combination and additional metadata.
Expand Down
10 changes: 5 additions & 5 deletions tests/shipment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,10 @@ func (c *ClientTests) TestShipmentRecommendShipDate() {

assert.True(len(recommendations) > 0)
for _, entry := range recommendations {
assert.NotNil(entry.TimeInTransitDetails.EasyPostRecommendedShipDate)
assert.NotNil(entry.TimeInTransitDetails.DeliveryDateConfidence)
assert.NotNil(entry.TimeInTransitDetails.EstimatedTransitDays)
assert.NotNil(entry.TimeInTransitDetails.DaysInTransit)
assert.NotNil(entry.TimeInTransitDetails.DesiredDeliveryDate)
assert.NotNil(entry.EasyPostTimeInTransitData.EasyPostRecommendedShipDate)
assert.NotNil(entry.EasyPostTimeInTransitData.DeliveryDateConfidence)
assert.NotNil(entry.EasyPostTimeInTransitData.EstimatedTransitDays)
assert.NotNil(entry.EasyPostTimeInTransitData.DaysInTransit)
assert.NotNil(entry.EasyPostTimeInTransitData.DesiredDeliveryDate)
}
}
12 changes: 6 additions & 6 deletions tests/smart_rate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func (c *ClientTests) TestEstimateDeliveryDateForZipPair() {
for _, entry := range estimates.Results {
assert.NotNil(entry.Carrier)
assert.NotNil(entry.Service)
assert.NotNil(entry.TimeInTransitDetails.EasyPostEstimatedDeliveryDate)
assert.NotNil(entry.TimeInTransitDetails.DaysInTransit)
assert.NotNil(entry.EasyPostTimeInTransitData.EasyPostEstimatedDeliveryDate)
assert.NotNil(entry.EasyPostTimeInTransitData.DaysInTransit)
}
}

Expand All @@ -53,10 +53,10 @@ func (c *ClientTests) TestRecommendShipDateForZipPair() {
for _, entry := range recommendations.Results {
assert.NotNil(entry.Carrier)
assert.NotNil(entry.Service)
assert.NotNil(entry.TimeInTransitDetails.EasyPostRecommendedShipDate)
assert.NotNil(entry.TimeInTransitDetails.DaysInTransit)
assert.NotNil(entry.TimeInTransitDetails.DeliveryDateConfidence)
assert.NotNil(entry.TimeInTransitDetails.EstimatedTransitDays)
assert.NotNil(entry.EasyPostTimeInTransitData.EasyPostRecommendedShipDate)
assert.NotNil(entry.EasyPostTimeInTransitData.DaysInTransit)
assert.NotNil(entry.EasyPostTimeInTransitData.DeliveryDateConfidence)
assert.NotNil(entry.EasyPostTimeInTransitData.EstimatedTransitDays)
}

}

0 comments on commit deccbab

Please sign in to comment.