Skip to content

Commit

Permalink
Merge branch 'B-21170' into B-21170-Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlusk committed Dec 24, 2024
2 parents 744bd15 + 7ac99f8 commit 31c40c0
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 180 deletions.
2 changes: 1 addition & 1 deletion migrations/app/migrations_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,6 @@
20241204155919_update_ordering_proc.up.sql
20241204210208_retroactive_update_of_ppm_max_and_estimated_incentives_prd.up.sql
20241210143143_redefine_mto_shipment_audit_table.up.sql
20241217163231_update_duty_locations_bad_zips.up.sql
20241216170325_update_nts_enum_name.up.sql
20241217163231_update_duty_locations_bad_zips.up.sql
20241217180136_add_AK_zips_to_zip3_distances.up.sql
2 changes: 1 addition & 1 deletion pkg/handlers/primeapi/mto_shipment.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type DeleteMTOShipmentHandler struct {
services.ShipmentDeleter
}

// Handle handler that updates a mto shipment
// Handle handler that deletes a mto shipment
func (h DeleteMTOShipmentHandler) Handle(params mtoshipmentops.DeleteMTOShipmentParams) middleware.Responder {
return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest,
func(appCtx appcontext.AppContext) (middleware.Responder, error) {
Expand Down
9 changes: 8 additions & 1 deletion pkg/handlers/primeapi/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ func Address(address *models.Address) *primemessages.Address {
if address == nil {
return nil
}
return &primemessages.Address{

payloadAddress := &primemessages.Address{
ID: strfmt.UUID(address.ID.String()),
StreetAddress1: &address.StreetAddress1,
StreetAddress2: address.StreetAddress2,
Expand All @@ -301,6 +302,12 @@ func Address(address *models.Address) *primemessages.Address {
County: address.County,
ETag: etag.GenerateEtag(address.UpdatedAt),
}

if address.UsPostRegionCityID != nil {
payloadAddress.UsPostRegionCitiesID = strfmt.UUID(address.UsPostRegionCityID.String())
}

return payloadAddress
}

// StorageFacility payload
Expand Down
5 changes: 5 additions & 0 deletions pkg/handlers/primeapi/payloads/payload_to_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func AddressModel(address *primemessages.Address) *models.Address {
ID: uuid.FromStringOrNil(address.ID.String()),
StreetAddress2: address.StreetAddress2,
StreetAddress3: address.StreetAddress3,
County: address.County,
}
if address.StreetAddress1 != nil {
modelAddress.StreetAddress1 = *address.StreetAddress1
Expand All @@ -56,6 +57,10 @@ func AddressModel(address *primemessages.Address) *models.Address {
if address.Country != nil {
modelAddress.Country = CountryModel(address.Country)
}
usPostRegionCitiesID := uuid.FromStringOrNil(address.UsPostRegionCitiesID.String())
if usPostRegionCitiesID != uuid.Nil {
modelAddress.UsPostRegionCityID = &usPostRegionCitiesID
}
return modelAddress
}

Expand Down
8 changes: 7 additions & 1 deletion pkg/handlers/primeapiv2/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func Address(address *models.Address) *primev2messages.Address {
if address == nil {
return nil
}
return &primev2messages.Address{
payloadAddress := &primev2messages.Address{
ID: strfmt.UUID(address.ID.String()),
StreetAddress1: &address.StreetAddress1,
StreetAddress2: address.StreetAddress2,
Expand All @@ -232,6 +232,12 @@ func Address(address *models.Address) *primev2messages.Address {
County: address.County,
ETag: etag.GenerateEtag(address.UpdatedAt),
}

if address.UsPostRegionCityID != nil {
payloadAddress.UsPostRegionCitiesID = strfmt.UUID(address.UsPostRegionCityID.String())
}

return payloadAddress
}

// StorageFacility payload
Expand Down
5 changes: 5 additions & 0 deletions pkg/handlers/primeapiv2/payloads/payload_to_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func AddressModel(address *primev2messages.Address) *models.Address {
ID: uuid.FromStringOrNil(address.ID.String()),
StreetAddress2: address.StreetAddress2,
StreetAddress3: address.StreetAddress3,
County: address.County,
}
if address.StreetAddress1 != nil {
modelAddress.StreetAddress1 = *address.StreetAddress1
Expand All @@ -56,6 +57,10 @@ func AddressModel(address *primev2messages.Address) *models.Address {
if address.Country != nil {
modelAddress.Country = CountryModel(address.Country)
}
usPostRegionCitiesID := uuid.FromStringOrNil(address.UsPostRegionCitiesID.String())
if usPostRegionCitiesID != uuid.Nil {
modelAddress.UsPostRegionCityID = &usPostRegionCitiesID
}
return modelAddress
}

Expand Down
8 changes: 7 additions & 1 deletion pkg/handlers/primeapiv3/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func Address(address *models.Address) *primev3messages.Address {
if address == nil {
return nil
}
return &primev3messages.Address{
payloadAddress := &primev3messages.Address{
ID: strfmt.UUID(address.ID.String()),
StreetAddress1: &address.StreetAddress1,
StreetAddress2: address.StreetAddress2,
Expand All @@ -259,6 +259,12 @@ func Address(address *models.Address) *primev3messages.Address {
ETag: etag.GenerateEtag(address.UpdatedAt),
County: address.County,
}

if address.UsPostRegionCityID != nil {
payloadAddress.UsPostRegionCitiesID = strfmt.UUID(address.UsPostRegionCityID.String())
}

return payloadAddress
}

// PPM Destination payload
Expand Down
5 changes: 5 additions & 0 deletions pkg/handlers/primeapiv3/payloads/payload_to_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func AddressModel(address *primev3messages.Address) *models.Address {
ID: uuid.FromStringOrNil(address.ID.String()),
StreetAddress2: address.StreetAddress2,
StreetAddress3: address.StreetAddress3,
County: address.County,
}
if address.StreetAddress1 != nil {
modelAddress.StreetAddress1 = *address.StreetAddress1
Expand All @@ -57,6 +58,10 @@ func AddressModel(address *primev3messages.Address) *models.Address {
if address.Country != nil {
modelAddress.Country = CountryModel(address.Country)
}
usPostRegionCitiesID := uuid.FromStringOrNil(address.UsPostRegionCitiesID.String())
if usPostRegionCitiesID != uuid.Nil {
modelAddress.UsPostRegionCityID = &usPostRegionCitiesID
}
return modelAddress
}

Expand Down
Loading

0 comments on commit 31c40c0

Please sign in to comment.