diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt
index 9ddddcdb98c..0a653662c7e 100644
--- a/migrations/app/migrations_manifest.txt
+++ b/migrations/app/migrations_manifest.txt
@@ -1047,6 +1047,7 @@
20241122155416_total_dependents_calculation.up.sql
20241122220314_create_port_and_port_location_test_data.up.sql
20241126222026_add_sort_column_to_re_service_items.up.sql
+20241127125545_add_excess_ub_weight_columns_to_move.up.sql
20241127133504_add_indexes_speed_up_counseling_offices.up.sql
20241202163059_create_test_sequence_dev_env.up.sql
20241203024453_add_ppm_max_incentive_column.up.sql
diff --git a/migrations/app/schema/20241127125545_add_excess_ub_weight_columns_to_move.up.sql b/migrations/app/schema/20241127125545_add_excess_ub_weight_columns_to_move.up.sql
new file mode 100644
index 00000000000..e88fbe69325
--- /dev/null
+++ b/migrations/app/schema/20241127125545_add_excess_ub_weight_columns_to_move.up.sql
@@ -0,0 +1,8 @@
+-- enable tracking of the timestamp a move with ub shipments are at risk of excess, as well as
+-- the timestamp of when an office user dismisses the notification
+
+ALTER TABLE moves ADD COLUMN IF NOT EXISTS excess_unaccompanied_baggage_weight_qualified_at timestamp with time zone;
+ALTER TABLE moves ADD COLUMN IF NOT EXISTS excess_unaccompanied_baggage_weight_acknowledged_at timestamp with time zone;
+
+COMMENT ON COLUMN moves.excess_unaccompanied_baggage_weight_qualified_at IS 'The date and time the sum of all the move''s unaccompanied baggage shipment weights met or exceeded the excess unaccompanied baggage weight qualification threshold.';
+COMMENT ON COLUMN moves.excess_unaccompanied_baggage_weight_acknowledged_at IS 'The date and time the TOO dismissed the risk of excess unaccompanied baggage weight alert.';
diff --git a/pkg/gen/ghcapi/configure_mymove.go b/pkg/gen/ghcapi/configure_mymove.go
index 2c7449ec836..32eb5174c09 100644
--- a/pkg/gen/ghcapi/configure_mymove.go
+++ b/pkg/gen/ghcapi/configure_mymove.go
@@ -72,6 +72,11 @@ func configureAPI(api *ghcoperations.MymoveAPI) http.Handler {
// You may change here the memory limit for this multipart form parser. Below is the default (32 MB).
// order.UploadAmendedOrdersMaxParseMemory = 32 << 20
+ if api.OrderAcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler == nil {
+ api.OrderAcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler = order.AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandlerFunc(func(params order.AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) middleware.Responder {
+ return middleware.NotImplemented("operation order.AcknowledgeExcessUnaccompaniedBaggageWeightRisk has not yet been implemented")
+ })
+ }
if api.OrderAcknowledgeExcessWeightRiskHandler == nil {
api.OrderAcknowledgeExcessWeightRiskHandler = order.AcknowledgeExcessWeightRiskHandlerFunc(func(params order.AcknowledgeExcessWeightRiskParams) middleware.Responder {
return middleware.NotImplemented("operation order.AcknowledgeExcessWeightRisk has not yet been implemented")
diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go
index 14b3a43903c..e0271647ece 100644
--- a/pkg/gen/ghcapi/embedded_spec.go
+++ b/pkg/gen/ghcapi/embedded_spec.go
@@ -3167,6 +3167,66 @@ func init() {
}
]
},
+ "/orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk": {
+ "post": {
+ "description": "Saves the date and time a TOO acknowledged the excess unaccompanied baggage weight risk by dismissing the alert",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "order"
+ ],
+ "summary": "Saves the date and time a TOO acknowledged the excess unaccompanied baggage weight risk by dismissing the alert",
+ "operationId": "acknowledgeExcessUnaccompaniedBaggageWeightRisk",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "If-Match",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "updated Move",
+ "schema": {
+ "$ref": "#/definitions/Move"
+ }
+ },
+ "403": {
+ "$ref": "#/responses/PermissionDenied"
+ },
+ "404": {
+ "$ref": "#/responses/NotFound"
+ },
+ "412": {
+ "$ref": "#/responses/PreconditionFailed"
+ },
+ "422": {
+ "$ref": "#/responses/UnprocessableEntity"
+ },
+ "500": {
+ "$ref": "#/responses/ServerError"
+ }
+ },
+ "x-permissions": [
+ "update.excessWeightRisk"
+ ]
+ },
+ "parameters": [
+ {
+ "type": "string",
+ "format": "uuid",
+ "description": "ID of order to use",
+ "name": "orderID",
+ "in": "path",
+ "required": true
+ }
+ ]
+ },
"/orders/{orderID}/acknowledge-excess-weight-risk": {
"post": {
"description": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert",
@@ -10051,6 +10111,18 @@ func init() {
"eTag": {
"type": "string"
},
+ "excessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "description": "Timestamp of when the TOO acknowledged the excess unaccompanied baggage weight risk by either dismissing the alert or updating the max billable weight",
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true
+ },
+ "excessUnaccompaniedBaggageWeightQualifiedAt": {
+ "description": "Timestamp of when the sum of estimated or actual unaccompanied baggage shipment weights of the move reached 90% of the weight allowance",
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true
+ },
"excess_weight_acknowledged_at": {
"description": "Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight",
"type": "string",
@@ -19235,6 +19307,81 @@ func init() {
}
]
},
+ "/orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk": {
+ "post": {
+ "description": "Saves the date and time a TOO acknowledged the excess unaccompanied baggage weight risk by dismissing the alert",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "order"
+ ],
+ "summary": "Saves the date and time a TOO acknowledged the excess unaccompanied baggage weight risk by dismissing the alert",
+ "operationId": "acknowledgeExcessUnaccompaniedBaggageWeightRisk",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "If-Match",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "updated Move",
+ "schema": {
+ "$ref": "#/definitions/Move"
+ }
+ },
+ "403": {
+ "description": "The request was denied",
+ "schema": {
+ "$ref": "#/definitions/Error"
+ }
+ },
+ "404": {
+ "description": "The requested resource wasn't found",
+ "schema": {
+ "$ref": "#/definitions/Error"
+ }
+ },
+ "412": {
+ "description": "Precondition failed",
+ "schema": {
+ "$ref": "#/definitions/Error"
+ }
+ },
+ "422": {
+ "description": "The payload was unprocessable.",
+ "schema": {
+ "$ref": "#/definitions/ValidationError"
+ }
+ },
+ "500": {
+ "description": "A server error occurred",
+ "schema": {
+ "$ref": "#/definitions/Error"
+ }
+ }
+ },
+ "x-permissions": [
+ "update.excessWeightRisk"
+ ]
+ },
+ "parameters": [
+ {
+ "type": "string",
+ "format": "uuid",
+ "description": "ID of order to use",
+ "name": "orderID",
+ "in": "path",
+ "required": true
+ }
+ ]
+ },
"/orders/{orderID}/acknowledge-excess-weight-risk": {
"post": {
"description": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert",
@@ -26889,6 +27036,18 @@ func init() {
"eTag": {
"type": "string"
},
+ "excessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "description": "Timestamp of when the TOO acknowledged the excess unaccompanied baggage weight risk by either dismissing the alert or updating the max billable weight",
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true
+ },
+ "excessUnaccompaniedBaggageWeightQualifiedAt": {
+ "description": "Timestamp of when the sum of estimated or actual unaccompanied baggage shipment weights of the move reached 90% of the weight allowance",
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true
+ },
"excess_weight_acknowledged_at": {
"description": "Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight",
"type": "string",
diff --git a/pkg/gen/ghcapi/ghcoperations/mymove_api.go b/pkg/gen/ghcapi/ghcoperations/mymove_api.go
index e64a6704256..c53c0fec4d7 100644
--- a/pkg/gen/ghcapi/ghcoperations/mymove_api.go
+++ b/pkg/gen/ghcapi/ghcoperations/mymove_api.go
@@ -71,6 +71,9 @@ func NewMymoveAPI(spec *loads.Document) *MymoveAPI {
BinProducer: runtime.ByteStreamProducer(),
JSONProducer: runtime.JSONProducer(),
+ OrderAcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler: order.AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandlerFunc(func(params order.AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) middleware.Responder {
+ return middleware.NotImplemented("operation order.AcknowledgeExcessUnaccompaniedBaggageWeightRisk has not yet been implemented")
+ }),
OrderAcknowledgeExcessWeightRiskHandler: order.AcknowledgeExcessWeightRiskHandlerFunc(func(params order.AcknowledgeExcessWeightRiskParams) middleware.Responder {
return middleware.NotImplemented("operation order.AcknowledgeExcessWeightRisk has not yet been implemented")
}),
@@ -438,6 +441,8 @@ type MymoveAPI struct {
// - application/json
JSONProducer runtime.Producer
+ // OrderAcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler sets the operation handler for the acknowledge excess unaccompanied baggage weight risk operation
+ OrderAcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler order.AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler
// OrderAcknowledgeExcessWeightRiskHandler sets the operation handler for the acknowledge excess weight risk operation
OrderAcknowledgeExcessWeightRiskHandler order.AcknowledgeExcessWeightRiskHandler
// EvaluationReportsAddAppealToSeriousIncidentHandler sets the operation handler for the add appeal to serious incident operation
@@ -735,6 +740,9 @@ func (o *MymoveAPI) Validate() error {
unregistered = append(unregistered, "JSONProducer")
}
+ if o.OrderAcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler == nil {
+ unregistered = append(unregistered, "order.AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler")
+ }
if o.OrderAcknowledgeExcessWeightRiskHandler == nil {
unregistered = append(unregistered, "order.AcknowledgeExcessWeightRiskHandler")
}
@@ -1148,6 +1156,10 @@ func (o *MymoveAPI) initHandlerCache() {
o.handlers = make(map[string]map[string]http.Handler)
}
+ if o.handlers["POST"] == nil {
+ o.handlers["POST"] = make(map[string]http.Handler)
+ }
+ o.handlers["POST"]["/orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk"] = order.NewAcknowledgeExcessUnaccompaniedBaggageWeightRisk(o.context, o.OrderAcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk.go
new file mode 100644
index 00000000000..f41ed6bdfd7
--- /dev/null
+++ b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk.go
@@ -0,0 +1,58 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package order
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the generate command
+
+import (
+ "net/http"
+
+ "github.com/go-openapi/runtime/middleware"
+)
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandlerFunc turns a function with the right signature into a acknowledge excess unaccompanied baggage weight risk handler
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandlerFunc func(AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) middleware.Responder
+
+// Handle executing the request and returning a response
+func (fn AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandlerFunc) Handle(params AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) middleware.Responder {
+ return fn(params)
+}
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler interface for that can handle valid acknowledge excess unaccompanied baggage weight risk params
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler interface {
+ Handle(AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) middleware.Responder
+}
+
+// NewAcknowledgeExcessUnaccompaniedBaggageWeightRisk creates a new http.Handler for the acknowledge excess unaccompanied baggage weight risk operation
+func NewAcknowledgeExcessUnaccompaniedBaggageWeightRisk(ctx *middleware.Context, handler AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler) *AcknowledgeExcessUnaccompaniedBaggageWeightRisk {
+ return &AcknowledgeExcessUnaccompaniedBaggageWeightRisk{Context: ctx, Handler: handler}
+}
+
+/*
+ AcknowledgeExcessUnaccompaniedBaggageWeightRisk swagger:route POST /orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk order acknowledgeExcessUnaccompaniedBaggageWeightRisk
+
+# Saves the date and time a TOO acknowledged the excess unaccompanied baggage weight risk by dismissing the alert
+
+Saves the date and time a TOO acknowledged the excess unaccompanied baggage weight risk by dismissing the alert
+*/
+type AcknowledgeExcessUnaccompaniedBaggageWeightRisk struct {
+ Context *middleware.Context
+ Handler AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler
+}
+
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRisk) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
+ route, rCtx, _ := o.Context.RouteInfo(r)
+ if rCtx != nil {
+ *r = *rCtx
+ }
+ var Params = NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskParams()
+ if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
+ o.Context.Respond(rw, r, route.Produces, route, err)
+ return
+ }
+
+ res := o.Handler.Handle(Params) // actually handle the request
+ o.Context.Respond(rw, r, route.Produces, route, res)
+
+}
diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_parameters.go
new file mode 100644
index 00000000000..15deb918e6e
--- /dev/null
+++ b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_parameters.go
@@ -0,0 +1,120 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package order
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "net/http"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/runtime/middleware"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/validate"
+)
+
+// NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskParams creates a new AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams object
+//
+// There are no default values defined in the spec.
+func NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskParams() AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams {
+
+ return AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams{}
+}
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams contains all the bound params for the acknowledge excess unaccompanied baggage weight risk operation
+// typically these are obtained from a http.Request
+//
+// swagger:parameters acknowledgeExcessUnaccompaniedBaggageWeightRisk
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams struct {
+
+ // HTTP Request Object
+ HTTPRequest *http.Request `json:"-"`
+
+ /*
+ Required: true
+ In: header
+ */
+ IfMatch string
+ /*ID of order to use
+ Required: true
+ In: path
+ */
+ OrderID strfmt.UUID
+}
+
+// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
+// for simple values it will use straight method calls.
+//
+// To ensure default values, the struct must have been initialized with NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskParams() beforehand.
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
+ var res []error
+
+ o.HTTPRequest = r
+
+ if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil {
+ res = append(res, err)
+ }
+
+ rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID")
+ if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil {
+ res = append(res, err)
+ }
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+// bindIfMatch binds and validates parameter IfMatch from header.
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error {
+ if !hasKey {
+ return errors.Required("If-Match", "header", rawData)
+ }
+ var raw string
+ if len(rawData) > 0 {
+ raw = rawData[len(rawData)-1]
+ }
+
+ // Required: true
+
+ if err := validate.RequiredString("If-Match", "header", raw); err != nil {
+ return err
+ }
+ o.IfMatch = raw
+
+ return nil
+}
+
+// bindOrderID binds and validates parameter OrderID from path.
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error {
+ var raw string
+ if len(rawData) > 0 {
+ raw = rawData[len(rawData)-1]
+ }
+
+ // Required: true
+ // Parameter is provided by construction from the route
+
+ // Format: uuid
+ value, err := formats.Parse("uuid", raw)
+ if err != nil {
+ return errors.InvalidType("orderID", "path", "strfmt.UUID", raw)
+ }
+ o.OrderID = *(value.(*strfmt.UUID))
+
+ if err := o.validateOrderID(formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// validateOrderID carries on validations for parameter OrderID
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams) validateOrderID(formats strfmt.Registry) error {
+
+ if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil {
+ return err
+ }
+ return nil
+}
diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_responses.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_responses.go
new file mode 100644
index 00000000000..04c674fc725
--- /dev/null
+++ b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_responses.go
@@ -0,0 +1,284 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package order
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "net/http"
+
+ "github.com/go-openapi/runtime"
+
+ "github.com/transcom/mymove/pkg/gen/ghcmessages"
+)
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskOKCode is the HTTP code returned for type AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK
+const AcknowledgeExcessUnaccompaniedBaggageWeightRiskOKCode int = 200
+
+/*
+AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK updated Move
+
+swagger:response acknowledgeExcessUnaccompaniedBaggageWeightRiskOK
+*/
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK struct {
+
+ /*
+ In: Body
+ */
+ Payload *ghcmessages.Move `json:"body,omitempty"`
+}
+
+// NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskOK creates AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK with default headers values
+func NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskOK() *AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK {
+
+ return &AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK{}
+}
+
+// WithPayload adds the payload to the acknowledge excess unaccompanied baggage weight risk o k response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK) WithPayload(payload *ghcmessages.Move) *AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK {
+ o.Payload = payload
+ return o
+}
+
+// SetPayload sets the payload to the acknowledge excess unaccompanied baggage weight risk o k response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK) SetPayload(payload *ghcmessages.Move) {
+ o.Payload = payload
+}
+
+// WriteResponse to the client
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.WriteHeader(200)
+ if o.Payload != nil {
+ payload := o.Payload
+ if err := producer.Produce(rw, payload); err != nil {
+ panic(err) // let the recovery middleware deal with this
+ }
+ }
+}
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbiddenCode is the HTTP code returned for type AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden
+const AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbiddenCode int = 403
+
+/*
+AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden The request was denied
+
+swagger:response acknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden
+*/
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden struct {
+
+ /*
+ In: Body
+ */
+ Payload *ghcmessages.Error `json:"body,omitempty"`
+}
+
+// NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden creates AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden with default headers values
+func NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden() *AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden {
+
+ return &AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden{}
+}
+
+// WithPayload adds the payload to the acknowledge excess unaccompanied baggage weight risk forbidden response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden {
+ o.Payload = payload
+ return o
+}
+
+// SetPayload sets the payload to the acknowledge excess unaccompanied baggage weight risk forbidden response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden) SetPayload(payload *ghcmessages.Error) {
+ o.Payload = payload
+}
+
+// WriteResponse to the client
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.WriteHeader(403)
+ if o.Payload != nil {
+ payload := o.Payload
+ if err := producer.Produce(rw, payload); err != nil {
+ panic(err) // let the recovery middleware deal with this
+ }
+ }
+}
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFoundCode is the HTTP code returned for type AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound
+const AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFoundCode int = 404
+
+/*
+AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound The requested resource wasn't found
+
+swagger:response acknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound
+*/
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound struct {
+
+ /*
+ In: Body
+ */
+ Payload *ghcmessages.Error `json:"body,omitempty"`
+}
+
+// NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound creates AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound with default headers values
+func NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound() *AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound {
+
+ return &AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound{}
+}
+
+// WithPayload adds the payload to the acknowledge excess unaccompanied baggage weight risk not found response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound {
+ o.Payload = payload
+ return o
+}
+
+// SetPayload sets the payload to the acknowledge excess unaccompanied baggage weight risk not found response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound) SetPayload(payload *ghcmessages.Error) {
+ o.Payload = payload
+}
+
+// WriteResponse to the client
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.WriteHeader(404)
+ if o.Payload != nil {
+ payload := o.Payload
+ if err := producer.Produce(rw, payload); err != nil {
+ panic(err) // let the recovery middleware deal with this
+ }
+ }
+}
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailedCode is the HTTP code returned for type AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed
+const AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailedCode int = 412
+
+/*
+AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed Precondition failed
+
+swagger:response acknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed
+*/
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed struct {
+
+ /*
+ In: Body
+ */
+ Payload *ghcmessages.Error `json:"body,omitempty"`
+}
+
+// NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed creates AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed with default headers values
+func NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed() *AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed {
+
+ return &AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed{}
+}
+
+// WithPayload adds the payload to the acknowledge excess unaccompanied baggage weight risk precondition failed response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed {
+ o.Payload = payload
+ return o
+}
+
+// SetPayload sets the payload to the acknowledge excess unaccompanied baggage weight risk precondition failed response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed) SetPayload(payload *ghcmessages.Error) {
+ o.Payload = payload
+}
+
+// WriteResponse to the client
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.WriteHeader(412)
+ if o.Payload != nil {
+ payload := o.Payload
+ if err := producer.Produce(rw, payload); err != nil {
+ panic(err) // let the recovery middleware deal with this
+ }
+ }
+}
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntityCode is the HTTP code returned for type AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity
+const AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntityCode int = 422
+
+/*
+AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity The payload was unprocessable.
+
+swagger:response acknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity
+*/
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity struct {
+
+ /*
+ In: Body
+ */
+ Payload *ghcmessages.ValidationError `json:"body,omitempty"`
+}
+
+// NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity creates AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity with default headers values
+func NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity() *AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity {
+
+ return &AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity{}
+}
+
+// WithPayload adds the payload to the acknowledge excess unaccompanied baggage weight risk unprocessable entity response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity {
+ o.Payload = payload
+ return o
+}
+
+// SetPayload sets the payload to the acknowledge excess unaccompanied baggage weight risk unprocessable entity response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) {
+ o.Payload = payload
+}
+
+// WriteResponse to the client
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.WriteHeader(422)
+ if o.Payload != nil {
+ payload := o.Payload
+ if err := producer.Produce(rw, payload); err != nil {
+ panic(err) // let the recovery middleware deal with this
+ }
+ }
+}
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerErrorCode is the HTTP code returned for type AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError
+const AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerErrorCode int = 500
+
+/*
+AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError A server error occurred
+
+swagger:response acknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError
+*/
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError struct {
+
+ /*
+ In: Body
+ */
+ Payload *ghcmessages.Error `json:"body,omitempty"`
+}
+
+// NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError creates AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError with default headers values
+func NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError() *AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError {
+
+ return &AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError{}
+}
+
+// WithPayload adds the payload to the acknowledge excess unaccompanied baggage weight risk internal server error response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError {
+ o.Payload = payload
+ return o
+}
+
+// SetPayload sets the payload to the acknowledge excess unaccompanied baggage weight risk internal server error response
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError) SetPayload(payload *ghcmessages.Error) {
+ o.Payload = payload
+}
+
+// WriteResponse to the client
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.WriteHeader(500)
+ if o.Payload != nil {
+ payload := o.Payload
+ if err := producer.Produce(rw, payload); err != nil {
+ panic(err) // let the recovery middleware deal with this
+ }
+ }
+}
diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_urlbuilder.go
new file mode 100644
index 00000000000..4cd575b01eb
--- /dev/null
+++ b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_unaccompanied_baggage_weight_risk_urlbuilder.go
@@ -0,0 +1,101 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package order
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the generate command
+
+import (
+ "errors"
+ "net/url"
+ golangswaggerpaths "path"
+ "strings"
+
+ "github.com/go-openapi/strfmt"
+)
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL generates an URL for the acknowledge excess unaccompanied baggage weight risk operation
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL struct {
+ OrderID strfmt.UUID
+
+ _basePath string
+ // avoid unkeyed usage
+ _ struct{}
+}
+
+// WithBasePath sets the base path for this url builder, only required when it's different from the
+// base path specified in the swagger spec.
+// When the value of the base path is an empty string
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL) WithBasePath(bp string) *AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL {
+ o.SetBasePath(bp)
+ return o
+}
+
+// SetBasePath sets the base path for this url builder, only required when it's different from the
+// base path specified in the swagger spec.
+// When the value of the base path is an empty string
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL) SetBasePath(bp string) {
+ o._basePath = bp
+}
+
+// Build a url path and query string
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL) Build() (*url.URL, error) {
+ var _result url.URL
+
+ var _path = "/orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk"
+
+ orderID := o.OrderID.String()
+ if orderID != "" {
+ _path = strings.Replace(_path, "{orderID}", orderID, -1)
+ } else {
+ return nil, errors.New("orderId is required on AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL")
+ }
+
+ _basePath := o._basePath
+ if _basePath == "" {
+ _basePath = "/ghc/v1"
+ }
+ _result.Path = golangswaggerpaths.Join(_basePath, _path)
+
+ return &_result, nil
+}
+
+// Must is a helper function to panic when the url builder returns an error
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL) Must(u *url.URL, err error) *url.URL {
+ if err != nil {
+ panic(err)
+ }
+ if u == nil {
+ panic("url can't be nil")
+ }
+ return u
+}
+
+// String returns the string representation of the path with query string
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL) String() string {
+ return o.Must(o.Build()).String()
+}
+
+// BuildFull builds a full url with scheme, host, path and query string
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL) BuildFull(scheme, host string) (*url.URL, error) {
+ if scheme == "" {
+ return nil, errors.New("scheme is required for a full url on AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL")
+ }
+ if host == "" {
+ return nil, errors.New("host is required for a full url on AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL")
+ }
+
+ base, err := o.Build()
+ if err != nil {
+ return nil, err
+ }
+
+ base.Scheme = scheme
+ base.Host = host
+ return base, nil
+}
+
+// StringFull returns the string representation of a complete url
+func (o *AcknowledgeExcessUnaccompaniedBaggageWeightRiskURL) StringFull(scheme, host string) string {
+ return o.Must(o.BuildFull(scheme, host)).String()
+}
diff --git a/pkg/gen/ghcmessages/move.go b/pkg/gen/ghcmessages/move.go
index bb67e748b11..26d652a3f42 100644
--- a/pkg/gen/ghcmessages/move.go
+++ b/pkg/gen/ghcmessages/move.go
@@ -68,6 +68,14 @@ type Move struct {
// e tag
ETag string `json:"eTag,omitempty"`
+ // Timestamp of when the TOO acknowledged the excess unaccompanied baggage weight risk by either dismissing the alert or updating the max billable weight
+ // Format: date-time
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt,omitempty"`
+
+ // Timestamp of when the sum of estimated or actual unaccompanied baggage shipment weights of the move reached 90% of the weight allowance
+ // Format: date-time
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt,omitempty"`
+
// Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight
// Format: date-time
ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excess_weight_acknowledged_at,omitempty"`
@@ -197,6 +205,14 @@ func (m *Move) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
+ if err := m.validateExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateExcessUnaccompaniedBaggageWeightQualifiedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil {
res = append(res, err)
}
@@ -453,6 +469,30 @@ func (m *Move) validateCreatedAt(formats strfmt.Registry) error {
return nil
}
+func (m *Move) validateExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats strfmt.Registry) error {
+ if swag.IsZero(m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("excessUnaccompaniedBaggageWeightAcknowledgedAt", "body", "date-time", m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *Move) validateExcessUnaccompaniedBaggageWeightQualifiedAt(formats strfmt.Registry) error {
+ if swag.IsZero(m.ExcessUnaccompaniedBaggageWeightQualifiedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("excessUnaccompaniedBaggageWeightQualifiedAt", "body", "date-time", m.ExcessUnaccompaniedBaggageWeightQualifiedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *Move) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required
return nil
diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go
index 5ce22a16bfb..5f3561c66d6 100644
--- a/pkg/gen/primeapi/embedded_spec.go
+++ b/pkg/gen/primeapi/embedded_spec.go
@@ -1840,6 +1840,22 @@ func init() {
"moveId"
],
"properties": {
+ "moveExcessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "description": "The date and time when the TOO acknowledged the excess unaccompanied baggage weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.\n",
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
+ "moveExcessUnaccompaniedBaggageWeightQualifiedAt": {
+ "description": "The date and time when the sum of all the move's unaccompanied baggage shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically.\n",
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
"moveExcessWeightAcknowledgedAt": {
"description": "The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.\n",
"type": "string",
@@ -2876,6 +2892,20 @@ func init() {
"type": "string",
"readOnly": true
},
+ "excessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
+ "excessUnaccompaniedBaggageWeightQualifiedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
"excessWeightAcknowledgedAt": {
"type": "string",
"format": "date-time",
@@ -6759,6 +6789,22 @@ func init() {
"moveId"
],
"properties": {
+ "moveExcessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "description": "The date and time when the TOO acknowledged the excess unaccompanied baggage weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.\n",
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
+ "moveExcessUnaccompaniedBaggageWeightQualifiedAt": {
+ "description": "The date and time when the sum of all the move's unaccompanied baggage shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically.\n",
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
"moveExcessWeightAcknowledgedAt": {
"description": "The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.\n",
"type": "string",
@@ -7795,6 +7841,20 @@ func init() {
"type": "string",
"readOnly": true
},
+ "excessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
+ "excessUnaccompaniedBaggageWeightQualifiedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
"excessWeightAcknowledgedAt": {
"type": "string",
"format": "date-time",
diff --git a/pkg/gen/primemessages/excess_weight_record.go b/pkg/gen/primemessages/excess_weight_record.go
index 03c572134ba..a057c0258b6 100644
--- a/pkg/gen/primemessages/excess_weight_record.go
+++ b/pkg/gen/primemessages/excess_weight_record.go
@@ -20,6 +20,18 @@ import (
type ExcessWeightRecord struct {
UploadWithOmissions
+ // The date and time when the TOO acknowledged the excess unaccompanied baggage weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.
+ //
+ // Read Only: true
+ // Format: date-time
+ MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ // The date and time when the sum of all the move's unaccompanied baggage shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically.
+ //
+ // Read Only: true
+ // Format: date-time
+ MoveExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"moveExcessUnaccompaniedBaggageWeightQualifiedAt"`
+
// The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.
//
// Read Only: true
@@ -50,6 +62,10 @@ func (m *ExcessWeightRecord) UnmarshalJSON(raw []byte) error {
// AO1
var dataAO1 struct {
+ MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ MoveExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"moveExcessUnaccompaniedBaggageWeightQualifiedAt"`
+
MoveExcessWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessWeightAcknowledgedAt"`
MoveExcessWeightQualifiedAt *strfmt.DateTime `json:"moveExcessWeightQualifiedAt"`
@@ -60,6 +76,10 @@ func (m *ExcessWeightRecord) UnmarshalJSON(raw []byte) error {
return err
}
+ m.MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt = dataAO1.MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt
+
+ m.MoveExcessUnaccompaniedBaggageWeightQualifiedAt = dataAO1.MoveExcessUnaccompaniedBaggageWeightQualifiedAt
+
m.MoveExcessWeightAcknowledgedAt = dataAO1.MoveExcessWeightAcknowledgedAt
m.MoveExcessWeightQualifiedAt = dataAO1.MoveExcessWeightQualifiedAt
@@ -79,6 +99,10 @@ func (m ExcessWeightRecord) MarshalJSON() ([]byte, error) {
}
_parts = append(_parts, aO0)
var dataAO1 struct {
+ MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ MoveExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"moveExcessUnaccompaniedBaggageWeightQualifiedAt"`
+
MoveExcessWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessWeightAcknowledgedAt"`
MoveExcessWeightQualifiedAt *strfmt.DateTime `json:"moveExcessWeightQualifiedAt"`
@@ -86,6 +110,10 @@ func (m ExcessWeightRecord) MarshalJSON() ([]byte, error) {
MoveID *strfmt.UUID `json:"moveId"`
}
+ dataAO1.MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt = m.MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt
+
+ dataAO1.MoveExcessUnaccompaniedBaggageWeightQualifiedAt = m.MoveExcessUnaccompaniedBaggageWeightQualifiedAt
+
dataAO1.MoveExcessWeightAcknowledgedAt = m.MoveExcessWeightAcknowledgedAt
dataAO1.MoveExcessWeightQualifiedAt = m.MoveExcessWeightQualifiedAt
@@ -109,6 +137,14 @@ func (m *ExcessWeightRecord) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
+ if err := m.validateMoveExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMoveExcessUnaccompaniedBaggageWeightQualifiedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validateMoveExcessWeightAcknowledgedAt(formats); err != nil {
res = append(res, err)
}
@@ -127,6 +163,32 @@ func (m *ExcessWeightRecord) Validate(formats strfmt.Registry) error {
return nil
}
+func (m *ExcessWeightRecord) validateMoveExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("moveExcessUnaccompaniedBaggageWeightAcknowledgedAt", "body", "date-time", m.MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *ExcessWeightRecord) validateMoveExcessUnaccompaniedBaggageWeightQualifiedAt(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.MoveExcessUnaccompaniedBaggageWeightQualifiedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("moveExcessUnaccompaniedBaggageWeightQualifiedAt", "body", "date-time", m.MoveExcessUnaccompaniedBaggageWeightQualifiedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *ExcessWeightRecord) validateMoveExcessWeightAcknowledgedAt(formats strfmt.Registry) error {
if swag.IsZero(m.MoveExcessWeightAcknowledgedAt) { // not required
@@ -175,6 +237,14 @@ func (m *ExcessWeightRecord) ContextValidate(ctx context.Context, formats strfmt
res = append(res, err)
}
+ if err := m.contextValidateMoveExcessUnaccompaniedBaggageWeightAcknowledgedAt(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateMoveExcessUnaccompaniedBaggageWeightQualifiedAt(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.contextValidateMoveExcessWeightAcknowledgedAt(ctx, formats); err != nil {
res = append(res, err)
}
@@ -189,6 +259,24 @@ func (m *ExcessWeightRecord) ContextValidate(ctx context.Context, formats strfmt
return nil
}
+func (m *ExcessWeightRecord) contextValidateMoveExcessUnaccompaniedBaggageWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "moveExcessUnaccompaniedBaggageWeightAcknowledgedAt", "body", m.MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *ExcessWeightRecord) contextValidateMoveExcessUnaccompaniedBaggageWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "moveExcessUnaccompaniedBaggageWeightQualifiedAt", "body", m.MoveExcessUnaccompaniedBaggageWeightQualifiedAt); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *ExcessWeightRecord) contextValidateMoveExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "moveExcessWeightAcknowledgedAt", "body", m.MoveExcessWeightAcknowledgedAt); err != nil {
diff --git a/pkg/gen/primemessages/move_task_order.go b/pkg/gen/primemessages/move_task_order.go
index befdf8fe3d0..b20f7b6a94e 100644
--- a/pkg/gen/primemessages/move_task_order.go
+++ b/pkg/gen/primemessages/move_task_order.go
@@ -53,6 +53,16 @@ type MoveTaskOrder struct {
// Read Only: true
ETag string `json:"eTag,omitempty"`
+ // excess unaccompanied baggage weight acknowledged at
+ // Read Only: true
+ // Format: date-time
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ // excess unaccompanied baggage weight qualified at
+ // Read Only: true
+ // Format: date-time
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
// excess weight acknowledged at
// Read Only: true
// Format: date-time
@@ -143,6 +153,10 @@ func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error {
ETag string `json:"eTag,omitempty"`
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"`
ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"`
@@ -206,6 +220,12 @@ func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error {
// eTag
result.ETag = data.ETag
+ // excessUnaccompaniedBaggageWeightAcknowledgedAt
+ result.ExcessUnaccompaniedBaggageWeightAcknowledgedAt = data.ExcessUnaccompaniedBaggageWeightAcknowledgedAt
+
+ // excessUnaccompaniedBaggageWeightQualifiedAt
+ result.ExcessUnaccompaniedBaggageWeightQualifiedAt = data.ExcessUnaccompaniedBaggageWeightQualifiedAt
+
// excessWeightAcknowledgedAt
result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt
@@ -273,6 +293,10 @@ func (m MoveTaskOrder) MarshalJSON() ([]byte, error) {
ETag string `json:"eTag,omitempty"`
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"`
ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"`
@@ -314,6 +338,10 @@ func (m MoveTaskOrder) MarshalJSON() ([]byte, error) {
ETag: m.ETag,
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt,
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: m.ExcessUnaccompaniedBaggageWeightQualifiedAt,
+
ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt,
ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt,
@@ -374,6 +402,14 @@ func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
+ if err := m.validateExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateExcessUnaccompaniedBaggageWeightQualifiedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil {
res = append(res, err)
}
@@ -464,6 +500,30 @@ func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error {
return nil
}
+func (m *MoveTaskOrder) validateExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats strfmt.Registry) error {
+ if swag.IsZero(m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("excessUnaccompaniedBaggageWeightAcknowledgedAt", "body", "date-time", m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MoveTaskOrder) validateExcessUnaccompaniedBaggageWeightQualifiedAt(formats strfmt.Registry) error {
+ if swag.IsZero(m.ExcessUnaccompaniedBaggageWeightQualifiedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("excessUnaccompaniedBaggageWeightQualifiedAt", "body", "date-time", m.ExcessUnaccompaniedBaggageWeightQualifiedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required
return nil
@@ -695,6 +755,14 @@ func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Regi
res = append(res, err)
}
+ if err := m.contextValidateExcessUnaccompaniedBaggageWeightAcknowledgedAt(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateExcessUnaccompaniedBaggageWeightQualifiedAt(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil {
res = append(res, err)
}
@@ -795,6 +863,24 @@ func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.
return nil
}
+func (m *MoveTaskOrder) contextValidateExcessUnaccompaniedBaggageWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "excessUnaccompaniedBaggageWeightAcknowledgedAt", "body", m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MoveTaskOrder) contextValidateExcessUnaccompaniedBaggageWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "excessUnaccompaniedBaggageWeightQualifiedAt", "body", m.ExcessUnaccompaniedBaggageWeightQualifiedAt); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil {
diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go
index f907813b53b..74ee52d88c1 100644
--- a/pkg/gen/primev2api/embedded_spec.go
+++ b/pkg/gen/primev2api/embedded_spec.go
@@ -1976,6 +1976,20 @@ func init() {
"type": "string",
"readOnly": true
},
+ "excessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
+ "excessUnaccompaniedBaggageWeightQualifiedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
"excessWeightAcknowledgedAt": {
"type": "string",
"format": "date-time",
@@ -5598,6 +5612,20 @@ func init() {
"type": "string",
"readOnly": true
},
+ "excessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
+ "excessUnaccompaniedBaggageWeightQualifiedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
"excessWeightAcknowledgedAt": {
"type": "string",
"format": "date-time",
diff --git a/pkg/gen/primev2messages/move_task_order.go b/pkg/gen/primev2messages/move_task_order.go
index c5e6cf21146..4ecf103cc43 100644
--- a/pkg/gen/primev2messages/move_task_order.go
+++ b/pkg/gen/primev2messages/move_task_order.go
@@ -57,6 +57,16 @@ type MoveTaskOrder struct {
// Read Only: true
ETag string `json:"eTag,omitempty"`
+ // excess unaccompanied baggage weight acknowledged at
+ // Read Only: true
+ // Format: date-time
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ // excess unaccompanied baggage weight qualified at
+ // Read Only: true
+ // Format: date-time
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
// excess weight acknowledged at
// Read Only: true
// Format: date-time
@@ -149,6 +159,10 @@ func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error {
ETag string `json:"eTag,omitempty"`
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"`
ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"`
@@ -215,6 +229,12 @@ func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error {
// eTag
result.ETag = data.ETag
+ // excessUnaccompaniedBaggageWeightAcknowledgedAt
+ result.ExcessUnaccompaniedBaggageWeightAcknowledgedAt = data.ExcessUnaccompaniedBaggageWeightAcknowledgedAt
+
+ // excessUnaccompaniedBaggageWeightQualifiedAt
+ result.ExcessUnaccompaniedBaggageWeightQualifiedAt = data.ExcessUnaccompaniedBaggageWeightQualifiedAt
+
// excessWeightAcknowledgedAt
result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt
@@ -284,6 +304,10 @@ func (m MoveTaskOrder) MarshalJSON() ([]byte, error) {
ETag string `json:"eTag,omitempty"`
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"`
ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"`
@@ -327,6 +351,10 @@ func (m MoveTaskOrder) MarshalJSON() ([]byte, error) {
ETag: m.ETag,
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt,
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: m.ExcessUnaccompaniedBaggageWeightQualifiedAt,
+
ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt,
ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt,
@@ -387,6 +415,14 @@ func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
+ if err := m.validateExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateExcessUnaccompaniedBaggageWeightQualifiedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil {
res = append(res, err)
}
@@ -477,6 +513,30 @@ func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error {
return nil
}
+func (m *MoveTaskOrder) validateExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats strfmt.Registry) error {
+ if swag.IsZero(m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("excessUnaccompaniedBaggageWeightAcknowledgedAt", "body", "date-time", m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MoveTaskOrder) validateExcessUnaccompaniedBaggageWeightQualifiedAt(formats strfmt.Registry) error {
+ if swag.IsZero(m.ExcessUnaccompaniedBaggageWeightQualifiedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("excessUnaccompaniedBaggageWeightQualifiedAt", "body", "date-time", m.ExcessUnaccompaniedBaggageWeightQualifiedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required
return nil
@@ -712,6 +772,14 @@ func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Regi
res = append(res, err)
}
+ if err := m.contextValidateExcessUnaccompaniedBaggageWeightAcknowledgedAt(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateExcessUnaccompaniedBaggageWeightQualifiedAt(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil {
res = append(res, err)
}
@@ -821,6 +889,24 @@ func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.
return nil
}
+func (m *MoveTaskOrder) contextValidateExcessUnaccompaniedBaggageWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "excessUnaccompaniedBaggageWeightAcknowledgedAt", "body", m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MoveTaskOrder) contextValidateExcessUnaccompaniedBaggageWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "excessUnaccompaniedBaggageWeightQualifiedAt", "body", m.ExcessUnaccompaniedBaggageWeightQualifiedAt); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil {
diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go
index df6a51d3016..b35aaf504b1 100644
--- a/pkg/gen/primev3api/embedded_spec.go
+++ b/pkg/gen/primev3api/embedded_spec.go
@@ -1641,6 +1641,31 @@ func init() {
}
]
},
+ "MTOServiceItemInternationalFuelSurcharge": {
+ "description": "Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/MTOServiceItem"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "portCode": {
+ "description": "A unique code for a Port",
+ "type": "string"
+ },
+ "reServiceCode": {
+ "description": "A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).",
+ "type": "string",
+ "enum": [
+ "PODFSC",
+ "POEFSC"
+ ]
+ }
+ }
+ }
+ ]
+ },
"MTOServiceItemModelType": {
"description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n",
"type": "string",
@@ -2210,6 +2235,20 @@ func init() {
"type": "string",
"readOnly": true
},
+ "excessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
+ "excessUnaccompaniedBaggageWeightQualifiedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
"excessWeightAcknowledgedAt": {
"type": "string",
"format": "date-time",
@@ -5948,6 +5987,31 @@ func init() {
}
]
},
+ "MTOServiceItemInternationalFuelSurcharge": {
+ "description": "Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/MTOServiceItem"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "portCode": {
+ "description": "A unique code for a Port",
+ "type": "string"
+ },
+ "reServiceCode": {
+ "description": "A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).",
+ "type": "string",
+ "enum": [
+ "PODFSC",
+ "POEFSC"
+ ]
+ }
+ }
+ }
+ ]
+ },
"MTOServiceItemModelType": {
"description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n",
"type": "string",
@@ -6517,6 +6581,20 @@ func init() {
"type": "string",
"readOnly": true
},
+ "excessUnaccompaniedBaggageWeightAcknowledgedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
+ "excessUnaccompaniedBaggageWeightQualifiedAt": {
+ "type": "string",
+ "format": "date-time",
+ "x-nullable": true,
+ "x-omitempty": false,
+ "readOnly": true
+ },
"excessWeightAcknowledgedAt": {
"type": "string",
"format": "date-time",
diff --git a/pkg/gen/primev3messages/m_t_o_service_item.go b/pkg/gen/primev3messages/m_t_o_service_item.go
index 9559114c004..d6861255a80 100644
--- a/pkg/gen/primev3messages/m_t_o_service_item.go
+++ b/pkg/gen/primev3messages/m_t_o_service_item.go
@@ -279,6 +279,12 @@ func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOService
return nil, err
}
return &result, nil
+ case "MTOServiceItemInternationalFuelSurcharge":
+ var result MTOServiceItemInternationalFuelSurcharge
+ if err := consumer.Consume(buf2, &result); err != nil {
+ return nil, err
+ }
+ return &result, nil
case "MTOServiceItemOriginSIT":
var result MTOServiceItemOriginSIT
if err := consumer.Consume(buf2, &result); err != nil {
diff --git a/pkg/gen/primev3messages/m_t_o_service_item_international_fuel_surcharge.go b/pkg/gen/primev3messages/m_t_o_service_item_international_fuel_surcharge.go
new file mode 100644
index 00000000000..73d7c4e4c0b
--- /dev/null
+++ b/pkg/gen/primev3messages/m_t_o_service_item_international_fuel_surcharge.go
@@ -0,0 +1,575 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package primev3messages
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// MTOServiceItemInternationalFuelSurcharge Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem.
+//
+// swagger:model MTOServiceItemInternationalFuelSurcharge
+type MTOServiceItemInternationalFuelSurcharge struct {
+ eTagField string
+
+ idField strfmt.UUID
+
+ lockedPriceCentsField *int64
+
+ moveTaskOrderIdField *strfmt.UUID
+
+ mtoShipmentIdField strfmt.UUID
+
+ reServiceNameField string
+
+ rejectionReasonField *string
+
+ serviceRequestDocumentsField ServiceRequestDocuments
+
+ statusField MTOServiceItemStatus
+
+ // A unique code for a Port
+ PortCode string `json:"portCode,omitempty"`
+
+ // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).
+ // Enum: [PODFSC POEFSC]
+ ReServiceCode string `json:"reServiceCode,omitempty"`
+}
+
+// ETag gets the e tag of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) ETag() string {
+ return m.eTagField
+}
+
+// SetETag sets the e tag of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetETag(val string) {
+ m.eTagField = val
+}
+
+// ID gets the id of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) ID() strfmt.UUID {
+ return m.idField
+}
+
+// SetID sets the id of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetID(val strfmt.UUID) {
+ m.idField = val
+}
+
+// LockedPriceCents gets the locked price cents of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) LockedPriceCents() *int64 {
+ return m.lockedPriceCentsField
+}
+
+// SetLockedPriceCents sets the locked price cents of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetLockedPriceCents(val *int64) {
+ m.lockedPriceCentsField = val
+}
+
+// ModelType gets the model type of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) ModelType() MTOServiceItemModelType {
+ return "MTOServiceItemInternationalFuelSurcharge"
+}
+
+// SetModelType sets the model type of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetModelType(val MTOServiceItemModelType) {
+}
+
+// MoveTaskOrderID gets the move task order ID of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) MoveTaskOrderID() *strfmt.UUID {
+ return m.moveTaskOrderIdField
+}
+
+// SetMoveTaskOrderID sets the move task order ID of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetMoveTaskOrderID(val *strfmt.UUID) {
+ m.moveTaskOrderIdField = val
+}
+
+// MtoShipmentID gets the mto shipment ID of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) MtoShipmentID() strfmt.UUID {
+ return m.mtoShipmentIdField
+}
+
+// SetMtoShipmentID sets the mto shipment ID of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetMtoShipmentID(val strfmt.UUID) {
+ m.mtoShipmentIdField = val
+}
+
+// ReServiceName gets the re service name of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) ReServiceName() string {
+ return m.reServiceNameField
+}
+
+// SetReServiceName sets the re service name of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetReServiceName(val string) {
+ m.reServiceNameField = val
+}
+
+// RejectionReason gets the rejection reason of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) RejectionReason() *string {
+ return m.rejectionReasonField
+}
+
+// SetRejectionReason sets the rejection reason of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetRejectionReason(val *string) {
+ m.rejectionReasonField = val
+}
+
+// ServiceRequestDocuments gets the service request documents of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) ServiceRequestDocuments() ServiceRequestDocuments {
+ return m.serviceRequestDocumentsField
+}
+
+// SetServiceRequestDocuments sets the service request documents of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetServiceRequestDocuments(val ServiceRequestDocuments) {
+ m.serviceRequestDocumentsField = val
+}
+
+// Status gets the status of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) Status() MTOServiceItemStatus {
+ return m.statusField
+}
+
+// SetStatus sets the status of this subtype
+func (m *MTOServiceItemInternationalFuelSurcharge) SetStatus(val MTOServiceItemStatus) {
+ m.statusField = val
+}
+
+// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
+func (m *MTOServiceItemInternationalFuelSurcharge) UnmarshalJSON(raw []byte) error {
+ var data struct {
+
+ // A unique code for a Port
+ PortCode string `json:"portCode,omitempty"`
+
+ // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).
+ // Enum: [PODFSC POEFSC]
+ ReServiceCode string `json:"reServiceCode,omitempty"`
+ }
+ buf := bytes.NewBuffer(raw)
+ dec := json.NewDecoder(buf)
+ dec.UseNumber()
+
+ if err := dec.Decode(&data); err != nil {
+ return err
+ }
+
+ var base struct {
+ /* Just the base type fields. Used for unmashalling polymorphic types.*/
+
+ ETag string `json:"eTag,omitempty"`
+
+ ID strfmt.UUID `json:"id,omitempty"`
+
+ LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"`
+
+ ModelType MTOServiceItemModelType `json:"modelType"`
+
+ MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"`
+
+ MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"`
+
+ ReServiceName string `json:"reServiceName,omitempty"`
+
+ RejectionReason *string `json:"rejectionReason,omitempty"`
+
+ ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"`
+
+ Status MTOServiceItemStatus `json:"status,omitempty"`
+ }
+ buf = bytes.NewBuffer(raw)
+ dec = json.NewDecoder(buf)
+ dec.UseNumber()
+
+ if err := dec.Decode(&base); err != nil {
+ return err
+ }
+
+ var result MTOServiceItemInternationalFuelSurcharge
+
+ result.eTagField = base.ETag
+
+ result.idField = base.ID
+
+ result.lockedPriceCentsField = base.LockedPriceCents
+
+ if base.ModelType != result.ModelType() {
+ /* Not the type we're looking for. */
+ return errors.New(422, "invalid modelType value: %q", base.ModelType)
+ }
+ result.moveTaskOrderIdField = base.MoveTaskOrderID
+
+ result.mtoShipmentIdField = base.MtoShipmentID
+
+ result.reServiceNameField = base.ReServiceName
+
+ result.rejectionReasonField = base.RejectionReason
+
+ result.serviceRequestDocumentsField = base.ServiceRequestDocuments
+
+ result.statusField = base.Status
+
+ result.PortCode = data.PortCode
+ result.ReServiceCode = data.ReServiceCode
+
+ *m = result
+
+ return nil
+}
+
+// MarshalJSON marshals this object with a polymorphic type to a JSON structure
+func (m MTOServiceItemInternationalFuelSurcharge) MarshalJSON() ([]byte, error) {
+ var b1, b2, b3 []byte
+ var err error
+ b1, err = json.Marshal(struct {
+
+ // A unique code for a Port
+ PortCode string `json:"portCode,omitempty"`
+
+ // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).
+ // Enum: [PODFSC POEFSC]
+ ReServiceCode string `json:"reServiceCode,omitempty"`
+ }{
+
+ PortCode: m.PortCode,
+
+ ReServiceCode: m.ReServiceCode,
+ })
+ if err != nil {
+ return nil, err
+ }
+ b2, err = json.Marshal(struct {
+ ETag string `json:"eTag,omitempty"`
+
+ ID strfmt.UUID `json:"id,omitempty"`
+
+ LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"`
+
+ ModelType MTOServiceItemModelType `json:"modelType"`
+
+ MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"`
+
+ MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"`
+
+ ReServiceName string `json:"reServiceName,omitempty"`
+
+ RejectionReason *string `json:"rejectionReason,omitempty"`
+
+ ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"`
+
+ Status MTOServiceItemStatus `json:"status,omitempty"`
+ }{
+
+ ETag: m.ETag(),
+
+ ID: m.ID(),
+
+ LockedPriceCents: m.LockedPriceCents(),
+
+ ModelType: m.ModelType(),
+
+ MoveTaskOrderID: m.MoveTaskOrderID(),
+
+ MtoShipmentID: m.MtoShipmentID(),
+
+ ReServiceName: m.ReServiceName(),
+
+ RejectionReason: m.RejectionReason(),
+
+ ServiceRequestDocuments: m.ServiceRequestDocuments(),
+
+ Status: m.Status(),
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ return swag.ConcatJSON(b1, b2, b3), nil
+}
+
+// Validate validates this m t o service item international fuel surcharge
+func (m *MTOServiceItemInternationalFuelSurcharge) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMoveTaskOrderID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMtoShipmentID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateServiceRequestDocuments(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateStatus(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateReServiceCode(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) validateID(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.ID()) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("id", "body", "uuid", m.ID().String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) validateMoveTaskOrderID(formats strfmt.Registry) error {
+
+ if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil {
+ return err
+ }
+
+ if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) validateMtoShipmentID(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.MtoShipmentID()) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) validateServiceRequestDocuments(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.ServiceRequestDocuments()) { // not required
+ return nil
+ }
+
+ if err := m.ServiceRequestDocuments().Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("serviceRequestDocuments")
+ } else if ce, ok := err.(*errors.CompositeError); ok {
+ return ce.ValidateName("serviceRequestDocuments")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) validateStatus(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.Status()) { // not required
+ return nil
+ }
+
+ if err := m.Status().Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("status")
+ } else if ce, ok := err.(*errors.CompositeError); ok {
+ return ce.ValidateName("status")
+ }
+ return err
+ }
+
+ return nil
+}
+
+var mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["PODFSC","POEFSC"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum = append(mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum, v)
+ }
+}
+
+// property enum
+func (m *MTOServiceItemInternationalFuelSurcharge) validateReServiceCodeEnum(path, location string, value string) error {
+ if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum, true); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) validateReServiceCode(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.ReServiceCode) { // not required
+ return nil
+ }
+
+ // value enum
+ if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ContextValidate validate this m t o service item international fuel surcharge based on the context it is used
+func (m *MTOServiceItemInternationalFuelSurcharge) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.contextValidateETag(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateID(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateReServiceName(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateRejectionReason(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateStatus(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateETag(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateID(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := m.ModelType().ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("modelType")
+ } else if ce, ok := err.(*errors.CompositeError); ok {
+ return ce.ValidateName("modelType")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("serviceRequestDocuments")
+ } else if ce, ok := err.(*errors.CompositeError); ok {
+ return ce.ValidateName("serviceRequestDocuments")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error {
+
+ if swag.IsZero(m.Status()) { // not required
+ return nil
+ }
+
+ if err := m.Status().ContextValidate(ctx, formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("status")
+ } else if ce, ok := err.(*errors.CompositeError); ok {
+ return ce.ValidateName("status")
+ }
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *MTOServiceItemInternationalFuelSurcharge) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *MTOServiceItemInternationalFuelSurcharge) UnmarshalBinary(b []byte) error {
+ var res MTOServiceItemInternationalFuelSurcharge
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/gen/primev3messages/move_task_order.go b/pkg/gen/primev3messages/move_task_order.go
index 02b991a0a16..3357553bf1c 100644
--- a/pkg/gen/primev3messages/move_task_order.go
+++ b/pkg/gen/primev3messages/move_task_order.go
@@ -57,6 +57,16 @@ type MoveTaskOrder struct {
// Read Only: true
ETag string `json:"eTag,omitempty"`
+ // excess unaccompanied baggage weight acknowledged at
+ // Read Only: true
+ // Format: date-time
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ // excess unaccompanied baggage weight qualified at
+ // Read Only: true
+ // Format: date-time
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
// excess weight acknowledged at
// Read Only: true
// Format: date-time
@@ -149,6 +159,10 @@ func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error {
ETag string `json:"eTag,omitempty"`
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"`
ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"`
@@ -215,6 +229,12 @@ func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error {
// eTag
result.ETag = data.ETag
+ // excessUnaccompaniedBaggageWeightAcknowledgedAt
+ result.ExcessUnaccompaniedBaggageWeightAcknowledgedAt = data.ExcessUnaccompaniedBaggageWeightAcknowledgedAt
+
+ // excessUnaccompaniedBaggageWeightQualifiedAt
+ result.ExcessUnaccompaniedBaggageWeightQualifiedAt = data.ExcessUnaccompaniedBaggageWeightQualifiedAt
+
// excessWeightAcknowledgedAt
result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt
@@ -284,6 +304,10 @@ func (m MoveTaskOrder) MarshalJSON() ([]byte, error) {
ETag string `json:"eTag,omitempty"`
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightAcknowledgedAt"`
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *strfmt.DateTime `json:"excessUnaccompaniedBaggageWeightQualifiedAt"`
+
ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"`
ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"`
@@ -327,6 +351,10 @@ func (m MoveTaskOrder) MarshalJSON() ([]byte, error) {
ETag: m.ETag,
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt,
+
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: m.ExcessUnaccompaniedBaggageWeightQualifiedAt,
+
ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt,
ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt,
@@ -387,6 +415,14 @@ func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
+ if err := m.validateExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateExcessUnaccompaniedBaggageWeightQualifiedAt(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil {
res = append(res, err)
}
@@ -477,6 +513,30 @@ func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error {
return nil
}
+func (m *MoveTaskOrder) validateExcessUnaccompaniedBaggageWeightAcknowledgedAt(formats strfmt.Registry) error {
+ if swag.IsZero(m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("excessUnaccompaniedBaggageWeightAcknowledgedAt", "body", "date-time", m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MoveTaskOrder) validateExcessUnaccompaniedBaggageWeightQualifiedAt(formats strfmt.Registry) error {
+ if swag.IsZero(m.ExcessUnaccompaniedBaggageWeightQualifiedAt) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("excessUnaccompaniedBaggageWeightQualifiedAt", "body", "date-time", m.ExcessUnaccompaniedBaggageWeightQualifiedAt.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required
return nil
@@ -712,6 +772,14 @@ func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Regi
res = append(res, err)
}
+ if err := m.contextValidateExcessUnaccompaniedBaggageWeightAcknowledgedAt(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.contextValidateExcessUnaccompaniedBaggageWeightQualifiedAt(ctx, formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil {
res = append(res, err)
}
@@ -821,6 +889,24 @@ func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.
return nil
}
+func (m *MoveTaskOrder) contextValidateExcessUnaccompaniedBaggageWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "excessUnaccompaniedBaggageWeightAcknowledgedAt", "body", m.ExcessUnaccompaniedBaggageWeightAcknowledgedAt); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *MoveTaskOrder) contextValidateExcessUnaccompaniedBaggageWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error {
+
+ if err := validate.ReadOnly(ctx, "excessUnaccompaniedBaggageWeightQualifiedAt", "body", m.ExcessUnaccompaniedBaggageWeightQualifiedAt); err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil {
diff --git a/pkg/handlers/ghcapi/api.go b/pkg/handlers/ghcapi/api.go
index 1b0a66d1956..38ea0a31b64 100644
--- a/pkg/handlers/ghcapi/api.go
+++ b/pkg/handlers/ghcapi/api.go
@@ -341,6 +341,11 @@ func NewGhcAPIHandler(handlerConfig handlers.HandlerConfig) *ghcops.MymoveAPI {
order.NewExcessWeightRiskManager(moveRouter),
}
+ ghcAPI.OrderAcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler = AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler{
+ handlerConfig,
+ order.NewExcessWeightRiskManager(moveRouter),
+ }
+
ghcAPI.MoveTaskOrderUpdateMoveTaskOrderStatusHandler = UpdateMoveTaskOrderStatusHandlerFunc{
handlerConfig,
moveTaskOrderUpdater,
diff --git a/pkg/handlers/ghcapi/documents_test.go b/pkg/handlers/ghcapi/documents_test.go
index 5f495c760a8..582f9cf0902 100644
--- a/pkg/handlers/ghcapi/documents_test.go
+++ b/pkg/handlers/ghcapi/documents_test.go
@@ -4,6 +4,7 @@ import (
"fmt"
"net/http"
"net/url"
+ "strconv"
"github.com/go-openapi/strfmt"
"github.com/gofrs/uuid"
@@ -52,6 +53,9 @@ func (suite *HandlerSuite) TestGetDocumentHandler() {
}
documentPayload := showResponse.Payload
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(userUpload.Upload.Filename)
+
// Validate outgoing payload
suite.NoError(documentPayload.Validate(strfmt.Default))
@@ -67,7 +71,74 @@ func (suite *HandlerSuite) TestGetDocumentHandler() {
uploadPayload := documentPayload.Uploads[0]
values := url.Values{}
values.Add("response-content-type", uploader.FileTypePDF)
- values.Add("response-content-disposition", "attachment; filename="+userUpload.Upload.Filename)
+ values.Add("response-content-disposition", "attachment; filename="+quotedFilename)
+ values.Add("signed", "test")
+ expectedURL := fmt.Sprintf("https://example.com/dir/%s?", userUpload.Upload.StorageKey) + values.Encode()
+ if (uploadPayload.URL).String() != expectedURL {
+ t.Errorf("wrong URL for upload, expected %s, got %s", expectedURL, uploadPayload.URL)
+ }
+}
+
+func (suite *HandlerSuite) TestGetDocumentHandlerForFilenamesWithCommas() {
+ t := suite.T()
+
+ userUpload := factory.BuildUserUpload(suite.DB(), []factory.Customization{
+ {
+ Model: models.Upload{
+ Filename: "FIRST, LAST - ISM AUTHORIZATION",
+ },
+ },
+ }, nil)
+
+ documentID := userUpload.DocumentID
+ var document models.Document
+
+ err := suite.DB().Eager("ServiceMember.User").Find(&document, documentID)
+ if err != nil {
+ suite.Fail("could not load document: %s", err)
+ }
+
+ params := documentop.NewGetDocumentParams()
+ params.DocumentID = strfmt.UUID(documentID.String())
+
+ req := &http.Request{}
+ req = suite.AuthenticateRequest(req, document.ServiceMember)
+ params.HTTPRequest = req
+
+ handlerConfig := suite.HandlerConfig()
+ fakeS3 := storageTest.NewFakeS3Storage(true)
+ handlerConfig.SetFileStorer(fakeS3)
+ handler := GetDocumentHandler{handlerConfig}
+
+ // Validate incoming payload: no body to validate
+
+ response := handler.Handle(params)
+
+ showResponse, ok := response.(*documentop.GetDocumentOK)
+ if !ok {
+ suite.Fail("Request failed: %#v", response)
+ }
+ documentPayload := showResponse.Payload
+
+ // Validate outgoing payload
+ suite.NoError(documentPayload.Validate(strfmt.Default))
+
+ responseDocumentUUID := documentPayload.ID.String()
+ if responseDocumentUUID != documentID.String() {
+ t.Errorf("wrong document uuid, expected %v, got %v", documentID, responseDocumentUUID)
+ }
+
+ if len(documentPayload.Uploads) != 1 {
+ t.Errorf("wrong number of uploads, expected 1, got %d", len(documentPayload.Uploads))
+ }
+
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(userUpload.Upload.Filename)
+
+ uploadPayload := documentPayload.Uploads[0]
+ values := url.Values{}
+ values.Add("response-content-type", uploader.FileTypePDF)
+ values.Add("response-content-disposition", "attachment; filename="+quotedFilename)
values.Add("signed", "test")
expectedURL := fmt.Sprintf("https://example.com/dir/%s?", userUpload.Upload.StorageKey) + values.Encode()
if (uploadPayload.URL).String() != expectedURL {
diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
index 20b96c8dcfd..a00caf64611 100644
--- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
+++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
@@ -88,38 +88,40 @@ func Move(move *models.Move, storer storage.FileStorer) (*ghcmessages.Move, erro
}
payload := &ghcmessages.Move{
- ID: strfmt.UUID(move.ID.String()),
- AvailableToPrimeAt: handlers.FmtDateTimePtr(move.AvailableToPrimeAt),
- ApprovedAt: handlers.FmtDateTimePtr(move.ApprovedAt),
- ContractorID: handlers.FmtUUIDPtr(move.ContractorID),
- Contractor: Contractor(move.Contractor),
- Locator: move.Locator,
- OrdersID: strfmt.UUID(move.OrdersID.String()),
- Orders: Order(&move.Orders),
- ReferenceID: handlers.FmtStringPtr(move.ReferenceID),
- Status: ghcmessages.MoveStatus(move.Status),
- ExcessWeightQualifiedAt: handlers.FmtDateTimePtr(move.ExcessWeightQualifiedAt),
- BillableWeightsReviewedAt: handlers.FmtDateTimePtr(move.BillableWeightsReviewedAt),
- CreatedAt: strfmt.DateTime(move.CreatedAt),
- SubmittedAt: handlers.FmtDateTimePtr(move.SubmittedAt),
- ApprovalsRequestedAt: handlers.FmtDateTimePtr(move.ApprovalsRequestedAt),
- UpdatedAt: strfmt.DateTime(move.UpdatedAt),
- ETag: etag.GenerateEtag(move.UpdatedAt),
- ServiceCounselingCompletedAt: handlers.FmtDateTimePtr(move.ServiceCounselingCompletedAt),
- ExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(move.ExcessWeightAcknowledgedAt),
- TioRemarks: handlers.FmtStringPtr(move.TIORemarks),
- FinancialReviewFlag: move.FinancialReviewFlag,
- FinancialReviewRemarks: move.FinancialReviewRemarks,
- CloseoutOfficeID: handlers.FmtUUIDPtr(move.CloseoutOfficeID),
- CloseoutOffice: TransportationOffice(move.CloseoutOffice),
- ShipmentGBLOC: gbloc,
- LockedByOfficeUserID: handlers.FmtUUIDPtr(move.LockedByOfficeUserID),
- LockedByOfficeUser: OfficeUser(move.LockedByOfficeUser),
- LockExpiresAt: handlers.FmtDateTimePtr(move.LockExpiresAt),
- AdditionalDocuments: additionalDocumentsPayload,
- SCAssignedUser: AssignedOfficeUser(move.SCAssignedUser),
- TOOAssignedUser: AssignedOfficeUser(move.TOOAssignedUser),
- TIOAssignedUser: AssignedOfficeUser(move.TIOAssignedUser),
+ ID: strfmt.UUID(move.ID.String()),
+ AvailableToPrimeAt: handlers.FmtDateTimePtr(move.AvailableToPrimeAt),
+ ApprovedAt: handlers.FmtDateTimePtr(move.ApprovedAt),
+ ContractorID: handlers.FmtUUIDPtr(move.ContractorID),
+ Contractor: Contractor(move.Contractor),
+ Locator: move.Locator,
+ OrdersID: strfmt.UUID(move.OrdersID.String()),
+ Orders: Order(&move.Orders),
+ ReferenceID: handlers.FmtStringPtr(move.ReferenceID),
+ Status: ghcmessages.MoveStatus(move.Status),
+ ExcessWeightQualifiedAt: handlers.FmtDateTimePtr(move.ExcessWeightQualifiedAt),
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: handlers.FmtDateTimePtr(move.ExcessUnaccompaniedBaggageWeightQualifiedAt),
+ BillableWeightsReviewedAt: handlers.FmtDateTimePtr(move.BillableWeightsReviewedAt),
+ CreatedAt: strfmt.DateTime(move.CreatedAt),
+ SubmittedAt: handlers.FmtDateTimePtr(move.SubmittedAt),
+ ApprovalsRequestedAt: handlers.FmtDateTimePtr(move.ApprovalsRequestedAt),
+ UpdatedAt: strfmt.DateTime(move.UpdatedAt),
+ ETag: etag.GenerateEtag(move.UpdatedAt),
+ ServiceCounselingCompletedAt: handlers.FmtDateTimePtr(move.ServiceCounselingCompletedAt),
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: handlers.FmtDateTimePtr(move.ExcessUnaccompaniedBaggageWeightAcknowledgedAt),
+ ExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(move.ExcessWeightAcknowledgedAt),
+ TioRemarks: handlers.FmtStringPtr(move.TIORemarks),
+ FinancialReviewFlag: move.FinancialReviewFlag,
+ FinancialReviewRemarks: move.FinancialReviewRemarks,
+ CloseoutOfficeID: handlers.FmtUUIDPtr(move.CloseoutOfficeID),
+ CloseoutOffice: TransportationOffice(move.CloseoutOffice),
+ ShipmentGBLOC: gbloc,
+ LockedByOfficeUserID: handlers.FmtUUIDPtr(move.LockedByOfficeUserID),
+ LockedByOfficeUser: OfficeUser(move.LockedByOfficeUser),
+ LockExpiresAt: handlers.FmtDateTimePtr(move.LockExpiresAt),
+ AdditionalDocuments: additionalDocumentsPayload,
+ SCAssignedUser: AssignedOfficeUser(move.SCAssignedUser),
+ TOOAssignedUser: AssignedOfficeUser(move.TOOAssignedUser),
+ TIOAssignedUser: AssignedOfficeUser(move.TIOAssignedUser),
}
return payload, nil
diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go
index 02310900ef2..439c1216c94 100644
--- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go
+++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go
@@ -114,6 +114,27 @@ func TestMove(t *testing.T) {
}
}
+func (suite *PayloadsSuite) TestExcessWeightInMovePayload() {
+ now := time.Now()
+
+ suite.Run("successfully converts excess weight in model to payload", func() {
+ move := models.Move{
+
+ ExcessWeightQualifiedAt: &now,
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &now,
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: &now,
+ ExcessWeightAcknowledgedAt: &now,
+ }
+
+ payload, err := Move(&move, &test.FakeS3Storage{})
+ suite.NoError(err)
+ suite.Equal(handlers.FmtDateTimePtr(move.ExcessWeightQualifiedAt), payload.ExcessWeightQualifiedAt)
+ suite.Equal(handlers.FmtDateTimePtr(move.ExcessUnaccompaniedBaggageWeightQualifiedAt), payload.ExcessUnaccompaniedBaggageWeightQualifiedAt)
+ suite.Equal(handlers.FmtDateTimePtr(move.ExcessUnaccompaniedBaggageWeightAcknowledgedAt), payload.ExcessUnaccompaniedBaggageWeightAcknowledgedAt)
+ suite.Equal(handlers.FmtDateTimePtr(move.ExcessWeightAcknowledgedAt), payload.ExcessWeightAcknowledgedAt)
+ })
+}
+
func (suite *PayloadsSuite) TestPaymentRequestQueue() {
officeUser := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{
{
diff --git a/pkg/handlers/ghcapi/orders.go b/pkg/handlers/ghcapi/orders.go
index 6e32d3d338f..2ffac091842 100644
--- a/pkg/handlers/ghcapi/orders.go
+++ b/pkg/handlers/ghcapi/orders.go
@@ -602,6 +602,59 @@ type AcknowledgeExcessWeightRiskHandler struct {
excessWeightRiskManager services.ExcessWeightRiskManager
}
+// AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler is called when a TOO dismissed the alert to acknowledge the excess unaccompanied baggage weight risk via POST /orders/{orderId}/acknowledge-excess-unaccompanied-baggage-weight-risk
+type AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler struct {
+ handlers.HandlerConfig
+ excessWeightRiskManager services.ExcessWeightRiskManager
+}
+
+// Handles acknowledging excess unaccompanied baggage weight
+func (h AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler) Handle(
+ params orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams,
+) middleware.Responder {
+ return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest,
+ func(appCtx appcontext.AppContext) (middleware.Responder, error) {
+
+ // handleError is a reusable function to deal with multiple errors
+ // when it comes to updating orders.
+ handleError := func(err error) (middleware.Responder, error) {
+ appCtx.Logger().Error("error acknowledging excess unaccompanied baggage weight risk", zap.Error(err))
+ switch e := err.(type) {
+ case apperror.NotFoundError:
+ return orderop.NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound(), err
+ case apperror.InvalidInputError:
+ payload := payloadForValidationError(handlers.ValidationErrMessage, err.Error(), h.GetTraceIDFromRequest(params.HTTPRequest), e.ValidationErrors)
+ return orderop.NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity().WithPayload(payload), err
+ case apperror.PreconditionFailedError:
+ return orderop.NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed().WithPayload(&ghcmessages.Error{Message: handlers.FmtString(err.Error())}), err
+ case apperror.ForbiddenError:
+ return orderop.NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskForbidden().WithPayload(&ghcmessages.Error{Message: handlers.FmtString(err.Error())}), err
+ default:
+ return orderop.NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError(), err
+ }
+ }
+
+ orderID := uuid.FromStringOrNil(params.OrderID.String())
+ updatedMove, err := h.excessWeightRiskManager.AcknowledgeExcessUnaccompaniedBaggageWeightRisk(
+ appCtx,
+ orderID,
+ params.IfMatch,
+ )
+ if err != nil {
+ return handleError(err)
+ }
+
+ h.triggerAcknowledgeExcessUnaccompaniedBaggageWeightRiskEvent(appCtx, updatedMove.ID, params)
+
+ movePayload, err := payloads.Move(updatedMove, h.FileStorer())
+ if err != nil {
+ return orderop.NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskInternalServerError(), err
+ }
+
+ return orderop.NewAcknowledgeExcessUnaccompaniedBaggageWeightRiskOK().WithPayload(movePayload), nil
+ })
+}
+
// Handle ... updates the authorized weight
func (h AcknowledgeExcessWeightRiskHandler) Handle(
params orderop.AcknowledgeExcessWeightRiskParams,
@@ -797,6 +850,26 @@ func (h AcknowledgeExcessWeightRiskHandler) triggerAcknowledgeExcessWeightRiskEv
}
}
+func (h AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler) triggerAcknowledgeExcessUnaccompaniedBaggageWeightRiskEvent(
+ appCtx appcontext.AppContext,
+ moveID uuid.UUID,
+ params orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams,
+) {
+ _, err := event.TriggerEvent(event.Event{
+ EndpointKey: event.GhcAcknowledgeExcessUnaccompaniedBaggageWeightRiskEndpointKey,
+ // Endpoint that is being handled
+ EventKey: event.MoveTaskOrderUpdateEventKey, // Event that you want to trigger
+ UpdatedObjectID: moveID, // ID of the updated logical object
+ MtoID: moveID, // ID of the associated Move
+ AppContext: appCtx,
+ TraceID: h.GetTraceIDFromRequest(params.HTTPRequest),
+ })
+ // If the event trigger fails, just log the error.
+ if err != nil {
+ appCtx.Logger().Error("ghcapi.acknowledgeExcessUnaccompaniedBaggageWeightRisk could not generate the event")
+ }
+}
+
func PayloadForOrdersModel(order models.Order) (*ghcmessages.OrderBody, error) {
payload := &ghcmessages.OrderBody{
ID: *handlers.FmtUUID(order.ID),
diff --git a/pkg/handlers/ghcapi/orders_test.go b/pkg/handlers/ghcapi/orders_test.go
index c3f25d9cdc7..5b602254726 100644
--- a/pkg/handlers/ghcapi/orders_test.go
+++ b/pkg/handlers/ghcapi/orders_test.go
@@ -2262,6 +2262,179 @@ func (suite *HandlerSuite) TestAcknowledgeExcessWeightRiskHandler() {
})
}
+func (suite *HandlerSuite) TestacknowledgeExcessUnaccompaniedBaggageWeightRiskHandler() {
+ request := httptest.NewRequest("POST", "/orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk", nil)
+
+ suite.Run("Returns 200 when all validations pass", func() {
+ handlerConfig := suite.HandlerConfig()
+ now := time.Now()
+ move := factory.BuildApprovalsRequestedMove(suite.DB(), []factory.Customization{
+ {
+ Model: models.Move{
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &now,
+ },
+ },
+ }, nil)
+ order := move.Orders
+
+ requestUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO, roles.RoleTypeTIO, roles.RoleTypeServicesCounselor})
+ request = suite.AuthenticateOfficeRequest(request, requestUser)
+
+ params := orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams{
+ HTTPRequest: request,
+ OrderID: strfmt.UUID(order.ID.String()),
+ IfMatch: etag.GenerateEtag(move.UpdatedAt),
+ }
+
+ router := moverouter.NewMoveRouter()
+ handler := AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler{
+ handlerConfig,
+ orderservice.NewExcessWeightRiskManager(router),
+ }
+
+ // Validate incoming payload: no body to validate
+
+ response := handler.Handle(params)
+
+ suite.IsNotErrResponse(response)
+ suite.IsType(&orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK{}, response)
+ moveOK := response.(*orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskOK)
+ movePayload := moveOK.Payload
+
+ // Validate outgoing payload
+ suite.NoError(movePayload.Validate(strfmt.Default))
+
+ suite.Equal(move.ID.String(), movePayload.ID.String())
+ suite.NotNil(movePayload.ExcessUnaccompaniedBaggageWeightAcknowledgedAt)
+ })
+
+ suite.Run("Returns 404 when updater returns NotFoundError", func() {
+ handlerConfig := suite.HandlerConfig()
+ now := time.Now()
+ move := factory.BuildApprovalsRequestedMove(suite.DB(), []factory.Customization{
+ {
+ Model: models.Move{
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &now,
+ },
+ },
+ }, nil)
+ order := move.Orders
+
+ requestUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO})
+ request = suite.AuthenticateOfficeRequest(request, requestUser)
+
+ params := orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams{
+ HTTPRequest: request,
+ OrderID: strfmt.UUID(order.ID.String()),
+ IfMatch: etag.GenerateEtag(order.UpdatedAt),
+ }
+
+ updater := &mocks.ExcessWeightRiskManager{}
+ handler := AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler{
+ handlerConfig,
+ updater,
+ }
+
+ updater.On("AcknowledgeExcessUnaccompaniedBaggageWeightRisk", mock.AnythingOfType("*appcontext.appContext"),
+ order.ID, params.IfMatch).Return(nil, apperror.NotFoundError{})
+
+ // Validate incoming payload: no body to validate
+
+ response := handler.Handle(params)
+
+ suite.IsType(&orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound{}, response)
+ payload := response.(*orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskNotFound).Payload
+
+ // Validate outgoing payload: nil payload
+ suite.Nil(payload)
+ })
+
+ suite.Run("Returns 412 when eTag does not match", func() {
+ handlerConfig := suite.HandlerConfig()
+ now := time.Now()
+ move := factory.BuildApprovalsRequestedMove(suite.DB(), []factory.Customization{
+ {
+ Model: models.Move{
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &now,
+ },
+ },
+ }, nil)
+ order := move.Orders
+
+ requestUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO})
+ request = suite.AuthenticateOfficeRequest(request, requestUser)
+
+ params := orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams{
+ HTTPRequest: request,
+ OrderID: strfmt.UUID(order.ID.String()),
+ IfMatch: "",
+ }
+
+ updater := &mocks.ExcessWeightRiskManager{}
+ handler := AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler{
+ handlerConfig,
+ updater,
+ }
+
+ updater.On("AcknowledgeExcessUnaccompaniedBaggageWeightRisk", mock.AnythingOfType("*appcontext.appContext"),
+ order.ID, params.IfMatch).Return(nil, apperror.PreconditionFailedError{})
+
+ // Validate incoming payload: no body to validate
+
+ response := handler.Handle(params)
+
+ suite.IsType(&orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed{}, response)
+ payload := response.(*orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskPreconditionFailed).Payload
+
+ // Validate outgoing payload
+ suite.NoError(payload.Validate(strfmt.Default))
+ })
+
+ suite.Run("Returns 422 when updater service returns validation errors", func() {
+ handlerConfig := suite.HandlerConfig()
+ now := time.Now()
+ move := factory.BuildApprovalsRequestedMove(suite.DB(), []factory.Customization{
+ {
+ Model: models.Move{
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &now,
+ },
+ },
+ }, nil)
+ order := move.Orders
+
+ requestUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO})
+ request = suite.AuthenticateOfficeRequest(request, requestUser)
+
+ params := orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskParams{
+ HTTPRequest: request,
+ OrderID: strfmt.UUID(order.ID.String()),
+ IfMatch: etag.GenerateEtag(order.UpdatedAt),
+ }
+
+ updater := &mocks.ExcessWeightRiskManager{}
+ handler := AcknowledgeExcessUnaccompaniedBaggageWeightRiskHandler{
+ handlerConfig,
+ updater,
+ }
+
+ verrs := validate.NewErrors()
+ verrs.Add("some key", "some validation error")
+ invalidInputError := apperror.NewInvalidInputError(order.ID, nil, verrs, "")
+ updater.On("AcknowledgeExcessUnaccompaniedBaggageWeightRisk", mock.AnythingOfType("*appcontext.appContext"),
+ order.ID, params.IfMatch).Return(nil, invalidInputError)
+
+ // Validate incoming payload: no body to validate
+
+ response := handler.Handle(params)
+
+ suite.IsType(&orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity{}, response)
+ payload := response.(*orderop.AcknowledgeExcessUnaccompaniedBaggageWeightRiskUnprocessableEntity).Payload
+
+ // Validate outgoing payload
+ suite.NoError(payload.Validate(strfmt.Default))
+ })
+}
+
// Test that an order notification got stored successfully
func (suite *HandlerSuite) TestAcknowledgeExcessWeightRiskEventTrigger() {
now := time.Now()
diff --git a/pkg/handlers/internalapi/documents_test.go b/pkg/handlers/internalapi/documents_test.go
index 4ef3886038e..49f41024c97 100644
--- a/pkg/handlers/internalapi/documents_test.go
+++ b/pkg/handlers/internalapi/documents_test.go
@@ -4,6 +4,7 @@ import (
"fmt"
"net/http"
"net/url"
+ "strconv"
"github.com/go-openapi/strfmt"
"github.com/gofrs/uuid"
@@ -91,6 +92,9 @@ func (suite *HandlerSuite) TestShowDocumentHandler() {
}
documentPayload := showResponse.Payload
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(userUpload.Upload.Filename)
+
responseDocumentUUID := documentPayload.ID.String()
if responseDocumentUUID != documentID.String() {
t.Errorf("wrong document uuid, expected %v, got %v", documentID, responseDocumentUUID)
@@ -103,7 +107,7 @@ func (suite *HandlerSuite) TestShowDocumentHandler() {
uploadPayload := documentPayload.Uploads[0]
values := url.Values{}
values.Add("response-content-type", uploader.FileTypePDF)
- values.Add("response-content-disposition", "attachment; filename="+userUpload.Upload.Filename)
+ values.Add("response-content-disposition", "attachment; filename="+quotedFilename)
values.Add("signed", "test")
expectedURL := fmt.Sprintf("https://example.com/dir/%s?", userUpload.Upload.StorageKey) + values.Encode()
if (uploadPayload.URL).String() != expectedURL {
diff --git a/pkg/handlers/internalapi/uploads_test.go b/pkg/handlers/internalapi/uploads_test.go
index 36119617912..36823072f73 100644
--- a/pkg/handlers/internalapi/uploads_test.go
+++ b/pkg/handlers/internalapi/uploads_test.go
@@ -13,6 +13,7 @@ import (
"fmt"
"net/http"
"net/url"
+ "strconv"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
@@ -461,6 +462,9 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
upload := models.Upload{}
err := suite.DB().Find(&upload, createdResponse.Payload.ID)
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(upload.Filename)
+
suite.NoError(err)
suite.Equal("V/Q6K9rVdEPVzgKbh5cn2x4Oci4XDaG4fcG04R41Iz4=", upload.Checksum)
@@ -470,7 +474,7 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(document.ServiceMember.UserID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(upload.ID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(uploader.FileTypeExcel))
- suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+upload.Filename))
+ suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+quotedFilename))
})
suite.Run("uploads .xlsx file", func() {
@@ -486,6 +490,9 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
upload := models.Upload{}
err := suite.DB().Find(&upload, createdResponse.Payload.ID)
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(upload.Filename)
+
suite.NoError(err)
suite.Equal("eRZ1Cr3Ms0692k03ftoEdqXpvd/CHcbxmhEGEQBYVdY=", upload.Checksum)
@@ -495,7 +502,7 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(document.ServiceMember.UserID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(upload.ID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(uploader.FileTypeExcelXLSX))
- suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+upload.Filename))
+ suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+quotedFilename))
})
suite.Run("uploads weight estimator .xlsx file (full weight)", func() {
@@ -513,6 +520,9 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
suite.NoError(err)
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(upload.Filename)
+
// uploaded xlsx document should now be converted to a pdf so we check for pdf instead of xlsx
suite.NotEmpty(createdResponse.Payload.ID)
suite.Contains(createdResponse.Payload.Filename, WeightEstimatorPrefix)
@@ -520,7 +530,7 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(document.ServiceMember.UserID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(upload.ID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(uploader.FileTypePDF))
- suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+upload.Filename))
+ suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+quotedFilename))
})
suite.Run("uploads file for a progear document", func() {
@@ -536,6 +546,9 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
upload := models.Upload{}
err := suite.DB().Find(&upload, createdResponse.Payload.ID)
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(upload.Filename)
+
suite.NoError(err)
suite.Equal("/io1MRhLi2BFk9eF+lH1Ax+hyH+bPhlEK7A9/bqWlPY=", upload.Checksum)
@@ -545,7 +558,7 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(document.ServiceMember.UserID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(upload.ID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(uploader.FileTypePNG))
- suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+upload.Filename))
+ suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+quotedFilename))
})
suite.Run("uploads file for an expense document", func() {
@@ -561,6 +574,9 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
upload := models.Upload{}
err := suite.DB().Find(&upload, createdResponse.Payload.ID)
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(upload.Filename)
+
suite.NoError(err)
suite.Equal("ibKT78j4CJecDXC6CbGISkqWFG5eSjCjlZJHlaFRho4=", upload.Checksum)
@@ -570,7 +586,7 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(document.ServiceMember.UserID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(upload.ID.String()))
suite.Contains(createdResponse.Payload.URL, url.QueryEscape(uploader.FileTypeJPEG))
- suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+upload.Filename))
+ suite.Contains(createdResponse.Payload.URL, url.QueryEscape("attachment; filename="+quotedFilename))
})
suite.Run("uploads file with filename characters not supported by ISO8859_1", func() {
@@ -586,8 +602,11 @@ func (suite *HandlerSuite) TestCreatePPMUploadsHandlerSuccess() {
upload := models.Upload{}
err := suite.DB().Find(&upload, createdResponse.Payload.ID)
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(upload.Filename)
+
filenameBuffer := make([]byte, 0)
- for _, r := range upload.Filename {
+ for _, r := range quotedFilename {
if encodedRune, ok := charmap.ISO8859_1.EncodeRune(r); ok {
filenameBuffer = append(filenameBuffer, encodedRune)
}
diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go
index 6eba5420892..723c7ea96b2 100644
--- a/pkg/handlers/primeapi/payloads/model_to_payload.go
+++ b/pkg/handlers/primeapi/payloads/model_to_payload.go
@@ -50,17 +50,19 @@ func MoveTaskOrder(appCtx appcontext.AppContext, moveTaskOrder *models.Move) *pr
ApprovedAt: handlers.FmtDateTimePtr(moveTaskOrder.ApprovedAt),
PrimeCounselingCompletedAt: handlers.FmtDateTimePtr(moveTaskOrder.PrimeCounselingCompletedAt),
ExcessWeightQualifiedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightQualifiedAt),
- ExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightAcknowledgedAt),
- ExcessWeightUploadID: handlers.FmtUUIDPtr(moveTaskOrder.ExcessWeightUploadID),
- OrderID: strfmt.UUID(moveTaskOrder.OrdersID.String()),
- Order: Order(&moveTaskOrder.Orders),
- DestinationGBLOC: destGbloc,
- DestinationPostalCode: destZip,
- ReferenceID: *moveTaskOrder.ReferenceID,
- PaymentRequests: *paymentRequests,
- MtoShipments: *mtoShipments,
- UpdatedAt: strfmt.DateTime(moveTaskOrder.UpdatedAt),
- ETag: etag.GenerateEtag(moveTaskOrder.UpdatedAt),
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessUnaccompaniedBaggageWeightQualifiedAt),
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessUnaccompaniedBaggageWeightAcknowledgedAt),
+ ExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightAcknowledgedAt),
+ ExcessWeightUploadID: handlers.FmtUUIDPtr(moveTaskOrder.ExcessWeightUploadID),
+ OrderID: strfmt.UUID(moveTaskOrder.OrdersID.String()),
+ Order: Order(&moveTaskOrder.Orders),
+ DestinationGBLOC: destGbloc,
+ DestinationPostalCode: destZip,
+ ReferenceID: *moveTaskOrder.ReferenceID,
+ PaymentRequests: *paymentRequests,
+ MtoShipments: *mtoShipments,
+ UpdatedAt: strfmt.DateTime(moveTaskOrder.UpdatedAt),
+ ETag: etag.GenerateEtag(moveTaskOrder.UpdatedAt),
}
if moveTaskOrder.PPMType != nil {
@@ -896,6 +898,8 @@ func ExcessWeightRecord(appCtx appcontext.AppContext, storer storage.FileStorer,
MoveID: handlers.FmtUUIDPtr(&move.ID),
MoveExcessWeightQualifiedAt: handlers.FmtDateTimePtr(move.ExcessWeightQualifiedAt),
MoveExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(move.ExcessWeightAcknowledgedAt),
+ MoveExcessUnaccompaniedBaggageWeightQualifiedAt: handlers.FmtDateTimePtr(move.ExcessUnaccompaniedBaggageWeightQualifiedAt),
+ MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt: handlers.FmtDateTimePtr(move.ExcessUnaccompaniedBaggageWeightAcknowledgedAt),
}
upload := Upload(appCtx, storer, move.ExcessWeightUpload)
diff --git a/pkg/handlers/primeapi/payloads/model_to_payload_test.go b/pkg/handlers/primeapi/payloads/model_to_payload_test.go
index 00c12a63791..dc0707e5b06 100644
--- a/pkg/handlers/primeapi/payloads/model_to_payload_test.go
+++ b/pkg/handlers/primeapi/payloads/model_to_payload_test.go
@@ -24,31 +24,35 @@ func (suite *PayloadsSuite) TestMoveTaskOrder() {
primeTime := time.Now()
submittedAt := time.Now()
excessWeightQualifiedAt := time.Now()
+ excessUnaccompaniedBaggageWeightQualifiedAt := time.Now()
excessWeightAcknowledgedAt := time.Now()
+ excessUnaccompaniedBaggageWeightAcknowledgedAt := time.Now()
excessWeightUploadID := uuid.Must(uuid.NewV4())
ordersType := primemessages.OrdersTypeRETIREMENT
originDutyGBLOC := "KKFA"
shipmentGBLOC := "AGFM"
basicMove := models.Move{
- ID: moveTaskOrderID,
- Locator: "TESTTEST",
- CreatedAt: time.Now(),
- AvailableToPrimeAt: &primeTime,
- ApprovedAt: &primeTime,
- OrdersID: ordersID,
- Orders: models.Order{OrdersType: internalmessages.OrdersType(ordersType), OriginDutyLocationGBLOC: &originDutyGBLOC},
- ReferenceID: &referenceID,
- PaymentRequests: models.PaymentRequests{},
- SubmittedAt: &submittedAt,
- UpdatedAt: time.Now(),
- Status: models.MoveStatusAPPROVED,
- SignedCertifications: models.SignedCertifications{},
- MTOServiceItems: models.MTOServiceItems{},
- MTOShipments: models.MTOShipments{},
- ExcessWeightQualifiedAt: &excessWeightQualifiedAt,
- ExcessWeightAcknowledgedAt: &excessWeightAcknowledgedAt,
- ExcessWeightUploadID: &excessWeightUploadID,
+ ID: moveTaskOrderID,
+ Locator: "TESTTEST",
+ CreatedAt: time.Now(),
+ AvailableToPrimeAt: &primeTime,
+ ApprovedAt: &primeTime,
+ OrdersID: ordersID,
+ Orders: models.Order{OrdersType: internalmessages.OrdersType(ordersType), OriginDutyLocationGBLOC: &originDutyGBLOC},
+ ReferenceID: &referenceID,
+ PaymentRequests: models.PaymentRequests{},
+ SubmittedAt: &submittedAt,
+ UpdatedAt: time.Now(),
+ Status: models.MoveStatusAPPROVED,
+ SignedCertifications: models.SignedCertifications{},
+ MTOServiceItems: models.MTOServiceItems{},
+ MTOShipments: models.MTOShipments{},
+ ExcessWeightQualifiedAt: &excessWeightQualifiedAt,
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &excessUnaccompaniedBaggageWeightQualifiedAt,
+ ExcessWeightAcknowledgedAt: &excessWeightAcknowledgedAt,
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: &excessUnaccompaniedBaggageWeightAcknowledgedAt,
+ ExcessWeightUploadID: &excessWeightUploadID,
ShipmentGBLOC: models.MoveToGBLOCs{
models.MoveToGBLOC{GBLOC: &shipmentGBLOC},
},
@@ -70,7 +74,9 @@ func (suite *PayloadsSuite) TestMoveTaskOrder() {
suite.Equal(strfmt.DateTime(basicMove.UpdatedAt), returnedModel.UpdatedAt)
suite.NotEmpty(returnedModel.ETag)
suite.True(returnedModel.ExcessWeightQualifiedAt.Equal(strfmt.DateTime(*basicMove.ExcessWeightQualifiedAt)))
+ suite.True(returnedModel.ExcessUnaccompaniedBaggageWeightQualifiedAt.Equal(strfmt.DateTime(*basicMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)))
suite.True(returnedModel.ExcessWeightAcknowledgedAt.Equal(strfmt.DateTime(*basicMove.ExcessWeightAcknowledgedAt)))
+ suite.True(returnedModel.ExcessUnaccompaniedBaggageWeightAcknowledgedAt.Equal(strfmt.DateTime(*basicMove.ExcessUnaccompaniedBaggageWeightAcknowledgedAt)))
suite.Require().NotNil(returnedModel.ExcessWeightUploadID)
suite.Equal(strfmt.UUID(basicMove.ExcessWeightUploadID.String()), *returnedModel.ExcessWeightUploadID)
})
@@ -153,17 +159,21 @@ func (suite *PayloadsSuite) TestExcessWeightRecord() {
}, []factory.Trait{factory.GetTraitTimestampedUpload})
move := models.Move{
- ID: id,
- ExcessWeightQualifiedAt: &now,
- ExcessWeightAcknowledgedAt: &now,
- ExcessWeightUploadID: &upload.ID,
- ExcessWeightUpload: &upload,
+ ID: id,
+ ExcessWeightQualifiedAt: &now,
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &now,
+ ExcessWeightAcknowledgedAt: &now,
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: &now,
+ ExcessWeightUploadID: &upload.ID,
+ ExcessWeightUpload: &upload,
}
excessWeightRecord := ExcessWeightRecord(suite.AppContextForTest(), fakeFileStorer, &move)
suite.Equal(move.ID.String(), excessWeightRecord.MoveID.String())
suite.Equal(strfmt.DateTime(*move.ExcessWeightQualifiedAt).String(), excessWeightRecord.MoveExcessWeightQualifiedAt.String())
+ suite.Equal(strfmt.DateTime(*move.ExcessUnaccompaniedBaggageWeightQualifiedAt).String(), excessWeightRecord.MoveExcessUnaccompaniedBaggageWeightQualifiedAt.String())
suite.Equal(strfmt.DateTime(*move.ExcessWeightAcknowledgedAt).String(), excessWeightRecord.MoveExcessWeightAcknowledgedAt.String())
+ suite.Equal(strfmt.DateTime(*move.ExcessUnaccompaniedBaggageWeightAcknowledgedAt).String(), excessWeightRecord.MoveExcessUnaccompaniedBaggageWeightAcknowledgedAt.String())
suite.Equal(move.ExcessWeightUploadID.String(), excessWeightRecord.ID.String())
suite.Equal(move.ExcessWeightUpload.ID.String(), excessWeightRecord.ID.String())
diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go
index 73cd61a1d34..18f0d6d3b57 100644
--- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go
+++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go
@@ -47,18 +47,20 @@ func MoveTaskOrder(appCtx appcontext.AppContext, moveTaskOrder *models.Move) *pr
ApprovedAt: handlers.FmtDateTimePtr(moveTaskOrder.ApprovedAt),
PrimeCounselingCompletedAt: handlers.FmtDateTimePtr(moveTaskOrder.PrimeCounselingCompletedAt),
ExcessWeightQualifiedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightQualifiedAt),
- ExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightAcknowledgedAt),
- ExcessWeightUploadID: handlers.FmtUUIDPtr(moveTaskOrder.ExcessWeightUploadID),
- OrderID: strfmt.UUID(moveTaskOrder.OrdersID.String()),
- Order: Order(&moveTaskOrder.Orders),
- DestinationGBLOC: destGbloc,
- DestinationPostalCode: destZip,
- ReferenceID: *moveTaskOrder.ReferenceID,
- PaymentRequests: *paymentRequests,
- MtoShipments: *mtoShipments,
- ContractNumber: moveTaskOrder.Contractor.ContractNumber,
- UpdatedAt: strfmt.DateTime(moveTaskOrder.UpdatedAt),
- ETag: etag.GenerateEtag(moveTaskOrder.UpdatedAt),
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessUnaccompaniedBaggageWeightQualifiedAt),
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessUnaccompaniedBaggageWeightAcknowledgedAt),
+ ExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightAcknowledgedAt),
+ ExcessWeightUploadID: handlers.FmtUUIDPtr(moveTaskOrder.ExcessWeightUploadID),
+ OrderID: strfmt.UUID(moveTaskOrder.OrdersID.String()),
+ Order: Order(&moveTaskOrder.Orders),
+ DestinationGBLOC: destGbloc,
+ DestinationPostalCode: destZip,
+ ReferenceID: *moveTaskOrder.ReferenceID,
+ PaymentRequests: *paymentRequests,
+ MtoShipments: *mtoShipments,
+ ContractNumber: moveTaskOrder.Contractor.ContractNumber,
+ UpdatedAt: strfmt.DateTime(moveTaskOrder.UpdatedAt),
+ ETag: etag.GenerateEtag(moveTaskOrder.UpdatedAt),
}
if moveTaskOrder.PPMType != nil {
diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go
index 8c250786af4..572f4f5dee8 100644
--- a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go
+++ b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go
@@ -23,7 +23,9 @@ func (suite *PayloadsSuite) TestMoveTaskOrder() {
primeTime := time.Now()
submittedAt := time.Now()
excessWeightQualifiedAt := time.Now()
+ excessUnaccompaniedBaggageWeightQualifiedAt := time.Now()
excessWeightAcknowledgedAt := time.Now()
+ excessUnaccompaniedBaggageWeightAcknowledgedAt := time.Now()
excessWeightUploadID := uuid.Must(uuid.NewV4())
ordersType := primev2messages.OrdersTypeRETIREMENT
originDutyGBLOC := "KKFA"
@@ -44,17 +46,19 @@ func (suite *PayloadsSuite) TestMoveTaskOrder() {
NAICS: models.NAICS,
PackingAndShippingInstructions: packingInstructions,
},
- ReferenceID: &referenceID,
- PaymentRequests: models.PaymentRequests{},
- SubmittedAt: &submittedAt,
- UpdatedAt: time.Now(),
- Status: models.MoveStatusAPPROVED,
- SignedCertifications: models.SignedCertifications{},
- MTOServiceItems: models.MTOServiceItems{},
- MTOShipments: models.MTOShipments{},
- ExcessWeightQualifiedAt: &excessWeightQualifiedAt,
- ExcessWeightAcknowledgedAt: &excessWeightAcknowledgedAt,
- ExcessWeightUploadID: &excessWeightUploadID,
+ ReferenceID: &referenceID,
+ PaymentRequests: models.PaymentRequests{},
+ SubmittedAt: &submittedAt,
+ UpdatedAt: time.Now(),
+ Status: models.MoveStatusAPPROVED,
+ SignedCertifications: models.SignedCertifications{},
+ MTOServiceItems: models.MTOServiceItems{},
+ MTOShipments: models.MTOShipments{},
+ ExcessWeightQualifiedAt: &excessWeightQualifiedAt,
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &excessUnaccompaniedBaggageWeightQualifiedAt,
+ ExcessWeightAcknowledgedAt: &excessWeightAcknowledgedAt,
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: &excessUnaccompaniedBaggageWeightAcknowledgedAt,
+ ExcessWeightUploadID: &excessWeightUploadID,
Contractor: &models.Contractor{
ContractNumber: factory.DefaultContractNumber,
},
@@ -78,7 +82,9 @@ func (suite *PayloadsSuite) TestMoveTaskOrder() {
suite.Equal(strfmt.DateTime(basicMove.UpdatedAt), returnedModel.UpdatedAt)
suite.NotEmpty(returnedModel.ETag)
suite.True(returnedModel.ExcessWeightQualifiedAt.Equal(strfmt.DateTime(*basicMove.ExcessWeightQualifiedAt)))
+ suite.True(returnedModel.ExcessUnaccompaniedBaggageWeightQualifiedAt.Equal(strfmt.DateTime(*basicMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)))
suite.True(returnedModel.ExcessWeightAcknowledgedAt.Equal(strfmt.DateTime(*basicMove.ExcessWeightAcknowledgedAt)))
+ suite.True(returnedModel.ExcessUnaccompaniedBaggageWeightAcknowledgedAt.Equal(strfmt.DateTime(*basicMove.ExcessUnaccompaniedBaggageWeightAcknowledgedAt)))
suite.Require().NotNil(returnedModel.ExcessWeightUploadID)
suite.Equal(strfmt.UUID(basicMove.ExcessWeightUploadID.String()), *returnedModel.ExcessWeightUploadID)
suite.Equal(factory.DefaultContractNumber, returnedModel.ContractNumber)
diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go
index c002b7c5472..ae162031750 100644
--- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go
+++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go
@@ -49,18 +49,20 @@ func MoveTaskOrder(appCtx appcontext.AppContext, moveTaskOrder *models.Move) *pr
AvailableToPrimeAt: handlers.FmtDateTimePtr(moveTaskOrder.AvailableToPrimeAt),
PrimeCounselingCompletedAt: handlers.FmtDateTimePtr(moveTaskOrder.PrimeCounselingCompletedAt),
ExcessWeightQualifiedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightQualifiedAt),
- ExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightAcknowledgedAt),
- ExcessWeightUploadID: handlers.FmtUUIDPtr(moveTaskOrder.ExcessWeightUploadID),
- OrderID: strfmt.UUID(moveTaskOrder.OrdersID.String()),
- Order: Order(&moveTaskOrder.Orders),
- DestinationGBLOC: destGbloc,
- DestinationPostalCode: destZip,
- ReferenceID: *moveTaskOrder.ReferenceID,
- PaymentRequests: *paymentRequests,
- MtoShipments: *mtoShipments,
- ContractNumber: moveTaskOrder.Contractor.ContractNumber,
- UpdatedAt: strfmt.DateTime(moveTaskOrder.UpdatedAt),
- ETag: etag.GenerateEtag(moveTaskOrder.UpdatedAt),
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessUnaccompaniedBaggageWeightQualifiedAt),
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessUnaccompaniedBaggageWeightAcknowledgedAt),
+ ExcessWeightAcknowledgedAt: handlers.FmtDateTimePtr(moveTaskOrder.ExcessWeightAcknowledgedAt),
+ ExcessWeightUploadID: handlers.FmtUUIDPtr(moveTaskOrder.ExcessWeightUploadID),
+ OrderID: strfmt.UUID(moveTaskOrder.OrdersID.String()),
+ Order: Order(&moveTaskOrder.Orders),
+ DestinationGBLOC: destGbloc,
+ DestinationPostalCode: destZip,
+ ReferenceID: *moveTaskOrder.ReferenceID,
+ PaymentRequests: *paymentRequests,
+ MtoShipments: *mtoShipments,
+ ContractNumber: moveTaskOrder.Contractor.ContractNumber,
+ UpdatedAt: strfmt.DateTime(moveTaskOrder.UpdatedAt),
+ ETag: etag.GenerateEtag(moveTaskOrder.UpdatedAt),
}
if moveTaskOrder.PPMType != nil {
@@ -853,6 +855,19 @@ func MTOServiceItem(mtoServiceItem *models.MTOServiceItem) primev3messages.MTOSe
EstimatedWeight: handlers.FmtPoundPtr(mtoServiceItem.EstimatedWeight),
ActualWeight: handlers.FmtPoundPtr(mtoServiceItem.ActualWeight),
}
+
+ case models.ReServiceCodePODFSC, models.ReServiceCodePOEFSC:
+ var portCode string
+ if mtoServiceItem.POELocation != nil {
+ portCode = mtoServiceItem.POELocation.Port.PortCode
+ } else if mtoServiceItem.PODLocation != nil {
+ portCode = mtoServiceItem.PODLocation.Port.PortCode
+ }
+ payload = &primev3messages.MTOServiceItemInternationalFuelSurcharge{
+ ReServiceCode: string(mtoServiceItem.ReService.Code),
+ PortCode: portCode,
+ }
+
default:
// otherwise, basic service item
payload = &primev3messages.MTOServiceItemBasic{
diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go
index ef37ecc322d..666233d4f52 100644
--- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go
+++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go
@@ -26,7 +26,9 @@ func (suite *PayloadsSuite) TestMoveTaskOrder() {
primeTime := time.Now()
submittedAt := time.Now()
excessWeightQualifiedAt := time.Now()
+ excessUnaccompaniedBaggageWeightQualifiedAt := time.Now()
excessWeightAcknowledgedAt := time.Now()
+ excessUnaccompaniedBaggageWeightAcknowledgedAt := time.Now()
excessWeightUploadID := uuid.Must(uuid.NewV4())
ordersType := primev3messages.OrdersTypeRETIREMENT
originDutyGBLOC := "KKFA"
@@ -70,9 +72,11 @@ func (suite *PayloadsSuite) TestMoveTaskOrder() {
},
},
},
- ExcessWeightQualifiedAt: &excessWeightQualifiedAt,
- ExcessWeightAcknowledgedAt: &excessWeightAcknowledgedAt,
- ExcessWeightUploadID: &excessWeightUploadID,
+ ExcessWeightQualifiedAt: &excessWeightQualifiedAt,
+ ExcessWeightAcknowledgedAt: &excessWeightAcknowledgedAt,
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &excessUnaccompaniedBaggageWeightQualifiedAt,
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt: &excessUnaccompaniedBaggageWeightAcknowledgedAt,
+ ExcessWeightUploadID: &excessWeightUploadID,
Contractor: &models.Contractor{
ContractNumber: factory.DefaultContractNumber,
},
@@ -95,7 +99,9 @@ func (suite *PayloadsSuite) TestMoveTaskOrder() {
suite.Equal(referenceID, returnedModel.ReferenceID)
suite.Equal(strfmt.DateTime(basicMove.UpdatedAt), returnedModel.UpdatedAt)
suite.NotEmpty(returnedModel.ETag)
+ suite.True(returnedModel.ExcessUnaccompaniedBaggageWeightQualifiedAt.Equal(strfmt.DateTime(*basicMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)))
suite.True(returnedModel.ExcessWeightQualifiedAt.Equal(strfmt.DateTime(*basicMove.ExcessWeightQualifiedAt)))
+ suite.True(returnedModel.ExcessUnaccompaniedBaggageWeightAcknowledgedAt.Equal(strfmt.DateTime(*basicMove.ExcessUnaccompaniedBaggageWeightAcknowledgedAt)))
suite.True(returnedModel.ExcessWeightAcknowledgedAt.Equal(strfmt.DateTime(*basicMove.ExcessWeightAcknowledgedAt)))
suite.Require().NotNil(returnedModel.ExcessWeightUploadID)
suite.Equal(strfmt.UUID(basicMove.ExcessWeightUploadID.String()), *returnedModel.ExcessWeightUploadID)
diff --git a/pkg/models/move.go b/pkg/models/move.go
index 31abba4a147..22bd18c743d 100644
--- a/pkg/models/move.go
+++ b/pkg/models/move.go
@@ -52,55 +52,57 @@ var locatorLetters = []rune("346789BCDFGHJKMPQRTVWXY")
// Move is an object representing a move task order which falls under an "Order" assigned to a service member
type Move struct {
- ID uuid.UUID `json:"id" db:"id"`
- Locator string `json:"locator" db:"locator"`
- CreatedAt time.Time `json:"created_at" db:"created_at"`
- UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
- SubmittedAt *time.Time `json:"submitted_at" db:"submitted_at"`
- OrdersID uuid.UUID `json:"orders_id" db:"orders_id"`
- Orders Order `belongs_to:"orders" fk_id:"orders_id"`
- Status MoveStatus `json:"status" db:"status"`
- SignedCertifications SignedCertifications `has_many:"signed_certifications" fk_id:"move_id" order_by:"created_at desc"`
- CancelReason *string `json:"cancel_reason" db:"cancel_reason"`
- Show *bool `json:"show" db:"show"`
- TIORemarks *string `db:"tio_remarks"`
- AvailableToPrimeAt *time.Time `db:"available_to_prime_at"`
- ApprovedAt *time.Time `db:"approved_at"`
- ContractorID *uuid.UUID `db:"contractor_id"`
- Contractor *Contractor `belongs_to:"contractors" fk_id:"contractor_id"`
- PPMType *string `db:"ppm_type"`
- MTOServiceItems MTOServiceItems `has_many:"mto_service_items" fk_id:"move_id"`
- PaymentRequests PaymentRequests `has_many:"payment_requests" fk_id:"move_id"`
- MTOShipments MTOShipments `has_many:"mto_shipments" fk_id:"move_id"`
- ReferenceID *string `db:"reference_id"`
- ServiceCounselingCompletedAt *time.Time `db:"service_counseling_completed_at"`
- PrimeCounselingCompletedAt *time.Time `db:"prime_counseling_completed_at"`
- ExcessWeightQualifiedAt *time.Time `db:"excess_weight_qualified_at"`
- ExcessWeightUploadID *uuid.UUID `db:"excess_weight_upload_id"`
- ExcessWeightUpload *Upload `belongs_to:"uploads" fk_id:"excess_weight_upload_id"`
- ExcessWeightAcknowledgedAt *time.Time `db:"excess_weight_acknowledged_at"`
- BillableWeightsReviewedAt *time.Time `db:"billable_weights_reviewed_at"`
- FinancialReviewFlag bool `db:"financial_review_flag"`
- FinancialReviewFlagSetAt *time.Time `db:"financial_review_flag_set_at"`
- FinancialReviewRemarks *string `db:"financial_review_remarks"`
- ShipmentGBLOC MoveToGBLOCs `has_many:"move_to_gbloc" fk_id:"move_id"`
- CloseoutOfficeID *uuid.UUID `db:"closeout_office_id"`
- CloseoutOffice *TransportationOffice `belongs_to:"transportation_offices" fk_id:"closeout_office_id"`
- ApprovalsRequestedAt *time.Time `db:"approvals_requested_at"`
- ShipmentSeqNum *int `db:"shipment_seq_num"`
- LockedByOfficeUserID *uuid.UUID `json:"locked_by" db:"locked_by"`
- LockedByOfficeUser *OfficeUser `belongs_to:"office_users" fk_id:"locked_by"`
- LockExpiresAt *time.Time `json:"lock_expires_at" db:"lock_expires_at"`
- AdditionalDocumentsID *uuid.UUID `json:"additional_documents_id" db:"additional_documents_id"`
- AdditionalDocuments *Document `belongs_to:"documents" fk_id:"additional_documents_id"`
- SCAssignedID *uuid.UUID `json:"sc_assigned_id" db:"sc_assigned_id"`
- SCAssignedUser *OfficeUser `belongs_to:"office_users" fk_id:"sc_assigned_id"`
- TOOAssignedID *uuid.UUID `json:"too_assigned_id" db:"too_assigned_id"`
- TOOAssignedUser *OfficeUser `belongs_to:"office_users" fk_id:"too_assigned_id"`
- TIOAssignedID *uuid.UUID `json:"tio_assigned_id" db:"tio_assigned_id"`
- TIOAssignedUser *OfficeUser `belongs_to:"office_users" fk_id:"tio_assigned_id"`
- CounselingOfficeID *uuid.UUID `json:"counseling_transportation_office_id" db:"counseling_transportation_office_id"`
- CounselingOffice *TransportationOffice `belongs_to:"transportation_offices" fk_id:"counseling_transportation_office_id"`
+ ID uuid.UUID `json:"id" db:"id"`
+ Locator string `json:"locator" db:"locator"`
+ CreatedAt time.Time `json:"created_at" db:"created_at"`
+ UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
+ SubmittedAt *time.Time `json:"submitted_at" db:"submitted_at"`
+ OrdersID uuid.UUID `json:"orders_id" db:"orders_id"`
+ Orders Order `belongs_to:"orders" fk_id:"orders_id"`
+ Status MoveStatus `json:"status" db:"status"`
+ SignedCertifications SignedCertifications `has_many:"signed_certifications" fk_id:"move_id" order_by:"created_at desc"`
+ CancelReason *string `json:"cancel_reason" db:"cancel_reason"`
+ Show *bool `json:"show" db:"show"`
+ TIORemarks *string `db:"tio_remarks"`
+ AvailableToPrimeAt *time.Time `db:"available_to_prime_at"`
+ ApprovedAt *time.Time `db:"approved_at"`
+ ContractorID *uuid.UUID `db:"contractor_id"`
+ Contractor *Contractor `belongs_to:"contractors" fk_id:"contractor_id"`
+ PPMType *string `db:"ppm_type"`
+ MTOServiceItems MTOServiceItems `has_many:"mto_service_items" fk_id:"move_id"`
+ PaymentRequests PaymentRequests `has_many:"payment_requests" fk_id:"move_id"`
+ MTOShipments MTOShipments `has_many:"mto_shipments" fk_id:"move_id"`
+ ReferenceID *string `db:"reference_id"`
+ ServiceCounselingCompletedAt *time.Time `db:"service_counseling_completed_at"`
+ PrimeCounselingCompletedAt *time.Time `db:"prime_counseling_completed_at"`
+ ExcessUnaccompaniedBaggageWeightQualifiedAt *time.Time `db:"excess_unaccompanied_baggage_weight_qualified_at"` // UB specific excess tracking
+ ExcessUnaccompaniedBaggageWeightAcknowledgedAt *time.Time `db:"excess_unaccompanied_baggage_weight_acknowledged_at"`
+ ExcessWeightQualifiedAt *time.Time `db:"excess_weight_qualified_at"` // Overall excess weight tracking (Includes UB in the sum if it violates excess)
+ ExcessWeightUploadID *uuid.UUID `db:"excess_weight_upload_id"`
+ ExcessWeightUpload *Upload `belongs_to:"uploads" fk_id:"excess_weight_upload_id"`
+ ExcessWeightAcknowledgedAt *time.Time `db:"excess_weight_acknowledged_at"`
+ BillableWeightsReviewedAt *time.Time `db:"billable_weights_reviewed_at"`
+ FinancialReviewFlag bool `db:"financial_review_flag"`
+ FinancialReviewFlagSetAt *time.Time `db:"financial_review_flag_set_at"`
+ FinancialReviewRemarks *string `db:"financial_review_remarks"`
+ ShipmentGBLOC MoveToGBLOCs `has_many:"move_to_gbloc" fk_id:"move_id"`
+ CloseoutOfficeID *uuid.UUID `db:"closeout_office_id"`
+ CloseoutOffice *TransportationOffice `belongs_to:"transportation_offices" fk_id:"closeout_office_id"`
+ ApprovalsRequestedAt *time.Time `db:"approvals_requested_at"`
+ ShipmentSeqNum *int `db:"shipment_seq_num"`
+ LockedByOfficeUserID *uuid.UUID `json:"locked_by" db:"locked_by"`
+ LockedByOfficeUser *OfficeUser `belongs_to:"office_users" fk_id:"locked_by"`
+ LockExpiresAt *time.Time `json:"lock_expires_at" db:"lock_expires_at"`
+ AdditionalDocumentsID *uuid.UUID `json:"additional_documents_id" db:"additional_documents_id"`
+ AdditionalDocuments *Document `belongs_to:"documents" fk_id:"additional_documents_id"`
+ SCAssignedID *uuid.UUID `json:"sc_assigned_id" db:"sc_assigned_id"`
+ SCAssignedUser *OfficeUser `belongs_to:"office_users" fk_id:"sc_assigned_id"`
+ TOOAssignedID *uuid.UUID `json:"too_assigned_id" db:"too_assigned_id"`
+ TOOAssignedUser *OfficeUser `belongs_to:"office_users" fk_id:"too_assigned_id"`
+ TIOAssignedID *uuid.UUID `json:"tio_assigned_id" db:"tio_assigned_id"`
+ TIOAssignedUser *OfficeUser `belongs_to:"office_users" fk_id:"tio_assigned_id"`
+ CounselingOfficeID *uuid.UUID `json:"counseling_transportation_office_id" db:"counseling_transportation_office_id"`
+ CounselingOffice *TransportationOffice `belongs_to:"transportation_offices" fk_id:"counseling_transportation_office_id"`
}
type MoveWithEarliestDate struct {
diff --git a/pkg/services/event/ghc_endpoint.go b/pkg/services/event/ghc_endpoint.go
index 78f3c192ab3..d24e480a02e 100644
--- a/pkg/services/event/ghc_endpoint.go
+++ b/pkg/services/event/ghc_endpoint.go
@@ -127,6 +127,9 @@ const GhcUpdateMaxBillableWeightAsTIOEndpointKey = "Ghc.UpdateMaxBillableWeightA
// GhcAcknowledgeExcessWeightRiskEndpointKey is the key for the AcknowledgeExcessWeightRisk endpoint in ghc
const GhcAcknowledgeExcessWeightRiskEndpointKey = "Ghc.AcknowledgeExcessWeightRisk"
+// GhcAcknowledgeExcessUnaccompaniedBaggageWeightRiskEndpointKey is the key for the AcknowledgeExcessUnaccompaniedBaggageWeightRisk endpoint in ghc
+const GhcAcknowledgeExcessUnaccompaniedBaggageWeightRiskEndpointKey = "Ghc.GhcAcknowledgeExcessUnaccompaniedBaggageWeightRiskEndpointKey"
+
// -------------------- ENDPOINT MAP ENTRIES --------------------
var ghcEndpoints = EndpointMapType{
GhcGetCustomerEndpointKey: {
@@ -285,4 +288,8 @@ var ghcEndpoints = EndpointMapType{
APIName: GhcAPIName,
OperationID: "AcknowledgeExcessWeightRisk",
},
+ GhcAcknowledgeExcessUnaccompaniedBaggageWeightRiskEndpointKey: {
+ APIName: GhcAPIName,
+ OperationID: "AcknowledgeExcessUnaccompaniedBaggageWeightRisk",
+ },
}
diff --git a/pkg/services/mocks/ExcessWeightRiskManager.go b/pkg/services/mocks/ExcessWeightRiskManager.go
index aad764a01cd..40f0db01a01 100644
--- a/pkg/services/mocks/ExcessWeightRiskManager.go
+++ b/pkg/services/mocks/ExcessWeightRiskManager.go
@@ -16,6 +16,36 @@ type ExcessWeightRiskManager struct {
mock.Mock
}
+// AcknowledgeExcessUnaccompaniedBaggageWeightRisk provides a mock function with given fields: appCtx, moveID, eTag
+func (_m *ExcessWeightRiskManager) AcknowledgeExcessUnaccompaniedBaggageWeightRisk(appCtx appcontext.AppContext, moveID uuid.UUID, eTag string) (*models.Move, error) {
+ ret := _m.Called(appCtx, moveID, eTag)
+
+ if len(ret) == 0 {
+ panic("no return value specified for AcknowledgeExcessUnaccompaniedBaggageWeightRisk")
+ }
+
+ var r0 *models.Move
+ var r1 error
+ if rf, ok := ret.Get(0).(func(appcontext.AppContext, uuid.UUID, string) (*models.Move, error)); ok {
+ return rf(appCtx, moveID, eTag)
+ }
+ if rf, ok := ret.Get(0).(func(appcontext.AppContext, uuid.UUID, string) *models.Move); ok {
+ r0 = rf(appCtx, moveID, eTag)
+ } else {
+ if ret.Get(0) != nil {
+ r0 = ret.Get(0).(*models.Move)
+ }
+ }
+
+ if rf, ok := ret.Get(1).(func(appcontext.AppContext, uuid.UUID, string) error); ok {
+ r1 = rf(appCtx, moveID, eTag)
+ } else {
+ r1 = ret.Error(1)
+ }
+
+ return r0, r1
+}
+
// AcknowledgeExcessWeightRisk provides a mock function with given fields: appCtx, moveID, eTag
func (_m *ExcessWeightRiskManager) AcknowledgeExcessWeightRisk(appCtx appcontext.AppContext, moveID uuid.UUID, eTag string) (*models.Move, error) {
ret := _m.Called(appCtx, moveID, eTag)
diff --git a/pkg/services/move/move_weights.go b/pkg/services/move/move_weights.go
index cf75d604652..e1fbda2e4f1 100644
--- a/pkg/services/move/move_weights.go
+++ b/pkg/services/move/move_weights.go
@@ -80,7 +80,7 @@ func lowerShipmentWeight(shipment models.MTOShipment) int {
func (w moveWeights) CheckExcessWeight(appCtx appcontext.AppContext, moveID uuid.UUID, updatedShipment models.MTOShipment) (*models.Move, *validate.Errors, error) {
db := appCtx.DB()
var move models.Move
- err := db.EagerPreload("MTOShipments", "Orders.Entitlement").Find(&move, moveID)
+ err := db.EagerPreload("MTOShipments", "Orders.Entitlement", "Orders.OriginDutyLocation.Address", "Orders.NewDutyLocation.Address", "Orders.ServiceMember").Find(&move, moveID)
if err != nil {
switch err {
case sql.ErrNoRows:
@@ -100,58 +100,144 @@ func (w moveWeights) CheckExcessWeight(appCtx appcontext.AppContext, moveID uuid
totalWeightAllowance := models.GetWeightAllotment(*move.Orders.Grade, move.Orders.OrdersType)
- weight := totalWeightAllowance.TotalWeightSelf
+ overallWeightAllowance := totalWeightAllowance.TotalWeightSelf
if *move.Orders.Entitlement.DependentsAuthorized {
- weight = totalWeightAllowance.TotalWeightSelfPlusDependents
+ overallWeightAllowance = totalWeightAllowance.TotalWeightSelfPlusDependents
}
+ ubWeightAllowance, err := models.GetUBWeightAllowance(appCtx, move.Orders.OriginDutyLocation.Address.IsOconus, move.Orders.NewDutyLocation.Address.IsOconus, move.Orders.ServiceMember.Affiliation, move.Orders.Grade, &move.Orders.OrdersType, move.Orders.Entitlement.DependentsAuthorized, move.Orders.Entitlement.AccompaniedTour, move.Orders.Entitlement.DependentsUnderTwelve, move.Orders.Entitlement.DependentsTwelveAndOver)
+ if err != nil {
+ return nil, nil, err
+ }
+ sumOfWeights := calculateSumOfWeights(move, &updatedShipment)
+ verrs, err := saveMoveExcessWeightValues(appCtx, &move, overallWeightAllowance, ubWeightAllowance, sumOfWeights)
+ if (verrs != nil && verrs.HasAny()) || err != nil {
+ return nil, verrs, err
+ }
+ return &move, nil, nil
+}
- // the shipment being updated/created potentially has not yet been saved in the database so use the weight in the
- // incoming payload that will be saved after
- estimatedWeightTotal := 0
- if updatedShipment.Status == models.MTOShipmentStatusApproved {
- if updatedShipment.PrimeEstimatedWeight != nil {
- estimatedWeightTotal += updatedShipment.PrimeEstimatedWeight.Int()
- }
- if updatedShipment.PPMShipment != nil && updatedShipment.PPMShipment.EstimatedWeight != nil {
- estimatedWeightTotal += updatedShipment.PPMShipment.EstimatedWeight.Int()
- }
+// Handle move excess weight values by updating
+// the move in place. This handles setting when the move qualified
+// for risk of excess weight as well as resetting it if the weight has been
+// updated to a new weight not at risk of excess
+func saveMoveExcessWeightValues(appCtx appcontext.AppContext, move *models.Move, overallWeightAllowance int, ubWeightAllowance int, sumOfWeights SumOfWeights) (*validate.Errors, error) {
+ now := time.Now() // Prepare a shared time for risk excess flagging
+
+ var isTheMoveBeingUpdated bool
+
+ // Check for risk of excess of the total move allowance (HHG and PPM)
+ if int(float32(overallWeightAllowance)*RiskOfExcessThreshold) <= sumOfWeights.SumEstimatedWeightOfMove {
+ isTheMoveBeingUpdated = true
+ excessWeightQualifiedAt := now
+ move.ExcessWeightQualifiedAt = &excessWeightQualifiedAt
+ } else if move.ExcessWeightQualifiedAt != nil {
+ // Reset qualified at
+ isTheMoveBeingUpdated = true
+ move.ExcessWeightQualifiedAt = nil
}
+ var hasUbShipments bool
for _, shipment := range move.MTOShipments {
- // We should avoid counting shipments that haven't been approved yet and will need to account for diversions
- // and cancellations factoring into the estimated weight total.
- if shipment.Status == models.MTOShipmentStatusApproved && shipment.PrimeEstimatedWeight != nil {
- if shipment.ID != updatedShipment.ID {
- if shipment.PrimeEstimatedWeight != nil {
- estimatedWeightTotal += shipment.PrimeEstimatedWeight.Int()
- }
- if shipment.PPMShipment != nil && shipment.PPMShipment.EstimatedWeight != nil {
- estimatedWeightTotal += shipment.PPMShipment.EstimatedWeight.Int()
- }
- }
+ if shipment.ShipmentType == models.MTOShipmentTypeUnaccompaniedBaggage {
+ hasUbShipments = true
}
}
- // may need to take into account floating point precision here but should be dealing with whole numbers
- if int(float32(weight)*RiskOfExcessThreshold) <= estimatedWeightTotal {
- excessWeightQualifiedAt := time.Now()
- move.ExcessWeightQualifiedAt = &excessWeightQualifiedAt
+ threshold := int(float32(ubWeightAllowance) * RiskOfExcessThreshold)
+ isWeightExceedingThreshold := (threshold <= sumOfWeights.SumEstimatedWeightOfUbShipments) || (threshold <= sumOfWeights.SumActualWeightOfUbShipments)
+
+ // Check for risk of excess of UB allowance if there are UB shipments
+ if hasUbShipments && isWeightExceedingThreshold {
+ isTheMoveBeingUpdated = true
+ excessUbWeightQualifiedAt := now
+ move.ExcessUnaccompaniedBaggageWeightQualifiedAt = &excessUbWeightQualifiedAt
+ } else if !hasUbShipments || move.ExcessUnaccompaniedBaggageWeightQualifiedAt != nil {
+ // Reset qualified at
+ isTheMoveBeingUpdated = true
+ move.ExcessUnaccompaniedBaggageWeightQualifiedAt = nil
+ }
- verrs, err := validateAndSave(appCtx, &move)
+ if isTheMoveBeingUpdated {
+ // Save risk excess flags
+ verrs, err := validateAndSave(appCtx, move)
if (verrs != nil && verrs.HasAny()) || err != nil {
- return nil, verrs, err
+ return verrs, err
}
- } else if move.ExcessWeightQualifiedAt != nil {
- // the move had previously qualified for excess weight but does not any longer so reset the value
- move.ExcessWeightQualifiedAt = nil
+ }
+ return nil, nil
+}
- verrs, err := validateAndSave(appCtx, &move)
- if (verrs != nil && verrs.HasAny()) || err != nil {
- return nil, verrs, err
+type SumOfWeights struct {
+ SumEstimatedWeightOfMove int
+ SumEstimatedWeightOfUbShipments int
+ SumActualWeightOfUbShipments int
+}
+
+func sumWeightsFromShipment(shipment models.MTOShipment) SumOfWeights {
+ var sumEstimatedWeightOfMove int
+ var sumEstimatedWeightOfUbShipments int
+ var sumActualWeightOfUbShipments int
+
+ if shipment.Status != models.MTOShipmentStatusApproved {
+ return SumOfWeights{}
+ }
+
+ // Sum the prime estimated weights
+ if shipment.PrimeEstimatedWeight != nil {
+ primeEstimatedWeightInt := shipment.PrimeEstimatedWeight.Int()
+ sumEstimatedWeightOfMove += primeEstimatedWeightInt
+ if shipment.ShipmentType == models.MTOShipmentTypeUnaccompaniedBaggage {
+ // Sum the UB estimated weight separately
+ sumEstimatedWeightOfUbShipments += primeEstimatedWeightInt
}
}
- return &move, nil, nil
+ if shipment.PPMShipment != nil && shipment.PPMShipment.EstimatedWeight != nil {
+ // Sum the PPM estimated weight into the overall sum
+ sumEstimatedWeightOfMove += shipment.PPMShipment.EstimatedWeight.Int()
+ }
+
+ if shipment.PrimeActualWeight != nil && shipment.ShipmentType == models.MTOShipmentTypeUnaccompaniedBaggage {
+ // Sum the actual weight of UB, we don't sum the actual weight of HHG or PPM at this time for determining if a move is at risk of excess
+ sumActualWeightOfUbShipments += shipment.PrimeActualWeight.Int()
+ }
+
+ return SumOfWeights{
+ SumEstimatedWeightOfMove: sumEstimatedWeightOfMove,
+ SumEstimatedWeightOfUbShipments: sumEstimatedWeightOfUbShipments,
+ SumActualWeightOfUbShipments: sumActualWeightOfUbShipments,
+ }
+}
+
+// Calculates the sum of weights for a move, including an optional updated shipment that may not be persisted to the database yet
+// If updatedShipment is nil, it calculates sums for the move as is
+// If updatedShipment is provided, it excludes it from the existing shipments and adds its weights separately since we don't want to include it
+//
+// in the normal sum (Since the normal sum won't accurately reflect the not-saved shipment being updated)
+func calculateSumOfWeights(move models.Move, updatedShipment *models.MTOShipment) SumOfWeights {
+ sumOfWeights := SumOfWeights{}
+
+ // Sum weights from existing shipments
+ for _, shipment := range move.MTOShipments {
+ if updatedShipment != nil && shipment.ID == updatedShipment.ID {
+ // Skip shipments that are not approved
+ continue
+ }
+ shipmentWeights := sumWeightsFromShipment(shipment)
+ sumOfWeights.SumEstimatedWeightOfMove += shipmentWeights.SumEstimatedWeightOfMove
+ sumOfWeights.SumEstimatedWeightOfUbShipments += shipmentWeights.SumEstimatedWeightOfUbShipments
+ sumOfWeights.SumActualWeightOfUbShipments += shipmentWeights.SumActualWeightOfUbShipments
+ }
+
+ // Sum weights from the updated shipment
+ if updatedShipment != nil {
+ updatedWeights := sumWeightsFromShipment(*updatedShipment)
+ sumOfWeights.SumEstimatedWeightOfMove += updatedWeights.SumEstimatedWeightOfMove
+ sumOfWeights.SumEstimatedWeightOfUbShipments += updatedWeights.SumEstimatedWeightOfUbShipments
+ sumOfWeights.SumActualWeightOfUbShipments += updatedWeights.SumActualWeightOfUbShipments
+ }
+
+ return sumOfWeights
}
func (w moveWeights) CheckAutoReweigh(appCtx appcontext.AppContext, moveID uuid.UUID, updatedShipment *models.MTOShipment) (models.MTOShipments, error) {
@@ -177,9 +263,9 @@ func (w moveWeights) CheckAutoReweigh(appCtx appcontext.AppContext, moveID uuid.
totalWeightAllowance := models.GetWeightAllotment(*move.Orders.Grade, move.Orders.OrdersType)
- weight := totalWeightAllowance.TotalWeightSelf
+ overallWeightAllowance := totalWeightAllowance.TotalWeightSelf
if *move.Orders.Entitlement.DependentsAuthorized {
- weight = totalWeightAllowance.TotalWeightSelfPlusDependents
+ overallWeightAllowance = totalWeightAllowance.TotalWeightSelfPlusDependents
}
moveWeightTotal := 0
@@ -199,7 +285,7 @@ func (w moveWeights) CheckAutoReweigh(appCtx appcontext.AppContext, moveID uuid.
autoReweighShipments := models.MTOShipments{}
// may need to take into account floating point precision here but should be dealing with whole numbers
- if int(float32(weight)*AutoReweighRequestThreshold) <= moveWeightTotal {
+ if int(float32(overallWeightAllowance)*AutoReweighRequestThreshold) <= moveWeightTotal {
for _, shipment := range move.MTOShipments {
// We should avoid counting shipments that haven't been approved yet and will need to account for diversions
// and cancellations factoring into the weight total.
diff --git a/pkg/services/move/move_weights_test.go b/pkg/services/move/move_weights_test.go
index 6ae571c088c..6528830e2e4 100644
--- a/pkg/services/move/move_weights_test.go
+++ b/pkg/services/move/move_weights_test.go
@@ -22,7 +22,7 @@ func (suite *MoveServiceSuite) TestExcessWeight() {
approvedMove := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil)
now := time.Now()
pickupDate := now.AddDate(0, 0, 10)
- approvedShipment := factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
+ approvedHHGShipment := factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
{
Model: models.MTOShipment{
Status: models.MTOShipmentStatusApproved,
@@ -35,28 +35,78 @@ func (suite *MoveServiceSuite) TestExcessWeight() {
LinkOnly: true,
},
}, nil)
+ approvedUbShipment := factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
+ {
+ Model: models.MTOShipment{
+ Status: models.MTOShipmentStatusApproved,
+ ApprovedDate: &now,
+ ScheduledPickupDate: &pickupDate,
+ ShipmentType: models.MTOShipmentTypeUnaccompaniedBaggage,
+ },
+ },
+ {
+ Model: approvedMove,
+ LinkOnly: true,
+ },
+ }, nil)
estimatedWeight := unit.Pound(7200)
- approvedShipment.PrimeEstimatedWeight = &estimatedWeight
- updatedMove, verrs, err := moveWeights.CheckExcessWeight(suite.AppContextForTest(), approvedMove.ID, approvedShipment)
-
+ approvedHHGShipment.PrimeEstimatedWeight = &estimatedWeight
+ approvedUbShipment.PrimeEstimatedWeight = &estimatedWeight
+ _, verrs, err := moveWeights.CheckExcessWeight(suite.AppContextForTest(), approvedMove.ID, approvedHHGShipment)
+ suite.Nil(verrs)
+ suite.NoError(err)
+ updatedMove, verrs, err := moveWeights.CheckExcessWeight(suite.AppContextForTest(), approvedMove.ID, approvedUbShipment)
suite.Nil(verrs)
suite.NoError(err)
+ // Move has nil excess weight risks before checking for excess weight
suite.Nil(approvedMove.ExcessWeightQualifiedAt)
+ suite.Nil(approvedMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)
+ // Move has not nil excess weight risks after checking for excess weight
suite.NotNil(updatedMove.ExcessWeightQualifiedAt)
+ suite.NotNil(updatedMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)
// refetch the move from the database not just the return value
err = suite.DB().Reload(&approvedMove)
suite.NoError(err)
+ // Ensure it saved to db
suite.NotNil(approvedMove.ExcessWeightQualifiedAt)
+ suite.NotNil(approvedMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)
})
suite.Run("does not flag move for excess weight when an approved shipment estimated weight is lower than threshold", func() {
- approvedMove := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil)
+ // Create a move with an oconus duty location so it qualifies for UB allowance
+ // The allowance based on these params should be 500 ub
+ oconusAddress := factory.BuildAddress(suite.DB(), []factory.Customization{
+ {
+ Model: models.Address{
+ IsOconus: models.BoolPointer(true),
+ },
+ },
+ }, nil)
+ oconusDutyLocation := factory.BuildDutyLocation(suite.DB(), []factory.Customization{
+ {
+ Model: oconusAddress,
+ LinkOnly: true,
+ },
+ }, nil)
+ order := factory.BuildOrder(suite.DB(), []factory.Customization{
+ {
+ Model: oconusDutyLocation,
+ LinkOnly: true,
+ Type: &factory.DutyLocations.OriginDutyLocation,
+ },
+ }, nil)
+ move := factory.BuildMove(suite.DB(), []factory.Customization{
+ {
+ Model: order,
+ LinkOnly: true,
+ }}, nil)
now := time.Now()
pickupDate := now.AddDate(0, 0, 10)
- approvedShipment := factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
+
+ approvedHHGShipment := factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
{
Model: models.MTOShipment{
Status: models.MTOShipmentStatusApproved,
@@ -65,24 +115,45 @@ func (suite *MoveServiceSuite) TestExcessWeight() {
},
},
{
- Model: approvedMove,
+ Model: move,
+ LinkOnly: true,
+ },
+ }, nil)
+ approvedUbShipment := factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
+ {
+ Model: models.MTOShipment{
+ Status: models.MTOShipmentStatusApproved,
+ ApprovedDate: &now,
+ ScheduledPickupDate: &pickupDate,
+ ShipmentType: models.MTOShipmentTypeUnaccompaniedBaggage,
+ },
+ },
+ {
+ Model: move,
LinkOnly: true,
},
}, nil)
- estimatedWeight := unit.Pound(7199)
- approvedShipment.PrimeEstimatedWeight = &estimatedWeight
- updatedMove, verrs, err := moveWeights.CheckExcessWeight(suite.AppContextForTest(), approvedMove.ID, approvedShipment)
-
+ estimatedHHGWeight := unit.Pound(7199)
+ estimatedUBWeight := unit.Pound(250)
+ approvedHHGShipment.PrimeEstimatedWeight = &estimatedHHGWeight
+ approvedUbShipment.PrimeEstimatedWeight = &estimatedUBWeight
+ _, verrs, err := moveWeights.CheckExcessWeight(suite.AppContextForTest(), move.ID, approvedHHGShipment)
+ suite.Nil(verrs)
+ suite.NoError(err)
+ updatedMove, verrs, err := moveWeights.CheckExcessWeight(suite.AppContextForTest(), move.ID, approvedUbShipment)
suite.Nil(verrs)
suite.NoError(err)
- suite.Nil(approvedMove.ExcessWeightQualifiedAt)
+ suite.Nil(move.ExcessWeightQualifiedAt)
suite.Nil(updatedMove.ExcessWeightQualifiedAt)
+ suite.Nil(move.ExcessUnaccompaniedBaggageWeightQualifiedAt)
+ suite.Nil(updatedMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)
- err = suite.DB().Reload(&approvedMove)
+ err = suite.DB().Reload(&move)
suite.NoError(err)
- suite.Nil(approvedMove.ExcessWeightQualifiedAt)
+ suite.Nil(move.ExcessWeightQualifiedAt)
+ suite.Nil(move.ExcessUnaccompaniedBaggageWeightQualifiedAt)
})
suite.Run("qualifies move for excess weight when the sum of approved shipments is updated within threshold", func() {
@@ -218,17 +289,46 @@ func (suite *MoveServiceSuite) TestExcessWeight() {
suite.Run("removes excess weight qualification when estimated weight drops below previously met threshold", func() {
now := time.Now()
- approvedMove := factory.BuildAvailableToPrimeMove(suite.DB(), []factory.Customization{
+ estimatedUbWeight := unit.Pound(250)
+ estimatedWeight := unit.Pound(7199 - estimatedUbWeight)
+
+ // Add an OCONUS address so it qualifies for UB allowance
+ // The allowance based on these params should be 500 ub
+ oconusAddress := factory.BuildAddress(suite.DB(), []factory.Customization{
{
- Model: models.Move{
- ExcessWeightQualifiedAt: &now,
+ Model: models.Address{
+ IsOconus: models.BoolPointer(true),
},
},
}, nil)
+ oconusDutyLocation := factory.BuildDutyLocation(suite.DB(), []factory.Customization{
+ {
+ Model: oconusAddress,
+ LinkOnly: true,
+ },
+ }, nil)
+ order := factory.BuildOrder(suite.DB(), []factory.Customization{
+ {
+ Model: oconusDutyLocation,
+ LinkOnly: true,
+ Type: &factory.DutyLocations.OriginDutyLocation,
+ },
+ }, nil)
+ // By default have excess weight turned on, we want to simulate it resetting
+ initialMove := factory.BuildMove(suite.DB(), []factory.Customization{
+ {
+ Model: models.Move{
+ ExcessWeightQualifiedAt: &now,
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &now,
+ },
+ },
+ {
+ Model: order,
+ LinkOnly: true,
+ }}, nil)
pickupDate := now.AddDate(0, 0, 10)
- estimatedWeight := unit.Pound(7200)
- approvedShipment := factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
+ factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
{
Model: models.MTOShipment{
Status: models.MTOShipmentStatusApproved,
@@ -238,24 +338,45 @@ func (suite *MoveServiceSuite) TestExcessWeight() {
},
},
{
- Model: approvedMove,
+ Model: initialMove,
+ LinkOnly: true,
+ },
+ }, nil)
+ approvedUbShipment := factory.BuildMTOShipmentMinimal(suite.DB(), []factory.Customization{
+ {
+ Model: models.MTOShipment{
+ Status: models.MTOShipmentStatusApproved,
+ ApprovedDate: &now,
+ ScheduledPickupDate: &pickupDate,
+ ShipmentType: models.MTOShipmentTypeUnaccompaniedBaggage,
+ PrimeEstimatedWeight: &estimatedUbWeight,
+ },
+ },
+ {
+ Model: initialMove,
LinkOnly: true,
},
}, nil)
- updatedEstimatedWeight := unit.Pound(7199)
- approvedShipment.PrimeEstimatedWeight = &updatedEstimatedWeight
- updatedMove, verrs, err := moveWeights.CheckExcessWeight(suite.AppContextForTest(), approvedMove.ID, approvedShipment)
+ // We defaulted to excess amounts
+ suite.NotNil(initialMove.ExcessWeightQualifiedAt)
+ suite.NotNil(initialMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)
+ updatedMove, verrs, err := moveWeights.CheckExcessWeight(suite.AppContextForTest(), initialMove.ID, approvedUbShipment)
suite.Nil(verrs)
suite.NoError(err)
- suite.NotNil(approvedMove.ExcessWeightQualifiedAt)
+ // The shipments we created will not qualify for risk of excess
+ // This means that after we CheckExcessWeight again, the
suite.Nil(updatedMove.ExcessWeightQualifiedAt)
+ suite.Nil(updatedMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)
- err = suite.DB().Reload(&approvedMove)
+ // Reload our original move that had excess weight qualified at present
+ // and now make sure it is nil
+ err = suite.DB().Reload(&initialMove)
suite.NoError(err)
- suite.Nil(approvedMove.ExcessWeightQualifiedAt)
+ suite.Nil(initialMove.ExcessWeightQualifiedAt)
+ suite.Nil(initialMove.ExcessUnaccompaniedBaggageWeightQualifiedAt)
})
suite.Run("returns error if orders grade is unset to lookup weight allowance", func() {
diff --git a/pkg/services/mto_shipment/mto_shipment_updater.go b/pkg/services/mto_shipment/mto_shipment_updater.go
index 3fa1f6ed832..d30e6842292 100644
--- a/pkg/services/mto_shipment/mto_shipment_updater.go
+++ b/pkg/services/mto_shipment/mto_shipment_updater.go
@@ -752,7 +752,7 @@ func (f *mtoShipmentUpdater) updateShipmentRecord(appCtx appcontext.AppContext,
existingMoveStatus := move.Status
// if the move is in excess weight risk and the TOO has not acknowledge that, need to change move status to "Approvals Requested"
// this will trigger the TOO to acknowledged the excess right, which populates ExcessWeightAcknowledgedAt
- if move.ExcessWeightQualifiedAt != nil && move.ExcessWeightAcknowledgedAt == nil {
+ if move.ExcessWeightQualifiedAt != nil && move.ExcessWeightAcknowledgedAt == nil || move.ExcessUnaccompaniedBaggageWeightQualifiedAt != nil && move.ExcessUnaccompaniedBaggageWeightAcknowledgedAt == nil {
err = f.moveRouter.SendToOfficeUser(txnAppCtx, move)
if err != nil {
return err
diff --git a/pkg/services/order.go b/pkg/services/order.go
index 4f33f6f1a23..c1bd25d1b84 100644
--- a/pkg/services/order.go
+++ b/pkg/services/order.go
@@ -40,6 +40,7 @@ type OrderUpdater interface {
//go:generate mockery --name ExcessWeightRiskManager
type ExcessWeightRiskManager interface {
AcknowledgeExcessWeightRisk(appCtx appcontext.AppContext, moveID uuid.UUID, eTag string) (*models.Move, error)
+ AcknowledgeExcessUnaccompaniedBaggageWeightRisk(appCtx appcontext.AppContext, moveID uuid.UUID, eTag string) (*models.Move, error)
UpdateBillableWeightAsTOO(appCtx appcontext.AppContext, orderID uuid.UUID, weight *int, eTag string) (*models.Order, uuid.UUID, error)
UpdateMaxBillableWeightAsTIO(appCtx appcontext.AppContext, orderID uuid.UUID, weight *int, remarks *string, eTag string) (*models.Order, uuid.UUID, error)
}
diff --git a/pkg/services/order/excess_weight_risk_manager.go b/pkg/services/order/excess_weight_risk_manager.go
index 47a9a278edd..bbf605ad9c5 100644
--- a/pkg/services/order/excess_weight_risk_manager.go
+++ b/pkg/services/order/excess_weight_risk_manager.go
@@ -68,7 +68,24 @@ func (f *excessWeightRiskManager) AcknowledgeExcessWeightRisk(appCtx appcontext.
return &models.Move{}, apperror.NewPreconditionFailedError(move.ID, query.StaleIdentifierError{StaleIdentifier: eTag})
}
- return f.acknowledgeRiskAndApproveMove(appCtx, *order)
+ return f.acknowledgeRiskAndApproveMove(appCtx, *order, false)
+}
+
+// AcknowledgeExcessUnaccompaniedBaggageWeightRisk records the date and time the TOO dismissed the excess unaccompanied baggage weight risk notification
+func (f *excessWeightRiskManager) AcknowledgeExcessUnaccompaniedBaggageWeightRisk(appCtx appcontext.AppContext, orderID uuid.UUID, eTag string) (*models.Move, error) {
+ order, err := f.findOrder(appCtx, orderID)
+ if err != nil {
+ return &models.Move{}, err
+ }
+
+ move := order.Moves[0]
+
+ existingETag := etag.GenerateEtag(move.UpdatedAt)
+ if existingETag != eTag {
+ return &models.Move{}, apperror.NewPreconditionFailedError(move.ID, query.StaleIdentifierError{StaleIdentifier: eTag})
+ }
+
+ return f.acknowledgeRiskAndApproveMove(appCtx, *order, true)
}
func (f *excessWeightRiskManager) findOrder(appCtx appcontext.AppContext, orderID uuid.UUID) (*models.Order, error) {
@@ -87,12 +104,12 @@ func (f *excessWeightRiskManager) findOrder(appCtx appcontext.AppContext, orderI
return &order, nil
}
-func (f *excessWeightRiskManager) acknowledgeRiskAndApproveMove(appCtx appcontext.AppContext, order models.Order) (*models.Move, error) {
+func (f *excessWeightRiskManager) acknowledgeRiskAndApproveMove(appCtx appcontext.AppContext, order models.Order, isAcknowledgingUbExcessWeightRisk bool) (*models.Move, error) {
move := order.Moves[0]
var returnedMove *models.Move
transactionError := appCtx.NewTransaction(func(txnAppCtx appcontext.AppContext) error {
- updatedMove, err := f.acknowledgeExcessWeight(txnAppCtx, move)
+ updatedMove, err := f.acknowledgeExcessWeight(txnAppCtx, move, isAcknowledgingUbExcessWeightRisk)
if err != nil {
return err
}
@@ -124,7 +141,10 @@ func (f *excessWeightRiskManager) updateBillableWeight(appCtx appcontext.AppCont
return err
}
- updatedMove, err := f.acknowledgeExcessWeight(txnAppCtx, move)
+ // Acknowledge excess weight for the overall move
+ // unaccompanied baggage is never affected by billable weight updates as it is
+ // a separate, immutable allowance
+ updatedMove, err := f.acknowledgeExcessWeight(txnAppCtx, move, false)
if err != nil {
return err
}
@@ -161,7 +181,9 @@ func (f *excessWeightRiskManager) updateMaxBillableWeightWithTIORemarks(appCtx a
return err
}
- updatedMove, err = f.acknowledgeExcessWeight(txnAppCtx, *updatedMove)
+ // Unaccompanied baggage is never affected by billable weight updates as it is
+ // a separate, immutable allowance
+ updatedMove, err = f.acknowledgeExcessWeight(txnAppCtx, *updatedMove, false)
if err != nil {
return err
}
@@ -199,16 +221,32 @@ func (f *excessWeightRiskManager) updateAuthorizedWeight(appCtx appcontext.AppCo
return f.handleError(order.ID, verrs, err)
}
-func (f *excessWeightRiskManager) acknowledgeExcessWeight(appCtx appcontext.AppContext, move models.Move) (*models.Move, error) {
- if !excessWeightRiskShouldBeAcknowledged(move) {
- return &move, nil
- }
-
- now := time.Now()
- move.ExcessWeightAcknowledgedAt = &now
- verrs, err := appCtx.DB().ValidateAndUpdate(&move)
- if e := f.handleError(move.ID, verrs, err); e != nil {
- return &move, e
+func (f *excessWeightRiskManager) acknowledgeExcessWeight(appCtx appcontext.AppContext, move models.Move, isAcknowledgingUbExcessWeightRisk bool) (*models.Move, error) {
+ // Separately handle whether the excess weight being acknowledged is for the entire move allowance or just the unaccompanied baggage allowance
+ if isAcknowledgingUbExcessWeightRisk {
+ // Make sure it should be acknowledgeable
+ if !excessUnaccompaniedBaggageWeightRiskShouldBeAcknowledged(move) {
+ return &move, nil
+ }
+ // Acknowledge it
+ now := time.Now()
+ move.ExcessUnaccompaniedBaggageWeightAcknowledgedAt = &now
+ verrs, err := appCtx.DB().ValidateAndUpdate(&move)
+ if e := f.handleError(move.ID, verrs, err); e != nil {
+ return &move, e
+ }
+ } else {
+ // Make sure it should be acknowledgeable
+ if !excessWeightRiskShouldBeAcknowledged(move) {
+ return &move, nil
+ }
+ // Acknowledge it
+ now := time.Now()
+ move.ExcessWeightAcknowledgedAt = &now
+ verrs, err := appCtx.DB().ValidateAndUpdate(&move)
+ if e := f.handleError(move.ID, verrs, err); e != nil {
+ return &move, e
+ }
}
return &move, nil
@@ -228,3 +266,7 @@ func (f *excessWeightRiskManager) handleError(modelID uuid.UUID, verrs *validate
func excessWeightRiskShouldBeAcknowledged(move models.Move) bool {
return move.ExcessWeightQualifiedAt != nil && move.ExcessWeightAcknowledgedAt == nil
}
+
+func excessUnaccompaniedBaggageWeightRiskShouldBeAcknowledged(move models.Move) bool {
+ return move.ExcessUnaccompaniedBaggageWeightQualifiedAt != nil && move.ExcessUnaccompaniedBaggageWeightAcknowledgedAt == nil
+}
diff --git a/pkg/services/order/excess_weight_risk_manager_test.go b/pkg/services/order/excess_weight_risk_manager_test.go
index ad67a0d80b5..c7c81e58f86 100644
--- a/pkg/services/order/excess_weight_risk_manager_test.go
+++ b/pkg/services/order/excess_weight_risk_manager_test.go
@@ -549,6 +549,34 @@ func (suite *OrderServiceSuite) TestAcknowledgeExcessWeightRisk() {
suite.NotNil(moveInDB.ExcessWeightAcknowledgedAt)
})
+ suite.Run("Updates the ExcessUnaccompaniedBaggageWeightAcknowledgedAt field and approves the move when all fields are valid", func() {
+ moveRouter := moverouter.NewMoveRouter()
+ excessWeightRiskManager := NewExcessWeightRiskManager(moveRouter)
+ now := time.Now()
+ move := factory.BuildApprovalsRequestedMove(suite.DB(), []factory.Customization{
+ {
+ Model: models.Move{
+ ExcessUnaccompaniedBaggageWeightQualifiedAt: &now,
+ },
+ },
+ }, nil)
+ order := move.Orders
+ eTag := etag.GenerateEtag(move.UpdatedAt)
+
+ updatedMove, err := excessWeightRiskManager.AcknowledgeExcessUnaccompaniedBaggageWeightRisk(suite.AppContextForTest(), order.ID, eTag)
+ suite.NoError(err)
+
+ var moveInDB models.Move
+ err = suite.DB().Find(&moveInDB, move.ID)
+ suite.NoError(err)
+
+ suite.Equal(move.ID.String(), updatedMove.ID.String())
+ suite.Equal(models.MoveStatusAPPROVED, moveInDB.Status)
+ suite.Equal(models.MoveStatusAPPROVED, updatedMove.Status)
+ suite.NotNil(moveInDB.ExcessUnaccompaniedBaggageWeightAcknowledgedAt)
+ suite.NotNil(updatedMove.ExcessUnaccompaniedBaggageWeightAcknowledgedAt)
+ })
+
suite.Run("Updates the ExcessWeightAcknowledgedAt field but does not approve the move if unreviewed service items exist", func() {
moveRouter := moverouter.NewMoveRouter()
excessWeightRiskManager := NewExcessWeightRiskManager(moveRouter)
diff --git a/pkg/storage/s3.go b/pkg/storage/s3.go
index a59443629e5..a5a04250d67 100644
--- a/pkg/storage/s3.go
+++ b/pkg/storage/s3.go
@@ -4,6 +4,7 @@ import (
"context"
"io"
"path"
+ "strconv"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
@@ -116,9 +117,11 @@ func (s *S3) TempFileSystem() *afero.Afero {
func (s *S3) PresignedURL(key string, contentType string, filename string) (string, error) {
namespacedKey := path.Join(s.keyNamespace, key)
presignClient := s3.NewPresignClient(s.client)
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(filename)
filenameBuffer := make([]byte, 0)
- for _, r := range filename {
+ for _, r := range quotedFilename {
if encodedRune, ok := charmap.ISO8859_1.EncodeRune(r); ok {
filenameBuffer = append(filenameBuffer, encodedRune)
}
diff --git a/pkg/storage/test/s3.go b/pkg/storage/test/s3.go
index da076681dfe..97d06e7733d 100644
--- a/pkg/storage/test/s3.go
+++ b/pkg/storage/test/s3.go
@@ -4,6 +4,7 @@ import (
"fmt"
"io"
"net/url"
+ "strconv"
"github.com/pkg/errors"
"github.com/spf13/afero"
@@ -58,7 +59,11 @@ func (fake *FakeS3Storage) Fetch(key string) (io.ReadCloser, error) {
// PresignedURL returns a URL that can be used to retrieve a file.
func (fake *FakeS3Storage) PresignedURL(key string, contentType string, filename string) (string, error) {
filenameBuffer := make([]byte, 0)
- for _, r := range filename {
+
+ // Double quote the filename to be able to handle filenames with commas in them
+ quotedFilename := strconv.Quote(filename)
+
+ for _, r := range quotedFilename {
if encodedRune, ok := charmap.ISO8859_1.EncodeRune(r); ok {
filenameBuffer = append(filenameBuffer, encodedRune)
}
diff --git a/playwright/tests/office/servicescounseling/servicesCounselingProGearTickets.spec.js b/playwright/tests/office/servicescounseling/servicesCounselingProGearTickets.spec.js
index 633abfd8e4d..18db9efd539 100644
--- a/playwright/tests/office/servicescounseling/servicesCounselingProGearTickets.spec.js
+++ b/playwright/tests/office/servicescounseling/servicesCounselingProGearTickets.spec.js
@@ -1,6 +1,8 @@
import { test, expect } from './servicesCounselingTestFixture';
test('A service counselor can approve/reject pro-gear weight tickets', async ({ page, scPage }) => {
+ // To solve timeout issues
+ test.slow();
// Create a move with TestHarness, and then navigate to the move details page for it
const move = await scPage.testHarness.buildApprovedMoveWithPPMProgearWeightTicketOffice();
await scPage.navigateToCloseoutMove(move.locator);
diff --git a/playwright/tests/office/txo/tooFlows.spec.js b/playwright/tests/office/txo/tooFlows.spec.js
index e4ec319314f..ebc7a29bfc6 100644
--- a/playwright/tests/office/txo/tooFlows.spec.js
+++ b/playwright/tests/office/txo/tooFlows.spec.js
@@ -461,16 +461,14 @@ test.describe('TOO user', () => {
// After updating, the button is disabeld and an alert is shown
await expect(page.getByTestId('modal')).not.toBeVisible();
await expect(page.locator('.shipment-heading')).toContainText('Cancellation Requested');
- await expect(
- page
- .locator('[data-testid="alert"]')
- .getByText('The request to cancel that shipment has been sent to the movers.'),
- ).toBeVisible();
+
+ const cancelAlert = page.getByText(/The request to cancel that shipment has been sent to the movers./);
+ await expect(cancelAlert).toBeVisible();
// Alert should disappear if focus changes
await page.locator('[data-testid="rejectTextButton"]').first().click();
await page.locator('[data-testid="closeRejectServiceItem"]').click();
- await expect(page.locator('[data-testid="alert"]')).not.toBeVisible();
+ await expect(cancelAlert).not.toBeVisible();
});
/**
@@ -735,15 +733,16 @@ test.describe('TOO user', () => {
await expect(page.locator('.shipment-heading')).toContainText('diversion requested');
// Check the alert message with shipment locator
- const alertText = await page.locator('[data-testid="alert"]').textContent();
+ const diversionAlert = page.getByText(/Diversion successfully requested for Shipment/);
+ const diversionAlertText = await diversionAlert.textContent();
const shipmentNumberPattern = /^Diversion successfully requested for Shipment #([A-Za-z0-9]{6}-\d{2})$/;
- const hasValidShipmentNumber = shipmentNumberPattern.test(alertText);
+ const hasValidShipmentNumber = shipmentNumberPattern.test(diversionAlertText);
expect(hasValidShipmentNumber).toBeTruthy();
// Alert should disappear if focus changes
await page.locator('[data-testid="rejectTextButton"]').first().click();
await page.locator('[data-testid="closeRejectServiceItem"]').click();
- await expect(page.locator('[data-testid="alert"]')).not.toBeVisible();
+ await expect(diversionAlert).not.toBeVisible();
});
});
diff --git a/src/components/Office/TXOTabNav/TXOTabNav.jsx b/src/components/Office/TXOTabNav/TXOTabNav.jsx
index ee7705bd391..d6e509528cd 100644
--- a/src/components/Office/TXOTabNav/TXOTabNav.jsx
+++ b/src/components/Office/TXOTabNav/TXOTabNav.jsx
@@ -53,7 +53,7 @@ const TXOTabNav = ({
moveTaskOrderTagCount += unapprovedServiceItemCount;
}
if (excessWeightRiskCount > 0) {
- moveTaskOrderTagCount += 1;
+ moveTaskOrderTagCount += excessWeightRiskCount;
}
if (unapprovedSITExtensionCount > 0) {
moveTaskOrderTagCount += unapprovedSITExtensionCount;
diff --git a/src/constants/MoveHistory/EventTemplates/AcknowledgeExcessUnaccompaniedBaggageWeightRisk/acknowledgeExcessUnaccompaniedBaggageWeightRisk.jsx b/src/constants/MoveHistory/EventTemplates/AcknowledgeExcessUnaccompaniedBaggageWeightRisk/acknowledgeExcessUnaccompaniedBaggageWeightRisk.jsx
new file mode 100644
index 00000000000..a7da5ef2b64
--- /dev/null
+++ b/src/constants/MoveHistory/EventTemplates/AcknowledgeExcessUnaccompaniedBaggageWeightRisk/acknowledgeExcessUnaccompaniedBaggageWeightRisk.jsx
@@ -0,0 +1,19 @@
+import React from 'react';
+
+import a from 'constants/MoveHistory/Database/Actions';
+import o from 'constants/MoveHistory/UIDisplay/Operations';
+import t from 'constants/MoveHistory/Database/Tables';
+import LabeledDetails from 'pages/Office/MoveHistory/LabeledDetails';
+
+export default {
+ action: a.UPDATE,
+ eventName: o.acknowledgeExcessUnaccompaniedBaggageWeightRisk,
+ tableName: t.moves,
+ getEventNameDisplay: () => 'Updated move',
+ getDetails: (historyRecord) => {
+ if (historyRecord?.changedValues?.excess_unaccompanied_baggage_weight_acknowledged_at) {
+ return 'Dismissed excess unaccompanied baggage weight alert';
+ }
+ return