From 8029ea9e707c35ad9d180c5442d0d444de09e0b4 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Tue, 23 Jan 2024 18:49:58 +0000 Subject: [PATCH 01/67] Created swagger endpoint all_moves --- pkg/gen/internalapi/configure_mymove.go | 5 + pkg/gen/internalapi/embedded_spec.go | 3859 +++++++++++++++-- .../internaloperations/moves/get_all_moves.go | 58 + .../moves/get_all_moves_parameters.go | 91 + .../moves/get_all_moves_responses.go | 194 + .../moves/get_all_moves_urlbuilder.go | 101 + .../internaloperations/mymove_api.go | 12 + pkg/gen/internalmessages/customer.go | 208 + pkg/gen/internalmessages/destination_type.go | 85 + pkg/gen/internalmessages/duty_location.go | 173 + pkg/gen/internalmessages/entitlements.go | 141 + pkg/gen/internalmessages/m_t_o_agent2.go | 306 ++ pkg/gen/internalmessages/m_t_o_agent_type2.go | 82 + pkg/gen/internalmessages/m_t_o_agents2.go | 85 + .../internalmessages/m_t_o_service_item.go | 465 ++ .../m_t_o_service_item_model_type.go | 95 + .../m_t_o_service_item_status.go | 90 + .../internalmessages/m_t_o_shipment_type2.go | 107 + .../m_t_o_shipment_without_service_items.go | 1165 +++++ ...m_t_o_shipments_without_service_objects.go | 78 + pkg/gen/internalmessages/move_task_order.go | 842 ++++ pkg/gen/internalmessages/moves_list.go | 183 + pkg/gen/internalmessages/order.go | 444 ++ pkg/gen/internalmessages/p_p_m_shipment2.go | 670 +++ pkg/gen/internalmessages/payment_request.go | 322 ++ .../payment_request_status.go | 96 + pkg/gen/internalmessages/payment_requests.go | 78 + .../internalmessages/payment_service_item.go | 266 ++ .../payment_service_item_param.go | 274 ++ .../payment_service_item_params.go | 78 + .../payment_service_item_status.go | 90 + .../internalmessages/payment_service_items.go | 78 + .../internalmessages/proof_of_service_doc.go | 121 + .../internalmessages/proof_of_service_docs.go | 78 + pkg/gen/internalmessages/reweigh.go | 280 ++ pkg/gen/internalmessages/reweigh_requester.go | 84 + pkg/gen/internalmessages/s_i_t_extension.go | 291 ++ pkg/gen/internalmessages/s_i_t_extensions.go | 78 + .../service_item_param_name.go | 270 ++ .../service_item_param_origin.go | 84 + .../service_item_param_type.go | 93 + .../service_request_document.go | 121 + .../service_request_documents.go | 78 + .../shipment_address_update.go | 315 ++ .../shipment_address_update_status.go | 90 + pkg/gen/internalmessages/storage_facility.go | 194 + .../internalmessages/upload_with_omissions.go | 276 ++ swagger-def/internal.yaml | 41 + swagger/internal.yaml | 1613 ++++++- 49 files changed, 14521 insertions(+), 407 deletions(-) create mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go create mode 100644 pkg/gen/internalmessages/customer.go create mode 100644 pkg/gen/internalmessages/destination_type.go create mode 100644 pkg/gen/internalmessages/duty_location.go create mode 100644 pkg/gen/internalmessages/entitlements.go create mode 100644 pkg/gen/internalmessages/m_t_o_agent2.go create mode 100644 pkg/gen/internalmessages/m_t_o_agent_type2.go create mode 100644 pkg/gen/internalmessages/m_t_o_agents2.go create mode 100644 pkg/gen/internalmessages/m_t_o_service_item.go create mode 100644 pkg/gen/internalmessages/m_t_o_service_item_model_type.go create mode 100644 pkg/gen/internalmessages/m_t_o_service_item_status.go create mode 100644 pkg/gen/internalmessages/m_t_o_shipment_type2.go create mode 100644 pkg/gen/internalmessages/m_t_o_shipment_without_service_items.go create mode 100644 pkg/gen/internalmessages/m_t_o_shipments_without_service_objects.go create mode 100644 pkg/gen/internalmessages/move_task_order.go create mode 100644 pkg/gen/internalmessages/moves_list.go create mode 100644 pkg/gen/internalmessages/order.go create mode 100644 pkg/gen/internalmessages/p_p_m_shipment2.go create mode 100644 pkg/gen/internalmessages/payment_request.go create mode 100644 pkg/gen/internalmessages/payment_request_status.go create mode 100644 pkg/gen/internalmessages/payment_requests.go create mode 100644 pkg/gen/internalmessages/payment_service_item.go create mode 100644 pkg/gen/internalmessages/payment_service_item_param.go create mode 100644 pkg/gen/internalmessages/payment_service_item_params.go create mode 100644 pkg/gen/internalmessages/payment_service_item_status.go create mode 100644 pkg/gen/internalmessages/payment_service_items.go create mode 100644 pkg/gen/internalmessages/proof_of_service_doc.go create mode 100644 pkg/gen/internalmessages/proof_of_service_docs.go create mode 100644 pkg/gen/internalmessages/reweigh.go create mode 100644 pkg/gen/internalmessages/reweigh_requester.go create mode 100644 pkg/gen/internalmessages/s_i_t_extension.go create mode 100644 pkg/gen/internalmessages/s_i_t_extensions.go create mode 100644 pkg/gen/internalmessages/service_item_param_name.go create mode 100644 pkg/gen/internalmessages/service_item_param_origin.go create mode 100644 pkg/gen/internalmessages/service_item_param_type.go create mode 100644 pkg/gen/internalmessages/service_request_document.go create mode 100644 pkg/gen/internalmessages/service_request_documents.go create mode 100644 pkg/gen/internalmessages/shipment_address_update.go create mode 100644 pkg/gen/internalmessages/shipment_address_update_status.go create mode 100644 pkg/gen/internalmessages/storage_facility.go create mode 100644 pkg/gen/internalmessages/upload_with_omissions.go diff --git a/pkg/gen/internalapi/configure_mymove.go b/pkg/gen/internalapi/configure_mymove.go index a5a94d9b495..465ab6df10c 100644 --- a/pkg/gen/internalapi/configure_mymove.go +++ b/pkg/gen/internalapi/configure_mymove.go @@ -192,6 +192,11 @@ func configureAPI(api *internaloperations.MymoveAPI) http.Handler { return middleware.NotImplemented("operation ppm.DeleteWeightTicket has not yet been implemented") }) } + if api.MovesGetAllMovesHandler == nil { + api.MovesGetAllMovesHandler = moves.GetAllMovesHandlerFunc(func(params moves.GetAllMovesParams) middleware.Responder { + return middleware.NotImplemented("operation moves.GetAllMoves has not yet been implemented") + }) + } if api.TransportationOfficesGetTransportationOfficesHandler == nil { api.TransportationOfficesGetTransportationOfficesHandler = transportation_offices.GetTransportationOfficesHandlerFunc(func(params transportation_offices.GetTransportationOfficesParams) middleware.Responder { return middleware.NotImplemented("operation transportation_offices.GetTransportationOffices has not yet been implemented") diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index f13223db818..0e95106c6e0 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -79,6 +79,46 @@ func init() { } } }, + "/all_moves/{serviceMemberId}": { + "get": { + "description": "Gets all moves that belongs to the serviceMember\n", + "produces": [ + "application/json" + ], + "tags": [ + "moves" + ], + "summary": "Return the current and previous moves of a service member", + "operationId": "getAllMoves", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", + "schema": { + "$ref": "#/definitions/MovesList" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, "/backup_contacts/{backupContactId}": { "get": { "description": "Returns the given service member backup contact", @@ -4296,6 +4336,53 @@ func init() { } } }, + "Customer": { + "type": "object", + "properties": { + "branch": { + "type": "string", + "example": "COAST_GUARD" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "fake@example.com" + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, "DeptIndicator": { "type": "string", "title": "Dept. indicator", @@ -4317,6 +4404,18 @@ func init() { }, "x-nullable": true }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, "Document": { "type": "object", "required": [ @@ -4343,6 +4442,32 @@ func init() { } } }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "addressID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, "DutyLocationPayload": { "type": "object", "required": [ @@ -4416,6 +4541,73 @@ func init() { } } }, + "Entitlements": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + } + } + }, "Error": { "type": "object", "required": [ @@ -4624,94 +4816,54 @@ func init() { } } }, - "MTOAgentType": { - "type": "string", - "title": "MTO Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOShipment": { + "MTOAgent-2": { + "type": "object", "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" + "agentType": { + "$ref": "#/definitions/MTOAgentType-2" }, "createdAt": { "type": "string", "format": "date-time", "readOnly": true }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, "eTag": { - "type": "string" + "type": "string", + "readOnly": true }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false + "firstName": { + "type": "string", + "x-nullable": true }, "id": { + "description": "The ID of the agent.", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "moveTaskOrderID": { + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "description": "The ID of the shipment this agent is permitted to release/receive.", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true, - "readOnly": true - }, - "requestedPickupDate": { + "phone": { "type": "string", - "format": "date", - "x-nullable": true, - "readOnly": true - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "status": { - "$ref": "#/definitions/MTOShipmentStatus" + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true }, "updatedAt": { "type": "string", @@ -4720,25 +4872,216 @@ func init() { } } }, - "MTOShipmentStatus": { + "MTOAgentType": { "type": "string", + "title": "MTO Agent Type", "enum": [ - "DRAFT", - "APPROVED", - "SUBMITTED", - "REJECTED" + "RELEASING_AGENT", + "RECEIVING_AGENT" ], - "readOnly": true + "example": "RELEASING_AGENT" }, - "MTOShipmentType": { + "MTOAgentType-2": { + "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", "type": "string", - "title": "Shipment Type", + "title": "Agent Type", "enum": [ - "HHG", - "HHG_INTO_NTS_DOMESTIC", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM" - ], + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOAgents-2": { + "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent-2" + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the service item.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this service item.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "The ID of the shipment this service is for, if any. Optional.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "The full descriptive name of the service.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "The reason why this service item was rejected by the TOO.", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "item was too heavy" + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "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\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating" + ] + }, + "MTOServiceItemStatus": { + "description": "The status of a service item, indicating where it is in the TOO's approval process.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipment": { + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true, + "readOnly": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true, + "readOnly": true + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "status": { + "$ref": "#/definitions/MTOShipmentStatus" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentStatus": { + "type": "string", + "enum": [ + "DRAFT", + "APPROVED", + "SUBMITTED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS_DOMESTIC", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM" + ], "x-display-value": { "HHG": "HHG", "INTERNATIONAL_HHG": "International HHG", @@ -4747,12 +5090,270 @@ func init() { }, "example": "HHG" }, + "MTOShipmentType-2": { + "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS_DOMESTIC` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n", + "type": "string", + "title": "Shipment Type", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS_DOMESTIC", + "HHG_OUTOF_NTS_DOMESTIC", + "INTERNATIONAL_HHG", + "INTERNATIONAL_UB", + "MOTORHOME", + "PPM" + ], + "x-display-value": { + "HHG": "Household goods move (HHG)", + "HHG_INTO_NTS_DOMESTIC": "HHG into Non-temporary storage (NTS)", + "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", + "PPM": "Personally Procured Move also known as Do It Yourself (DITY)" + }, + "example": "HHG" + }, + "MTOShipmentWithoutServiceItems": { + "type": "object", + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents-2" + }, + "approvedDate": { + "description": "The date when the Transportation Ordering Officer first approved this shipment for the move.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment-2" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "description": "The date when the Prime contractor recorded the shipment's estimated weight.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedPickupDate": { + "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requiredDeliveryDate": { + "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "reweigh": { + "$ref": "#/definitions/Reweigh" + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType-2" + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "status": { + "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, "MTOShipments": { "type": "array", "items": { "$ref": "#/definitions/MTOShipment" } }, + "MTOShipmentsWithoutServiceObjects": { + "description": "A list of shipments without their associated service items.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + }, "MethodOfReceipt": { "type": "string", "title": "Method of Receipt", @@ -5260,6 +5861,124 @@ func init() { "SUBMITTED": "Submitted" } }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "mtoShipments", + "mtoServiceItems", + "paymentRequests" + ], + "properties": { + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightUploadId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "ppmType": { + "type": "string", + "enum": [ + "PARTIAL", + "FULL" + ] + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MovesList": { + "type": "object", + "properties": { + "currentMove": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "previousMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveTaskOrder" + } + } + } + }, "MovingExpense": { "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", "type": "object", @@ -5556,6 +6275,63 @@ func init() { "x-nullable": true, "x-omitempty": false }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "rank", + "linesOfAccounting" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "linesOfAccounting": { + "type": "string" + }, + "orderNumber": { + "type": "string" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "rank": { + "type": "string", + "example": "E_5" + }, + "reportByDate": { + "type": "string", + "format": "date" + } + } + }, "OrderPayGrade": { "type": "string", "title": "Rank", @@ -5833,30 +6609,307 @@ func init() { "type": "integer", "title": "High estimate" }, - "range_min": { - "type": "integer", - "title": "Low estimate" - } - } - }, - "PPMIncentive": { - "type": "object", - "required": [ - "gcc", - "incentive_percentage" - ], - "properties": { - "gcc": { + "range_min": { + "type": "integer", + "title": "Low estimate" + } + } + }, + "PPMIncentive": { + "type": "object", + "required": [ + "gcc", + "incentive_percentage" + ], + "properties": { + "gcc": { + "type": "integer", + "title": "GCC" + }, + "incentive_percentage": { + "type": "integer", + "title": "PPM Incentive @ 95%" + } + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "pickupPostalCode", + "destinationPostalCode", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceStatus": { + "$ref": "#/definitions/PPMAdvanceStatus" + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp of when the PPM Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationPostalCode": { + "description": "The postal code of the destination location where goods are being delivered to.", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "example": "90210" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin their move.\n", + "type": "string", + "format": "date" + }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "Primary auto-generated unique identifier of the PPM shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "movingExpenses": { + "description": "All expense documentation receipt records of this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + } + }, + "pickupPostalCode": { + "description": "The postal code of the origin location where goods are being moved from.", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "example": "90210" + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightTickets": { + "description": "All pro-gear weight ticket documentation records for this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDestinationPostalCode": { + "description": "An optional secondary location near the destination where goods will be dropped off.", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "secondaryPickupPostalCode": { + "type": "string", + "format": "An optional secondary pickup location near the origin where additional goods exist.", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "signedCertification": { + "$ref": "#/definitions/SignedCertification" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", "type": "integer", - "title": "GCC" + "x-nullable": true, + "x-omitempty": false, + "example": 2000 }, - "incentive_percentage": { + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", "type": "integer", - "title": "PPM Incentive @ 95%" + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "weightTickets": { + "$ref": "#/definitions/WeightTickets" } - } + }, + "x-nullable": true }, - "PPMShipment": { + "PPMShipment-2": { "description": "A personally procured move is a type of shipment that a service member moves themselves.", "required": [ "id", @@ -5905,15 +6958,12 @@ func init() { "x-omitempty": false }, "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", + "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", "type": "integer", "format": "cents", "x-nullable": true, "x-omitempty": false }, - "advanceStatus": { - "$ref": "#/definitions/PPMAdvanceStatus" - }, "approvedAt": { "description": "The timestamp of when the shipment was approved and the service member can begin their move.", "type": "string", @@ -5922,7 +6972,7 @@ func init() { "x-omitempty": false }, "createdAt": { - "description": "Timestamp of when the PPM Shipment was initially created (UTC)", + "description": "The timestamp of when the PPM shipment was created (UTC)", "type": "string", "format": "date-time", "readOnly": true @@ -5931,7 +6981,6 @@ func init() { "description": "The postal code of the destination location where goods are being delivered to.", "type": "string", "format": "zip", - "title": "ZIP", "pattern": "^(\\d{5})$", "example": "90210" }, @@ -5948,25 +6997,17 @@ func init() { "x-omitempty": false }, "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", "type": "integer", "x-nullable": true, "x-omitempty": false, "example": 4200 }, "expectedDepartureDate": { - "description": "Date the customer expects to begin their move.\n", + "description": "Date the customer expects to begin moving from their origin.\n", "type": "string", "format": "date" }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, "hasProGear": { "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", "type": "boolean", @@ -5986,19 +7027,12 @@ func init() { "x-omitempty": false }, "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", + "description": "The primary unique identifier of this PPM shipment", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "movingExpenses": { - "description": "All expense documentation receipt records of this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - } - }, "pickupPostalCode": { "description": "The postal code of the origin location where goods are being moved from.", "type": "string", @@ -6008,18 +7042,11 @@ func init() { "example": "90210" }, "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", "x-nullable": true, "x-omitempty": false }, - "proGearWeightTickets": { - "description": "All pro-gear weight ticket documentation records for this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, "reviewedAt": { "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", "type": "string", @@ -6031,31 +7058,27 @@ func init() { "description": "An optional secondary location near the destination where goods will be dropped off.", "type": "string", "format": "zip", - "title": "ZIP", "pattern": "^(\\d{5})$", "x-nullable": true, "x-omitempty": false, "example": "90210" }, "secondaryPickupPostalCode": { + "description": "An optional secondary pickup location near the origin where additional goods exist.", "type": "string", - "format": "An optional secondary pickup location near the origin where additional goods exist.", - "title": "ZIP", + "format": "zip", "pattern": "^(\\d{5})$", "x-nullable": true, "x-omitempty": false, "example": "90210" }, "shipmentId": { - "description": "The id of the parent MTOShipment object", + "description": "The id of the parent MTOShipment record", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "signedCertification": { - "$ref": "#/definitions/SignedCertification" - }, "sitEstimatedCost": { "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", "type": "integer", @@ -6078,7 +7101,7 @@ func init() { "x-omitempty": false }, "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", + "description": "The estimated weight of the goods being put into storage in pounds.", "type": "integer", "x-nullable": true, "x-omitempty": false, @@ -6102,7 +7125,7 @@ func init() { ] }, "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", "type": "integer", "x-nullable": true, "x-omitempty": false @@ -6118,17 +7141,10 @@ func init() { "x-omitempty": false }, "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", + "description": "The timestamp of when a property of this object was last updated (UTC)", "type": "string", "format": "date-time", "readOnly": true - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "weightTickets": { - "$ref": "#/definitions/WeightTickets" } }, "x-nullable": true @@ -6349,80 +7365,254 @@ func init() { "x-nullable": true, "example": "John" }, - "last_name": { + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "personal_email": { + "type": "string", + "format": "x-email", + "title": "Personal Email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "phone_is_preferred": { + "type": "boolean", + "title": "Phone", + "x-nullable": true + }, + "rank": { + "$ref": "#/definitions/ServiceMemberRank" + }, + "residential_address": { + "$ref": "#/definitions/Address" + }, + "secondary_telephone": { + "type": "string", + "format": "telephone", + "title": "Alternate Phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "suffix": { + "type": "string", + "title": "Suffix", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best Contact Phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PaymentMethodsTotals": { + "type": "object", + "properties": { + "GTCC": { + "type": "integer" + }, + "MIL_PAY": { + "type": "integer" + }, + "OTHER": { + "type": "integer" + } + } + }, + "PaymentRequest": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "paymentServiceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "RECEIVED_BY_GEX", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, - "middle_name": { + "mtoServiceItemID": { "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, - "personal_email": { + "paymentRequestID": { "type": "string", - "format": "x-email", - "title": "Personal Email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, - "phone_is_preferred": { - "type": "boolean", - "title": "Phone", - "x-nullable": true + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" }, - "rank": { - "$ref": "#/definitions/ServiceMemberRank" + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true }, - "residential_address": { - "$ref": "#/definitions/Address" + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" }, - "secondary_telephone": { + "rejectionReason": { "type": "string", - "format": "telephone", - "title": "Alternate Phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", "x-nullable": true, - "example": "212-555-5555" + "example": "documentation was incomplete" }, - "suffix": { + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { "type": "string", - "title": "Suffix", - "x-nullable": true, - "example": "Jr." + "readOnly": true }, - "telephone": { + "id": { "type": "string", - "format": "telephone", - "title": "Best Contact Phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, - "user_id": { + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { "type": "string", "format": "uuid", "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PaymentMethodsTotals": { - "type": "object", - "properties": { - "GTCC": { - "type": "integer" }, - "MIL_PAY": { - "type": "integer" + "type": { + "$ref": "#/definitions/ServiceItemParamType" }, - "OTHER": { - "type": "integer" + "value": { + "type": "string", + "example": "3025" } } }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, "PersonallyProcuredMovePayload": { "type": "object", "required": [ @@ -6721,6 +7911,23 @@ func init() { } } }, + "ProofOfServiceDoc": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, "RateEnginePostalCodePayload": { "type": "object", "required": [ @@ -6796,6 +8003,70 @@ func init() { ], "x-nullable": true }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the Prime" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, "Role": { "type": "object", "required": [ @@ -6824,6 +8095,88 @@ func init() { } } }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, "SITLocationType": { "description": "The list of SIT location types.", "type": "string", @@ -6855,6 +8208,98 @@ func init() { } } }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, "ServiceMemberBackupContactPayload": { "type": "object", "required": [ @@ -7108,7 +8553,88 @@ func init() { "W_4": "W-4", "W_5": "W-5" }, - "x-nullable": true + "x-nullable": true + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ServiceRequestDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a destination address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true }, "SignedCertification": { "description": "Signed certification", @@ -7266,6 +8792,43 @@ func init() { "$ref": "#/definitions/SignedCertificationPayload" } }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, "SubmitMoveForApprovalPayload": { "type": "object", "properties": { @@ -7863,6 +9426,57 @@ func init() { } } }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, "ValidationError": { "required": [ "invalidFields" @@ -8316,6 +9930,55 @@ func init() { } } }, + "/all_moves/{serviceMemberId}": { + "get": { + "description": "Gets all moves that belongs to the serviceMember\n", + "produces": [ + "application/json" + ], + "tags": [ + "moves" + ], + "summary": "Return the current and previous moves of a service member", + "operationId": "getAllMoves", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", + "schema": { + "$ref": "#/definitions/MovesList" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, "/backup_contacts/{backupContactId}": { "get": { "description": "Returns the given service member backup contact", @@ -12954,6 +14617,53 @@ func init() { } } }, + "Customer": { + "type": "object", + "properties": { + "branch": { + "type": "string", + "example": "COAST_GUARD" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "fake@example.com" + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, "DeptIndicator": { "type": "string", "title": "Dept. indicator", @@ -12975,6 +14685,18 @@ func init() { }, "x-nullable": true }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, "Document": { "type": "object", "required": [ @@ -13001,6 +14723,32 @@ func init() { } } }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "addressID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, "DutyLocationPayload": { "type": "object", "required": [ @@ -13066,10 +14814,77 @@ func init() { "x-nullable": true, "example": 2000 }, - "proGearSpouse": { - "description": "Spouse's pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by rank\n", + "proGearSpouse": { + "description": "Spouse's pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by rank\n", + "type": "integer", + "x-nullable": true, + "example": 500 + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { "type": "integer", - "x-nullable": true, + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", "example": 500 } } @@ -13282,6 +15097,62 @@ func init() { } } }, + "MTOAgent-2": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType-2" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "description": "The ID of the agent.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "description": "The ID of the shipment this agent is permitted to release/receive.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, "MTOAgentType": { "type": "string", "title": "MTO Agent Type", @@ -13291,16 +15162,272 @@ func init() { ], "example": "RELEASING_AGENT" }, + "MTOAgentType-2": { + "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", + "type": "string", + "title": "Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, "MTOAgents": { "type": "array", "items": { "$ref": "#/definitions/MTOAgent" } }, + "MTOAgents-2": { + "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent-2" + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the service item.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this service item.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "The ID of the shipment this service is for, if any. Optional.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "The full descriptive name of the service.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "The reason why this service item was rejected by the TOO.", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "item was too heavy" + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "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\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating" + ] + }, + "MTOServiceItemStatus": { + "description": "The status of a service item, indicating where it is in the TOO's approval process.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ], + "readOnly": true + }, "MTOShipment": { "properties": { "agents": { - "$ref": "#/definitions/MTOAgents" + "$ref": "#/definitions/MTOAgents" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true, + "readOnly": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true, + "readOnly": true + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "status": { + "$ref": "#/definitions/MTOShipmentStatus" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentStatus": { + "type": "string", + "enum": [ + "DRAFT", + "APPROVED", + "SUBMITTED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS_DOMESTIC", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM" + ], + "x-display-value": { + "HHG": "HHG", + "INTERNATIONAL_HHG": "International HHG", + "INTERNATIONAL_UB": "International UB", + "PPM": "PPM" + }, + "example": "HHG" + }, + "MTOShipmentType-2": { + "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS_DOMESTIC` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n", + "type": "string", + "title": "Shipment Type", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS_DOMESTIC", + "HHG_OUTOF_NTS_DOMESTIC", + "INTERNATIONAL_HHG", + "INTERNATIONAL_UB", + "MOTORHOME", + "PPM" + ], + "x-display-value": { + "HHG": "Household goods move (HHG)", + "HHG_INTO_NTS_DOMESTIC": "HHG into Non-temporary storage (NTS)", + "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", + "PPM": "Personally Procured Move also known as Do It Yourself (DITY)" + }, + "example": "HHG" + }, + "MTOShipmentWithoutServiceItems": { + "type": "object", + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents-2" + }, + "approvedDate": { + "description": "The date when the Transportation Ordering Officer first approved this shipment for the move.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" }, "createdAt": { "type": "string", @@ -13308,68 +15435,185 @@ func init() { "readOnly": true }, "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", "type": "string", "x-nullable": true, "readOnly": true, "example": "handle with care" }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, "destinationAddress": { - "$ref": "#/definitions/Address" + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, - "eTag": { - "type": "string" + "destinationType": { + "$ref": "#/definitions/DestinationType" }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" }, - "hasSecondaryPickupAddress": { - "type": "boolean", + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", "x-nullable": true, "x-omitempty": false }, "id": { + "description": "The ID of the shipment.", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, "moveTaskOrderID": { + "description": "The ID of the move for this shipment.", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, "pickupAddress": { - "$ref": "#/definitions/Address" + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" }, "ppmShipment": { - "$ref": "#/definitions/PPMShipment" + "$ref": "#/definitions/PPMShipment-2" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "description": "The date when the Prime contractor recorded the shipment's estimated weight.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true }, "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.", "type": "string", "format": "date", "x-nullable": true, + "x-omitempty": false, "readOnly": true }, "requestedPickupDate": { + "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requiredDeliveryDate": { + "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", "type": "string", "format": "date", "x-nullable": true, + "x-omitempty": false, "readOnly": true }, + "reweigh": { + "$ref": "#/definitions/Reweigh" + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "secondaryPickupAddress": { - "$ref": "#/definitions/Address" + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] }, "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" + "$ref": "#/definitions/MTOShipmentType-2" + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" }, "status": { - "$ref": "#/definitions/MTOShipmentStatus" + "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] }, "updatedAt": { "type": "string", @@ -13378,39 +15622,19 @@ func init() { } } }, - "MTOShipmentStatus": { - "type": "string", - "enum": [ - "DRAFT", - "APPROVED", - "SUBMITTED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipmentType": { - "type": "string", - "title": "Shipment Type", - "enum": [ - "HHG", - "HHG_INTO_NTS_DOMESTIC", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM" - ], - "x-display-value": { - "HHG": "HHG", - "INTERNATIONAL_HHG": "International HHG", - "INTERNATIONAL_UB": "International UB", - "PPM": "PPM" - }, - "example": "HHG" - }, "MTOShipments": { "type": "array", "items": { "$ref": "#/definitions/MTOShipment" } }, + "MTOShipmentsWithoutServiceObjects": { + "description": "A list of shipments without their associated service items.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + }, "MethodOfReceipt": { "type": "string", "title": "Method of Receipt", @@ -13920,6 +16144,124 @@ func init() { "SUBMITTED": "Submitted" } }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "mtoShipments", + "mtoServiceItems", + "paymentRequests" + ], + "properties": { + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightUploadId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "ppmType": { + "type": "string", + "enum": [ + "PARTIAL", + "FULL" + ] + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MovesList": { + "type": "object", + "properties": { + "currentMove": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "previousMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveTaskOrder" + } + } + } + }, "MovingExpense": { "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", "type": "object", @@ -14216,6 +16558,63 @@ func init() { "x-nullable": true, "x-omitempty": false }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "rank", + "linesOfAccounting" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "linesOfAccounting": { + "type": "string" + }, + "orderNumber": { + "type": "string" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "rank": { + "type": "string", + "example": "E_5" + }, + "reportByDate": { + "type": "string", + "format": "date" + } + } + }, "OrderPayGrade": { "type": "string", "title": "Rank", @@ -14493,30 +16892,307 @@ func init() { "type": "integer", "title": "High estimate" }, - "range_min": { - "type": "integer", - "title": "Low estimate" - } - } - }, - "PPMIncentive": { - "type": "object", - "required": [ - "gcc", - "incentive_percentage" - ], - "properties": { - "gcc": { + "range_min": { + "type": "integer", + "title": "Low estimate" + } + } + }, + "PPMIncentive": { + "type": "object", + "required": [ + "gcc", + "incentive_percentage" + ], + "properties": { + "gcc": { + "type": "integer", + "title": "GCC" + }, + "incentive_percentage": { + "type": "integer", + "title": "PPM Incentive @ 95%" + } + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "pickupPostalCode", + "destinationPostalCode", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceStatus": { + "$ref": "#/definitions/PPMAdvanceStatus" + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp of when the PPM Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationPostalCode": { + "description": "The postal code of the destination location where goods are being delivered to.", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "example": "90210" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin their move.\n", + "type": "string", + "format": "date" + }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "Primary auto-generated unique identifier of the PPM shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "movingExpenses": { + "description": "All expense documentation receipt records of this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + } + }, + "pickupPostalCode": { + "description": "The postal code of the origin location where goods are being moved from.", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "example": "90210" + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightTickets": { + "description": "All pro-gear weight ticket documentation records for this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDestinationPostalCode": { + "description": "An optional secondary location near the destination where goods will be dropped off.", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "secondaryPickupPostalCode": { + "type": "string", + "format": "An optional secondary pickup location near the origin where additional goods exist.", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "signedCertification": { + "$ref": "#/definitions/SignedCertification" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", "type": "integer", - "title": "GCC" + "x-nullable": true, + "x-omitempty": false, + "example": 2000 }, - "incentive_percentage": { + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", "type": "integer", - "title": "PPM Incentive @ 95%" + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "weightTickets": { + "$ref": "#/definitions/WeightTickets" } - } + }, + "x-nullable": true }, - "PPMShipment": { + "PPMShipment-2": { "description": "A personally procured move is a type of shipment that a service member moves themselves.", "required": [ "id", @@ -14565,15 +17241,12 @@ func init() { "x-omitempty": false }, "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", + "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", "type": "integer", "format": "cents", "x-nullable": true, "x-omitempty": false }, - "advanceStatus": { - "$ref": "#/definitions/PPMAdvanceStatus" - }, "approvedAt": { "description": "The timestamp of when the shipment was approved and the service member can begin their move.", "type": "string", @@ -14582,7 +17255,7 @@ func init() { "x-omitempty": false }, "createdAt": { - "description": "Timestamp of when the PPM Shipment was initially created (UTC)", + "description": "The timestamp of when the PPM shipment was created (UTC)", "type": "string", "format": "date-time", "readOnly": true @@ -14591,7 +17264,6 @@ func init() { "description": "The postal code of the destination location where goods are being delivered to.", "type": "string", "format": "zip", - "title": "ZIP", "pattern": "^(\\d{5})$", "example": "90210" }, @@ -14608,25 +17280,17 @@ func init() { "x-omitempty": false }, "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", "type": "integer", "x-nullable": true, "x-omitempty": false, "example": 4200 }, "expectedDepartureDate": { - "description": "Date the customer expects to begin their move.\n", + "description": "Date the customer expects to begin moving from their origin.\n", "type": "string", "format": "date" }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, "hasProGear": { "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", "type": "boolean", @@ -14646,19 +17310,12 @@ func init() { "x-omitempty": false }, "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", + "description": "The primary unique identifier of this PPM shipment", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "movingExpenses": { - "description": "All expense documentation receipt records of this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - } - }, "pickupPostalCode": { "description": "The postal code of the origin location where goods are being moved from.", "type": "string", @@ -14668,18 +17325,11 @@ func init() { "example": "90210" }, "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", "type": "integer", "x-nullable": true, "x-omitempty": false }, - "proGearWeightTickets": { - "description": "All pro-gear weight ticket documentation records for this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, "reviewedAt": { "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", "type": "string", @@ -14691,31 +17341,27 @@ func init() { "description": "An optional secondary location near the destination where goods will be dropped off.", "type": "string", "format": "zip", - "title": "ZIP", "pattern": "^(\\d{5})$", "x-nullable": true, "x-omitempty": false, "example": "90210" }, "secondaryPickupPostalCode": { + "description": "An optional secondary pickup location near the origin where additional goods exist.", "type": "string", - "format": "An optional secondary pickup location near the origin where additional goods exist.", - "title": "ZIP", + "format": "zip", "pattern": "^(\\d{5})$", "x-nullable": true, "x-omitempty": false, "example": "90210" }, "shipmentId": { - "description": "The id of the parent MTOShipment object", + "description": "The id of the parent MTOShipment record", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "signedCertification": { - "$ref": "#/definitions/SignedCertification" - }, "sitEstimatedCost": { "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", "type": "integer", @@ -14738,7 +17384,7 @@ func init() { "x-omitempty": false }, "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", + "description": "The estimated weight of the goods being put into storage in pounds.", "type": "integer", "x-nullable": true, "x-omitempty": false, @@ -14762,7 +17408,7 @@ func init() { ] }, "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", "type": "integer", "x-nullable": true, "x-omitempty": false @@ -14778,17 +17424,10 @@ func init() { "x-omitempty": false }, "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", + "description": "The timestamp of when a property of this object was last updated (UTC)", "type": "string", "format": "date-time", "readOnly": true - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "weightTickets": { - "$ref": "#/definitions/WeightTickets" } }, "x-nullable": true @@ -15085,6 +17724,180 @@ func init() { } } }, + "PaymentRequest": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "paymentServiceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "RECEIVED_BY_GEX", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, "PersonallyProcuredMovePayload": { "type": "object", "required": [ @@ -15386,6 +18199,23 @@ func init() { } } }, + "ProofOfServiceDoc": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, "RateEnginePostalCodePayload": { "type": "object", "required": [ @@ -15461,6 +18291,70 @@ func init() { ], "x-nullable": true }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the Prime" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, "Role": { "type": "object", "required": [ @@ -15489,6 +18383,88 @@ func init() { } } }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, "SITLocationType": { "description": "The list of SIT location types.", "type": "string", @@ -15520,6 +18496,98 @@ func init() { } } }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, "ServiceMemberBackupContactPayload": { "type": "object", "required": [ @@ -15775,6 +18843,87 @@ func init() { }, "x-nullable": true }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ServiceRequestDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a destination address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, "SignedCertification": { "description": "Signed certification", "type": "object", @@ -15931,6 +19080,43 @@ func init() { "$ref": "#/definitions/SignedCertificationPayload" } }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, "SubmitMoveForApprovalPayload": { "type": "object", "properties": { @@ -16536,6 +19722,57 @@ func init() { } } }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, "ValidationError": { "required": [ "invalidFields" diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go new file mode 100644 index 00000000000..8ea11457d43 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// 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" +) + +// GetAllMovesHandlerFunc turns a function with the right signature into a get all moves handler +type GetAllMovesHandlerFunc func(GetAllMovesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetAllMovesHandlerFunc) Handle(params GetAllMovesParams) middleware.Responder { + return fn(params) +} + +// GetAllMovesHandler interface for that can handle valid get all moves params +type GetAllMovesHandler interface { + Handle(GetAllMovesParams) middleware.Responder +} + +// NewGetAllMoves creates a new http.Handler for the get all moves operation +func NewGetAllMoves(ctx *middleware.Context, handler GetAllMovesHandler) *GetAllMoves { + return &GetAllMoves{Context: ctx, Handler: handler} +} + +/* + GetAllMoves swagger:route GET /all_moves/{serviceMemberId} moves getAllMoves + +# Return the current and previous moves of a service member + +Gets all moves that belongs to the serviceMember +*/ +type GetAllMoves struct { + Context *middleware.Context + Handler GetAllMovesHandler +} + +func (o *GetAllMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetAllMovesParams() + 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/internalapi/internaloperations/moves/get_all_moves_parameters.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go new file mode 100644 index 00000000000..dc7953b2274 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// 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" +) + +// NewGetAllMovesParams creates a new GetAllMovesParams object +// +// There are no default values defined in the spec. +func NewGetAllMovesParams() GetAllMovesParams { + + return GetAllMovesParams{} +} + +// GetAllMovesParams contains all the bound params for the get all moves operation +// typically these are obtained from a http.Request +// +// swagger:parameters getAllMoves +type GetAllMovesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the service member + Required: true + In: path + */ + ServiceMemberID 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 NewGetAllMovesParams() beforehand. +func (o *GetAllMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") + if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindServiceMemberID binds and validates parameter ServiceMemberID from path. +func (o *GetAllMovesParams) bindServiceMemberID(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("serviceMemberId", "path", "strfmt.UUID", raw) + } + o.ServiceMemberID = *(value.(*strfmt.UUID)) + + if err := o.validateServiceMemberID(formats); err != nil { + return err + } + + return nil +} + +// validateServiceMemberID carries on validations for parameter ServiceMemberID +func (o *GetAllMovesParams) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go new file mode 100644 index 00000000000..f6f638eee3f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// 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/internalmessages" +) + +// GetAllMovesOKCode is the HTTP code returned for type GetAllMovesOK +const GetAllMovesOKCode int = 200 + +/* +GetAllMovesOK Successfully retrieved moves. A successful fetch might still return zero moves. + +swagger:response getAllMovesOK +*/ +type GetAllMovesOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovesList `json:"body,omitempty"` +} + +// NewGetAllMovesOK creates GetAllMovesOK with default headers values +func NewGetAllMovesOK() *GetAllMovesOK { + + return &GetAllMovesOK{} +} + +// WithPayload adds the payload to the get all moves o k response +func (o *GetAllMovesOK) WithPayload(payload *internalmessages.MovesList) *GetAllMovesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all moves o k response +func (o *GetAllMovesOK) SetPayload(payload *internalmessages.MovesList) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllMovesOK) 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 + } + } +} + +// GetAllMovesUnauthorizedCode is the HTTP code returned for type GetAllMovesUnauthorized +const GetAllMovesUnauthorizedCode int = 401 + +/* +GetAllMovesUnauthorized The request was denied. + +swagger:response getAllMovesUnauthorized +*/ +type GetAllMovesUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetAllMovesUnauthorized creates GetAllMovesUnauthorized with default headers values +func NewGetAllMovesUnauthorized() *GetAllMovesUnauthorized { + + return &GetAllMovesUnauthorized{} +} + +// WithPayload adds the payload to the get all moves unauthorized response +func (o *GetAllMovesUnauthorized) WithPayload(payload *internalmessages.ClientError) *GetAllMovesUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all moves unauthorized response +func (o *GetAllMovesUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllMovesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetAllMovesForbiddenCode is the HTTP code returned for type GetAllMovesForbidden +const GetAllMovesForbiddenCode int = 403 + +/* +GetAllMovesForbidden The request was denied. + +swagger:response getAllMovesForbidden +*/ +type GetAllMovesForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetAllMovesForbidden creates GetAllMovesForbidden with default headers values +func NewGetAllMovesForbidden() *GetAllMovesForbidden { + + return &GetAllMovesForbidden{} +} + +// WithPayload adds the payload to the get all moves forbidden response +func (o *GetAllMovesForbidden) WithPayload(payload *internalmessages.ClientError) *GetAllMovesForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all moves forbidden response +func (o *GetAllMovesForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllMovesForbidden) 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 + } + } +} + +// GetAllMovesInternalServerErrorCode is the HTTP code returned for type GetAllMovesInternalServerError +const GetAllMovesInternalServerErrorCode int = 500 + +/* +GetAllMovesInternalServerError A server error occurred. + +swagger:response getAllMovesInternalServerError +*/ +type GetAllMovesInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewGetAllMovesInternalServerError creates GetAllMovesInternalServerError with default headers values +func NewGetAllMovesInternalServerError() *GetAllMovesInternalServerError { + + return &GetAllMovesInternalServerError{} +} + +// WithPayload adds the payload to the get all moves internal server error response +func (o *GetAllMovesInternalServerError) WithPayload(payload *internalmessages.Error) *GetAllMovesInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all moves internal server error response +func (o *GetAllMovesInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllMovesInternalServerError) 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/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go new file mode 100644 index 00000000000..24cb4d4346f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// 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" +) + +// GetAllMovesURL generates an URL for the get all moves operation +type GetAllMovesURL struct { + ServiceMemberID 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 *GetAllMovesURL) WithBasePath(bp string) *GetAllMovesURL { + 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 *GetAllMovesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetAllMovesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/all_moves/{serviceMemberId}" + + serviceMemberID := o.ServiceMemberID.String() + if serviceMemberID != "" { + _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) + } else { + return nil, errors.New("serviceMemberId is required on GetAllMovesURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _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 *GetAllMovesURL) 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 *GetAllMovesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetAllMovesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetAllMovesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetAllMovesURL") + } + + 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 *GetAllMovesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/mymove_api.go b/pkg/gen/internalapi/internaloperations/mymove_api.go index f7ee6bd6355..0a908162c78 100644 --- a/pkg/gen/internalapi/internaloperations/mymove_api.go +++ b/pkg/gen/internalapi/internaloperations/mymove_api.go @@ -141,6 +141,9 @@ func NewMymoveAPI(spec *loads.Document) *MymoveAPI { PpmDeleteWeightTicketHandler: ppm.DeleteWeightTicketHandlerFunc(func(params ppm.DeleteWeightTicketParams) middleware.Responder { return middleware.NotImplemented("operation ppm.DeleteWeightTicket has not yet been implemented") }), + MovesGetAllMovesHandler: moves.GetAllMovesHandlerFunc(func(params moves.GetAllMovesParams) middleware.Responder { + return middleware.NotImplemented("operation moves.GetAllMoves has not yet been implemented") + }), TransportationOfficesGetTransportationOfficesHandler: transportation_offices.GetTransportationOfficesHandlerFunc(func(params transportation_offices.GetTransportationOfficesParams) middleware.Responder { return middleware.NotImplemented("operation transportation_offices.GetTransportationOffices has not yet been implemented") }), @@ -373,6 +376,8 @@ type MymoveAPI struct { UploadsDeleteUploadsHandler uploads.DeleteUploadsHandler // PpmDeleteWeightTicketHandler sets the operation handler for the delete weight ticket operation PpmDeleteWeightTicketHandler ppm.DeleteWeightTicketHandler + // MovesGetAllMovesHandler sets the operation handler for the get all moves operation + MovesGetAllMovesHandler moves.GetAllMovesHandler // TransportationOfficesGetTransportationOfficesHandler sets the operation handler for the get transportation offices operation TransportationOfficesGetTransportationOfficesHandler transportation_offices.GetTransportationOfficesHandler // EntitlementsIndexEntitlementsHandler sets the operation handler for the index entitlements operation @@ -621,6 +626,9 @@ func (o *MymoveAPI) Validate() error { if o.PpmDeleteWeightTicketHandler == nil { unregistered = append(unregistered, "ppm.DeleteWeightTicketHandler") } + if o.MovesGetAllMovesHandler == nil { + unregistered = append(unregistered, "moves.GetAllMovesHandler") + } if o.TransportationOfficesGetTransportationOfficesHandler == nil { unregistered = append(unregistered, "transportation_offices.GetTransportationOfficesHandler") } @@ -951,6 +959,10 @@ func (o *MymoveAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } + o.handlers["GET"]["/all_moves/{serviceMemberId}"] = moves.NewGetAllMoves(o.context, o.MovesGetAllMovesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } o.handlers["GET"]["/transportation-offices"] = transportation_offices.NewGetTransportationOffices(o.context, o.TransportationOfficesGetTransportationOfficesHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) diff --git a/pkg/gen/internalmessages/customer.go b/pkg/gen/internalmessages/customer.go new file mode 100644 index 00000000000..f9093b9eb58 --- /dev/null +++ b/pkg/gen/internalmessages/customer.go @@ -0,0 +1,208 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Customer customer +// +// swagger:model Customer +type Customer struct { + + // branch + // Example: COAST_GUARD + Branch string `json:"branch,omitempty"` + + // current address + CurrentAddress *Address `json:"currentAddress,omitempty"` + + // dod ID + DodID string `json:"dodID,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Example: fake@example.com + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email string `json:"email,omitempty"` + + // first name + // Example: Vanya + FirstName string `json:"firstName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + // Example: Petrovna + LastName string `json:"lastName,omitempty"` + + // phone + Phone string `json:"phone,omitempty"` + + // user ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UserID strfmt.UUID `json:"userID,omitempty"` +} + +// Validate validates this customer +func (m *Customer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCurrentAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Customer) validateCurrentAddress(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentAddress) { // not required + return nil + } + + if m.CurrentAddress != nil { + if err := m.CurrentAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("currentAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("currentAddress") + } + return err + } + } + + return nil +} + +func (m *Customer) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *Customer) 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 *Customer) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("userID", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this customer based on the context it is used +func (m *Customer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCurrentAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Customer) contextValidateCurrentAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.CurrentAddress != nil { + + if swag.IsZero(m.CurrentAddress) { // not required + return nil + } + + if err := m.CurrentAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("currentAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("currentAddress") + } + return err + } + } + + return nil +} + +func (m *Customer) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Customer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Customer) UnmarshalBinary(b []byte) error { + var res Customer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/destination_type.go b/pkg/gen/internalmessages/destination_type.go new file mode 100644 index 00000000000..d15212a21fe --- /dev/null +++ b/pkg/gen/internalmessages/destination_type.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// DestinationType Destination Type +// Example: OTHER_THAN_AUTHORIZED +// +// swagger:model DestinationType +type DestinationType string + +func NewDestinationType(value DestinationType) *DestinationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated DestinationType. +func (m DestinationType) Pointer() *DestinationType { + return &m +} + +const ( + + // DestinationTypeHOMEOFRECORD captures enum value "HOME_OF_RECORD" + DestinationTypeHOMEOFRECORD DestinationType = "HOME_OF_RECORD" + + // DestinationTypeHOMEOFSELECTION captures enum value "HOME_OF_SELECTION" + DestinationTypeHOMEOFSELECTION DestinationType = "HOME_OF_SELECTION" + + // DestinationTypePLACEENTEREDACTIVEDUTY captures enum value "PLACE_ENTERED_ACTIVE_DUTY" + DestinationTypePLACEENTEREDACTIVEDUTY DestinationType = "PLACE_ENTERED_ACTIVE_DUTY" + + // DestinationTypeOTHERTHANAUTHORIZED captures enum value "OTHER_THAN_AUTHORIZED" + DestinationTypeOTHERTHANAUTHORIZED DestinationType = "OTHER_THAN_AUTHORIZED" +) + +// for schema +var destinationTypeEnum []interface{} + +func init() { + var res []DestinationType + if err := json.Unmarshal([]byte(`["HOME_OF_RECORD","HOME_OF_SELECTION","PLACE_ENTERED_ACTIVE_DUTY","OTHER_THAN_AUTHORIZED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + destinationTypeEnum = append(destinationTypeEnum, v) + } +} + +func (m DestinationType) validateDestinationTypeEnum(path, location string, value DestinationType) error { + if err := validate.EnumCase(path, location, value, destinationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this destination type +func (m DestinationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateDestinationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this destination type based on context it is used +func (m DestinationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/duty_location.go b/pkg/gen/internalmessages/duty_location.go new file mode 100644 index 00000000000..759ecb63d2c --- /dev/null +++ b/pkg/gen/internalmessages/duty_location.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DutyLocation duty location +// +// swagger:model DutyLocation +type DutyLocation struct { + + // address + Address *Address `json:"address,omitempty"` + + // address ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + AddressID strfmt.UUID `json:"addressID,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // name + // Example: Fort Bragg North Station + Name string `json:"name,omitempty"` +} + +// Validate validates this duty location +func (m *DutyLocation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAddressID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DutyLocation) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *DutyLocation) validateAddressID(formats strfmt.Registry) error { + if swag.IsZero(m.AddressID) { // not required + return nil + } + + if err := validate.FormatOf("addressID", "body", "uuid", m.AddressID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DutyLocation) 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 +} + +// ContextValidate validate this duty location based on the context it is used +func (m *DutyLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DutyLocation) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *DutyLocation) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DutyLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DutyLocation) UnmarshalBinary(b []byte) error { + var res DutyLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/entitlements.go b/pkg/gen/internalmessages/entitlements.go new file mode 100644 index 00000000000..65873a5ca10 --- /dev/null +++ b/pkg/gen/internalmessages/entitlements.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Entitlements entitlements +// +// swagger:model Entitlements +type Entitlements struct { + + // authorized weight + // Example: 2000 + AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` + + // dependents authorized + // Example: true + DependentsAuthorized *bool `json:"dependentsAuthorized,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 571008b1-b0de-454d-b843-d71be9f02c04 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // non temporary storage + // Example: false + NonTemporaryStorage *bool `json:"nonTemporaryStorage,omitempty"` + + // organizational clothing and individual equipment + // Example: false + OrganizationalClothingAndIndividualEquipment bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` + + // privately owned vehicle + // Example: false + PrivatelyOwnedVehicle *bool `json:"privatelyOwnedVehicle,omitempty"` + + // pro gear weight + // Example: 2000 + ProGearWeight int64 `json:"proGearWeight,omitempty"` + + // pro gear weight spouse + // Example: 500 + ProGearWeightSpouse int64 `json:"proGearWeightSpouse,omitempty"` + + // required medical equipment weight + // Example: 500 + RequiredMedicalEquipmentWeight int64 `json:"requiredMedicalEquipmentWeight,omitempty"` + + // storage in transit + // Example: 90 + StorageInTransit int64 `json:"storageInTransit,omitempty"` + + // total dependents + // Example: 2 + TotalDependents int64 `json:"totalDependents,omitempty"` + + // total weight + // Example: 500 + TotalWeight int64 `json:"totalWeight,omitempty"` +} + +// Validate validates this entitlements +func (m *Entitlements) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Entitlements) 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 +} + +// ContextValidate validate this entitlements based on the context it is used +func (m *Entitlements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Entitlements) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Entitlements) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Entitlements) UnmarshalBinary(b []byte) error { + var res Entitlements + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_agent2.go b/pkg/gen/internalmessages/m_t_o_agent2.go new file mode 100644 index 00000000000..e24b7178425 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_agent2.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgent2 m t o agent 2 +// +// swagger:model MTOAgent-2 +type MTOAgent2 struct { + + // agent type + AgentType MTOAgentType2 `json:"agentType,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$ + Email *string `json:"email,omitempty"` + + // first name + FirstName *string `json:"firstName,omitempty"` + + // The ID of the agent. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + LastName *string `json:"lastName,omitempty"` + + // The ID of the shipment this agent is permitted to release/receive. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // phone + // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ + Phone *string `json:"phone,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o agent 2 +func (m *MTOAgent2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOAgent2) validateAgentType(formats strfmt.Registry) error { + if swag.IsZero(m.AgentType) { // not required + return nil + } + + if err := m.AgentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentType") + } + return err + } + + return nil +} + +func (m *MTOAgent2) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent2) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent2) 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 *MTOAgent2) 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 *MTOAgent2) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent2) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o agent 2 based on the context it is used +func (m *MTOAgent2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + 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.contextValidateMtoShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOAgent2) contextValidateAgentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.AgentType) { // not required + return nil + } + + if err := m.AgentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentType") + } + return err + } + + return nil +} + +func (m *MTOAgent2) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent2) 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 *MTOAgent2) 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 *MTOAgent2) contextValidateMtoShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "mtoShipmentID", "body", strfmt.UUID(m.MtoShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent2) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOAgent2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOAgent2) UnmarshalBinary(b []byte) error { + var res MTOAgent2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_agent_type2.go b/pkg/gen/internalmessages/m_t_o_agent_type2.go new file mode 100644 index 00000000000..f3ac5993211 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_agent_type2.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOAgentType2 Agent Type +// +// The type for this agent. `RELEASING` means they have authority on pickup, `RECEIVING` means they can receive the shipment on delivery. +// +// Example: RELEASING_AGENT +// +// swagger:model MTOAgentType-2 +type MTOAgentType2 string + +func NewMTOAgentType2(value MTOAgentType2) *MTOAgentType2 { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOAgentType2. +func (m MTOAgentType2) Pointer() *MTOAgentType2 { + return &m +} + +const ( + + // MTOAgentType2RELEASINGAGENT captures enum value "RELEASING_AGENT" + MTOAgentType2RELEASINGAGENT MTOAgentType2 = "RELEASING_AGENT" + + // MTOAgentType2RECEIVINGAGENT captures enum value "RECEIVING_AGENT" + MTOAgentType2RECEIVINGAGENT MTOAgentType2 = "RECEIVING_AGENT" +) + +// for schema +var mTOAgentType2Enum []interface{} + +func init() { + var res []MTOAgentType2 + if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOAgentType2Enum = append(mTOAgentType2Enum, v) + } +} + +func (m MTOAgentType2) validateMTOAgentType2Enum(path, location string, value MTOAgentType2) error { + if err := validate.EnumCase(path, location, value, mTOAgentType2Enum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o agent type 2 +func (m MTOAgentType2) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOAgentType2Enum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o agent type 2 based on context it is used +func (m MTOAgentType2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_agents2.go b/pkg/gen/internalmessages/m_t_o_agents2.go new file mode 100644 index 00000000000..5bec41e9499 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_agents2.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgents2 A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment. +// +// swagger:model MTOAgents-2 +type MTOAgents2 []*MTOAgent2 + +// Validate validates this m t o agents 2 +func (m MTOAgents2) Validate(formats strfmt.Registry) error { + var res []error + + iMTOAgents2Size := int64(len(m)) + + if err := validate.MaxItems("", "body", iMTOAgents2Size, 2); err != nil { + return err + } + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o agents 2 based on the context it is used +func (m MTOAgents2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_service_item.go b/pkg/gen/internalmessages/m_t_o_service_item.go new file mode 100644 index 00000000000..e5c0918e820 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_service_item.go @@ -0,0 +1,465 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// 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" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItem MTOServiceItem describes a base type of a service item. Polymorphic type. +// +// swagger:discriminator MTOServiceItem modelType +type MTOServiceItem interface { + runtime.Validatable + runtime.ContextValidatable + + // A hash unique to this service item that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag() string + SetETag(string) + + // The ID of the service item. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID() strfmt.UUID + SetID(strfmt.UUID) + + // model type + // Required: true + ModelType() MTOServiceItemModelType + SetModelType(MTOServiceItemModelType) + + // The ID of the move for this service item. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveTaskOrderID() *strfmt.UUID + SetMoveTaskOrderID(*strfmt.UUID) + + // The ID of the shipment this service is for, if any. Optional. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID() strfmt.UUID + SetMtoShipmentID(strfmt.UUID) + + // The full descriptive name of the service. + // Read Only: true + ReServiceName() string + SetReServiceName(string) + + // The reason why this service item was rejected by the TOO. + // Example: item was too heavy + // Read Only: true + RejectionReason() *string + SetRejectionReason(*string) + + // service request documents + ServiceRequestDocuments() ServiceRequestDocuments + SetServiceRequestDocuments(ServiceRequestDocuments) + + // status + Status() MTOServiceItemStatus + SetStatus(MTOServiceItemStatus) + + // AdditionalProperties in base type shoud be handled just like regular properties + // At this moment, the base type property is pushed down to the subtype +} + +type mTOServiceItem struct { + eTagField string + + idField strfmt.UUID + + modelTypeField MTOServiceItemModelType + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus +} + +// ETag gets the e tag of this polymorphic type +func (m *mTOServiceItem) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this polymorphic type +func (m *mTOServiceItem) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this polymorphic type +func (m *mTOServiceItem) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this polymorphic type +func (m *mTOServiceItem) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this polymorphic type +func (m *mTOServiceItem) ModelType() MTOServiceItemModelType { + return "MTOServiceItem" +} + +// SetModelType sets the model type of this polymorphic type +func (m *mTOServiceItem) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this polymorphic type +func (m *mTOServiceItem) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this polymorphic type +func (m *mTOServiceItem) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this polymorphic type +func (m *mTOServiceItem) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this polymorphic type +func (m *mTOServiceItem) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this polymorphic type +func (m *mTOServiceItem) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this polymorphic type +func (m *mTOServiceItem) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this polymorphic type +func (m *mTOServiceItem) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this polymorphic type +func (m *mTOServiceItem) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this polymorphic type +func (m *mTOServiceItem) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this polymorphic type +func (m *mTOServiceItem) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this polymorphic type +func (m *mTOServiceItem) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this polymorphic type +func (m *mTOServiceItem) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalMTOServiceItemSlice unmarshals polymorphic slices of MTOServiceItem +func UnmarshalMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]MTOServiceItem, error) { + var elements []json.RawMessage + if err := consumer.Consume(reader, &elements); err != nil { + return nil, err + } + + var result []MTOServiceItem + for _, element := range elements { + obj, err := unmarshalMTOServiceItem(element, consumer) + if err != nil { + return nil, err + } + result = append(result, obj) + } + return result, nil +} + +// UnmarshalMTOServiceItem unmarshals polymorphic MTOServiceItem +func UnmarshalMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (MTOServiceItem, error) { + // we need to read this twice, so first into a buffer + data, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + return unmarshalMTOServiceItem(data, consumer) +} + +func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOServiceItem, error) { + buf := bytes.NewBuffer(data) + buf2 := bytes.NewBuffer(data) + + // the first time this is read is to fetch the value of the modelType property. + var getType struct { + ModelType string `json:"modelType"` + } + if err := consumer.Consume(buf, &getType); err != nil { + return nil, err + } + + if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { + return nil, err + } + + // The value of modelType is used to determine which type to create and unmarshal the data into + switch getType.ModelType { + case "MTOServiceItem": + var result mTOServiceItem + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + } + return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) +} + +// Validate validates this m t o service item +func (m *mTOServiceItem) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 +} + +// ContextValidate validate this m t o service item based on the context it is used +func (m *mTOServiceItem) 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.contextValidateModelType(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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 +} diff --git a/pkg/gen/internalmessages/m_t_o_service_item_model_type.go b/pkg/gen/internalmessages/m_t_o_service_item_model_type.go new file mode 100644 index 00000000000..07ae886028e --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_service_item_model_type.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemModelType Describes all model sub-types for a MTOServiceItem model. +// +// Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. +// - DOFSIT, DOASIT - MTOServiceItemOriginSIT +// - DDFSIT, DDASIT - MTOServiceItemDestSIT +// - DOSHUT, DDSHUT - MTOServiceItemShuttle +// - DCRT, DUCRT - MTOServiceItemDomesticCrating +// +// The documentation will then update with the supported fields. +// +// swagger:model MTOServiceItemModelType +type MTOServiceItemModelType string + +func NewMTOServiceItemModelType(value MTOServiceItemModelType) *MTOServiceItemModelType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemModelType. +func (m MTOServiceItemModelType) Pointer() *MTOServiceItemModelType { + return &m +} + +const ( + + // MTOServiceItemModelTypeMTOServiceItemBasic captures enum value "MTOServiceItemBasic" + MTOServiceItemModelTypeMTOServiceItemBasic MTOServiceItemModelType = "MTOServiceItemBasic" + + // MTOServiceItemModelTypeMTOServiceItemOriginSIT captures enum value "MTOServiceItemOriginSIT" + MTOServiceItemModelTypeMTOServiceItemOriginSIT MTOServiceItemModelType = "MTOServiceItemOriginSIT" + + // MTOServiceItemModelTypeMTOServiceItemDestSIT captures enum value "MTOServiceItemDestSIT" + MTOServiceItemModelTypeMTOServiceItemDestSIT MTOServiceItemModelType = "MTOServiceItemDestSIT" + + // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" + MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" + + // MTOServiceItemModelTypeMTOServiceItemDomesticCrating captures enum value "MTOServiceItemDomesticCrating" + MTOServiceItemModelTypeMTOServiceItemDomesticCrating MTOServiceItemModelType = "MTOServiceItemDomesticCrating" +) + +// for schema +var mTOServiceItemModelTypeEnum []interface{} + +func init() { + var res []MTOServiceItemModelType + if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticCrating"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemModelTypeEnum = append(mTOServiceItemModelTypeEnum, v) + } +} + +func (m MTOServiceItemModelType) validateMTOServiceItemModelTypeEnum(path, location string, value MTOServiceItemModelType) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemModelTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item model type +func (m MTOServiceItemModelType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemModelTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o service item model type based on context it is used +func (m MTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_service_item_status.go b/pkg/gen/internalmessages/m_t_o_service_item_status.go new file mode 100644 index 00000000000..654ca780746 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemStatus The status of a service item, indicating where it is in the TOO's approval process. +// +// swagger:model MTOServiceItemStatus +type MTOServiceItemStatus string + +func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. +func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { + return &m +} + +const ( + + // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" + MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" + + // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" + MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" + + // MTOServiceItemStatusREJECTED captures enum value "REJECTED" + MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" +) + +// for schema +var mTOServiceItemStatusEnum []interface{} + +func init() { + var res []MTOServiceItemStatus + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) + } +} + +func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item status +func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o service item status based on the context it is used +func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", MTOServiceItemStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_shipment_type2.go b/pkg/gen/internalmessages/m_t_o_shipment_type2.go new file mode 100644 index 00000000000..2dd1c50b017 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_shipment_type2.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOShipmentType2 Shipment Type +// +// The type of shipment. +// - `HHG` = Household goods move +// - `HHG_INTO_NTS_DOMESTIC` = HHG into Non-temporary storage (NTS) +// - `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) +// - `PPM` = Personally Procured Move also known as Do It Yourself (DITY) +// +// Example: HHG +// +// swagger:model MTOShipmentType-2 +type MTOShipmentType2 string + +func NewMTOShipmentType2(value MTOShipmentType2) *MTOShipmentType2 { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOShipmentType2. +func (m MTOShipmentType2) Pointer() *MTOShipmentType2 { + return &m +} + +const ( + + // MTOShipmentType2BOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" + MTOShipmentType2BOATHAULAWAY MTOShipmentType2 = "BOAT_HAUL_AWAY" + + // MTOShipmentType2BOATTOWAWAY captures enum value "BOAT_TOW_AWAY" + MTOShipmentType2BOATTOWAWAY MTOShipmentType2 = "BOAT_TOW_AWAY" + + // MTOShipmentType2HHG captures enum value "HHG" + MTOShipmentType2HHG MTOShipmentType2 = "HHG" + + // MTOShipmentType2HHGINTONTSDOMESTIC captures enum value "HHG_INTO_NTS_DOMESTIC" + MTOShipmentType2HHGINTONTSDOMESTIC MTOShipmentType2 = "HHG_INTO_NTS_DOMESTIC" + + // MTOShipmentType2HHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" + MTOShipmentType2HHGOUTOFNTSDOMESTIC MTOShipmentType2 = "HHG_OUTOF_NTS_DOMESTIC" + + // MTOShipmentType2INTERNATIONALHHG captures enum value "INTERNATIONAL_HHG" + MTOShipmentType2INTERNATIONALHHG MTOShipmentType2 = "INTERNATIONAL_HHG" + + // MTOShipmentType2INTERNATIONALUB captures enum value "INTERNATIONAL_UB" + MTOShipmentType2INTERNATIONALUB MTOShipmentType2 = "INTERNATIONAL_UB" + + // MTOShipmentType2MOTORHOME captures enum value "MOTORHOME" + MTOShipmentType2MOTORHOME MTOShipmentType2 = "MOTORHOME" + + // MTOShipmentType2PPM captures enum value "PPM" + MTOShipmentType2PPM MTOShipmentType2 = "PPM" +) + +// for schema +var mTOShipmentType2Enum []interface{} + +func init() { + var res []MTOShipmentType2 + if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS_DOMESTIC","HHG_OUTOF_NTS_DOMESTIC","INTERNATIONAL_HHG","INTERNATIONAL_UB","MOTORHOME","PPM"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentType2Enum = append(mTOShipmentType2Enum, v) + } +} + +func (m MTOShipmentType2) validateMTOShipmentType2Enum(path, location string, value MTOShipmentType2) error { + if err := validate.EnumCase(path, location, value, mTOShipmentType2Enum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o shipment type 2 +func (m MTOShipmentType2) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOShipmentType2Enum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o shipment type 2 based on context it is used +func (m MTOShipmentType2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_shipment_without_service_items.go b/pkg/gen/internalmessages/m_t_o_shipment_without_service_items.go new file mode 100644 index 00000000000..bc38f51b9d8 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_shipment_without_service_items.go @@ -0,0 +1,1165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipmentWithoutServiceItems m t o shipment without service items +// +// swagger:model MTOShipmentWithoutServiceItems +type MTOShipmentWithoutServiceItems struct { + + // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. + // Format: date + ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` + + // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. + // Format: date + ActualPickupDate *strfmt.Date `json:"actualPickupDate"` + + // agents + Agents MTOAgents2 `json:"agents,omitempty"` + + // The date when the Transportation Ordering Officer first approved this shipment for the move. + // Read Only: true + // Format: date + ApprovedDate *strfmt.Date `json:"approvedDate"` + + // The counselor can use the counselor remarks field to inform the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // + // Counselors enters this information when creating or editing an MTO Shipment. Optional field. + // + // Example: handle with care + // Read Only: true + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // The customer can use the customer remarks field to inform the services counselor and the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // + // Customer enters this information during onboarding. Optional field. + // + // Example: handle with care + // Read Only: true + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // delivery address update + DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` + + // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details + // during onboarding, if they know their new address already. + // + // May be blank when entered by the customer, required when entered by the Prime. May not represent the true + // final destination due to the shipment being diverted or placed in SIT. + // + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. + // + Diversion bool `json:"diversion,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. + // + // Format: date + FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` + + // The ID of the shipment. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // The ID of the move for this shipment. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 4500 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. + // + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. + // + PointOfContact string `json:"pointOfContact,omitempty"` + + // ppm shipment + PpmShipment *PPMShipment2 `json:"ppmShipment,omitempty"` + + // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. + // Example: 4500 + // Minimum: 1 + PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` + + // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. + // + // Example: 4500 + // Minimum: 1 + PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` + + // The date when the Prime contractor recorded the shipment's estimated weight. + // Read Only: true + // Format: date + PrimeEstimatedWeightRecordedDate *strfmt.Date `json:"primeEstimatedWeightRecordedDate"` + + // The customer's preferred delivery date. + // Read Only: true + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate"` + + // The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. + // + // Read Only: true + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate"` + + // The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified. + // + // Read Only: true + // Format: date + RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate"` + + // reweigh + Reweigh *Reweigh `json:"reweigh,omitempty"` + + // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. + // Format: date + ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` + + // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. + // Format: date + ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` + + // A second delivery address for this shipment, if the customer entered one. An optional field. + SecondaryDeliveryAddress struct { + Address + } `json:"secondaryDeliveryAddress,omitempty"` + + // A second pickup address for this shipment, if the customer entered one. An optional field. + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // shipment type + ShipmentType MTOShipmentType2 `json:"shipmentType,omitempty"` + + // sit extensions + SitExtensions SITExtensions `json:"sitExtensions,omitempty"` + + // The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances. + // + // Read Only: true + // Enum: [SUBMITTED APPROVED REJECTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] + Status string `json:"status,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o shipment without service items +func (m *MTOShipmentWithoutServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeliveryAddressUpdate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { + res = append(res, err) + } + + 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.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeActualWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeightRecordedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequiredDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReweigh(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExtensions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateActualDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateActualPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateApprovedDate(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedDate) { // not required + return nil + } + + if err := validate.FormatOf("approvedDate", "body", "date", m.ApprovedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDeliveryAddressUpdate(formats strfmt.Registry) error { + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if m.DeliveryAddressUpdate != nil { + if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) 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 *MTOShipmentWithoutServiceItems) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeActualWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeActualWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeightRecordedDate(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeightRecordedDate) { // not required + return nil + } + + if err := validate.FormatOf("primeEstimatedWeightRecordedDate", "body", "date", m.PrimeEstimatedWeightRecordedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequiredDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequiredDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateReweigh(formats strfmt.Registry) error { + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if m.Reweigh != nil { + if err := m.Reweigh.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateScheduledDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateScheduledPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSitExtensions(formats strfmt.Registry) error { + if swag.IsZero(m.SitExtensions) { // not required + return nil + } + + if err := m.SitExtensions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +var mTOShipmentWithoutServiceItemsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentWithoutServiceItemsTypeStatusPropEnum = append(mTOShipmentWithoutServiceItemsTypeStatusPropEnum, v) + } +} + +const ( + + // MTOShipmentWithoutServiceItemsStatusSUBMITTED captures enum value "SUBMITTED" + MTOShipmentWithoutServiceItemsStatusSUBMITTED string = "SUBMITTED" + + // MTOShipmentWithoutServiceItemsStatusAPPROVED captures enum value "APPROVED" + MTOShipmentWithoutServiceItemsStatusAPPROVED string = "APPROVED" + + // MTOShipmentWithoutServiceItemsStatusREJECTED captures enum value "REJECTED" + MTOShipmentWithoutServiceItemsStatusREJECTED string = "REJECTED" + + // MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" + MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" + + // MTOShipmentWithoutServiceItemsStatusCANCELED captures enum value "CANCELED" + MTOShipmentWithoutServiceItemsStatusCANCELED string = "CANCELED" + + // MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" + MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" +) + +// prop value enum +func (m *MTOShipmentWithoutServiceItems) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o shipment without service items based on the context it is used +func (m *MTOShipmentWithoutServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateApprovedDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCounselorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + 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.contextValidateMoveTaskOrderID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeEstimatedWeightRecordedDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequiredDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReweigh(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitExtensions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateApprovedDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedDate", "body", m.ApprovedDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCounselorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "counselorRemarks", "body", m.CounselorRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { + + if m.DeliveryAddressUpdate != nil { + + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) 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 *MTOShipmentWithoutServiceItems) 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 *MTOShipmentWithoutServiceItems) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePrimeEstimatedWeightRecordedDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeEstimatedWeightRecordedDate", "body", m.PrimeEstimatedWeightRecordedDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequiredDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requiredDeliveryDate", "body", m.RequiredDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { + + if m.Reweigh != nil { + + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipmentWithoutServiceItems) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipmentWithoutServiceItems) UnmarshalBinary(b []byte) error { + var res MTOShipmentWithoutServiceItems + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_shipments_without_service_objects.go b/pkg/gen/internalmessages/m_t_o_shipments_without_service_objects.go new file mode 100644 index 00000000000..34d53a70165 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_shipments_without_service_objects.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOShipmentsWithoutServiceObjects A list of shipments without their associated service items. +// +// swagger:model MTOShipmentsWithoutServiceObjects +type MTOShipmentsWithoutServiceObjects []*MTOShipmentWithoutServiceItems + +// Validate validates this m t o shipments without service objects +func (m MTOShipmentsWithoutServiceObjects) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o shipments without service objects based on the context it is used +func (m MTOShipmentsWithoutServiceObjects) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/move_task_order.go b/pkg/gen/internalmessages/move_task_order.go new file mode 100644 index 00000000000..e8fffeb0248 --- /dev/null +++ b/pkg/gen/internalmessages/move_task_order.go @@ -0,0 +1,842 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// 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" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveTaskOrder move task order +// +// swagger:model MoveTaskOrder +type MoveTaskOrder struct { + + // available to prime at + // Read Only: true + // Format: date-time + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // excess weight acknowledged at + // Read Only: true + // Format: date-time + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + // excess weight qualified at + // Read Only: true + // Format: date-time + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + // excess weight upload Id + // Read Only: true + // Format: uuid + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + // id + // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move code + // Example: HYXFJF + // Read Only: true + MoveCode string `json:"moveCode,omitempty"` + + mtoServiceItemsField []MTOServiceItem + + // mto shipments + // Required: true + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + // order + Order *Order `json:"order,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // payment requests + // Required: true + PaymentRequests PaymentRequests `json:"paymentRequests"` + + // ppm estimated weight + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + // ppm type + // Enum: [PARTIAL FULL] + PpmType string `json:"ppmType,omitempty"` + + // prime counseling completed at + // Read Only: true + // Format: date-time + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID string `json:"referenceId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// MtoServiceItems gets the mto service items of this base type +func (m *MoveTaskOrder) MtoServiceItems() []MTOServiceItem { + return m.mtoServiceItemsField +} + +// SetMtoServiceItems sets the mto service items of this base type +func (m *MoveTaskOrder) SetMtoServiceItems(val []MTOServiceItem) { + m.mtoServiceItemsField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error { + var data struct { + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + ETag string `json:"eTag,omitempty"` + + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + ID strfmt.UUID `json:"id,omitempty"` + + MoveCode string `json:"moveCode,omitempty"` + + MtoServiceItems json.RawMessage `json:"mtoServiceItems"` + + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + Order *Order `json:"order,omitempty"` + + OrderID strfmt.UUID `json:"orderID,omitempty"` + + PaymentRequests PaymentRequests `json:"paymentRequests"` + + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + PpmType string `json:"ppmType,omitempty"` + + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + ReferenceID string `json:"referenceId,omitempty"` + + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + propMtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) + if err != nil && err != io.EOF { + return err + } + + var result MoveTaskOrder + + // availableToPrimeAt + result.AvailableToPrimeAt = data.AvailableToPrimeAt + + // createdAt + result.CreatedAt = data.CreatedAt + + // eTag + result.ETag = data.ETag + + // excessWeightAcknowledgedAt + result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt + + // excessWeightQualifiedAt + result.ExcessWeightQualifiedAt = data.ExcessWeightQualifiedAt + + // excessWeightUploadId + result.ExcessWeightUploadID = data.ExcessWeightUploadID + + // id + result.ID = data.ID + + // moveCode + result.MoveCode = data.MoveCode + + // mtoServiceItems + result.mtoServiceItemsField = propMtoServiceItems + + // mtoShipments + result.MtoShipments = data.MtoShipments + + // order + result.Order = data.Order + + // orderID + result.OrderID = data.OrderID + + // paymentRequests + result.PaymentRequests = data.PaymentRequests + + // ppmEstimatedWeight + result.PpmEstimatedWeight = data.PpmEstimatedWeight + + // ppmType + result.PpmType = data.PpmType + + // primeCounselingCompletedAt + result.PrimeCounselingCompletedAt = data.PrimeCounselingCompletedAt + + // referenceId + result.ReferenceID = data.ReferenceID + + // updatedAt + result.UpdatedAt = data.UpdatedAt + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MoveTaskOrder) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + ETag string `json:"eTag,omitempty"` + + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + ID strfmt.UUID `json:"id,omitempty"` + + MoveCode string `json:"moveCode,omitempty"` + + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + Order *Order `json:"order,omitempty"` + + OrderID strfmt.UUID `json:"orderID,omitempty"` + + PaymentRequests PaymentRequests `json:"paymentRequests"` + + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + PpmType string `json:"ppmType,omitempty"` + + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + ReferenceID string `json:"referenceId,omitempty"` + + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + }{ + + AvailableToPrimeAt: m.AvailableToPrimeAt, + + CreatedAt: m.CreatedAt, + + ETag: m.ETag, + + ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt, + + ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt, + + ExcessWeightUploadID: m.ExcessWeightUploadID, + + ID: m.ID, + + MoveCode: m.MoveCode, + + MtoShipments: m.MtoShipments, + + Order: m.Order, + + OrderID: m.OrderID, + + PaymentRequests: m.PaymentRequests, + + PpmEstimatedWeight: m.PpmEstimatedWeight, + + PpmType: m.PpmType, + + PrimeCounselingCompletedAt: m.PrimeCounselingCompletedAt, + + ReferenceID: m.ReferenceID, + + UpdatedAt: m.UpdatedAt, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` + }{ + + MtoServiceItems: m.mtoServiceItemsField, + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this move task order +func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAvailableToPrimeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightQualifiedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightUploadID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrder(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequests(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableToPrimeAt) { // not required + return nil + } + + if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.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 + } + + if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightUploadID(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightUploadID) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightUploadId", "body", "uuid", m.ExcessWeightUploadID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateMtoServiceItems(formats strfmt.Registry) error { + + if err := validate.Required("mtoServiceItems", "body", m.MtoServiceItems()); err != nil { + return err + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *MoveTaskOrder) validateMtoShipments(formats strfmt.Registry) error { + + if err := validate.Required("mtoShipments", "body", m.MtoShipments); err != nil { + return err + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateOrder(formats strfmt.Registry) error { + if swag.IsZero(m.Order) { // not required + return nil + } + + if m.Order != nil { + if err := m.Order.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePaymentRequests(formats strfmt.Registry) error { + + if err := validate.Required("paymentRequests", "body", m.PaymentRequests); err != nil { + return err + } + + if err := m.PaymentRequests.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentRequests") + } + return err + } + + return nil +} + +var moveTaskOrderTypePpmTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PARTIAL","FULL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveTaskOrderTypePpmTypePropEnum = append(moveTaskOrderTypePpmTypePropEnum, v) + } +} + +const ( + + // MoveTaskOrderPpmTypePARTIAL captures enum value "PARTIAL" + MoveTaskOrderPpmTypePARTIAL string = "PARTIAL" + + // MoveTaskOrderPpmTypeFULL captures enum value "FULL" + MoveTaskOrderPpmTypeFULL string = "FULL" +) + +// prop value enum +func (m *MoveTaskOrder) validatePpmTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, moveTaskOrderTypePpmTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MoveTaskOrder) validatePpmType(formats strfmt.Registry) error { + if swag.IsZero(m.PpmType) { // not required + return nil + } + + // value enum + if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move task order based on the context it is used +func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightUploadID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrder(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequests(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) 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 *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightUploadID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightUploadId", "body", m.ExcessWeightUploadID); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if swag.IsZero(m.mtoServiceItemsField[i]) { // not required + return nil + } + + if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { + + if m.Order != nil { + + if swag.IsZero(m.Order) { // not required + return nil + } + + if err := m.Order.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePaymentRequests(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentRequests.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentRequests") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { + var res MoveTaskOrder + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/moves_list.go b/pkg/gen/internalmessages/moves_list.go new file mode 100644 index 00000000000..72a550defce --- /dev/null +++ b/pkg/gen/internalmessages/moves_list.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MovesList moves list +// +// swagger:model MovesList +type MovesList struct { + + // current move + CurrentMove []*MoveTaskOrder `json:"currentMove"` + + // previous moves + PreviousMoves []*MoveTaskOrder `json:"previousMoves"` +} + +// Validate validates this moves list +func (m *MovesList) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCurrentMove(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePreviousMoves(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovesList) validateCurrentMove(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentMove) { // not required + return nil + } + + for i := 0; i < len(m.CurrentMove); i++ { + if swag.IsZero(m.CurrentMove[i]) { // not required + continue + } + + if m.CurrentMove[i] != nil { + if err := m.CurrentMove[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("currentMove" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("currentMove" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MovesList) validatePreviousMoves(formats strfmt.Registry) error { + if swag.IsZero(m.PreviousMoves) { // not required + return nil + } + + for i := 0; i < len(m.PreviousMoves); i++ { + if swag.IsZero(m.PreviousMoves[i]) { // not required + continue + } + + if m.PreviousMoves[i] != nil { + if err := m.PreviousMoves[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("previousMoves" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("previousMoves" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this moves list based on the context it is used +func (m *MovesList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCurrentMove(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePreviousMoves(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovesList) contextValidateCurrentMove(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CurrentMove); i++ { + + if m.CurrentMove[i] != nil { + + if swag.IsZero(m.CurrentMove[i]) { // not required + return nil + } + + if err := m.CurrentMove[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("currentMove" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("currentMove" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MovesList) contextValidatePreviousMoves(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PreviousMoves); i++ { + + if m.PreviousMoves[i] != nil { + + if swag.IsZero(m.PreviousMoves[i]) { // not required + return nil + } + + if err := m.PreviousMoves[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("previousMoves" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("previousMoves" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MovesList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MovesList) UnmarshalBinary(b []byte) error { + var res MovesList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/order.go b/pkg/gen/internalmessages/order.go new file mode 100644 index 00000000000..1c7f48bf30d --- /dev/null +++ b/pkg/gen/internalmessages/order.go @@ -0,0 +1,444 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Order order +// +// swagger:model Order +type Order struct { + + // customer + Customer *Customer `json:"customer,omitempty"` + + // customer ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + CustomerID strfmt.UUID `json:"customerID,omitempty"` + + // destination duty location + DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // entitlement + Entitlement *Entitlements `json:"entitlement,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lines of accounting + // Required: true + LinesOfAccounting *string `json:"linesOfAccounting"` + + // order number + // Required: true + OrderNumber *string `json:"orderNumber"` + + // orders type + OrdersType OrdersType `json:"ordersType,omitempty"` + + // origin duty location + OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` + + // origin duty location g b l o c + // Example: KKFA + OriginDutyLocationGBLOC string `json:"originDutyLocationGBLOC,omitempty"` + + // rank + // Example: E_5 + // Required: true + Rank *string `json:"rank"` + + // report by date + // Format: date + ReportByDate strfmt.Date `json:"reportByDate,omitempty"` +} + +// Validate validates this order +func (m *Order) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntitlement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinesOfAccounting(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderNumber(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRank(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) validateCustomer(formats strfmt.Registry) error { + if swag.IsZero(m.Customer) { // not required + return nil + } + + if m.Customer != nil { + if err := m.Customer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) validateCustomerID(formats strfmt.Registry) error { + if swag.IsZero(m.CustomerID) { // not required + return nil + } + + if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if m.DestinationDutyLocation != nil { + if err := m.DestinationDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateEntitlement(formats strfmt.Registry) error { + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if m.Entitlement != nil { + if err := m.Entitlement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) 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 *Order) validateLinesOfAccounting(formats strfmt.Registry) error { + + if err := validate.Required("linesOfAccounting", "body", m.LinesOfAccounting); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrderNumber(formats strfmt.Registry) error { + + if err := validate.Required("orderNumber", "body", m.OrderNumber); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrdersType(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + + return nil +} + +func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if m.OriginDutyLocation != nil { + if err := m.OriginDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateRank(formats strfmt.Registry) error { + + if err := validate.Required("rank", "body", m.Rank); err != nil { + return err + } + + return nil +} + +func (m *Order) validateReportByDate(formats strfmt.Registry) error { + if swag.IsZero(m.ReportByDate) { // not required + return nil + } + + if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this order based on the context it is used +func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntitlement(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { + + if m.Customer != nil { + + if swag.IsZero(m.Customer) { // not required + return nil + } + + if err := m.Customer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationDutyLocation != nil { + + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) 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 *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { + + if m.Entitlement != nil { + + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + + return nil +} + +func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginDutyLocation != nil { + + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Order) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Order) UnmarshalBinary(b []byte) error { + var res Order + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/p_p_m_shipment2.go b/pkg/gen/internalmessages/p_p_m_shipment2.go new file mode 100644 index 00000000000..1dddd27965c --- /dev/null +++ b/pkg/gen/internalmessages/p_p_m_shipment2.go @@ -0,0 +1,670 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMShipment2 A personally procured move is a type of shipment that a service member moves themselves. +// +// swagger:model PPMShipment-2 +type PPMShipment2 struct { + + // ZIP + // + // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` + + // The actual start date of when the PPM shipment left the origin. + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate"` + + // ZIP + // + // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualPickupPostalCode *string `json:"actualPickupPostalCode"` + + // The amount received for an advance, or null if no advance is received. + // + AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` + + // The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive. + // + AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` + + // The timestamp of when the shipment was approved and the service member can begin their move. + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt"` + + // The timestamp of when the PPM shipment was created (UTC) + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // The postal code of the destination location where goods are being delivered to. + // Example: 90210 + // Required: true + // Pattern: ^(\d{5})$ + DestinationPostalCode *string `json:"destinationPostalCode"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Required: true + // Read Only: true + ETag string `json:"eTag"` + + // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + EstimatedIncentive *int64 `json:"estimatedIncentive"` + + // The estimated weight of the PPM shipment goods being moved in pounds. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Date the customer expects to begin moving from their origin. + // + // Required: true + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear"` + + // Indicates whether an advance was received for the PPM shipment. + // + HasReceivedAdvance *bool `json:"hasReceivedAdvance"` + + // Indicates whether an advance has been requested for the PPM shipment. + // + HasRequestedAdvance *bool `json:"hasRequestedAdvance"` + + // The primary unique identifier of this PPM shipment + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // ZIP + // + // The postal code of the origin location where goods are being moved from. + // Example: 90210 + // Required: true + // Pattern: ^(\d{5})$ + PickupPostalCode *string `json:"pickupPostalCode"` + + // The estimated weight of the pro-gear being moved belonging to the service member in pounds. + ProGearWeight *int64 `json:"proGearWeight"` + + // The timestamp of when the Service Counselor has reviewed all of the closeout documents. + // Format: date-time + ReviewedAt *strfmt.DateTime `json:"reviewedAt"` + + // An optional secondary location near the destination where goods will be dropped off. + // Example: 90210 + // Pattern: ^(\d{5})$ + SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode"` + + // An optional secondary pickup location near the origin where additional goods exist. + // Example: 90210 + // Pattern: ^(\d{5})$ + SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode"` + + // The id of the parent MTOShipment record + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` + + // The estimated weight of the goods being put into storage in pounds. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + // Required: true + SitExpected *bool `json:"sitExpected"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse in pounds. + SpouseProGearWeight *int64 `json:"spouseProGearWeight"` + + // status + // Required: true + Status PPMShipmentStatus `json:"status"` + + // The timestamp of when the customer submitted their PPM documentation to the counselor for review. + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt"` + + // The timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this p p m shipment 2 +func (m *PPMShipment2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExpected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment2) validateActualDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateActualPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateDestinationPostalCode(formats strfmt.Registry) error { + + if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { + return err + } + + if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateETag(formats strfmt.Registry) error { + + if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateExpectedDepartureDate(formats strfmt.Registry) error { + + if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { + return err + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validatePickupPostalCode(formats strfmt.Registry) error { + + if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { + return err + } + + if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateReviewedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateSitExpected(formats strfmt.Registry) error { + + if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment2) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { + return err + } + + 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 +} + +func (m *PPMShipment2) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m shipment 2 based on the context it is used +func (m *PPMShipment2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + 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.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment2) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) 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 *PPMShipment2) 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 *PPMShipment2) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment2) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment2) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + 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 +} + +func (m *PPMShipment2) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMShipment2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMShipment2) UnmarshalBinary(b []byte) error { + var res PPMShipment2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/payment_request.go b/pkg/gen/internalmessages/payment_request.go new file mode 100644 index 00000000000..7cad12596c1 --- /dev/null +++ b/pkg/gen/internalmessages/payment_request.go @@ -0,0 +1,322 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentRequest payment request +// +// swagger:model PaymentRequest +type PaymentRequest struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // is final + IsFinal *bool `json:"isFinal,omitempty"` + + // move task order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // payment request number + // Example: 1234-5678-1 + // Read Only: true + PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` + + // payment service items + PaymentServiceItems PaymentServiceItems `json:"paymentServiceItems,omitempty"` + + // proof of service docs + ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` + + // recalculation of payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` +} + +// Validate validates this payment request +func (m *PaymentRequest) 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.validatePaymentServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfServiceDocs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecalculationOfPaymentRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validatePaymentServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItems) { // not required + return nil + } + + if err := m.PaymentServiceItems.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { + if swag.IsZero(m.ProofOfServiceDocs) { // not required + return nil + } + + if err := m.ProofOfServiceDocs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) 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 +} + +// ContextValidate validate this payment request based on the context it is used +func (m *PaymentRequest) 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.contextValidatePaymentRequestNumber(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRecalculationOfPaymentRequestID(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 *PaymentRequest) 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 *PaymentRequest) 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 *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItems.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) 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 *PaymentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRequest) UnmarshalBinary(b []byte) error { + var res PaymentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/payment_request_status.go b/pkg/gen/internalmessages/payment_request_status.go new file mode 100644 index 00000000000..e5729df0738 --- /dev/null +++ b/pkg/gen/internalmessages/payment_request_status.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentRequestStatus Payment Request Status +// +// swagger:model PaymentRequestStatus +type PaymentRequestStatus string + +func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. +func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { + return &m +} + +const ( + + // PaymentRequestStatusPENDING captures enum value "PENDING" + PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" + + // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" + PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" + + // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + + // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" + + // PaymentRequestStatusRECEIVEDBYGEX captures enum value "RECEIVED_BY_GEX" + PaymentRequestStatusRECEIVEDBYGEX PaymentRequestStatus = "RECEIVED_BY_GEX" + + // PaymentRequestStatusPAID captures enum value "PAID" + PaymentRequestStatusPAID PaymentRequestStatus = "PAID" + + // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" + PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" + + // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" + PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" +) + +// for schema +var paymentRequestStatusEnum []interface{} + +func init() { + var res []PaymentRequestStatus + if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","RECEIVED_BY_GEX","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) + } +} + +func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { + if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment request status +func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment request status based on context it is used +func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/payment_requests.go b/pkg/gen/internalmessages/payment_requests.go new file mode 100644 index 00000000000..e7da06c306b --- /dev/null +++ b/pkg/gen/internalmessages/payment_requests.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentRequests payment requests +// +// swagger:model PaymentRequests +type PaymentRequests []*PaymentRequest + +// Validate validates this payment requests +func (m PaymentRequests) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment requests based on the context it is used +func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/payment_service_item.go b/pkg/gen/internalmessages/payment_service_item.go new file mode 100644 index 00000000000..b86789b8f8e --- /dev/null +++ b/pkg/gen/internalmessages/payment_service_item.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItem payment service item +// +// swagger:model PaymentServiceItem +type PaymentServiceItem struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` + + // payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` + + // payment service item params + PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` + + // Price of the service item in cents + PriceCents *int64 `json:"priceCents,omitempty"` + + // reference ID + // Example: 1234-5678-c56a4180 + // Read Only: true + ReferenceID string `json:"referenceID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentServiceItemStatus `json:"status,omitempty"` +} + +// Validate validates this payment service item +func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemParams(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemParams) { // not required + return nil + } + + if err := m.PaymentServiceItemParams.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) 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 +} + +// ContextValidate validate this payment service item based on the context it is used +func (m *PaymentServiceItem) 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.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReferenceID(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 *PaymentServiceItem) 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 *PaymentServiceItem) 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 *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) 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 *PaymentServiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { + var res PaymentServiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/payment_service_item_param.go b/pkg/gen/internalmessages/payment_service_item_param.go new file mode 100644 index 00000000000..7cf0fbbe90c --- /dev/null +++ b/pkg/gen/internalmessages/payment_service_item_param.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemParam payment service item param +// +// swagger:model PaymentServiceItemParam +type PaymentServiceItemParam struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // key + Key ServiceItemParamName `json:"key,omitempty"` + + // origin + Origin ServiceItemParamOrigin `json:"origin,omitempty"` + + // payment service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` + + // type + Type ServiceItemParamType `json:"type,omitempty"` + + // value + // Example: 3025 + Value string `json:"value,omitempty"` +} + +// Validate validates this payment service item param +func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item param based on the context it is used +func (m *PaymentServiceItemParam) 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.contextValidateKey(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) 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 *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { + var res PaymentServiceItemParam + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/payment_service_item_params.go b/pkg/gen/internalmessages/payment_service_item_params.go new file mode 100644 index 00000000000..d84f9dae6a9 --- /dev/null +++ b/pkg/gen/internalmessages/payment_service_item_params.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItemParams payment service item params +// +// swagger:model PaymentServiceItemParams +type PaymentServiceItemParams []*PaymentServiceItemParam + +// Validate validates this payment service item params +func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service item params based on the context it is used +func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/payment_service_item_status.go b/pkg/gen/internalmessages/payment_service_item_status.go new file mode 100644 index 00000000000..90f078aa186 --- /dev/null +++ b/pkg/gen/internalmessages/payment_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemStatus Payment Service Item Status +// +// swagger:model PaymentServiceItemStatus +type PaymentServiceItemStatus string + +func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. +func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { + return &m +} + +const ( + + // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" + PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" + + // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" + PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" + + // PaymentServiceItemStatusDENIED captures enum value "DENIED" + PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" + + // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" + + // PaymentServiceItemStatusPAID captures enum value "PAID" + PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" + + // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" + PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" +) + +// for schema +var paymentServiceItemStatusEnum []interface{} + +func init() { + var res []PaymentServiceItemStatus + if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) + } +} + +func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment service item status +func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment service item status based on context it is used +func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/payment_service_items.go b/pkg/gen/internalmessages/payment_service_items.go new file mode 100644 index 00000000000..0da94045578 --- /dev/null +++ b/pkg/gen/internalmessages/payment_service_items.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItems payment service items +// +// swagger:model PaymentServiceItems +type PaymentServiceItems []*PaymentServiceItem + +// Validate validates this payment service items +func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service items based on the context it is used +func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/proof_of_service_doc.go b/pkg/gen/internalmessages/proof_of_service_doc.go new file mode 100644 index 00000000000..a80507bf548 --- /dev/null +++ b/pkg/gen/internalmessages/proof_of_service_doc.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDoc proof of service doc +// +// swagger:model ProofOfServiceDoc +type ProofOfServiceDoc struct { + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this proof of service doc +func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this proof of service doc based on the context it is used +func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { + var res ProofOfServiceDoc + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/proof_of_service_docs.go b/pkg/gen/internalmessages/proof_of_service_docs.go new file mode 100644 index 00000000000..3e067521f21 --- /dev/null +++ b/pkg/gen/internalmessages/proof_of_service_docs.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDocs proof of service docs +// +// swagger:model ProofOfServiceDocs +type ProofOfServiceDocs []*ProofOfServiceDoc + +// Validate validates this proof of service docs +func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this proof of service docs based on the context it is used +func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/reweigh.go b/pkg/gen/internalmessages/reweigh.go new file mode 100644 index 00000000000..421485115e3 --- /dev/null +++ b/pkg/gen/internalmessages/reweigh.go @@ -0,0 +1,280 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. +// +// swagger:model Reweigh +type Reweigh struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // requested at + // Format: date-time + RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` + + // requested by + RequestedBy ReweighRequester `json:"requestedBy,omitempty"` + + // shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // verification provided at + // Format: date-time + VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` + + // verification reason + // Example: The reweigh was not performed due to some justification provided by the Prime + VerificationReason *string `json:"verificationReason"` + + // weight + // Example: 2000 + Weight *int64 `json:"weight"` +} + +// Validate validates this reweigh +func (m *Reweigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVerificationProvidedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedAt) { // not required + return nil + } + + if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { + if swag.IsZero(m.VerificationProvidedAt) { // not required + return nil + } + + if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this reweigh based on the context it is used +func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) 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 *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Reweigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Reweigh) UnmarshalBinary(b []byte) error { + var res Reweigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/reweigh_requester.go b/pkg/gen/internalmessages/reweigh_requester.go new file mode 100644 index 00000000000..7f07d2b8a93 --- /dev/null +++ b/pkg/gen/internalmessages/reweigh_requester.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReweighRequester reweigh requester +// +// swagger:model ReweighRequester +type ReweighRequester string + +func NewReweighRequester(value ReweighRequester) *ReweighRequester { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReweighRequester. +func (m ReweighRequester) Pointer() *ReweighRequester { + return &m +} + +const ( + + // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" + ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" + + // ReweighRequesterPRIME captures enum value "PRIME" + ReweighRequesterPRIME ReweighRequester = "PRIME" + + // ReweighRequesterSYSTEM captures enum value "SYSTEM" + ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" + + // ReweighRequesterTOO captures enum value "TOO" + ReweighRequesterTOO ReweighRequester = "TOO" +) + +// for schema +var reweighRequesterEnum []interface{} + +func init() { + var res []ReweighRequester + if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reweighRequesterEnum = append(reweighRequesterEnum, v) + } +} + +func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { + if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this reweigh requester +func (m ReweighRequester) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReweighRequesterEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this reweigh requester based on context it is used +func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/s_i_t_extension.go b/pkg/gen/internalmessages/s_i_t_extension.go new file mode 100644 index 00000000000..75a8faf353a --- /dev/null +++ b/pkg/gen/internalmessages/s_i_t_extension.go @@ -0,0 +1,291 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. +// +// swagger:model SITExtension +type SITExtension struct { + + // approved days + // Example: 30 + ApprovedDays *int64 `json:"approvedDays"` + + // contractor remarks + // Example: We need SIT additional days. The customer has not found a house yet. + ContractorRemarks *string `json:"contractorRemarks"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // decision date + // Format: date-time + DecisionDate *strfmt.DateTime `json:"decisionDate"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // office remarks + OfficeRemarks *string `json:"officeRemarks"` + + // request reason + // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] + RequestReason string `json:"requestReason,omitempty"` + + // requested days + // Example: 30 + RequestedDays int64 `json:"requestedDays,omitempty"` + + // status + // Enum: [PENDING APPROVED DENIED] + Status interface{} `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this s i t extension +func (m *SITExtension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecisionDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { + if swag.IsZero(m.DecisionDate) { // not required + return nil + } + + if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) 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 *SITExtension) 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 +} + +var sITExtensionTypeRequestReasonPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) + } +} + +const ( + + // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" + SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" + + // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" + SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" + + // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" + SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" + + // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" + SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" + + // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + + // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" + SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" + + // SITExtensionRequestReasonOTHER captures enum value "OTHER" + SITExtensionRequestReasonOTHER string = "OTHER" +) + +// prop value enum +func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { + if swag.IsZero(m.RequestReason) { // not required + return nil + } + + // value enum + if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this s i t extension based on the context it is used +func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) 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 *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SITExtension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITExtension) UnmarshalBinary(b []byte) error { + var res SITExtension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/s_i_t_extensions.go b/pkg/gen/internalmessages/s_i_t_extensions.go new file mode 100644 index 00000000000..2f6e5e425ce --- /dev/null +++ b/pkg/gen/internalmessages/s_i_t_extensions.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SITExtensions s i t extensions +// +// swagger:model SITExtensions +type SITExtensions []*SITExtension + +// Validate validates this s i t extensions +func (m SITExtensions) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this s i t extensions based on the context it is used +func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/service_item_param_name.go b/pkg/gen/internalmessages/service_item_param_name.go new file mode 100644 index 00000000000..8fc55bde8f0 --- /dev/null +++ b/pkg/gen/internalmessages/service_item_param_name.go @@ -0,0 +1,270 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamName service item param name +// +// swagger:model ServiceItemParamName +type ServiceItemParamName string + +func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. +func (m ServiceItemParamName) Pointer() *ServiceItemParamName { + return &m +} + +const ( + + // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" + ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" + + // ServiceItemParamNameContractCode captures enum value "ContractCode" + ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" + + // ServiceItemParamNameContractYearName captures enum value "ContractYearName" + ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" + + // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" + ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" + + // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" + ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" + + // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" + ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" + + // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" + ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" + + // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" + ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" + + // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" + ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" + + // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" + ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" + + // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" + ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" + + // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" + ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" + + // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" + ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" + + // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" + ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" + + // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" + ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" + + // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" + ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" + + // ServiceItemParamNameIsPeak captures enum value "IsPeak" + ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" + + // ServiceItemParamNameMarketDest captures enum value "MarketDest" + ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" + + // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" + ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" + + // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" + ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" + + // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" + ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" + + // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" + ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" + + // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" + ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" + + // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" + ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" + + // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" + ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" + + // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" + ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" + + // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" + ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" + + // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" + ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" + + // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" + ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" + + // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" + ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" + + // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" + ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" + + // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" + ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" + + // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" + ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" + + // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" + ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" + + // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" + ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" + ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" + + // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" + ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" + + // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" + ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" + + // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" + + // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" + ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" + + // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" + ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" + + // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" + ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" + + // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" + ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" + + // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" + ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" + + // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" + ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" + + // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" + ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" + + // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" + ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" + + // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" + ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" + + // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" + ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" + + // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" + ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" + + // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" + ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" + + // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" + ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" + + // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" + ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" + + // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" + ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" + + // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" + ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" + + // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" + ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" + + // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" + ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" + + // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" + ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" + + // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" + ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" + + // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" + ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" + + // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" + ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" + + // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" + ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" + + // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" + ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" + + // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" + ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" +) + +// for schema +var serviceItemParamNameEnum []interface{} + +func init() { + var res []ServiceItemParamName + if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) + } +} + +func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { + if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param name +func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param name based on context it is used +func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/service_item_param_origin.go b/pkg/gen/internalmessages/service_item_param_origin.go new file mode 100644 index 00000000000..2415c82c964 --- /dev/null +++ b/pkg/gen/internalmessages/service_item_param_origin.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamOrigin service item param origin +// +// swagger:model ServiceItemParamOrigin +type ServiceItemParamOrigin string + +func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. +func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { + return &m +} + +const ( + + // ServiceItemParamOriginPRIME captures enum value "PRIME" + ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" + + // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" + ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" + + // ServiceItemParamOriginPRICER captures enum value "PRICER" + ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" + + // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" + ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" +) + +// for schema +var serviceItemParamOriginEnum []interface{} + +func init() { + var res []ServiceItemParamOrigin + if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) + } +} + +func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { + if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param origin +func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param origin based on context it is used +func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/service_item_param_type.go b/pkg/gen/internalmessages/service_item_param_type.go new file mode 100644 index 00000000000..8fed68e90ab --- /dev/null +++ b/pkg/gen/internalmessages/service_item_param_type.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamType service item param type +// +// swagger:model ServiceItemParamType +type ServiceItemParamType string + +func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. +func (m ServiceItemParamType) Pointer() *ServiceItemParamType { + return &m +} + +const ( + + // ServiceItemParamTypeSTRING captures enum value "STRING" + ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" + + // ServiceItemParamTypeDATE captures enum value "DATE" + ServiceItemParamTypeDATE ServiceItemParamType = "DATE" + + // ServiceItemParamTypeINTEGER captures enum value "INTEGER" + ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" + + // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" + ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" + + // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" + ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" + + // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" + ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" + + // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" + ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" +) + +// for schema +var serviceItemParamTypeEnum []interface{} + +func init() { + var res []ServiceItemParamType + if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) + } +} + +func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { + if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param type +func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param type based on context it is used +func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/service_request_document.go b/pkg/gen/internalmessages/service_request_document.go new file mode 100644 index 00000000000..0078b6a77a0 --- /dev/null +++ b/pkg/gen/internalmessages/service_request_document.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocument service request document +// +// swagger:model ServiceRequestDocument +type ServiceRequestDocument struct { + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this service request document +func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service request document based on the context it is used +func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { + var res ServiceRequestDocument + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/service_request_documents.go b/pkg/gen/internalmessages/service_request_documents.go new file mode 100644 index 00000000000..0accee434c2 --- /dev/null +++ b/pkg/gen/internalmessages/service_request_documents.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocuments service request documents +// +// swagger:model ServiceRequestDocuments +type ServiceRequestDocuments []*ServiceRequestDocument + +// Validate validates this service request documents +func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this service request documents based on the context it is used +func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/shipment_address_update.go b/pkg/gen/internalmessages/shipment_address_update.go new file mode 100644 index 00000000000..f60d85c32e4 --- /dev/null +++ b/pkg/gen/internalmessages/shipment_address_update.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdate This represents a destination address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. +// +// swagger:model ShipmentAddressUpdate +type ShipmentAddressUpdate struct { + + // Contractor Remarks + // + // The reason there is an address change. + // Example: This is a contractor remark + // Required: true + // Read Only: true + ContractorRemarks string `json:"contractorRemarks"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // new address + // Required: true + NewAddress *Address `json:"newAddress"` + + // Office Remarks + // + // The TOO comment on approval or rejection. + // Example: This is an office remark + OfficeRemarks *string `json:"officeRemarks,omitempty"` + + // original address + // Required: true + OriginalAddress *Address `json:"originalAddress"` + + // shipment ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID"` + + // status + // Required: true + Status ShipmentAddressUpdateStatus `json:"status"` +} + +// Validate validates this shipment address update +func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContractorRemarks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { + + if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { + + if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { + return err + } + + if m.NewAddress != nil { + if err := m.NewAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { + + if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { + return err + } + + if m.OriginalAddress != nil { + if err := m.OriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { + return err + } + + 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 +} + +// ContextValidate validate this shipment address update based on the context it is used +func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNewAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(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 *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) 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 *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.NewAddress != nil { + + if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginalAddress != nil { + + if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + 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 *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { + var res ShipmentAddressUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/shipment_address_update_status.go b/pkg/gen/internalmessages/shipment_address_update_status.go new file mode 100644 index 00000000000..bb9475488d5 --- /dev/null +++ b/pkg/gen/internalmessages/shipment_address_update_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdateStatus Status +// +// swagger:model ShipmentAddressUpdateStatus +type ShipmentAddressUpdateStatus string + +func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. +func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { + return &m +} + +const ( + + // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" + ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" + + // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" + ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" + + // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" + ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" +) + +// for schema +var shipmentAddressUpdateStatusEnum []interface{} + +func init() { + var res []ShipmentAddressUpdateStatus + if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) + } +} + +func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { + if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this shipment address update status +func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this shipment address update status based on the context it is used +func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/storage_facility.go b/pkg/gen/internalmessages/storage_facility.go new file mode 100644 index 00000000000..e50a749dfd1 --- /dev/null +++ b/pkg/gen/internalmessages/storage_facility.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StorageFacility The Storage Facility information for the shipment +// +// swagger:model StorageFacility +type StorageFacility struct { + + // address + Address *Address `json:"address,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // facility name + FacilityName string `json:"facilityName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lot number + LotNumber *string `json:"lotNumber,omitempty"` + + // phone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Phone *string `json:"phone,omitempty"` +} + +// Validate validates this storage facility +func (m *StorageFacility) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this storage facility based on the context it is used +func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StorageFacility) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StorageFacility) UnmarshalBinary(b []byte) error { + var res StorageFacility + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/upload_with_omissions.go b/pkg/gen/internalmessages/upload_with_omissions.go new file mode 100644 index 00000000000..17d77acd97c --- /dev/null +++ b/pkg/gen/internalmessages/upload_with_omissions.go @@ -0,0 +1,276 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UploadWithOmissions An uploaded file. +// +// swagger:model UploadWithOmissions +type UploadWithOmissions struct { + + // bytes + // Required: true + Bytes *int64 `json:"bytes"` + + // content type + // Example: application/pdf + // Required: true + ContentType *string `json:"contentType"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // filename + // Example: filename.pdf + // Required: true + Filename *string `json:"filename"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // status + // Enum: [INFECTED CLEAN PROCESSING] + Status string `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // url + // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this upload with omissions +func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBytes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFilename(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { + + if err := validate.Required("bytes", "body", m.Bytes); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("contentType", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { + + if err := validate.Required("filename", "body", m.Filename); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) 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 +} + +var uploadWithOmissionsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) + } +} + +const ( + + // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" + UploadWithOmissionsStatusINFECTED string = "INFECTED" + + // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" + UploadWithOmissionsStatusCLEAN string = "CLEAN" + + // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" + UploadWithOmissionsStatusPROCESSING string = "PROCESSING" +) + +// prop value enum +func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this upload with omissions based on the context it is used +func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { + var res UploadWithOmissions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 63300848358..1e0cec3f900 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2690,6 +2690,17 @@ definitions: - title - detail type: object + MovesList: + type: object + properties: + currentMove: + type: array + items: + $ref: 'definitions/prime/MoveTaskOrder.yaml' + previousMoves: + type: array + items: + $ref: 'definitions/prime/MoveTaskOrder.yaml' paths: /estimates/ppm: get: @@ -3035,6 +3046,36 @@ paths: description: payload is too large '500': description: server error + /all_moves/{serviceMemberId}: + get: + summary: Return the current and previous moves of a service member + description: | + Gets all moves that belongs to the serviceMember + operationId: getAllMoves + tags: + - moves + produces: + - application/json + parameters: + - in: path + name: serviceMemberId + type: string + format: uuid + required: true + description: UUID of the service member + responses: + '200': + description: >- + Successfully retrieved moves. A successful fetch might still return + zero moves. + schema: + $ref: '#/definitions/MovesList' + '401': + $ref: '#/responses/PermissionDenied' + '403': + $ref: '#/responses/PermissionDenied' + '500': + $ref: '#/responses/ServerError' /moves/{moveId}: patch: summary: Patches the move diff --git a/swagger/internal.yaml b/swagger/internal.yaml index 496ed4142f4..c86dc32bb56 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2723,6 +2723,17 @@ definitions: - title - detail type: object + MovesList: + type: object + properties: + currentMove: + type: array + items: + $ref: '#/definitions/MoveTaskOrder' + previousMoves: + type: array + items: + $ref: '#/definitions/MoveTaskOrder' FeatureFlagBoolean: description: A feature flag type: object @@ -3877,106 +3888,1486 @@ definitions: - destinationPostalCode - sitExpected - eTag - PpmID: - description: | - The PPM Shipment ID to associate with the assigned certificate. + Customer: + type: object + properties: + id: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + dodID: + type: string + userID: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + currentAddress: + $ref: '#/definitions/Address' + firstName: + type: string + example: Vanya + lastName: + type: string + example: Petrovna + branch: + type: string + example: COAST_GUARD + phone: + type: string + format: telephone + email: + type: string + format: x-email + pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + example: fake@example.com + eTag: + type: string + readOnly: true + Entitlements: + type: object + properties: + id: + example: 571008b1-b0de-454d-b843-d71be9f02c04 + format: uuid + type: string + authorizedWeight: + example: 2000 + type: integer + x-formatting: weight + x-nullable: true + dependentsAuthorized: + example: true + type: boolean + x-nullable: true + nonTemporaryStorage: + example: false + type: boolean + x-nullable: true + privatelyOwnedVehicle: + example: false + type: boolean + x-nullable: true + proGearWeight: + example: 2000 + type: integer + x-formatting: weight + proGearWeightSpouse: + example: 500 + type: integer + x-formatting: weight + requiredMedicalEquipmentWeight: + example: 500 + type: integer + x-formatting: weight + organizationalClothingAndIndividualEquipment: + type: boolean + example: false + storageInTransit: + example: 90 + type: integer + totalWeight: + example: 500 + type: integer + x-formatting: weight + totalDependents: + example: 2 + type: integer + eTag: + type: string + readOnly: true + DutyLocation: + type: object + properties: + id: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + name: + type: string + example: Fort Bragg North Station + addressID: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + address: + $ref: '#/definitions/Address' + eTag: + type: string + readOnly: true + Order: + type: object + required: + - orderNumber + - rank + - linesOfAccounting + properties: + id: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + customer: + $ref: '#/definitions/Customer' + customerID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + entitlement: + $ref: '#/definitions/Entitlements' + destinationDutyLocation: + $ref: '#/definitions/DutyLocation' + originDutyLocation: + $ref: '#/definitions/DutyLocation' + originDutyLocationGBLOC: + type: string + example: KKFA + rank: + type: string + example: E_5 + reportByDate: + type: string + format: date + ordersType: + $ref: '#/definitions/OrdersType' + orderNumber: + type: string + linesOfAccounting: + type: string + eTag: + type: string + readOnly: true + PaymentRequestStatus: type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - x-nullable: true - MovingExpenseType: + enum: + - PENDING + - REVIEWED + - REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED + - SENT_TO_GEX + - RECEIVED_BY_GEX + - PAID + - EDI_ERROR + - DEPRECATED + title: Payment Request Status + UploadWithOmissions: + description: An uploaded file. + type: object + properties: + id: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + url: + type: string + format: uri + example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 + filename: + type: string + example: filename.pdf + contentType: + type: string + format: mime-type + example: application/pdf + bytes: + type: integer + status: + type: string + enum: + - INFECTED + - CLEAN + - PROCESSING + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + required: + - filename + - contentType + - bytes + ProofOfServiceDoc: + type: object + properties: + uploads: + type: array + items: + $ref: '#/definitions/UploadWithOmissions' + ProofOfServiceDocs: + type: array + items: + $ref: '#/definitions/ProofOfServiceDoc' + PaymentServiceItemStatus: type: string - description: Moving Expense Type enum: - - CONTRACTED_EXPENSE - - GAS - - OIL - - OTHER - - PACKING_MATERIALS - - RENTAL_EQUIPMENT - - STORAGE - - TOLLS - - WEIGHING_FEE - x-display-value: - CONTRACTED_EXPENSE: Contracted expense - GAS: Gas - OIL: Oil - OTHER: Other - PACKING_MATERIALS: Packing materials - STORAGE: Storage - RENTAL_EQUIPMENT: Rental equipment - TOLLS: Tolls - WEIGHING_FEE: Weighing fee - NullableString: + - REQUESTED + - APPROVED + - DENIED + - SENT_TO_GEX + - PAID + - EDI_ERROR + title: Payment Service Item Status + ServiceItemParamName: type: string - x-go-type: - import: - package: github.com/transcom/mymove/pkg/swagger/nullable - type: String -paths: - /estimates/ppm: - get: - summary: Return a PPM cost estimate - description: Calculates a reimbursement range for a PPM move (excluding SIT) - operationId: showPPMEstimate - tags: - - ppm - parameters: - - in: query - name: original_move_date - type: string - format: date - required: true - - in: query - name: origin_zip - type: string - format: zip - pattern: ^(\d{5}([\-]\d{4})?)$ - required: true - - in: query - name: origin_duty_location_zip - type: string - format: zip - pattern: ^(\d{5}([\-]\d{4})?)$ - required: true - - in: query - name: orders_id - type: string - format: uuid - required: true - - in: query - name: weight_estimate - type: integer - required: true - responses: - '200': - description: Made estimate of PPM cost range - schema: - $ref: '#/definitions/PPMEstimateRange' - '400': - description: invalid request - '401': - description: request requires user authentication - '403': - description: user is not authorized - '404': - description: >- - ppm discount not found for provided postal codes and original move - date - '409': - description: distance is less than 50 miles (no short haul moves) - '422': - description: cannot process request with given information - '500': - description: internal server error - /estimates/ppm_sit: - get: - summary: Return a PPM move's SIT cost estimate - description: Calculates a reimbursment for a PPM move's SIT - operationId: showPPMSitEstimate - tags: - - ppm - parameters: + enum: + - ActualPickupDate + - ContractCode + - ContractYearName + - CubicFeetBilled + - CubicFeetCrating + - DimensionHeight + - DimensionLength + - DimensionWidth + - DistanceZip + - DistanceZipSITDest + - DistanceZipSITOrigin + - EIAFuelPrice + - EscalationCompounded + - FSCMultiplier + - FSCPriceDifferenceInCents + - FSCWeightBasedDistanceMultiplier + - IsPeak + - MarketDest + - MarketOrigin + - MTOAvailableToPrimeAt + - NTSPackingFactor + - NumberDaysSIT + - PriceAreaDest + - PriceAreaIntlDest + - PriceAreaIntlOrigin + - PriceAreaOrigin + - PriceRateOrFactor + - PSI_LinehaulDom + - PSI_LinehaulDomPrice + - PSI_LinehaulShort + - PSI_LinehaulShortPrice + - PSI_PriceDomDest + - PSI_PriceDomDestPrice + - PSI_PriceDomOrigin + - PSI_PriceDomOriginPrice + - PSI_ShippingLinehaulIntlCO + - PSI_ShippingLinehaulIntlCOPrice + - PSI_ShippingLinehaulIntlOC + - PSI_ShippingLinehaulIntlOCPrice + - PSI_ShippingLinehaulIntlOO + - PSI_ShippingLinehaulIntlOOPrice + - RateAreaNonStdDest + - RateAreaNonStdOrigin + - ReferenceDate + - RequestedPickupDate + - ServiceAreaDest + - ServiceAreaOrigin + - ServicesScheduleDest + - ServicesScheduleOrigin + - SITPaymentRequestEnd + - SITPaymentRequestStart + - SITScheduleDest + - SITScheduleOrigin + - SITServiceAreaDest + - SITServiceAreaOrigin + - WeightAdjusted + - WeightBilled + - WeightEstimated + - WeightOriginal + - WeightReweigh + - ZipDestAddress + - ZipPickupAddress + - ZipSITDestHHGFinalAddress + - ZipSITDestHHGOriginalAddress + - ZipSITOriginHHGActualAddress + - ZipSITOriginHHGOriginalAddress + ServiceItemParamType: + type: string + enum: + - STRING + - DATE + - INTEGER + - DECIMAL + - TIMESTAMP + - PaymentServiceItemUUID + - BOOLEAN + ServiceItemParamOrigin: + type: string + enum: + - PRIME + - SYSTEM + - PRICER + - PAYMENT_REQUEST + PaymentServiceItemParam: + type: object + properties: + id: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + readOnly: true + type: string + paymentServiceItemID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + key: + $ref: '#/definitions/ServiceItemParamName' + value: + example: '3025' + type: string + type: + $ref: '#/definitions/ServiceItemParamType' + origin: + $ref: '#/definitions/ServiceItemParamOrigin' + eTag: + type: string + readOnly: true + PaymentServiceItemParams: + type: array + items: + $ref: '#/definitions/PaymentServiceItemParam' + PaymentServiceItem: + type: object + properties: + id: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + readOnly: true + type: string + paymentRequestID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + mtoServiceItemID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + status: + $ref: '#/definitions/PaymentServiceItemStatus' + priceCents: + type: integer + format: cents + title: Price of the service item in cents + x-nullable: true + rejectionReason: + example: documentation was incomplete + type: string + x-nullable: true + referenceID: + example: 1234-5678-c56a4180 + readOnly: true + format: string + paymentServiceItemParams: + $ref: '#/definitions/PaymentServiceItemParams' + eTag: + type: string + readOnly: true + PaymentServiceItems: + type: array + items: + $ref: '#/definitions/PaymentServiceItem' + PaymentRequest: + type: object + properties: + id: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + readOnly: true + type: string + isFinal: + default: false + type: boolean + moveTaskOrderID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + rejectionReason: + example: documentation was incomplete + type: string + x-nullable: true + status: + $ref: '#/definitions/PaymentRequestStatus' + paymentRequestNumber: + example: 1234-5678-1 + readOnly: true + type: string + recalculationOfPaymentRequestID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + readOnly: true + x-nullable: true + proofOfServiceDocs: + $ref: '#/definitions/ProofOfServiceDocs' + paymentServiceItems: + $ref: '#/definitions/PaymentServiceItems' + eTag: + type: string + readOnly: true + PaymentRequests: + type: array + items: + $ref: '#/definitions/PaymentRequest' + MTOServiceItemStatus: + description: >- + The status of a service item, indicating where it is in the TOO's approval + process. + type: string + readOnly: true + enum: + - SUBMITTED + - APPROVED + - REJECTED + MTOServiceItemModelType: + description: > + Describes all model sub-types for a MTOServiceItem model. + + + Using this list, choose the correct modelType in the dropdown, + corresponding to the service item type. + * DOFSIT, DOASIT - MTOServiceItemOriginSIT + * DDFSIT, DDASIT - MTOServiceItemDestSIT + * DOSHUT, DDSHUT - MTOServiceItemShuttle + * DCRT, DUCRT - MTOServiceItemDomesticCrating + + The documentation will then update with the supported fields. + type: string + enum: + - MTOServiceItemBasic + - MTOServiceItemOriginSIT + - MTOServiceItemDestSIT + - MTOServiceItemShuttle + - MTOServiceItemDomesticCrating + ServiceRequestDocument: + properties: + uploads: + items: + $ref: '#/definitions/UploadWithOmissions' + type: array + type: object + ServiceRequestDocuments: + items: + $ref: '#/definitions/ServiceRequestDocument' + type: array + MTOServiceItem: + description: MTOServiceItem describes a base type of a service item. Polymorphic type. + type: object + discriminator: modelType + properties: + id: + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + description: The ID of the service item. + readOnly: true + moveTaskOrderID: + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + description: The ID of the move for this service item. + mtoShipmentID: + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + description: The ID of the shipment this service is for, if any. Optional. + reServiceName: + type: string + readOnly: true + description: The full descriptive name of the service. + status: + $ref: '#/definitions/MTOServiceItemStatus' + rejectionReason: + example: item was too heavy + type: string + x-nullable: true + readOnly: true + description: The reason why this service item was rejected by the TOO. + modelType: + $ref: '#/definitions/MTOServiceItemModelType' + serviceRequestDocuments: + $ref: '#/definitions/ServiceRequestDocuments' + eTag: + type: string + readOnly: true + description: >- + A hash unique to this service item that should be used as the + "If-Match" header for any updates. + required: + - modelType + - moveTaskOrderID + MTOAgentType-2: + title: Agent Type + description: > + The type for this agent. `RELEASING` means they have authority on pickup, + `RECEIVING` means they can receive the shipment on delivery. + type: string + example: RELEASING_AGENT + enum: + - RELEASING_AGENT + - RECEIVING_AGENT + MTOAgent-2: + properties: + id: + description: The ID of the agent. + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + readOnly: true + type: string + mtoShipmentID: + description: The ID of the shipment this agent is permitted to release/receive. + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + updatedAt: + format: date-time + type: string + readOnly: true + firstName: + type: string + x-nullable: true + lastName: + type: string + x-nullable: true + email: + type: string + format: x-email + pattern: ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$ + x-nullable: true + phone: + type: string + format: telephone + pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ + x-nullable: true + agentType: + $ref: '#/definitions/MTOAgentType-2' + eTag: + type: string + readOnly: true + type: object + MTOAgents-2: + description: > + A list of the agents for a shipment. Agents are the people who the Prime + contractor recognize as permitted to release (in the case of pickup) or + receive (on delivery) a shipment. + items: + $ref: '#/definitions/MTOAgent-2' + type: array + maxItems: 2 + SITExtension: + type: object + description: >- + A storage in transit (SIT) Extension is a request for an increase in the + billable number of days a shipment is allowed to be in SIT. + properties: + id: + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + mtoShipmentID: + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + requestReason: + type: string + enum: + - SERIOUS_ILLNESS_MEMBER + - SERIOUS_ILLNESS_DEPENDENT + - IMPENDING_ASSIGNEMENT + - DIRECTED_TEMPORARY_DUTY + - NONAVAILABILITY_OF_CIVILIAN_HOUSING + - AWAITING_COMPLETION_OF_RESIDENCE + - OTHER + contractorRemarks: + example: We need SIT additional days. The customer has not found a house yet. + type: string + x-nullable: true + x-omitempty: false + requestedDays: + type: integer + example: 30 + status: + enum: + - PENDING + - APPROVED + - DENIED + approvedDays: + type: integer + example: 30 + x-nullable: true + x-omitempty: false + decisionDate: + format: date-time + type: string + x-nullable: true + x-omitempty: false + officeRemarks: + type: string + x-nullable: true + x-omitempty: false + createdAt: + format: date-time + type: string + readOnly: true + updatedAt: + format: date-time + type: string + readOnly: true + eTag: + type: string + readOnly: true + SITExtensions: + type: array + items: + $ref: '#/definitions/SITExtension' + ReweighRequester: + type: string + enum: + - CUSTOMER + - PRIME + - SYSTEM + - TOO + Reweigh: + description: >- + A reweigh is when a shipment is weighed for a second time due to the + request of a customer, the contractor, system or TOO. + properties: + id: + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + requestedAt: + format: date-time + type: string + requestedBy: + $ref: '#/definitions/ReweighRequester' + verificationProvidedAt: + format: date-time + type: string + x-nullable: true + x-omitempty: false + verificationReason: + example: >- + The reweigh was not performed due to some justification provided by + the Prime + type: string + x-nullable: true + x-omitempty: false + weight: + example: 2000 + type: integer + x-formatting: weight + x-nullable: true + x-omitempty: false + shipmentID: + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + createdAt: + format: date-time + type: string + readOnly: true + updatedAt: + format: date-time + type: string + readOnly: true + eTag: + type: string + readOnly: true + DestinationType: + type: string + title: Destination Type + example: OTHER_THAN_AUTHORIZED + x-nullable: true + enum: + - HOME_OF_RECORD + - HOME_OF_SELECTION + - PLACE_ENTERED_ACTIVE_DUTY + - OTHER_THAN_AUTHORIZED + StorageFacility: + description: The Storage Facility information for the shipment + type: object + properties: + id: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + facilityName: + type: string + address: + $ref: '#/definitions/Address' + lotNumber: + type: string + x-nullable: true + phone: + type: string + format: telephone + pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + x-nullable: true + email: + type: string + format: x-email + pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + x-nullable: true + eTag: + type: string + readOnly: true + MTOShipmentType-2: + title: Shipment Type + description: | + The type of shipment. + * `HHG` = Household goods move + * `HHG_INTO_NTS_DOMESTIC` = HHG into Non-temporary storage (NTS) + * `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) + * `PPM` = Personally Procured Move also known as Do It Yourself (DITY) + type: string + example: HHG + enum: + - BOAT_HAUL_AWAY + - BOAT_TOW_AWAY + - HHG + - HHG_INTO_NTS_DOMESTIC + - HHG_OUTOF_NTS_DOMESTIC + - INTERNATIONAL_HHG + - INTERNATIONAL_UB + - MOTORHOME + - PPM + x-display-value: + HHG: Household goods move (HHG) + HHG_INTO_NTS_DOMESTIC: HHG into Non-temporary storage (NTS) + HHG_OUTOF_NTS_DOMESTIC: HHG out of Non-temporary storage (NTS Release) + PPM: Personally Procured Move also known as Do It Yourself (DITY) + PPMShipment-2: + description: >- + A personally procured move is a type of shipment that a service member + moves themselves. + x-nullable: true + properties: + id: + description: The primary unique identifier of this PPM shipment + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + readOnly: true + shipmentId: + description: The id of the parent MTOShipment record + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + readOnly: true + createdAt: + description: The timestamp of when the PPM shipment was created (UTC) + format: date-time + type: string + readOnly: true + updatedAt: + description: The timestamp of when a property of this object was last updated (UTC) + format: date-time + type: string + readOnly: true + status: + $ref: '#/definitions/PPMShipmentStatus' + expectedDepartureDate: + description: | + Date the customer expects to begin moving from their origin. + format: date + type: string + actualMoveDate: + description: The actual start date of when the PPM shipment left the origin. + format: date + type: string + x-nullable: true + x-omitempty: false + submittedAt: + description: >- + The timestamp of when the customer submitted their PPM documentation + to the counselor for review. + format: date-time + type: string + x-nullable: true + x-omitempty: false + reviewedAt: + description: >- + The timestamp of when the Service Counselor has reviewed all of the + closeout documents. + format: date-time + type: string + x-nullable: true + x-omitempty: false + approvedAt: + description: >- + The timestamp of when the shipment was approved and the service member + can begin their move. + format: date-time + type: string + x-nullable: true + x-omitempty: false + pickupPostalCode: + description: >- + The postal code of the origin location where goods are being moved + from. + format: zip + type: string + title: ZIP + example: '90210' + pattern: ^(\d{5})$ + secondaryPickupPostalCode: + description: >- + An optional secondary pickup location near the origin where additional + goods exist. + format: zip + type: string + example: '90210' + pattern: ^(\d{5})$ + x-nullable: true + x-omitempty: false + actualPickupPostalCode: + description: > + The actual postal code where the PPM shipment started. To be filled + once the customer has moved the shipment. + format: zip + type: string + title: ZIP + example: '90210' + pattern: ^(\d{5})$ + x-nullable: true + x-omitempty: false + destinationPostalCode: + description: >- + The postal code of the destination location where goods are being + delivered to. + format: zip + type: string + example: '90210' + pattern: ^(\d{5})$ + secondaryDestinationPostalCode: + description: >- + An optional secondary location near the destination where goods will + be dropped off. + format: zip + type: string + example: '90210' + pattern: ^(\d{5})$ + x-nullable: true + x-omitempty: false + actualDestinationPostalCode: + description: > + The actual postal code where the PPM shipment ended. To be filled once + the customer has moved the shipment. + format: zip + type: string + title: ZIP + example: '90210' + pattern: ^(\d{5})$ + x-nullable: true + x-omitempty: false + sitExpected: + description: > + Captures whether some or all of the PPM shipment will require + temporary storage at the origin or destination. + + + Must be set to `true` when providing `sitLocation`, + `sitEstimatedWeight`, `sitEstimatedEntryDate`, and + `sitEstimatedDepartureDate` values to calculate the + `sitEstimatedCost`. + type: boolean + estimatedWeight: + description: The estimated weight of the PPM shipment goods being moved in pounds. + type: integer + example: 4200 + x-nullable: true + x-omitempty: false + hasProGear: + description: > + Indicates whether PPM shipment has pro gear for themselves or their + spouse. + type: boolean + x-nullable: true + x-omitempty: false + proGearWeight: + description: >- + The estimated weight of the pro-gear being moved belonging to the + service member in pounds. + type: integer + x-nullable: true + x-omitempty: false + spouseProGearWeight: + description: >- + The estimated weight of the pro-gear being moved belonging to a spouse + in pounds. + type: integer + x-nullable: true + x-omitempty: false + estimatedIncentive: + description: >- + The estimated amount the government will pay the service member to + move their belongings based on the moving date, locations, and + shipment weight. + type: integer + format: cents + x-nullable: true + x-omitempty: false + hasRequestedAdvance: + description: | + Indicates whether an advance has been requested for the PPM shipment. + type: boolean + x-nullable: true + x-omitempty: false + advanceAmountRequested: + description: > + The amount requested as an advance by the service member, up to a + maximum percentage of the estimated incentive. + type: integer + format: cents + x-nullable: true + x-omitempty: false + hasReceivedAdvance: + description: | + Indicates whether an advance was received for the PPM shipment. + type: boolean + x-nullable: true + x-omitempty: false + advanceAmountReceived: + description: | + The amount received for an advance, or null if no advance is received. + type: integer + format: cents + x-nullable: true + x-omitempty: false + sitLocation: + allOf: + - $ref: '#/definitions/SITLocationType' + - x-nullable: true + - x-omitempty: false + sitEstimatedWeight: + description: The estimated weight of the goods being put into storage in pounds. + type: integer + example: 2000 + x-nullable: true + x-omitempty: false + sitEstimatedEntryDate: + description: The date that goods will first enter the storage location. + format: date + type: string + x-nullable: true + x-omitempty: false + sitEstimatedDepartureDate: + description: The date that goods will exit the storage location. + format: date + type: string + x-nullable: true + x-omitempty: false + sitEstimatedCost: + description: >- + The estimated amount that the government will pay the service member + to put their goods into storage. This estimated storage cost is + separate from the estimated incentive. + type: integer + format: cents + x-nullable: true + x-omitempty: false + eTag: + description: >- + A hash unique to this shipment that should be used as the "If-Match" + header for any updates. + type: string + readOnly: true + required: + - id + - shipmentId + - createdAt + - status + - expectedDepartureDate + - pickupPostalCode + - destinationPostalCode + - sitExpected + - eTag + ShipmentAddressUpdateStatus: + type: string + title: Status + readOnly: true + x-display-value: + REQUESTED: REQUESTED + REJECTED: REJECTED + APPROVED: APPROVED + enum: + - REQUESTED + - REJECTED + - APPROVED + ShipmentAddressUpdate: + description: > + This represents a destination address change request made by the Prime + that is either auto-approved or requires review if the pricing criteria + has changed. If criteria has changed, then it must be approved or rejected + by a TOO. + type: object + properties: + id: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + readOnly: true + contractorRemarks: + type: string + example: This is a contractor remark + title: Contractor Remarks + description: The reason there is an address change. + readOnly: true + officeRemarks: + type: string + example: This is an office remark + title: Office Remarks + x-nullable: true + description: The TOO comment on approval or rejection. + status: + $ref: '#/definitions/ShipmentAddressUpdateStatus' + shipmentID: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + readOnly: true + originalAddress: + $ref: '#/definitions/Address' + newAddress: + $ref: '#/definitions/Address' + required: + - id + - status + - shipmentID + - originalAddress + - newAddress + - contractorRemarks + MTOShipmentWithoutServiceItems: + type: object + properties: + id: + description: The ID of the shipment. + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + readOnly: true + moveTaskOrderID: + description: The ID of the move for this shipment. + example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + format: uuid + type: string + readOnly: true + approvedDate: + description: >- + The date when the Transportation Ordering Officer first approved this + shipment for the move. + format: date + type: string + readOnly: true + x-omitempty: false + x-nullable: true + requestedPickupDate: + description: > + The date the customer selects during onboarding as their preferred + pickup date. Other dates, such as required delivery date and (outside + MilMove) the pack date, are derived from this date. + format: date + type: string + readOnly: true + x-omitempty: false + x-nullable: true + requestedDeliveryDate: + description: The customer's preferred delivery date. + format: date + type: string + readOnly: true + x-omitempty: false + x-nullable: true + scheduledPickupDate: + description: >- + The date the Prime contractor scheduled to pick up this shipment after + consultation with the customer. + format: date + type: string + x-omitempty: false + x-nullable: true + actualPickupDate: + description: >- + The date when the Prime contractor actually picked up the shipment. + Updated after-the-fact. + format: date + type: string + x-omitempty: false + x-nullable: true + firstAvailableDeliveryDate: + description: > + The date the Prime provides to the customer as the first possible + delivery date so that they can plan their travel accordingly. + format: date + type: string + x-omitempty: false + x-nullable: true + requiredDeliveryDate: + description: > + The latest date by which the Prime can deliver a customer's shipment + without violating the contract. This is calculated based on weight, + distance, and the scheduled pickup date. It cannot be modified. + format: date + type: string + readOnly: true + x-omitempty: false + x-nullable: true + scheduledDeliveryDate: + description: >- + The date the Prime contractor scheduled to deliver this shipment after + consultation with the customer. + format: date + type: string + x-omitempty: false + x-nullable: true + actualDeliveryDate: + description: >- + The date when the Prime contractor actually delivered the shipment. + Updated after-the-fact. + format: date + type: string + x-omitempty: false + x-nullable: true + primeEstimatedWeight: + description: > + The estimated weight of this shipment, determined by the movers during + the pre-move survey. This value **can only be updated once.** If there + was an issue with estimating the weight and a mistake was made, the + Prime contracter will need to contact the TOO to change it. + type: integer + example: 4500 + minimum: 1 + x-nullable: true + primeEstimatedWeightRecordedDate: + description: >- + The date when the Prime contractor recorded the shipment's estimated + weight. + format: date + type: string + readOnly: true + x-omitempty: false + x-nullable: true + primeActualWeight: + description: >- + The actual weight of the shipment, provided after the Prime packs, + picks up, and weighs a customer's shipment. + type: integer + example: 4500 + minimum: 1 + x-nullable: true + ntsRecordedWeight: + description: >- + The previously recorded weight for the NTS Shipment. Used for NTS + Release to know what the previous primeActualWeight or billable weight + was. + type: integer + example: 4500 + x-nullable: true + x-formatting: weight + customerRemarks: + description: > + The customer can use the customer remarks field to inform the services + counselor and the movers about any + + special circumstances for this shipment. Typical examples: + * bulky or fragile items, + * weapons, + * access info for their address. + + Customer enters this information during onboarding. Optional field. + type: string + example: handle with care + x-nullable: true + readOnly: true + counselorRemarks: + description: > + The counselor can use the counselor remarks field to inform the movers + about any + + special circumstances for this shipment. Typical examples: + * bulky or fragile items, + * weapons, + * access info for their address. + + Counselors enters this information when creating or editing an MTO + Shipment. Optional field. + type: string + example: handle with care + x-nullable: true + readOnly: true + agents: + $ref: '#/definitions/MTOAgents-2' + sitExtensions: + $ref: '#/definitions/SITExtensions' + reweigh: + $ref: '#/definitions/Reweigh' + pickupAddress: + description: > + The address where the movers should pick up this shipment, entered by + the customer during onboarding when they enter shipment details. + allOf: + - $ref: '#/definitions/Address' + destinationAddress: + description: > + Where the movers should deliver this shipment. Often provided by the + customer when they enter shipment details + + during onboarding, if they know their new address already. + + + May be blank when entered by the customer, required when entered by + the Prime. May not represent the true + + final destination due to the shipment being diverted or placed in SIT. + allOf: + - $ref: '#/definitions/Address' + destinationType: + $ref: '#/definitions/DestinationType' + secondaryPickupAddress: + description: >- + A second pickup address for this shipment, if the customer entered + one. An optional field. + allOf: + - $ref: '#/definitions/Address' + secondaryDeliveryAddress: + description: >- + A second delivery address for this shipment, if the customer entered + one. An optional field. + allOf: + - $ref: '#/definitions/Address' + storageFacility: + allOf: + - x-nullable: true + - $ref: '#/definitions/StorageFacility' + shipmentType: + $ref: '#/definitions/MTOShipmentType-2' + diversion: + description: > + This value indicates whether or not this shipment is part of a + diversion. If yes, the shipment can be either the starting or ending + segment of the diversion. + type: boolean + status: + description: > + The status of a shipment, indicating where it is in the TOO's approval + process. Can only be updated by the contractor in special + circumstances. + type: string + readOnly: true + enum: + - SUBMITTED + - APPROVED + - REJECTED + - CANCELLATION_REQUESTED + - CANCELED + - DIVERSION_REQUESTED + ppmShipment: + $ref: '#/definitions/PPMShipment-2' + deliveryAddressUpdate: + $ref: '#/definitions/ShipmentAddressUpdate' + eTag: + description: >- + A hash unique to this shipment that should be used as the "If-Match" + header for any updates. + type: string + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + updatedAt: + format: date-time + type: string + readOnly: true + pointOfContact: + type: string + description: > + Email or ID of the person who will be contacted in the event of + questions or concerns about this update. May be the person performing + the update, or someone else working with the Prime contractor. + MTOShipmentsWithoutServiceObjects: + description: A list of shipments without their associated service items. + items: + $ref: '#/definitions/MTOShipmentWithoutServiceItems' + type: array + MoveTaskOrder: + type: object + required: + - mtoShipments + - mtoServiceItems + - paymentRequests + properties: + id: + example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + format: uuid + type: string + moveCode: + type: string + example: HYXFJF + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + orderID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + order: + $ref: '#/definitions/Order' + referenceId: + example: 1001-3456 + type: string + availableToPrimeAt: + format: date-time + type: string + x-nullable: true + readOnly: true + updatedAt: + format: date-time + type: string + readOnly: true + primeCounselingCompletedAt: + format: date-time + type: string + x-nullable: true + readOnly: true + paymentRequests: + $ref: '#/definitions/PaymentRequests' + mtoServiceItems: + type: array + items: + $ref: '#/definitions/MTOServiceItem' + mtoShipments: + $ref: '#/definitions/MTOShipmentsWithoutServiceObjects' + ppmType: + type: string + enum: + - PARTIAL + - FULL + ppmEstimatedWeight: + type: integer + excessWeightQualifiedAt: + type: string + format: date-time + readOnly: true + x-omitempty: false + x-nullable: true + excessWeightAcknowledgedAt: + type: string + format: date-time + readOnly: true + x-omitempty: false + x-nullable: true + excessWeightUploadId: + type: string + format: uuid + readOnly: true + x-omitempty: false + x-nullable: true + eTag: + type: string + readOnly: true + PpmID: + description: | + The PPM Shipment ID to associate with the assigned certificate. + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + x-nullable: true + MovingExpenseType: + type: string + description: Moving Expense Type + enum: + - CONTRACTED_EXPENSE + - GAS + - OIL + - OTHER + - PACKING_MATERIALS + - RENTAL_EQUIPMENT + - STORAGE + - TOLLS + - WEIGHING_FEE + x-display-value: + CONTRACTED_EXPENSE: Contracted expense + GAS: Gas + OIL: Oil + OTHER: Other + PACKING_MATERIALS: Packing materials + STORAGE: Storage + RENTAL_EQUIPMENT: Rental equipment + TOLLS: Tolls + WEIGHING_FEE: Weighing fee + NullableString: + type: string + x-go-type: + import: + package: github.com/transcom/mymove/pkg/swagger/nullable + type: String +paths: + /estimates/ppm: + get: + summary: Return a PPM cost estimate + description: Calculates a reimbursement range for a PPM move (excluding SIT) + operationId: showPPMEstimate + tags: + - ppm + parameters: + - in: query + name: original_move_date + type: string + format: date + required: true + - in: query + name: origin_zip + type: string + format: zip + pattern: ^(\d{5}([\-]\d{4})?)$ + required: true + - in: query + name: origin_duty_location_zip + type: string + format: zip + pattern: ^(\d{5}([\-]\d{4})?)$ + required: true + - in: query + name: orders_id + type: string + format: uuid + required: true + - in: query + name: weight_estimate + type: integer + required: true + responses: + '200': + description: Made estimate of PPM cost range + schema: + $ref: '#/definitions/PPMEstimateRange' + '400': + description: invalid request + '401': + description: request requires user authentication + '403': + description: user is not authorized + '404': + description: >- + ppm discount not found for provided postal codes and original move + date + '409': + description: distance is less than 50 miles (no short haul moves) + '422': + description: cannot process request with given information + '500': + description: internal server error + /estimates/ppm_sit: + get: + summary: Return a PPM move's SIT cost estimate + description: Calculates a reimbursment for a PPM move's SIT + operationId: showPPMSitEstimate + tags: + - ppm + parameters: - in: query name: personally_procured_move_id type: string @@ -4266,6 +5657,36 @@ paths: description: payload is too large '500': description: server error + /all_moves/{serviceMemberId}: + get: + summary: Return the current and previous moves of a service member + description: | + Gets all moves that belongs to the serviceMember + operationId: getAllMoves + tags: + - moves + produces: + - application/json + parameters: + - in: path + name: serviceMemberId + type: string + format: uuid + required: true + description: UUID of the service member + responses: + '200': + description: >- + Successfully retrieved moves. A successful fetch might still return + zero moves. + schema: + $ref: '#/definitions/MovesList' + '401': + $ref: '#/responses/PermissionDenied' + '403': + $ref: '#/responses/PermissionDenied' + '500': + $ref: '#/responses/ServerError' /moves/{moveId}: patch: summary: Patches the move From 708e93756b62c708a2ffabb4cfe288678904bb2d Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Tue, 23 Jan 2024 19:30:06 +0000 Subject: [PATCH 02/67] Created getAllMoves handler --- pkg/handlers/internalapi/api.go | 2 ++ pkg/handlers/internalapi/moves.go | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/pkg/handlers/internalapi/api.go b/pkg/handlers/internalapi/api.go index 7ff49ce9db7..21228407c48 100644 --- a/pkg/handlers/internalapi/api.go +++ b/pkg/handlers/internalapi/api.go @@ -86,6 +86,8 @@ func NewInternalAPI(handlerConfig handlers.HandlerConfig) *internalops.MymoveAPI } internalAPI.MovesPatchMoveHandler = PatchMoveHandler{handlerConfig, closeoutOfficeUpdater} + internalAPI.MovesGetAllMovesHandler = GetAllMovesHandler{handlerConfig} + internalAPI.MovesShowMoveHandler = ShowMoveHandler{handlerConfig} internalAPI.MovesSubmitMoveForApprovalHandler = SubmitMoveHandler{ handlerConfig, diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index 2094c97ccdf..54cec9cc0e4 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -354,3 +354,16 @@ func (h SubmitAmendedOrdersHandler) Handle(params moveop.SubmitAmendedOrdersPara return moveop.NewSubmitAmendedOrdersOK().WithPayload(movePayload), nil }) } + +type GetAllMovesHandler struct { + handlers.HandlerConfig +} + +// GetAllMovesHandler returns the current and all previous moves of a service member +func (h GetAllMovesHandler) Handle(params moveop.GetAllMovesParams) middleware.Responder { + return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, + func(appCtx appcontext.AppContext) (middleware.Responder, error) { + + return moveop.NewGetAllMovesOK().WithPayload(nil), nil + }) +} From 81de9931d5189c1257ab50b76b4082e81f0cfa51 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 24 Jan 2024 16:04:04 +0000 Subject: [PATCH 03/67] Initial commit, templates, notification code, and tests. --- .../prime_counseling_complete_template.html | 26 +++ .../prime_counseling_complete_template.txt | 29 +++ pkg/handlers/primeapi/move_task_order.go | 10 + .../prime_counseling_complete.go | 127 +++++++++++++ .../prime_counseling_complete_test.go | 177 ++++++++++++++++++ 5 files changed, 369 insertions(+) create mode 100644 pkg/assets/notifications/templates/prime_counseling_complete_template.html create mode 100644 pkg/assets/notifications/templates/prime_counseling_complete_template.txt create mode 100644 pkg/notifications/prime_counseling_complete.go create mode 100644 pkg/notifications/prime_counseling_complete_test.go diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.html b/pkg/assets/notifications/templates/prime_counseling_complete_template.html new file mode 100644 index 00000000000..90453a4a3db --- /dev/null +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.html @@ -0,0 +1,26 @@ +

*** DO NOT REPLY directly to this email ***

+

This is a confirmation that your counselor has approved move details for the assigned move code {{.Locator}} from {{.OriginDutyLocation}} to {{.DestinationDutyLocation}} in the MilMove system.

+

What this means to you:

+

If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

+

Next steps for a PPM:

+
    +
  • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
  • +
  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • +
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • +
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
  • +
+

Next steps for government arranged shipments:

+
    +
  • If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request.
  • +
  • If you have not already done so, please schedule a pre-move survey using HomeSafe Connect or by contacting a HomeSafe Customer Care Representative.
  • +
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
  • +
+

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

+

Thank you,

+ +

USTRANSCOM MilMove Team

+ +

+ The information contained in this email may contain Privacy Act information and is therefore protected under the + Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine. +

\ No newline at end of file diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.txt b/pkg/assets/notifications/templates/prime_counseling_complete_template.txt new file mode 100644 index 00000000000..ffe89d739bf --- /dev/null +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.txt @@ -0,0 +1,29 @@ +*** DO NOT REPLY directly to this email *** +This is a confirmation that your counselor has approved move details for the assigned move code {{.Locator}} from {{.OriginDutyLocation}} to {{.DestinationDutyLocation}} in the MilMove system. + +What this means to you: +If you are doing a Personally Procured Move (PPM), you can start moving your personal property. + +Next steps for a PPM: +• Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected. + +• If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. + +• If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: + +• Once you complete your PPM, log into MilMove , upload your receipts and weight tickets, and submit your PPM for review. + +Next steps for government arranged shipments: +• If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request. + +• If you have not already done so, please schedule a pre-move survey using HomeSafe Connect or by contacting a HomeSafe Customer Care Representative. + +• HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove. + +If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL. + +Thank you, + +USTRANSCOM MilMove Team + +The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine. \ No newline at end of file diff --git a/pkg/handlers/primeapi/move_task_order.go b/pkg/handlers/primeapi/move_task_order.go index 791638fa7d3..c8d97ea5242 100644 --- a/pkg/handlers/primeapi/move_task_order.go +++ b/pkg/handlers/primeapi/move_task_order.go @@ -18,6 +18,7 @@ import ( "github.com/transcom/mymove/pkg/handlers" "github.com/transcom/mymove/pkg/handlers/primeapi/payloads" "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/notifications" "github.com/transcom/mymove/pkg/services" ) @@ -194,7 +195,16 @@ func (h UpdateMTOPostCounselingInformationHandler) Handle(params movetaskorderop payloads.InternalServerError(nil, h.GetTraceIDFromRequest(params.HTTPRequest))), err } } + mtoPayload := payloads.MoveTaskOrder(mto) + err = h.NotificationSender().SendNotification(appCtx, + notifications.NewPrimeCounselingComplete(*mtoPayload), + ) + if err != nil { + return movetaskorderops.NewUpdateMTOPostCounselingInformationInternalServerError().WithPayload( + payloads.InternalServerError(nil, h.GetTraceIDFromRequest(params.HTTPRequest))), err + } + return movetaskorderops.NewUpdateMTOPostCounselingInformationOK().WithPayload(mtoPayload), nil }) } diff --git a/pkg/notifications/prime_counseling_complete.go b/pkg/notifications/prime_counseling_complete.go new file mode 100644 index 00000000000..05da7595c12 --- /dev/null +++ b/pkg/notifications/prime_counseling_complete.go @@ -0,0 +1,127 @@ +package notifications + +import ( + "bytes" + "fmt" + html "html/template" + text "text/template" + + "go.uber.org/zap" + + "github.com/transcom/mymove/pkg/appcontext" + "github.com/transcom/mymove/pkg/assets" + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +var ( + PrimeCounselingCompleteRawText = string(assets.MustAsset("notifications/templates/prime_counseling_complete_template.txt")) + PrimeCounselingCompleteTextTemplate = text.Must(text.New("text_template").Parse(PrimeCounselingCompleteRawText)) + PrimeCounselingCompleteRawHTML = string(assets.MustAsset("notifications/templates/prime_counseling_complete_template.html")) + PrimeCounselingCompleteHTMLTemplate = html.Must(html.New("text_template").Parse(PrimeCounselingCompleteRawHTML)) +) + +// PrimeCounselingComplete has notification content for moves that have had their counseling completed by the Prime +type PrimeCounselingComplete struct { + moveTaskOrder primemessages.MoveTaskOrder + htmlTemplate *html.Template + textTemplate *text.Template +} + +// PrimeCounselingCompleteData is used to render an email template +type PrimeCounselingCompleteData struct { + CustomerEmail string + OriginDutyLocation string + DestinationDutyLocation string + Locator string +} + +// NewPrimeCounselingComplete returns a new payment reminder notification 14 days after actual move in date +func NewPrimeCounselingComplete(moveTaskOrder primemessages.MoveTaskOrder) *PrimeCounselingComplete { + + return &PrimeCounselingComplete{ + moveTaskOrder: moveTaskOrder, + htmlTemplate: PrimeCounselingCompleteHTMLTemplate, + textTemplate: PrimeCounselingCompleteTextTemplate, + } +} + +// NotificationSendingContext expects a `notification` with an `emails` method, +// so we implement `email` to satisfy that interface +func (m PrimeCounselingComplete) emails(appCtx appcontext.AppContext) ([]emailContent, error) { + var emails []emailContent + + appCtx.Logger().Info("MTO (Move Task Order) Locator", + zap.String("uuid", m.moveTaskOrder.MoveCode), + ) + + emailData, err := GetEmailData(m.moveTaskOrder, appCtx) + if err != nil { + return nil, err + } + var htmlBody, textBody string + htmlBody, textBody, err = m.renderTemplates(appCtx, emailData) + + if err != nil { + appCtx.Logger().Error("error rendering template", zap.Error(err)) + } + + primeCounselingEmail := emailContent{ + recipientEmail: emailData.CustomerEmail, + subject: "Your counselor has approved your move details", + htmlBody: htmlBody, + textBody: textBody, + } + + return append(emails, primeCounselingEmail), nil +} + +func GetEmailData(m primemessages.MoveTaskOrder, appCtx appcontext.AppContext) (PrimeCounselingCompleteData, error) { + if m.Order.Customer.Email == "" { + return PrimeCounselingCompleteData{}, fmt.Errorf("no email found for service member") + } + + appCtx.Logger().Info("generated Prime Counseling Completed email", + zap.String("service member uuid", string(m.Order.Customer.ID)), + zap.String("service member email", string(m.Order.Customer.Email)), + zap.String("Move Locator", string(m.MoveCode)), + zap.String("Origin Duty Location Name", string(m.Order.OriginDutyLocation.Name)), + zap.String("Destination Duty Location Name", string(m.Order.DestinationDutyLocation.Name)), + ) + + return PrimeCounselingCompleteData{ + OriginDutyLocation: m.Order.OriginDutyLocation.Name, + DestinationDutyLocation: m.Order.DestinationDutyLocation.Name, + Locator: m.MoveCode, + }, nil +} + +func (m PrimeCounselingComplete) renderTemplates(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, string, error) { + htmlBody, err := m.RenderHTML(appCtx, data) + if err != nil { + return "", "", fmt.Errorf("error rendering html template using %#v", data) + } + textBody, err := m.RenderText(appCtx, data) + if err != nil { + return "", "", fmt.Errorf("error rendering text template using %#v", data) + } + return htmlBody, textBody, nil +} + +// RenderHTML renders the html for the email +func (m PrimeCounselingComplete) RenderHTML(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error) { + var htmlBuffer bytes.Buffer + if err := m.htmlTemplate.Execute(&htmlBuffer, data); err != nil { + appCtx.Logger().Error("cant render html template ", zap.Error(err)) + } + return htmlBuffer.String(), nil +} + +// RenderText renders the text for the email +func (m PrimeCounselingComplete) RenderText(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error) { + var textBuffer bytes.Buffer + if err := m.textTemplate.Execute(&textBuffer, data); err != nil { + appCtx.Logger().Error("cant render text template ", zap.Error(err)) + return "", err + } + return textBuffer.String(), nil +} \ No newline at end of file diff --git a/pkg/notifications/prime_counseling_complete_test.go b/pkg/notifications/prime_counseling_complete_test.go new file mode 100644 index 00000000000..352c3982e9f --- /dev/null +++ b/pkg/notifications/prime_counseling_complete_test.go @@ -0,0 +1,177 @@ +package notifications + +import ( + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +var member = primemessages.Customer{Email: "test@example.com"} +var primeOrder = primemessages.Order{ + OriginDutyLocation: &primemessages.DutyLocation{Name: "Fort Origin"}, + DestinationDutyLocation: &primemessages.DutyLocation{Name: "Fort Destination"}, + Customer: &member, +} +var payload = primemessages.MoveTaskOrder{ + MoveCode: "TEST00", + Order: &primeOrder, +} +var correctPrimeCounselingData = PrimeCounselingCompleteData{ + CustomerEmail: "test@example.com", + Locator: "TEST00", + OriginDutyLocation: "Fort Origin", + DestinationDutyLocation: "Fort Destination", +} + +func (suite *NotificationSuite) TestPrimeCounselingComplete() { + + // Create a move that is available to prime and has the counseling service item attached + // move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + // reServiceCS := factory.BuildReServiceByCode(suite.DB(), models.ReServiceCodeCS) + // serviceItemCS := models.MTOServiceItem{ + // MoveTaskOrderID: move.ID, + // MoveTaskOrder: move, + // ReService: reServiceCS, + // Status: models.MTOServiceItemStatusApproved, + // } + // factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{ + // { + // Model: move, + // LinkOnly: true, + // }, + // { + // Model: serviceItemCS, + // }, + // }, nil) + //serviceMember := factory.BuildServiceMember() // "leo_spaceman_sm@example.com" + // dutyLocation := factory.FetchOrBuildCurrentDutyLocation(suite.DB()) + // dutyLocation2 := factory.FetchOrBuildOrdersDutyLocation(suite.DB()) + // order := factory.BuildOrder(suite.DB(), []factory.Customization{ + // { + // Model: dutyLocation, + // LinkOnly: true, + // Type: &factory.DutyLocations.OriginDutyLocation, + // }, + // { + // Model: dutyLocation2, + // LinkOnly: true, + // Type: &factory.DutyLocations.NewDutyLocation, + // }, + // { + // Model: serviceMember, + // Type: &factory.ServiceMember, + // }, + // }, nil) + + // member := primemessages.Customer{Email: "test@example.com"} + // primeOrder := primemessages.Order { + // OriginDutyLocation: &primemessages.DutyLocation{Name: "Fort Origin"}, + // DestinationDutyLocation: &primemessages.DutyLocation{Name: "Fort Destination"}, + // Customer: &member, + // } + // payload := primemessages.MoveTaskOrder{ + // MoveCode: "TEST00", + // Order: &primeOrder, + // } + + ///moveTaskOrder := payloads.MoveTaskOrder(&move) + notification := NewPrimeCounselingComplete(payload) + + primeCounselingEmailData, err := GetEmailData(notification.moveTaskOrder, suite.AppContextForTest()) + suite.NoError(err) + suite.NotNil(primeCounselingEmailData) + suite.Equal(primeCounselingEmailData, correctPrimeCounselingData) + + suite.EqualExportedValues(primeCounselingEmailData, PrimeCounselingCompleteData{ + OriginDutyLocation: primeOrder.OriginDutyLocation.Name, + DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, + Locator: payload.MoveCode, + }) + + expectedHTMLContent := getCorrectEmailTemplate(primeCounselingEmailData) + + htmlContent, err := notification.RenderHTML(suite.AppContextForTest(), primeCounselingEmailData) + + suite.NoError(err) + suite.Equal(expectedHTMLContent, htmlContent) +} + +func (suite *NotificationSuite) TestPrimeCounselingCompleteTextTemplateRender() { + notification := NewPrimeCounselingComplete(payload) + + primeCounselingEmailData, err := GetEmailData(notification.moveTaskOrder, suite.AppContextForTest()) + suite.NoError(err) + suite.NotNil(primeCounselingEmailData) + suite.Equal(primeCounselingEmailData, correctPrimeCounselingData) + + suite.EqualExportedValues(primeCounselingEmailData, PrimeCounselingCompleteData{ + OriginDutyLocation: primeOrder.OriginDutyLocation.Name, + DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, + Locator: payload.MoveCode, + }) + + expectedTextContent := getCorrectTextTemplate(primeCounselingEmailData) + + textContent, err := notification.RenderText(suite.AppContextForTest(), primeCounselingEmailData) + + suite.NoError(err) + suite.Equal(expectedTextContent, textContent) +} + +func getCorrectEmailTemplate(emailData PrimeCounselingCompleteData) string { + return `Subject Line: Your counselor has approved your move details +Email message body: +

*** DO NOT REPLY directly to this email ***

+

This is a confirmation that your counselor has approved move details for the assigned move code ` + emailData.Locator + ` from ` + emailData.OriginDutyLocation + ` to ` + emailData.DestinationDutyLocation + ` in the MilMove system.

+

What this means to you:

+

If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

+

Next steps for a PPM:

+
    +
  • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
  • +
  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • +
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • +
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
  • +
+

Next steps for government arranged shipments:

+
    +
  • If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request.
  • +
  • If you have not already done so, please schedule a pre-move survey using HomeSafe Connect or by contacting a HomeSafe Customer Care Representative.
  • +
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
  • +
+

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

+

Thank you,

+ +

USTRANSCOM MilMove Team

+ +

The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.

` +} + +func getCorrectTextTemplate(emailData PrimeCounselingCompleteData) string { + return `Subject Line: Your counselor has approved your move details +Email message body: +*** DO NOT REPLY directly to this email *** +This is a confirmation that your counselor has approved move details for the assigned move code ` + emailData.Locator + ` from ` + emailData.OriginDutyLocation + ` to ` + emailData.DestinationDutyLocation + ` in the MilMove system. +What this means to you: +If you are doing a Personally Procured Move (PPM), you can start moving your personal property. +Next steps for a PPM: +• Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected. + +• If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. + +• If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: + +• Once you complete your PPM, log into MilMove , upload your receipts and weight tickets, and submit your PPM for review. + +Next steps for government arranged shipments: +• If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request. + +• If you have not already done so, please schedule a pre-move survey using HomeSafe Connect or by contacting a HomeSafe Customer Care Representative. + +• HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove. + +If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL. + +Thank you, + +USTRANSCOM MilMove Team + +The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.` +} \ No newline at end of file From 9990f6e9dc4bf59518414b46a091ca0aec2d12b1 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 24 Jan 2024 16:56:08 +0000 Subject: [PATCH 04/67] New tests passing. --- .../prime_counseling_complete_template.html | 10 ++++---- .../prime_counseling_complete_test.go | 23 ++++++++----------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.html b/pkg/assets/notifications/templates/prime_counseling_complete_template.html index 90453a4a3db..c302e7db339 100644 --- a/pkg/assets/notifications/templates/prime_counseling_complete_template.html +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.html @@ -5,17 +5,17 @@

Next steps for a PPM:

  • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
  • -
  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • -
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • -
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
  • +
  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • +
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • +
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.

Next steps for government arranged shipments:

  • If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request.
  • If you have not already done so, please schedule a pre-move survey using HomeSafe Connect or by contacting a HomeSafe Customer Care Representative.
  • -
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
  • +
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
-

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

+

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

Thank you,

USTRANSCOM MilMove Team

diff --git a/pkg/notifications/prime_counseling_complete_test.go b/pkg/notifications/prime_counseling_complete_test.go index 352c3982e9f..248c9dbeccf 100644 --- a/pkg/notifications/prime_counseling_complete_test.go +++ b/pkg/notifications/prime_counseling_complete_test.go @@ -15,7 +15,6 @@ var payload = primemessages.MoveTaskOrder{ Order: &primeOrder, } var correctPrimeCounselingData = PrimeCounselingCompleteData{ - CustomerEmail: "test@example.com", Locator: "TEST00", OriginDutyLocation: "Fort Origin", DestinationDutyLocation: "Fort Destination", @@ -117,26 +116,24 @@ func (suite *NotificationSuite) TestPrimeCounselingCompleteTextTemplateRender() } func getCorrectEmailTemplate(emailData PrimeCounselingCompleteData) string { - return `Subject Line: Your counselor has approved your move details -Email message body: -

*** DO NOT REPLY directly to this email ***

-

This is a confirmation that your counselor has approved move details for the assigned move code ` + emailData.Locator + ` from ` + emailData.OriginDutyLocation + ` to ` + emailData.DestinationDutyLocation + ` in the MilMove system.

+ return `

*** DO NOT REPLY directly to this email ***

+

This is a confirmation that your counselor has approved move details for the assigned move code ` + emailData.Locator + ` from ` + emailData.OriginDutyLocation + ` to ` + emailData.DestinationDutyLocation + ` in the MilMove system.

What this means to you:

If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

Next steps for a PPM:

  • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
  • -
  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • -
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • -
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
  • +
  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • +
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • +
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.

Next steps for government arranged shipments:

  • If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request.
  • If you have not already done so, please schedule a pre-move survey using HomeSafe Connect or by contacting a HomeSafe Customer Care Representative.
  • -
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
  • +
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
-

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

+

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

Thank you,

USTRANSCOM MilMove Team

@@ -145,12 +142,12 @@ Email message body: } func getCorrectTextTemplate(emailData PrimeCounselingCompleteData) string { - return `Subject Line: Your counselor has approved your move details -Email message body: -*** DO NOT REPLY directly to this email *** + return `*** DO NOT REPLY directly to this email *** This is a confirmation that your counselor has approved move details for the assigned move code ` + emailData.Locator + ` from ` + emailData.OriginDutyLocation + ` to ` + emailData.DestinationDutyLocation + ` in the MilMove system. + What this means to you: If you are doing a Personally Procured Move (PPM), you can start moving your personal property. + Next steps for a PPM: • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected. From 0eed4706e377a456ed958bf3161fcb50c7f9a1ad Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 24 Jan 2024 20:09:36 +0000 Subject: [PATCH 05/67] Fixed email sending and edited tests. --- .../templates/prime_counseling_complete_template.html | 7 ++++++- pkg/handlers/primeapi/move_task_order.go | 1 + pkg/notifications/prime_counseling_complete.go | 1 + pkg/notifications/prime_counseling_complete_test.go | 7 ++++++- pkg/testdatagen/testharness/make_move.go | 4 +++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.html b/pkg/assets/notifications/templates/prime_counseling_complete_template.html index c302e7db339..99592bba434 100644 --- a/pkg/assets/notifications/templates/prime_counseling_complete_template.html +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.html @@ -1,18 +1,23 @@

*** DO NOT REPLY directly to this email ***

-

This is a confirmation that your counselor has approved move details for the assigned move code {{.Locator}} from {{.OriginDutyLocation}} to {{.DestinationDutyLocation}} in the MilMove system.

+

This is a confirmation that your counselor has approved move details for the assigned move code {{.Locator}} from {{.OriginDutyLocation}} to {{.DestinationDutyLocation}} in the MilMove system.

What this means to you:

If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

Next steps for a PPM:

  • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
  • +
  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • +
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • +
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.

Next steps for government arranged shipments:

  • If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request.
  • +
  • If you have not already done so, please schedule a pre-move survey using HomeSafe Connect or by contacting a HomeSafe Customer Care Representative.
  • +
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

diff --git a/pkg/handlers/primeapi/move_task_order.go b/pkg/handlers/primeapi/move_task_order.go index c8d97ea5242..3ee118db51a 100644 --- a/pkg/handlers/primeapi/move_task_order.go +++ b/pkg/handlers/primeapi/move_task_order.go @@ -201,6 +201,7 @@ func (h UpdateMTOPostCounselingInformationHandler) Handle(params movetaskorderop notifications.NewPrimeCounselingComplete(*mtoPayload), ) if err != nil { + appCtx.Logger().Error(err.Error()) return movetaskorderops.NewUpdateMTOPostCounselingInformationInternalServerError().WithPayload( payloads.InternalServerError(nil, h.GetTraceIDFromRequest(params.HTTPRequest))), err } diff --git a/pkg/notifications/prime_counseling_complete.go b/pkg/notifications/prime_counseling_complete.go index 05da7595c12..5634277b698 100644 --- a/pkg/notifications/prime_counseling_complete.go +++ b/pkg/notifications/prime_counseling_complete.go @@ -89,6 +89,7 @@ func GetEmailData(m primemessages.MoveTaskOrder, appCtx appcontext.AppContext) ( ) return PrimeCounselingCompleteData{ + CustomerEmail: m.Order.Customer.Email, OriginDutyLocation: m.Order.OriginDutyLocation.Name, DestinationDutyLocation: m.Order.DestinationDutyLocation.Name, Locator: m.MoveCode, diff --git a/pkg/notifications/prime_counseling_complete_test.go b/pkg/notifications/prime_counseling_complete_test.go index 248c9dbeccf..1acc7da686d 100644 --- a/pkg/notifications/prime_counseling_complete_test.go +++ b/pkg/notifications/prime_counseling_complete_test.go @@ -117,20 +117,25 @@ func (suite *NotificationSuite) TestPrimeCounselingCompleteTextTemplateRender() func getCorrectEmailTemplate(emailData PrimeCounselingCompleteData) string { return `

*** DO NOT REPLY directly to this email ***

-

This is a confirmation that your counselor has approved move details for the assigned move code ` + emailData.Locator + ` from ` + emailData.OriginDutyLocation + ` to ` + emailData.DestinationDutyLocation + ` in the MilMove system.

+

This is a confirmation that your counselor has approved move details for the assigned move code ` + emailData.Locator + ` from ` + emailData.OriginDutyLocation + ` to ` + emailData.DestinationDutyLocation + ` in the MilMove system.

What this means to you:

If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

Next steps for a PPM:

  • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
  • +
  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • +
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • +
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.

Next steps for government arranged shipments:

  • If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request.
  • +
  • If you have not already done so, please schedule a pre-move survey using HomeSafe Connect or by contacting a HomeSafe Customer Care Representative.
  • +
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

diff --git a/pkg/testdatagen/testharness/make_move.go b/pkg/testdatagen/testharness/make_move.go index 14a05eac322..7705e85e5a9 100644 --- a/pkg/testdatagen/testharness/make_move.go +++ b/pkg/testdatagen/testharness/make_move.go @@ -2285,9 +2285,11 @@ func MakeHHGMoveWithRetireeForTOO(appCtx appcontext.AppContext) models.Move { retirement := internalmessages.OrdersTypeRETIREMENT hhg := models.MTOShipmentTypeHHG hor := models.DestinationTypeHomeOfRecord + originDutyLocation := factory.FetchOrBuildCurrentDutyLocation(appCtx.DB()) move := scenario.CreateMoveWithOptions(appCtx, testdatagen.Assertions{ Order: models.Order{ - OrdersType: retirement, + OrdersType: retirement, + OriginDutyLocation: &originDutyLocation, }, MTOShipment: models.MTOShipment{ ShipmentType: hhg, From 80b91d66b1f39da01d022a7c23e6a07dddb12779 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Thu, 25 Jan 2024 03:44:19 +0000 Subject: [PATCH 06/67] Returning All moves payload --- pkg/gen/internalapi/embedded_spec.go | 3536 +++-------------- pkg/gen/internalmessages/destination_type.go | 85 - pkg/gen/internalmessages/internal_move.go | 409 ++ pkg/gen/internalmessages/m_t_o_agent2.go | 306 -- pkg/gen/internalmessages/m_t_o_agent_type2.go | 82 - pkg/gen/internalmessages/m_t_o_agents2.go | 85 - .../internalmessages/m_t_o_service_item.go | 465 --- .../m_t_o_service_item_model_type.go | 95 - .../m_t_o_service_item_status.go | 90 - .../internalmessages/m_t_o_shipment_type2.go | 107 - .../m_t_o_shipment_without_service_items.go | 1165 ------ ...m_t_o_shipments_without_service_objects.go | 78 - pkg/gen/internalmessages/move_task_order.go | 842 ---- pkg/gen/internalmessages/moves_list.go | 4 +- pkg/gen/internalmessages/p_p_m_shipment2.go | 670 ---- pkg/gen/internalmessages/payment_request.go | 322 -- .../payment_request_status.go | 96 - pkg/gen/internalmessages/payment_requests.go | 78 - .../internalmessages/payment_service_item.go | 266 -- .../payment_service_item_param.go | 274 -- .../payment_service_item_params.go | 78 - .../payment_service_item_status.go | 90 - .../internalmessages/payment_service_items.go | 78 - .../internalmessages/proof_of_service_doc.go | 121 - .../internalmessages/proof_of_service_docs.go | 78 - pkg/gen/internalmessages/reweigh.go | 280 -- pkg/gen/internalmessages/reweigh_requester.go | 84 - pkg/gen/internalmessages/s_i_t_extension.go | 291 -- pkg/gen/internalmessages/s_i_t_extensions.go | 78 - .../service_item_param_name.go | 270 -- .../service_item_param_origin.go | 84 - .../service_item_param_type.go | 93 - .../service_request_document.go | 121 - .../service_request_documents.go | 78 - .../shipment_address_update.go | 315 -- .../shipment_address_update_status.go | 90 - pkg/gen/internalmessages/storage_facility.go | 194 - .../internalmessages/upload_with_omissions.go | 276 -- pkg/handlers/internalapi/moves.go | 106 +- pkg/models/move.go | 26 + swagger-def/internal.yaml | 58 +- swagger/internal.yaml | 1291 +----- 42 files changed, 1132 insertions(+), 12103 deletions(-) delete mode 100644 pkg/gen/internalmessages/destination_type.go create mode 100644 pkg/gen/internalmessages/internal_move.go delete mode 100644 pkg/gen/internalmessages/m_t_o_agent2.go delete mode 100644 pkg/gen/internalmessages/m_t_o_agent_type2.go delete mode 100644 pkg/gen/internalmessages/m_t_o_agents2.go delete mode 100644 pkg/gen/internalmessages/m_t_o_service_item.go delete mode 100644 pkg/gen/internalmessages/m_t_o_service_item_model_type.go delete mode 100644 pkg/gen/internalmessages/m_t_o_service_item_status.go delete mode 100644 pkg/gen/internalmessages/m_t_o_shipment_type2.go delete mode 100644 pkg/gen/internalmessages/m_t_o_shipment_without_service_items.go delete mode 100644 pkg/gen/internalmessages/m_t_o_shipments_without_service_objects.go delete mode 100644 pkg/gen/internalmessages/move_task_order.go delete mode 100644 pkg/gen/internalmessages/p_p_m_shipment2.go delete mode 100644 pkg/gen/internalmessages/payment_request.go delete mode 100644 pkg/gen/internalmessages/payment_request_status.go delete mode 100644 pkg/gen/internalmessages/payment_requests.go delete mode 100644 pkg/gen/internalmessages/payment_service_item.go delete mode 100644 pkg/gen/internalmessages/payment_service_item_param.go delete mode 100644 pkg/gen/internalmessages/payment_service_item_params.go delete mode 100644 pkg/gen/internalmessages/payment_service_item_status.go delete mode 100644 pkg/gen/internalmessages/payment_service_items.go delete mode 100644 pkg/gen/internalmessages/proof_of_service_doc.go delete mode 100644 pkg/gen/internalmessages/proof_of_service_docs.go delete mode 100644 pkg/gen/internalmessages/reweigh.go delete mode 100644 pkg/gen/internalmessages/reweigh_requester.go delete mode 100644 pkg/gen/internalmessages/s_i_t_extension.go delete mode 100644 pkg/gen/internalmessages/s_i_t_extensions.go delete mode 100644 pkg/gen/internalmessages/service_item_param_name.go delete mode 100644 pkg/gen/internalmessages/service_item_param_origin.go delete mode 100644 pkg/gen/internalmessages/service_item_param_type.go delete mode 100644 pkg/gen/internalmessages/service_request_document.go delete mode 100644 pkg/gen/internalmessages/service_request_documents.go delete mode 100644 pkg/gen/internalmessages/shipment_address_update.go delete mode 100644 pkg/gen/internalmessages/shipment_address_update_status.go delete mode 100644 pkg/gen/internalmessages/storage_facility.go delete mode 100644 pkg/gen/internalmessages/upload_with_omissions.go diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index 0e95106c6e0..f9dec64d2a6 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4404,18 +4404,6 @@ func init() { }, "x-nullable": true }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, "Document": { "type": "object", "required": [ @@ -4712,6 +4700,76 @@ func init() { "$ref": "#/definitions/ServiceMemberBackupContactPayload" } }, + "InternalMove": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipments" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "orders": { + "type": "object" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, "InvalidRequestResponsePayload": { "type": "object", "properties": { @@ -4816,62 +4874,6 @@ func init() { } } }, - "MTOAgent-2": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType-2" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "description": "The ID of the agent.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "description": "The ID of the shipment this agent is permitted to release/receive.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, "MTOAgentType": { "type": "string", "title": "MTO Agent Type", @@ -4881,107 +4883,12 @@ func init() { ], "example": "RELEASING_AGENT" }, - "MTOAgentType-2": { - "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", - "type": "string", - "title": "Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, "MTOAgents": { "type": "array", "items": { "$ref": "#/definitions/MTOAgent" } }, - "MTOAgents-2": { - "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent-2" - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the service item.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this service item.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "The ID of the shipment this service is for, if any. Optional.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "The full descriptive name of the service.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "The reason why this service item was rejected by the TOO.", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "item was too heavy" - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "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\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating" - ] - }, - "MTOServiceItemStatus": { - "description": "The status of a service item, indicating where it is in the TOO's approval process.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ], - "readOnly": true - }, "MTOShipment": { "properties": { "agents": { @@ -5090,327 +4997,69 @@ func init() { }, "example": "HHG" }, - "MTOShipmentType-2": { - "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS_DOMESTIC` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n", + "MTOShipments": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + }, + "MethodOfReceipt": { "type": "string", - "title": "Shipment Type", + "title": "Method of Receipt", "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS_DOMESTIC", - "HHG_OUTOF_NTS_DOMESTIC", - "INTERNATIONAL_HHG", - "INTERNATIONAL_UB", - "MOTORHOME", - "PPM" + "MIL_PAY", + "OTHER_DD", + "GTCC" ], "x-display-value": { - "HHG": "Household goods move (HHG)", - "HHG_INTO_NTS_DOMESTIC": "HHG into Non-temporary storage (NTS)", - "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", - "PPM": "Personally Procured Move also known as Do It Yourself (DITY)" + "GTCC": "GTCC", + "MIL_PAY": "MilPay", + "OTHER_DD": "Other account" }, - "example": "HHG" + "x-nullable": true }, - "MTOShipmentWithoutServiceItems": { + "MoveDatesSummary": { "type": "object", + "required": [ + "id", + "move_id", + "move_date", + "pack", + "pickup", + "transit", + "delivery", + "report" + ], "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false + "delivery": { + "type": "array", + "items": { + "type": "string", + "format": "date", + "example": "2018-09-25" + } }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "id": { "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents-2" + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538:2018-09-25" }, - "approvedDate": { - "description": "The date when the Transportation Ordering Officer first approved this shipment for the move.", + "move_date": { "type": "string", "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true + "example": "2018-09-25" }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "move_id": { "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment-2" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "description": "The date when the Prime contractor recorded the shipment's estimated weight.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedPickupDate": { - "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requiredDeliveryDate": { - "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "reweigh": { - "$ref": "#/definitions/Reweigh" - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType-2" - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "status": { - "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipments": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipment" - } - }, - "MTOShipmentsWithoutServiceObjects": { - "description": "A list of shipments without their associated service items.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - }, - "MethodOfReceipt": { - "type": "string", - "title": "Method of Receipt", - "enum": [ - "MIL_PAY", - "OTHER_DD", - "GTCC" - ], - "x-display-value": { - "GTCC": "GTCC", - "MIL_PAY": "MilPay", - "OTHER_DD": "Other account" - }, - "x-nullable": true - }, - "MoveDatesSummary": { - "type": "object", - "required": [ - "id", - "move_id", - "move_date", - "pack", - "pickup", - "transit", - "delivery", - "report" - ], - "properties": { - "delivery": { - "type": "array", - "items": { - "type": "string", - "format": "date", - "example": "2018-09-25" - } - }, - "id": { - "type": "string", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538:2018-09-25" - }, - "move_date": { - "type": "string", - "format": "date", - "example": "2018-09-25" - }, - "move_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "pack": { - "type": "array", - "items": { - "type": "string", - "format": "date", - "example": "2018-09-25" - } + "pack": { + "type": "array", + "items": { + "type": "string", + "format": "date", + "example": "2018-09-25" + } }, "pickup": { "type": "array", @@ -5861,153 +5510,52 @@ func init() { "SUBMITTED": "Submitted" } }, - "MoveTaskOrder": { + "MovesList": { + "type": "object", + "properties": { + "currentMove": { + "type": "array", + "items": { + "$ref": "#/definitions/InternalMove" + } + }, + "previousMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/InternalMove" + } + } + } + }, + "MovingExpense": { + "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", "type": "object", "required": [ - "mtoShipments", - "mtoServiceItems", - "paymentRequests" + "id", + "createdAt", + "updatedAt", + "ppmShipmentId", + "documentId", + "document" ], "properties": { - "availableToPrimeAt": { - "type": "string", - "format": "date-time", + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer", "x-nullable": true, - "readOnly": true + "x-omitempty": false }, "createdAt": { + "description": "Timestamp the moving expense object was initially created in the system (UTC)", "type": "string", "format": "date-time", "readOnly": true }, - "eTag": { - "type": "string", - "readOnly": true - }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { + "description": { + "description": "A brief description of the expense", "type": "string", - "format": "date-time", "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightUploadId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "ppmType": { - "type": "string", - "enum": [ - "PARTIAL", - "FULL" - ] - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MovesList": { - "type": "object", - "properties": { - "currentMove": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "previousMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveTaskOrder" - } - } - } - }, - "MovingExpense": { - "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "ppmShipmentId", - "documentId", - "document" - ], - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp the moving expense object was initially created in the system (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "A brief description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false + "x-omitempty": false }, "document": { "allOf": [ @@ -6909,366 +6457,126 @@ func init() { }, "x-nullable": true }, - "PPMShipment-2": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_PAYMENT_APPROVAL**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **PAYMENT_APPROVED**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_PAYMENT_APPROVAL", + "PAYMENT_APPROVED" + ], + "readOnly": true + }, + "PPMSitEstimate": { + "type": "object", "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", - "sitExpected", - "eTag" + "estimate" ], "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "estimate": { + "type": "integer", + "title": "Value in cents of SIT estimate for PPM" + } + } + }, + "PPMStatus": { + "type": "string", + "title": "PPM status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "COMPLETED", + "CANCELED", + "PAYMENT_REQUESTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "COMPLETED": "Completed", + "DRAFT": "Draft", + "PAYMENT_REQUESTED": "Payment Requested", + "SUBMITTED": "Submitted" + } + }, + "PatchMovePayload": { + "type": "object", + "required": [ + "closeoutOfficeId" + ], + "properties": { + "closeoutOfficeId": { + "description": "The transportation office that will handle the PPM shipment's closeout approvals for Army and Air Force service members", "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", + "format": "uuid" + } + } + }, + "PatchPersonallyProcuredMovePayload": { + "type": "object", + "properties": { + "actual_move_date": { "type": "string", "format": "date", + "title": "When did you actually move?", "x-nullable": true, - "x-omitempty": false + "example": "2018-04-26" }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "additional_pickup_postal_code": { "type": "string", "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", + "title": "ZIP code", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", "x-nullable": true, - "x-omitempty": false, "example": "90210" }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false + "advance": { + "$ref": "#/definitions/Reimbursement" }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", + "advance_worksheet": { + "$ref": "#/definitions/Document" + }, + "days_in_storage": { "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false + "title": "How many days of storage do you think you'll need?", + "maximum": 90, + "x-nullable": true }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "destination_postal_code": { "type": "string", - "format": "date-time", + "format": "zip", + "title": "ZIP code", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", "x-nullable": true, - "x-omitempty": false + "example": "90210" }, - "createdAt": { - "description": "The timestamp of when the PPM shipment was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true + "has_additional_postal_code": { + "type": "boolean", + "title": "Will you move anything from another pickup location?", + "x-nullable": true }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", + "has_pro_gear": { "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "example": "90210" + "title": "Has Pro-Gear", + "enum": [ + "NOT SURE", + "YES", + "NO" + ], + "x-nullable": true }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "has_pro_gear_over_thousand": { "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The primary unique identifier of this PPM shipment", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", - "type": "string", - "format": "zip", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment record", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "description": "The timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_PAYMENT_APPROVAL**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **PAYMENT_APPROVED**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_PAYMENT_APPROVAL", - "PAYMENT_APPROVED" - ], - "readOnly": true - }, - "PPMSitEstimate": { - "type": "object", - "required": [ - "estimate" - ], - "properties": { - "estimate": { - "type": "integer", - "title": "Value in cents of SIT estimate for PPM" - } - } - }, - "PPMStatus": { - "type": "string", - "title": "PPM status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "COMPLETED", - "CANCELED", - "PAYMENT_REQUESTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "COMPLETED": "Completed", - "DRAFT": "Draft", - "PAYMENT_REQUESTED": "Payment Requested", - "SUBMITTED": "Submitted" - } - }, - "PatchMovePayload": { - "type": "object", - "required": [ - "closeoutOfficeId" - ], - "properties": { - "closeoutOfficeId": { - "description": "The transportation office that will handle the PPM shipment's closeout approvals for Army and Air Force service members", - "type": "string", - "format": "uuid" - } - } - }, - "PatchPersonallyProcuredMovePayload": { - "type": "object", - "properties": { - "actual_move_date": { - "type": "string", - "format": "date", - "title": "When did you actually move?", - "x-nullable": true, - "example": "2018-04-26" - }, - "additional_pickup_postal_code": { - "type": "string", - "format": "zip", - "title": "ZIP code", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "advance": { - "$ref": "#/definitions/Reimbursement" - }, - "advance_worksheet": { - "$ref": "#/definitions/Document" - }, - "days_in_storage": { - "type": "integer", - "title": "How many days of storage do you think you'll need?", - "maximum": 90, - "x-nullable": true - }, - "destination_postal_code": { - "type": "string", - "format": "zip", - "title": "ZIP code", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "has_additional_postal_code": { - "type": "boolean", - "title": "Will you move anything from another pickup location?", - "x-nullable": true - }, - "has_pro_gear": { - "type": "string", - "title": "Has Pro-Gear", - "enum": [ - "NOT SURE", - "YES", - "NO" - ], - "x-nullable": true - }, - "has_pro_gear_over_thousand": { - "type": "string", - "title": "Has Pro-Gear Over Thousand Pounds", - "enum": [ - "NOT SURE", - "YES", - "NO" - ], - "x-nullable": true + "title": "Has Pro-Gear Over Thousand Pounds", + "enum": [ + "NOT SURE", + "YES", + "NO" + ], + "x-nullable": true }, "has_requested_advance": { "type": "boolean", @@ -7439,180 +6747,6 @@ func init() { } } }, - "PaymentRequest": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "paymentServiceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "RECEIVED_BY_GEX", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, "PersonallyProcuredMovePayload": { "type": "object", "required": [ @@ -7911,23 +7045,6 @@ func init() { } } }, - "ProofOfServiceDoc": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, "RateEnginePostalCodePayload": { "type": "object", "required": [ @@ -8003,70 +7120,6 @@ func init() { ], "x-nullable": true }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the Prime" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, "Role": { "type": "object", "required": [ @@ -8085,98 +7138,16 @@ func init() { "format": "uuid", "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, - "roleType": { - "type": "string", - "example": "customer" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, + "roleType": { + "type": "string", + "example": "customer" + }, "updatedAt": { "type": "string", - "format": "date-time", - "readOnly": true + "format": "date-time" } } }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, "SITLocationType": { "description": "The list of SIT location types.", "type": "string", @@ -8208,98 +7179,6 @@ func init() { } } }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, "ServiceMemberBackupContactPayload": { "type": "object", "required": [ @@ -8555,87 +7434,6 @@ func init() { }, "x-nullable": true }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ServiceRequestDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a destination address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, "SignedCertification": { "description": "Signed certification", "type": "object", @@ -8792,43 +7590,6 @@ func init() { "$ref": "#/definitions/SignedCertificationPayload" } }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, "SubmitMoveForApprovalPayload": { "type": "object", "properties": { @@ -9426,57 +8187,6 @@ func init() { } } }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, "ValidationError": { "required": [ "invalidFields" @@ -14685,18 +13395,6 @@ func init() { }, "x-nullable": true }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, "Document": { "type": "object", "required": [ @@ -14969,30 +13667,100 @@ func init() { } } }, - "IndexEntitlements": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/WeightAllotment" - } - }, - "IndexMovesPayload": { - "type": "array", - "items": { - "$ref": "#/definitions/MovePayload" - } - }, - "IndexPersonallyProcuredMovePayload": { - "type": "array", - "items": { - "$ref": "#/definitions/PersonallyProcuredMovePayload" - } - }, - "IndexServiceMemberBackupContactsPayload": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, + "IndexEntitlements": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/WeightAllotment" + } + }, + "IndexMovesPayload": { + "type": "array", + "items": { + "$ref": "#/definitions/MovePayload" + } + }, + "IndexPersonallyProcuredMovePayload": { + "type": "array", + "items": { + "$ref": "#/definitions/PersonallyProcuredMovePayload" + } + }, + "IndexServiceMemberBackupContactsPayload": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "InternalMove": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipments" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "orders": { + "type": "object" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, "InvalidRequestResponsePayload": { "type": "object", "properties": { @@ -15097,337 +13865,25 @@ func init() { } } }, - "MTOAgent-2": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType-2" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "description": "The ID of the agent.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "description": "The ID of the shipment this agent is permitted to release/receive.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, "MTOAgentType": { "type": "string", "title": "MTO Agent Type", "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgentType-2": { - "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", - "type": "string", - "title": "Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOAgents-2": { - "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent-2" - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the service item.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this service item.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "The ID of the shipment this service is for, if any. Optional.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "The full descriptive name of the service.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "The reason why this service item was rejected by the TOO.", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "item was too heavy" - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "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\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating" - ] - }, - "MTOServiceItemStatus": { - "description": "The status of a service item, indicating where it is in the TOO's approval process.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipment": { - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true, - "readOnly": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true, - "readOnly": true - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "status": { - "$ref": "#/definitions/MTOShipmentStatus" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentStatus": { - "type": "string", - "enum": [ - "DRAFT", - "APPROVED", - "SUBMITTED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipmentType": { - "type": "string", - "title": "Shipment Type", - "enum": [ - "HHG", - "HHG_INTO_NTS_DOMESTIC", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM" - ], - "x-display-value": { - "HHG": "HHG", - "INTERNATIONAL_HHG": "International HHG", - "INTERNATIONAL_UB": "International UB", - "PPM": "PPM" - }, - "example": "HHG" - }, - "MTOShipmentType-2": { - "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS_DOMESTIC` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n", - "type": "string", - "title": "Shipment Type", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS_DOMESTIC", - "HHG_OUTOF_NTS_DOMESTIC", - "INTERNATIONAL_HHG", - "INTERNATIONAL_UB", - "MOTORHOME", - "PPM" + "RELEASING_AGENT", + "RECEIVING_AGENT" ], - "x-display-value": { - "HHG": "Household goods move (HHG)", - "HHG_INTO_NTS_DOMESTIC": "HHG into Non-temporary storage (NTS)", - "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", - "PPM": "Personally Procured Move also known as Do It Yourself (DITY)" - }, - "example": "HHG" + "example": "RELEASING_AGENT" }, - "MTOShipmentWithoutServiceItems": { - "type": "object", + "MTOAgents": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOShipment": { "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, "agents": { - "$ref": "#/definitions/MTOAgents-2" - }, - "approvedDate": { - "description": "The date when the Transportation Ordering Officer first approved this shipment for the move.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" + "$ref": "#/definitions/MTOAgents" }, "createdAt": { "type": "string", @@ -15435,185 +13891,68 @@ func init() { "readOnly": true }, "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", "type": "string", "x-nullable": true, "readOnly": true, "example": "handle with care" }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" + "$ref": "#/definitions/Address" }, "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true + "type": "string" }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", "x-nullable": true, "x-omitempty": false }, "id": { - "description": "The ID of the shipment.", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, "moveTaskOrderID": { - "description": "The ID of the move for this shipment.", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" + "$ref": "#/definitions/Address" }, "ppmShipment": { - "$ref": "#/definitions/PPMShipment-2" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "description": "The date when the Prime contractor recorded the shipment's estimated weight.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true + "$ref": "#/definitions/PPMShipment" }, "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.", "type": "string", "format": "date", "x-nullable": true, - "x-omitempty": false, "readOnly": true }, "requestedPickupDate": { - "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requiredDeliveryDate": { - "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", "type": "string", "format": "date", "x-nullable": true, - "x-omitempty": false, "readOnly": true }, - "reweigh": { - "$ref": "#/definitions/Reweigh" - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] + "$ref": "#/definitions/Address" }, "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] + "$ref": "#/definitions/Address" }, "shipmentType": { - "$ref": "#/definitions/MTOShipmentType-2" - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" + "$ref": "#/definitions/MTOShipmentType" }, "status": { - "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] + "$ref": "#/definitions/MTOShipmentStatus" }, "updatedAt": { "type": "string", @@ -15622,19 +13961,39 @@ func init() { } } }, + "MTOShipmentStatus": { + "type": "string", + "enum": [ + "DRAFT", + "APPROVED", + "SUBMITTED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS_DOMESTIC", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM" + ], + "x-display-value": { + "HHG": "HHG", + "INTERNATIONAL_HHG": "International HHG", + "INTERNATIONAL_UB": "International UB", + "PPM": "PPM" + }, + "example": "HHG" + }, "MTOShipments": { "type": "array", "items": { "$ref": "#/definitions/MTOShipment" } }, - "MTOShipmentsWithoutServiceObjects": { - "description": "A list of shipments without their associated service items.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - }, "MethodOfReceipt": { "type": "string", "title": "Method of Receipt", @@ -16140,109 +14499,8 @@ func init() { "x-display-value": { "APPROVED": "Approved", "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "mtoShipments", - "mtoServiceItems", - "paymentRequests" - ], - "properties": { - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightUploadId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "ppmType": { - "type": "string", - "enum": [ - "PARTIAL", - "FULL" - ] - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } + "DRAFT": "Draft", + "SUBMITTED": "Submitted" } }, "MovesList": { @@ -16251,13 +14509,13 @@ func init() { "currentMove": { "type": "array", "items": { - "$ref": "#/definitions/MoveTaskOrder" + "$ref": "#/definitions/InternalMove" } }, "previousMoves": { "type": "array", "items": { - "$ref": "#/definitions/MoveTaskOrder" + "$ref": "#/definitions/InternalMove" } } } @@ -16884,315 +15142,38 @@ func init() { "PPMEstimateRange": { "type": "object", "required": [ - "range_min", - "range_max" - ], - "properties": { - "range_max": { - "type": "integer", - "title": "High estimate" - }, - "range_min": { - "type": "integer", - "title": "Low estimate" - } - } - }, - "PPMIncentive": { - "type": "object", - "required": [ - "gcc", - "incentive_percentage" - ], - "properties": { - "gcc": { - "type": "integer", - "title": "GCC" - }, - "incentive_percentage": { - "type": "integer", - "title": "PPM Incentive @ 95%" - } - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "pickupPostalCode", - "destinationPostalCode", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceStatus": { - "$ref": "#/definitions/PPMAdvanceStatus" - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp of when the PPM Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationPostalCode": { - "description": "The postal code of the destination location where goods are being delivered to.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin their move.\n", - "type": "string", - "format": "date" - }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "movingExpenses": { - "description": "All expense documentation receipt records of this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - } - }, - "pickupPostalCode": { - "description": "The postal code of the origin location where goods are being moved from.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightTickets": { - "description": "All pro-gear weight ticket documentation records for this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDestinationPostalCode": { - "description": "An optional secondary location near the destination where goods will be dropped off.", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "secondaryPickupPostalCode": { - "type": "string", - "format": "An optional secondary pickup location near the origin where additional goods exist.", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "signedCertification": { - "$ref": "#/definitions/SignedCertification" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", + "range_min", + "range_max" + ], + "properties": { + "range_max": { "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] + "title": "High estimate" }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "range_min": { "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" + "title": "Low estimate" + } + } + }, + "PPMIncentive": { + "type": "object", + "required": [ + "gcc", + "incentive_percentage" + ], + "properties": { + "gcc": { + "type": "integer", + "title": "GCC" }, - "weightTickets": { - "$ref": "#/definitions/WeightTickets" + "incentive_percentage": { + "type": "integer", + "title": "PPM Incentive @ 95%" } - }, - "x-nullable": true + } }, - "PPMShipment-2": { + "PPMShipment": { "description": "A personally procured move is a type of shipment that a service member moves themselves.", "required": [ "id", @@ -17241,12 +15222,15 @@ func init() { "x-omitempty": false }, "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", + "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", "type": "integer", "format": "cents", "x-nullable": true, "x-omitempty": false }, + "advanceStatus": { + "$ref": "#/definitions/PPMAdvanceStatus" + }, "approvedAt": { "description": "The timestamp of when the shipment was approved and the service member can begin their move.", "type": "string", @@ -17255,7 +15239,7 @@ func init() { "x-omitempty": false }, "createdAt": { - "description": "The timestamp of when the PPM shipment was created (UTC)", + "description": "Timestamp of when the PPM Shipment was initially created (UTC)", "type": "string", "format": "date-time", "readOnly": true @@ -17264,6 +15248,7 @@ func init() { "description": "The postal code of the destination location where goods are being delivered to.", "type": "string", "format": "zip", + "title": "ZIP", "pattern": "^(\\d{5})$", "example": "90210" }, @@ -17280,17 +15265,25 @@ func init() { "x-omitempty": false }, "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "description": "The estimated weight of the PPM shipment goods being moved.", "type": "integer", "x-nullable": true, "x-omitempty": false, "example": 4200 }, "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", + "description": "Date the customer expects to begin their move.\n", "type": "string", "format": "date" }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, "hasProGear": { "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", "type": "boolean", @@ -17310,12 +15303,19 @@ func init() { "x-omitempty": false }, "id": { - "description": "The primary unique identifier of this PPM shipment", + "description": "Primary auto-generated unique identifier of the PPM shipment object", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, + "movingExpenses": { + "description": "All expense documentation receipt records of this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + } + }, "pickupPostalCode": { "description": "The postal code of the origin location where goods are being moved from.", "type": "string", @@ -17325,11 +15325,18 @@ func init() { "example": "90210" }, "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", "type": "integer", "x-nullable": true, "x-omitempty": false }, + "proGearWeightTickets": { + "description": "All pro-gear weight ticket documentation records for this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, "reviewedAt": { "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", "type": "string", @@ -17341,27 +15348,31 @@ func init() { "description": "An optional secondary location near the destination where goods will be dropped off.", "type": "string", "format": "zip", + "title": "ZIP", "pattern": "^(\\d{5})$", "x-nullable": true, "x-omitempty": false, "example": "90210" }, "secondaryPickupPostalCode": { - "description": "An optional secondary pickup location near the origin where additional goods exist.", "type": "string", - "format": "zip", + "format": "An optional secondary pickup location near the origin where additional goods exist.", + "title": "ZIP", "pattern": "^(\\d{5})$", "x-nullable": true, "x-omitempty": false, "example": "90210" }, "shipmentId": { - "description": "The id of the parent MTOShipment record", + "description": "The id of the parent MTOShipment object", "type": "string", "format": "uuid", "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, + "signedCertification": { + "$ref": "#/definitions/SignedCertification" + }, "sitEstimatedCost": { "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", "type": "integer", @@ -17384,7 +15395,7 @@ func init() { "x-omitempty": false }, "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", + "description": "The estimated weight of the goods being put into storage.", "type": "integer", "x-nullable": true, "x-omitempty": false, @@ -17408,7 +15419,7 @@ func init() { ] }, "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", "type": "integer", "x-nullable": true, "x-omitempty": false @@ -17424,10 +15435,17 @@ func init() { "x-omitempty": false }, "updatedAt": { - "description": "The timestamp of when a property of this object was last updated (UTC)", + "description": "Timestamp of when a property of this object was last updated (UTC)", "type": "string", "format": "date-time", "readOnly": true + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "weightTickets": { + "$ref": "#/definitions/WeightTickets" } }, "x-nullable": true @@ -17724,180 +15742,6 @@ func init() { } } }, - "PaymentRequest": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "paymentServiceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "RECEIVED_BY_GEX", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, "PersonallyProcuredMovePayload": { "type": "object", "required": [ @@ -18199,23 +16043,6 @@ func init() { } } }, - "ProofOfServiceDoc": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, "RateEnginePostalCodePayload": { "type": "object", "required": [ @@ -18291,70 +16118,6 @@ func init() { ], "x-nullable": true }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the Prime" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, "Role": { "type": "object", "required": [ @@ -18383,88 +16146,6 @@ func init() { } } }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, "SITLocationType": { "description": "The list of SIT location types.", "type": "string", @@ -18496,98 +16177,6 @@ func init() { } } }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, "ServiceMemberBackupContactPayload": { "type": "object", "required": [ @@ -18843,87 +16432,6 @@ func init() { }, "x-nullable": true }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ServiceRequestDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a destination address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, "SignedCertification": { "description": "Signed certification", "type": "object", @@ -19080,43 +16588,6 @@ func init() { "$ref": "#/definitions/SignedCertificationPayload" } }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, "SubmitMoveForApprovalPayload": { "type": "object", "properties": { @@ -19722,57 +17193,6 @@ func init() { } } }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, "ValidationError": { "required": [ "invalidFields" diff --git a/pkg/gen/internalmessages/destination_type.go b/pkg/gen/internalmessages/destination_type.go deleted file mode 100644 index d15212a21fe..00000000000 --- a/pkg/gen/internalmessages/destination_type.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// DestinationType Destination Type -// Example: OTHER_THAN_AUTHORIZED -// -// swagger:model DestinationType -type DestinationType string - -func NewDestinationType(value DestinationType) *DestinationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated DestinationType. -func (m DestinationType) Pointer() *DestinationType { - return &m -} - -const ( - - // DestinationTypeHOMEOFRECORD captures enum value "HOME_OF_RECORD" - DestinationTypeHOMEOFRECORD DestinationType = "HOME_OF_RECORD" - - // DestinationTypeHOMEOFSELECTION captures enum value "HOME_OF_SELECTION" - DestinationTypeHOMEOFSELECTION DestinationType = "HOME_OF_SELECTION" - - // DestinationTypePLACEENTEREDACTIVEDUTY captures enum value "PLACE_ENTERED_ACTIVE_DUTY" - DestinationTypePLACEENTEREDACTIVEDUTY DestinationType = "PLACE_ENTERED_ACTIVE_DUTY" - - // DestinationTypeOTHERTHANAUTHORIZED captures enum value "OTHER_THAN_AUTHORIZED" - DestinationTypeOTHERTHANAUTHORIZED DestinationType = "OTHER_THAN_AUTHORIZED" -) - -// for schema -var destinationTypeEnum []interface{} - -func init() { - var res []DestinationType - if err := json.Unmarshal([]byte(`["HOME_OF_RECORD","HOME_OF_SELECTION","PLACE_ENTERED_ACTIVE_DUTY","OTHER_THAN_AUTHORIZED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - destinationTypeEnum = append(destinationTypeEnum, v) - } -} - -func (m DestinationType) validateDestinationTypeEnum(path, location string, value DestinationType) error { - if err := validate.EnumCase(path, location, value, destinationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this destination type -func (m DestinationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateDestinationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this destination type based on context it is used -func (m DestinationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go new file mode 100644 index 00000000000..d5771a016ad --- /dev/null +++ b/pkg/gen/internalmessages/internal_move.go @@ -0,0 +1,409 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InternalMove internal move +// +// swagger:model InternalMove +type InternalMove struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // excess weight acknowledged at + // Read Only: true + // Format: date-time + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + // excess weight qualified at + // Read Only: true + // Format: date-time + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + // id + // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move code + // Example: HYXFJF + // Read Only: true + MoveCode string `json:"moveCode,omitempty"` + + // mto shipments + MtoShipments MTOShipments `json:"mtoShipments,omitempty"` + + // order + Order *Order `json:"order,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // orders + Orders interface{} `json:"orders,omitempty"` + + // ppm estimated weight + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + // prime counseling completed at + // Read Only: true + // Format: date-time + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID string `json:"referenceId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this internal move +func (m *InternalMove) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightQualifiedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrder(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InternalMove) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) 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 *InternalMove) validateMtoShipments(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipments) { // not required + return nil + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *InternalMove) validateOrder(formats strfmt.Registry) error { + if swag.IsZero(m.Order) { // not required + return nil + } + + if m.Order != nil { + if err := m.Order.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *InternalMove) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this internal move based on the context it is used +func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrder(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InternalMove) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) 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 *InternalMove) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *InternalMove) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { + + if m.Order != nil { + + if swag.IsZero(m.Order) { // not required + return nil + } + + if err := m.Order.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *InternalMove) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InternalMove) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InternalMove) UnmarshalBinary(b []byte) error { + var res InternalMove + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_agent2.go b/pkg/gen/internalmessages/m_t_o_agent2.go deleted file mode 100644 index e24b7178425..00000000000 --- a/pkg/gen/internalmessages/m_t_o_agent2.go +++ /dev/null @@ -1,306 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgent2 m t o agent 2 -// -// swagger:model MTOAgent-2 -type MTOAgent2 struct { - - // agent type - AgentType MTOAgentType2 `json:"agentType,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$ - Email *string `json:"email,omitempty"` - - // first name - FirstName *string `json:"firstName,omitempty"` - - // The ID of the agent. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - LastName *string `json:"lastName,omitempty"` - - // The ID of the shipment this agent is permitted to release/receive. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // phone - // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ - Phone *string `json:"phone,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o agent 2 -func (m *MTOAgent2) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOAgent2) validateAgentType(formats strfmt.Registry) error { - if swag.IsZero(m.AgentType) { // not required - return nil - } - - if err := m.AgentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agentType") - } - return err - } - - return nil -} - -func (m *MTOAgent2) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent2) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent2) 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 *MTOAgent2) 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 *MTOAgent2) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent2) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o agent 2 based on the context it is used -func (m *MTOAgent2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - 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.contextValidateMtoShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOAgent2) contextValidateAgentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.AgentType) { // not required - return nil - } - - if err := m.AgentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agentType") - } - return err - } - - return nil -} - -func (m *MTOAgent2) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent2) 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 *MTOAgent2) 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 *MTOAgent2) contextValidateMtoShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "mtoShipmentID", "body", strfmt.UUID(m.MtoShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent2) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOAgent2) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOAgent2) UnmarshalBinary(b []byte) error { - var res MTOAgent2 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_agent_type2.go b/pkg/gen/internalmessages/m_t_o_agent_type2.go deleted file mode 100644 index f3ac5993211..00000000000 --- a/pkg/gen/internalmessages/m_t_o_agent_type2.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOAgentType2 Agent Type -// -// The type for this agent. `RELEASING` means they have authority on pickup, `RECEIVING` means they can receive the shipment on delivery. -// -// Example: RELEASING_AGENT -// -// swagger:model MTOAgentType-2 -type MTOAgentType2 string - -func NewMTOAgentType2(value MTOAgentType2) *MTOAgentType2 { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOAgentType2. -func (m MTOAgentType2) Pointer() *MTOAgentType2 { - return &m -} - -const ( - - // MTOAgentType2RELEASINGAGENT captures enum value "RELEASING_AGENT" - MTOAgentType2RELEASINGAGENT MTOAgentType2 = "RELEASING_AGENT" - - // MTOAgentType2RECEIVINGAGENT captures enum value "RECEIVING_AGENT" - MTOAgentType2RECEIVINGAGENT MTOAgentType2 = "RECEIVING_AGENT" -) - -// for schema -var mTOAgentType2Enum []interface{} - -func init() { - var res []MTOAgentType2 - if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOAgentType2Enum = append(mTOAgentType2Enum, v) - } -} - -func (m MTOAgentType2) validateMTOAgentType2Enum(path, location string, value MTOAgentType2) error { - if err := validate.EnumCase(path, location, value, mTOAgentType2Enum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o agent type 2 -func (m MTOAgentType2) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOAgentType2Enum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o agent type 2 based on context it is used -func (m MTOAgentType2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_agents2.go b/pkg/gen/internalmessages/m_t_o_agents2.go deleted file mode 100644 index 5bec41e9499..00000000000 --- a/pkg/gen/internalmessages/m_t_o_agents2.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgents2 A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment. -// -// swagger:model MTOAgents-2 -type MTOAgents2 []*MTOAgent2 - -// Validate validates this m t o agents 2 -func (m MTOAgents2) Validate(formats strfmt.Registry) error { - var res []error - - iMTOAgents2Size := int64(len(m)) - - if err := validate.MaxItems("", "body", iMTOAgents2Size, 2); err != nil { - return err - } - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o agents 2 based on the context it is used -func (m MTOAgents2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_service_item.go b/pkg/gen/internalmessages/m_t_o_service_item.go deleted file mode 100644 index e5c0918e820..00000000000 --- a/pkg/gen/internalmessages/m_t_o_service_item.go +++ /dev/null @@ -1,465 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// 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" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItem MTOServiceItem describes a base type of a service item. Polymorphic type. -// -// swagger:discriminator MTOServiceItem modelType -type MTOServiceItem interface { - runtime.Validatable - runtime.ContextValidatable - - // A hash unique to this service item that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag() string - SetETag(string) - - // The ID of the service item. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID() strfmt.UUID - SetID(strfmt.UUID) - - // model type - // Required: true - ModelType() MTOServiceItemModelType - SetModelType(MTOServiceItemModelType) - - // The ID of the move for this service item. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveTaskOrderID() *strfmt.UUID - SetMoveTaskOrderID(*strfmt.UUID) - - // The ID of the shipment this service is for, if any. Optional. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID() strfmt.UUID - SetMtoShipmentID(strfmt.UUID) - - // The full descriptive name of the service. - // Read Only: true - ReServiceName() string - SetReServiceName(string) - - // The reason why this service item was rejected by the TOO. - // Example: item was too heavy - // Read Only: true - RejectionReason() *string - SetRejectionReason(*string) - - // service request documents - ServiceRequestDocuments() ServiceRequestDocuments - SetServiceRequestDocuments(ServiceRequestDocuments) - - // status - Status() MTOServiceItemStatus - SetStatus(MTOServiceItemStatus) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type mTOServiceItem struct { - eTagField string - - idField strfmt.UUID - - modelTypeField MTOServiceItemModelType - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus -} - -// ETag gets the e tag of this polymorphic type -func (m *mTOServiceItem) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this polymorphic type -func (m *mTOServiceItem) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this polymorphic type -func (m *mTOServiceItem) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *mTOServiceItem) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this polymorphic type -func (m *mTOServiceItem) ModelType() MTOServiceItemModelType { - return "MTOServiceItem" -} - -// SetModelType sets the model type of this polymorphic type -func (m *mTOServiceItem) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this polymorphic type -func (m *mTOServiceItem) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this polymorphic type -func (m *mTOServiceItem) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this polymorphic type -func (m *mTOServiceItem) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this polymorphic type -func (m *mTOServiceItem) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this polymorphic type -func (m *mTOServiceItem) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this polymorphic type -func (m *mTOServiceItem) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this polymorphic type -func (m *mTOServiceItem) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this polymorphic type -func (m *mTOServiceItem) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this polymorphic type -func (m *mTOServiceItem) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this polymorphic type -func (m *mTOServiceItem) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this polymorphic type -func (m *mTOServiceItem) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this polymorphic type -func (m *mTOServiceItem) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalMTOServiceItemSlice unmarshals polymorphic slices of MTOServiceItem -func UnmarshalMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]MTOServiceItem, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []MTOServiceItem - for _, element := range elements { - obj, err := unmarshalMTOServiceItem(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalMTOServiceItem unmarshals polymorphic MTOServiceItem -func UnmarshalMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (MTOServiceItem, error) { - // we need to read this twice, so first into a buffer - data, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalMTOServiceItem(data, consumer) -} - -func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOServiceItem, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the modelType property. - var getType struct { - ModelType string `json:"modelType"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { - return nil, err - } - - // The value of modelType is used to determine which type to create and unmarshal the data into - switch getType.ModelType { - case "MTOServiceItem": - var result mTOServiceItem - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) -} - -// Validate validates this m t o service item -func (m *mTOServiceItem) 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 len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 -} - -// ContextValidate validate this m t o service item based on the context it is used -func (m *mTOServiceItem) 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.contextValidateModelType(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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 *mTOServiceItem) 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 -} diff --git a/pkg/gen/internalmessages/m_t_o_service_item_model_type.go b/pkg/gen/internalmessages/m_t_o_service_item_model_type.go deleted file mode 100644 index 07ae886028e..00000000000 --- a/pkg/gen/internalmessages/m_t_o_service_item_model_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemModelType Describes all model sub-types for a MTOServiceItem model. -// -// Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. -// - DOFSIT, DOASIT - MTOServiceItemOriginSIT -// - DDFSIT, DDASIT - MTOServiceItemDestSIT -// - DOSHUT, DDSHUT - MTOServiceItemShuttle -// - DCRT, DUCRT - MTOServiceItemDomesticCrating -// -// The documentation will then update with the supported fields. -// -// swagger:model MTOServiceItemModelType -type MTOServiceItemModelType string - -func NewMTOServiceItemModelType(value MTOServiceItemModelType) *MTOServiceItemModelType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemModelType. -func (m MTOServiceItemModelType) Pointer() *MTOServiceItemModelType { - return &m -} - -const ( - - // MTOServiceItemModelTypeMTOServiceItemBasic captures enum value "MTOServiceItemBasic" - MTOServiceItemModelTypeMTOServiceItemBasic MTOServiceItemModelType = "MTOServiceItemBasic" - - // MTOServiceItemModelTypeMTOServiceItemOriginSIT captures enum value "MTOServiceItemOriginSIT" - MTOServiceItemModelTypeMTOServiceItemOriginSIT MTOServiceItemModelType = "MTOServiceItemOriginSIT" - - // MTOServiceItemModelTypeMTOServiceItemDestSIT captures enum value "MTOServiceItemDestSIT" - MTOServiceItemModelTypeMTOServiceItemDestSIT MTOServiceItemModelType = "MTOServiceItemDestSIT" - - // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" - MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" - - // MTOServiceItemModelTypeMTOServiceItemDomesticCrating captures enum value "MTOServiceItemDomesticCrating" - MTOServiceItemModelTypeMTOServiceItemDomesticCrating MTOServiceItemModelType = "MTOServiceItemDomesticCrating" -) - -// for schema -var mTOServiceItemModelTypeEnum []interface{} - -func init() { - var res []MTOServiceItemModelType - if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticCrating"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemModelTypeEnum = append(mTOServiceItemModelTypeEnum, v) - } -} - -func (m MTOServiceItemModelType) validateMTOServiceItemModelTypeEnum(path, location string, value MTOServiceItemModelType) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemModelTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item model type -func (m MTOServiceItemModelType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemModelTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o service item model type based on context it is used -func (m MTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_service_item_status.go b/pkg/gen/internalmessages/m_t_o_service_item_status.go deleted file mode 100644 index 654ca780746..00000000000 --- a/pkg/gen/internalmessages/m_t_o_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemStatus The status of a service item, indicating where it is in the TOO's approval process. -// -// swagger:model MTOServiceItemStatus -type MTOServiceItemStatus string - -func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. -func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { - return &m -} - -const ( - - // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" - MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" - - // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" - MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" - - // MTOServiceItemStatusREJECTED captures enum value "REJECTED" - MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" -) - -// for schema -var mTOServiceItemStatusEnum []interface{} - -func init() { - var res []MTOServiceItemStatus - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) - } -} - -func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item status -func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o service item status based on the context it is used -func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", MTOServiceItemStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_shipment_type2.go b/pkg/gen/internalmessages/m_t_o_shipment_type2.go deleted file mode 100644 index 2dd1c50b017..00000000000 --- a/pkg/gen/internalmessages/m_t_o_shipment_type2.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOShipmentType2 Shipment Type -// -// The type of shipment. -// - `HHG` = Household goods move -// - `HHG_INTO_NTS_DOMESTIC` = HHG into Non-temporary storage (NTS) -// - `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) -// - `PPM` = Personally Procured Move also known as Do It Yourself (DITY) -// -// Example: HHG -// -// swagger:model MTOShipmentType-2 -type MTOShipmentType2 string - -func NewMTOShipmentType2(value MTOShipmentType2) *MTOShipmentType2 { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOShipmentType2. -func (m MTOShipmentType2) Pointer() *MTOShipmentType2 { - return &m -} - -const ( - - // MTOShipmentType2BOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" - MTOShipmentType2BOATHAULAWAY MTOShipmentType2 = "BOAT_HAUL_AWAY" - - // MTOShipmentType2BOATTOWAWAY captures enum value "BOAT_TOW_AWAY" - MTOShipmentType2BOATTOWAWAY MTOShipmentType2 = "BOAT_TOW_AWAY" - - // MTOShipmentType2HHG captures enum value "HHG" - MTOShipmentType2HHG MTOShipmentType2 = "HHG" - - // MTOShipmentType2HHGINTONTSDOMESTIC captures enum value "HHG_INTO_NTS_DOMESTIC" - MTOShipmentType2HHGINTONTSDOMESTIC MTOShipmentType2 = "HHG_INTO_NTS_DOMESTIC" - - // MTOShipmentType2HHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" - MTOShipmentType2HHGOUTOFNTSDOMESTIC MTOShipmentType2 = "HHG_OUTOF_NTS_DOMESTIC" - - // MTOShipmentType2INTERNATIONALHHG captures enum value "INTERNATIONAL_HHG" - MTOShipmentType2INTERNATIONALHHG MTOShipmentType2 = "INTERNATIONAL_HHG" - - // MTOShipmentType2INTERNATIONALUB captures enum value "INTERNATIONAL_UB" - MTOShipmentType2INTERNATIONALUB MTOShipmentType2 = "INTERNATIONAL_UB" - - // MTOShipmentType2MOTORHOME captures enum value "MOTORHOME" - MTOShipmentType2MOTORHOME MTOShipmentType2 = "MOTORHOME" - - // MTOShipmentType2PPM captures enum value "PPM" - MTOShipmentType2PPM MTOShipmentType2 = "PPM" -) - -// for schema -var mTOShipmentType2Enum []interface{} - -func init() { - var res []MTOShipmentType2 - if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS_DOMESTIC","HHG_OUTOF_NTS_DOMESTIC","INTERNATIONAL_HHG","INTERNATIONAL_UB","MOTORHOME","PPM"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentType2Enum = append(mTOShipmentType2Enum, v) - } -} - -func (m MTOShipmentType2) validateMTOShipmentType2Enum(path, location string, value MTOShipmentType2) error { - if err := validate.EnumCase(path, location, value, mTOShipmentType2Enum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o shipment type 2 -func (m MTOShipmentType2) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOShipmentType2Enum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o shipment type 2 based on context it is used -func (m MTOShipmentType2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_shipment_without_service_items.go b/pkg/gen/internalmessages/m_t_o_shipment_without_service_items.go deleted file mode 100644 index bc38f51b9d8..00000000000 --- a/pkg/gen/internalmessages/m_t_o_shipment_without_service_items.go +++ /dev/null @@ -1,1165 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipmentWithoutServiceItems m t o shipment without service items -// -// swagger:model MTOShipmentWithoutServiceItems -type MTOShipmentWithoutServiceItems struct { - - // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. - // Format: date - ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` - - // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. - // Format: date - ActualPickupDate *strfmt.Date `json:"actualPickupDate"` - - // agents - Agents MTOAgents2 `json:"agents,omitempty"` - - // The date when the Transportation Ordering Officer first approved this shipment for the move. - // Read Only: true - // Format: date - ApprovedDate *strfmt.Date `json:"approvedDate"` - - // The counselor can use the counselor remarks field to inform the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // - // Counselors enters this information when creating or editing an MTO Shipment. Optional field. - // - // Example: handle with care - // Read Only: true - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // The customer can use the customer remarks field to inform the services counselor and the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // - // Customer enters this information during onboarding. Optional field. - // - // Example: handle with care - // Read Only: true - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // delivery address update - DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` - - // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details - // during onboarding, if they know their new address already. - // - // May be blank when entered by the customer, required when entered by the Prime. May not represent the true - // final destination due to the shipment being diverted or placed in SIT. - // - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. - // - Diversion bool `json:"diversion,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. - // - // Format: date - FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` - - // The ID of the shipment. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // The ID of the move for this shipment. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 4500 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. - // - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. - // - PointOfContact string `json:"pointOfContact,omitempty"` - - // ppm shipment - PpmShipment *PPMShipment2 `json:"ppmShipment,omitempty"` - - // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. - // Example: 4500 - // Minimum: 1 - PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` - - // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. - // - // Example: 4500 - // Minimum: 1 - PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` - - // The date when the Prime contractor recorded the shipment's estimated weight. - // Read Only: true - // Format: date - PrimeEstimatedWeightRecordedDate *strfmt.Date `json:"primeEstimatedWeightRecordedDate"` - - // The customer's preferred delivery date. - // Read Only: true - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate"` - - // The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. - // - // Read Only: true - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate"` - - // The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified. - // - // Read Only: true - // Format: date - RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate"` - - // reweigh - Reweigh *Reweigh `json:"reweigh,omitempty"` - - // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. - // Format: date - ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` - - // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. - // Format: date - ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` - - // A second delivery address for this shipment, if the customer entered one. An optional field. - SecondaryDeliveryAddress struct { - Address - } `json:"secondaryDeliveryAddress,omitempty"` - - // A second pickup address for this shipment, if the customer entered one. An optional field. - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // shipment type - ShipmentType MTOShipmentType2 `json:"shipmentType,omitempty"` - - // sit extensions - SitExtensions SITExtensions `json:"sitExtensions,omitempty"` - - // The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances. - // - // Read Only: true - // Enum: [SUBMITTED APPROVED REJECTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] - Status string `json:"status,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o shipment without service items -func (m *MTOShipmentWithoutServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeliveryAddressUpdate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { - res = append(res, err) - } - - 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.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeActualWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeightRecordedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequiredDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReweigh(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExtensions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateActualDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateActualPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateApprovedDate(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedDate) { // not required - return nil - } - - if err := validate.FormatOf("approvedDate", "body", "date", m.ApprovedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDeliveryAddressUpdate(formats strfmt.Registry) error { - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if m.DeliveryAddressUpdate != nil { - if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) 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 *MTOShipmentWithoutServiceItems) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeActualWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeActualWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeightRecordedDate(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeightRecordedDate) { // not required - return nil - } - - if err := validate.FormatOf("primeEstimatedWeightRecordedDate", "body", "date", m.PrimeEstimatedWeightRecordedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequiredDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequiredDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateReweigh(formats strfmt.Registry) error { - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if m.Reweigh != nil { - if err := m.Reweigh.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateScheduledDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateScheduledPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSitExtensions(formats strfmt.Registry) error { - if swag.IsZero(m.SitExtensions) { // not required - return nil - } - - if err := m.SitExtensions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -var mTOShipmentWithoutServiceItemsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentWithoutServiceItemsTypeStatusPropEnum = append(mTOShipmentWithoutServiceItemsTypeStatusPropEnum, v) - } -} - -const ( - - // MTOShipmentWithoutServiceItemsStatusSUBMITTED captures enum value "SUBMITTED" - MTOShipmentWithoutServiceItemsStatusSUBMITTED string = "SUBMITTED" - - // MTOShipmentWithoutServiceItemsStatusAPPROVED captures enum value "APPROVED" - MTOShipmentWithoutServiceItemsStatusAPPROVED string = "APPROVED" - - // MTOShipmentWithoutServiceItemsStatusREJECTED captures enum value "REJECTED" - MTOShipmentWithoutServiceItemsStatusREJECTED string = "REJECTED" - - // MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" - MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" - - // MTOShipmentWithoutServiceItemsStatusCANCELED captures enum value "CANCELED" - MTOShipmentWithoutServiceItemsStatusCANCELED string = "CANCELED" - - // MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" - MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" -) - -// prop value enum -func (m *MTOShipmentWithoutServiceItems) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o shipment without service items based on the context it is used -func (m *MTOShipmentWithoutServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateApprovedDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCounselorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - 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.contextValidateMoveTaskOrderID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeEstimatedWeightRecordedDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequiredDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReweigh(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitExtensions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateApprovedDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedDate", "body", m.ApprovedDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCounselorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "counselorRemarks", "body", m.CounselorRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { - - if m.DeliveryAddressUpdate != nil { - - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) 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 *MTOShipmentWithoutServiceItems) 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 *MTOShipmentWithoutServiceItems) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePrimeEstimatedWeightRecordedDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeEstimatedWeightRecordedDate", "body", m.PrimeEstimatedWeightRecordedDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequiredDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requiredDeliveryDate", "body", m.RequiredDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { - - if m.Reweigh != nil { - - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipmentWithoutServiceItems) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipmentWithoutServiceItems) UnmarshalBinary(b []byte) error { - var res MTOShipmentWithoutServiceItems - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_shipments_without_service_objects.go b/pkg/gen/internalmessages/m_t_o_shipments_without_service_objects.go deleted file mode 100644 index 34d53a70165..00000000000 --- a/pkg/gen/internalmessages/m_t_o_shipments_without_service_objects.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOShipmentsWithoutServiceObjects A list of shipments without their associated service items. -// -// swagger:model MTOShipmentsWithoutServiceObjects -type MTOShipmentsWithoutServiceObjects []*MTOShipmentWithoutServiceItems - -// Validate validates this m t o shipments without service objects -func (m MTOShipmentsWithoutServiceObjects) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o shipments without service objects based on the context it is used -func (m MTOShipmentsWithoutServiceObjects) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/move_task_order.go b/pkg/gen/internalmessages/move_task_order.go deleted file mode 100644 index e8fffeb0248..00000000000 --- a/pkg/gen/internalmessages/move_task_order.go +++ /dev/null @@ -1,842 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// 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" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveTaskOrder move task order -// -// swagger:model MoveTaskOrder -type MoveTaskOrder struct { - - // available to prime at - // Read Only: true - // Format: date-time - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // excess weight acknowledged at - // Read Only: true - // Format: date-time - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - // excess weight qualified at - // Read Only: true - // Format: date-time - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - // excess weight upload Id - // Read Only: true - // Format: uuid - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - // id - // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move code - // Example: HYXFJF - // Read Only: true - MoveCode string `json:"moveCode,omitempty"` - - mtoServiceItemsField []MTOServiceItem - - // mto shipments - // Required: true - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - // order - Order *Order `json:"order,omitempty"` - - // order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrderID strfmt.UUID `json:"orderID,omitempty"` - - // payment requests - // Required: true - PaymentRequests PaymentRequests `json:"paymentRequests"` - - // ppm estimated weight - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - // ppm type - // Enum: [PARTIAL FULL] - PpmType string `json:"ppmType,omitempty"` - - // prime counseling completed at - // Read Only: true - // Format: date-time - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID string `json:"referenceId,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// MtoServiceItems gets the mto service items of this base type -func (m *MoveTaskOrder) MtoServiceItems() []MTOServiceItem { - return m.mtoServiceItemsField -} - -// SetMtoServiceItems sets the mto service items of this base type -func (m *MoveTaskOrder) SetMtoServiceItems(val []MTOServiceItem) { - m.mtoServiceItemsField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error { - var data struct { - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - ETag string `json:"eTag,omitempty"` - - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - ID strfmt.UUID `json:"id,omitempty"` - - MoveCode string `json:"moveCode,omitempty"` - - MtoServiceItems json.RawMessage `json:"mtoServiceItems"` - - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - Order *Order `json:"order,omitempty"` - - OrderID strfmt.UUID `json:"orderID,omitempty"` - - PaymentRequests PaymentRequests `json:"paymentRequests"` - - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - PpmType string `json:"ppmType,omitempty"` - - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - ReferenceID string `json:"referenceId,omitempty"` - - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propMtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - - var result MoveTaskOrder - - // availableToPrimeAt - result.AvailableToPrimeAt = data.AvailableToPrimeAt - - // createdAt - result.CreatedAt = data.CreatedAt - - // eTag - result.ETag = data.ETag - - // excessWeightAcknowledgedAt - result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt - - // excessWeightQualifiedAt - result.ExcessWeightQualifiedAt = data.ExcessWeightQualifiedAt - - // excessWeightUploadId - result.ExcessWeightUploadID = data.ExcessWeightUploadID - - // id - result.ID = data.ID - - // moveCode - result.MoveCode = data.MoveCode - - // mtoServiceItems - result.mtoServiceItemsField = propMtoServiceItems - - // mtoShipments - result.MtoShipments = data.MtoShipments - - // order - result.Order = data.Order - - // orderID - result.OrderID = data.OrderID - - // paymentRequests - result.PaymentRequests = data.PaymentRequests - - // ppmEstimatedWeight - result.PpmEstimatedWeight = data.PpmEstimatedWeight - - // ppmType - result.PpmType = data.PpmType - - // primeCounselingCompletedAt - result.PrimeCounselingCompletedAt = data.PrimeCounselingCompletedAt - - // referenceId - result.ReferenceID = data.ReferenceID - - // updatedAt - result.UpdatedAt = data.UpdatedAt - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MoveTaskOrder) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - ETag string `json:"eTag,omitempty"` - - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - ID strfmt.UUID `json:"id,omitempty"` - - MoveCode string `json:"moveCode,omitempty"` - - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - Order *Order `json:"order,omitempty"` - - OrderID strfmt.UUID `json:"orderID,omitempty"` - - PaymentRequests PaymentRequests `json:"paymentRequests"` - - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - PpmType string `json:"ppmType,omitempty"` - - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - ReferenceID string `json:"referenceId,omitempty"` - - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - }{ - - AvailableToPrimeAt: m.AvailableToPrimeAt, - - CreatedAt: m.CreatedAt, - - ETag: m.ETag, - - ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt, - - ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt, - - ExcessWeightUploadID: m.ExcessWeightUploadID, - - ID: m.ID, - - MoveCode: m.MoveCode, - - MtoShipments: m.MtoShipments, - - Order: m.Order, - - OrderID: m.OrderID, - - PaymentRequests: m.PaymentRequests, - - PpmEstimatedWeight: m.PpmEstimatedWeight, - - PpmType: m.PpmType, - - PrimeCounselingCompletedAt: m.PrimeCounselingCompletedAt, - - ReferenceID: m.ReferenceID, - - UpdatedAt: m.UpdatedAt, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` - }{ - - MtoServiceItems: m.mtoServiceItemsField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this move task order -func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAvailableToPrimeAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightQualifiedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightUploadID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrder(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequests(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableToPrimeAt) { // not required - return nil - } - - if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.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 - } - - if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightUploadID(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightUploadID) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightUploadId", "body", "uuid", m.ExcessWeightUploadID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateMtoServiceItems(formats strfmt.Registry) error { - - if err := validate.Required("mtoServiceItems", "body", m.MtoServiceItems()); err != nil { - return err - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *MoveTaskOrder) validateMtoShipments(formats strfmt.Registry) error { - - if err := validate.Required("mtoShipments", "body", m.MtoShipments); err != nil { - return err - } - - if err := m.MtoShipments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateOrder(formats strfmt.Registry) error { - if swag.IsZero(m.Order) { // not required - return nil - } - - if m.Order != nil { - if err := m.Order.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.OrderID) { // not required - return nil - } - - if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePaymentRequests(formats strfmt.Registry) error { - - if err := validate.Required("paymentRequests", "body", m.PaymentRequests); err != nil { - return err - } - - if err := m.PaymentRequests.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentRequests") - } - return err - } - - return nil -} - -var moveTaskOrderTypePpmTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARTIAL","FULL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveTaskOrderTypePpmTypePropEnum = append(moveTaskOrderTypePpmTypePropEnum, v) - } -} - -const ( - - // MoveTaskOrderPpmTypePARTIAL captures enum value "PARTIAL" - MoveTaskOrderPpmTypePARTIAL string = "PARTIAL" - - // MoveTaskOrderPpmTypeFULL captures enum value "FULL" - MoveTaskOrderPpmTypeFULL string = "FULL" -) - -// prop value enum -func (m *MoveTaskOrder) validatePpmTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, moveTaskOrderTypePpmTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MoveTaskOrder) validatePpmType(formats strfmt.Registry) error { - if swag.IsZero(m.PpmType) { // not required - return nil - } - - // value enum - if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move task order based on the context it is used -func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightUploadID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrder(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequests(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) 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 *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightUploadID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightUploadId", "body", m.ExcessWeightUploadID); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if swag.IsZero(m.mtoServiceItemsField[i]) { // not required - return nil - } - - if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { - - if m.Order != nil { - - if swag.IsZero(m.Order) { // not required - return nil - } - - if err := m.Order.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePaymentRequests(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentRequests.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentRequests") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { - var res MoveTaskOrder - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/moves_list.go b/pkg/gen/internalmessages/moves_list.go index 72a550defce..61450be60be 100644 --- a/pkg/gen/internalmessages/moves_list.go +++ b/pkg/gen/internalmessages/moves_list.go @@ -20,10 +20,10 @@ import ( type MovesList struct { // current move - CurrentMove []*MoveTaskOrder `json:"currentMove"` + CurrentMove []*InternalMove `json:"currentMove"` // previous moves - PreviousMoves []*MoveTaskOrder `json:"previousMoves"` + PreviousMoves []*InternalMove `json:"previousMoves"` } // Validate validates this moves list diff --git a/pkg/gen/internalmessages/p_p_m_shipment2.go b/pkg/gen/internalmessages/p_p_m_shipment2.go deleted file mode 100644 index 1dddd27965c..00000000000 --- a/pkg/gen/internalmessages/p_p_m_shipment2.go +++ /dev/null @@ -1,670 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMShipment2 A personally procured move is a type of shipment that a service member moves themselves. -// -// swagger:model PPMShipment-2 -type PPMShipment2 struct { - - // ZIP - // - // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` - - // The actual start date of when the PPM shipment left the origin. - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate"` - - // ZIP - // - // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualPickupPostalCode *string `json:"actualPickupPostalCode"` - - // The amount received for an advance, or null if no advance is received. - // - AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` - - // The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive. - // - AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` - - // The timestamp of when the shipment was approved and the service member can begin their move. - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt"` - - // The timestamp of when the PPM shipment was created (UTC) - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // The postal code of the destination location where goods are being delivered to. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - DestinationPostalCode *string `json:"destinationPostalCode"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Required: true - // Read Only: true - ETag string `json:"eTag"` - - // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - EstimatedIncentive *int64 `json:"estimatedIncentive"` - - // The estimated weight of the PPM shipment goods being moved in pounds. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Date the customer expects to begin moving from their origin. - // - // Required: true - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear"` - - // Indicates whether an advance was received for the PPM shipment. - // - HasReceivedAdvance *bool `json:"hasReceivedAdvance"` - - // Indicates whether an advance has been requested for the PPM shipment. - // - HasRequestedAdvance *bool `json:"hasRequestedAdvance"` - - // The primary unique identifier of this PPM shipment - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // ZIP - // - // The postal code of the origin location where goods are being moved from. - // Example: 90210 - // Required: true - // Pattern: ^(\d{5})$ - PickupPostalCode *string `json:"pickupPostalCode"` - - // The estimated weight of the pro-gear being moved belonging to the service member in pounds. - ProGearWeight *int64 `json:"proGearWeight"` - - // The timestamp of when the Service Counselor has reviewed all of the closeout documents. - // Format: date-time - ReviewedAt *strfmt.DateTime `json:"reviewedAt"` - - // An optional secondary location near the destination where goods will be dropped off. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryDestinationPostalCode *string `json:"secondaryDestinationPostalCode"` - - // An optional secondary pickup location near the origin where additional goods exist. - // Example: 90210 - // Pattern: ^(\d{5})$ - SecondaryPickupPostalCode *string `json:"secondaryPickupPostalCode"` - - // The id of the parent MTOShipment record - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` - - // The estimated weight of the goods being put into storage in pounds. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - // Required: true - SitExpected *bool `json:"sitExpected"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse in pounds. - SpouseProGearWeight *int64 `json:"spouseProGearWeight"` - - // status - // Required: true - Status PPMShipmentStatus `json:"status"` - - // The timestamp of when the customer submitted their PPM documentation to the counselor for review. - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt"` - - // The timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this p p m shipment 2 -func (m *PPMShipment2) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReviewedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExpected(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment2) validateActualDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateActualPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateDestinationPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("destinationPostalCode", "body", m.DestinationPostalCode); err != nil { - return err - } - - if err := validate.Pattern("destinationPostalCode", "body", *m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateETag(formats strfmt.Registry) error { - - if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateExpectedDepartureDate(formats strfmt.Registry) error { - - if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { - return err - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validatePickupPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("pickupPostalCode", "body", m.PickupPostalCode); err != nil { - return err - } - - if err := validate.Pattern("pickupPostalCode", "body", *m.PickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateReviewedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ReviewedAt) { // not required - return nil - } - - if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateSecondaryDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryDestinationPostalCode", "body", *m.SecondaryDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateSecondaryPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("secondaryPickupPostalCode", "body", *m.SecondaryPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateSitExpected(formats strfmt.Registry) error { - - if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment2) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { - return err - } - - 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 -} - -func (m *PPMShipment2) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m shipment 2 based on the context it is used -func (m *PPMShipment2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - 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.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment2) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) 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 *PPMShipment2) 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 *PPMShipment2) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment2) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment2) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - 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 -} - -func (m *PPMShipment2) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMShipment2) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMShipment2) UnmarshalBinary(b []byte) error { - var res PPMShipment2 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/payment_request.go b/pkg/gen/internalmessages/payment_request.go deleted file mode 100644 index 7cad12596c1..00000000000 --- a/pkg/gen/internalmessages/payment_request.go +++ /dev/null @@ -1,322 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentRequest payment request -// -// swagger:model PaymentRequest -type PaymentRequest struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // is final - IsFinal *bool `json:"isFinal,omitempty"` - - // move task order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // payment request number - // Example: 1234-5678-1 - // Read Only: true - PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` - - // payment service items - PaymentServiceItems PaymentServiceItems `json:"paymentServiceItems,omitempty"` - - // proof of service docs - ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` - - // recalculation of payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` -} - -// Validate validates this payment request -func (m *PaymentRequest) 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.validatePaymentServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfServiceDocs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecalculationOfPaymentRequestID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validatePaymentServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItems) { // not required - return nil - } - - if err := m.PaymentServiceItems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { - if swag.IsZero(m.ProofOfServiceDocs) { // not required - return nil - } - - if err := m.ProofOfServiceDocs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) 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 -} - -// ContextValidate validate this payment request based on the context it is used -func (m *PaymentRequest) 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.contextValidatePaymentRequestNumber(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRecalculationOfPaymentRequestID(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 *PaymentRequest) 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 *PaymentRequest) 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 *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) 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 *PaymentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentRequest) UnmarshalBinary(b []byte) error { - var res PaymentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/payment_request_status.go b/pkg/gen/internalmessages/payment_request_status.go deleted file mode 100644 index e5729df0738..00000000000 --- a/pkg/gen/internalmessages/payment_request_status.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentRequestStatus Payment Request Status -// -// swagger:model PaymentRequestStatus -type PaymentRequestStatus string - -func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. -func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { - return &m -} - -const ( - - // PaymentRequestStatusPENDING captures enum value "PENDING" - PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" - - // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" - PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" - - // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - - // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" - - // PaymentRequestStatusRECEIVEDBYGEX captures enum value "RECEIVED_BY_GEX" - PaymentRequestStatusRECEIVEDBYGEX PaymentRequestStatus = "RECEIVED_BY_GEX" - - // PaymentRequestStatusPAID captures enum value "PAID" - PaymentRequestStatusPAID PaymentRequestStatus = "PAID" - - // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" - PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" - - // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" - PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" -) - -// for schema -var paymentRequestStatusEnum []interface{} - -func init() { - var res []PaymentRequestStatus - if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","RECEIVED_BY_GEX","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) - } -} - -func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { - if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment request status -func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment request status based on context it is used -func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/payment_requests.go b/pkg/gen/internalmessages/payment_requests.go deleted file mode 100644 index e7da06c306b..00000000000 --- a/pkg/gen/internalmessages/payment_requests.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentRequests payment requests -// -// swagger:model PaymentRequests -type PaymentRequests []*PaymentRequest - -// Validate validates this payment requests -func (m PaymentRequests) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment requests based on the context it is used -func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/payment_service_item.go b/pkg/gen/internalmessages/payment_service_item.go deleted file mode 100644 index b86789b8f8e..00000000000 --- a/pkg/gen/internalmessages/payment_service_item.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItem payment service item -// -// swagger:model PaymentServiceItem -type PaymentServiceItem struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` - - // payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` - - // payment service item params - PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` - - // Price of the service item in cents - PriceCents *int64 `json:"priceCents,omitempty"` - - // reference ID - // Example: 1234-5678-c56a4180 - // Read Only: true - ReferenceID string `json:"referenceID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentServiceItemStatus `json:"status,omitempty"` -} - -// Validate validates this payment service item -func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequestID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemParams(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemParams) { // not required - return nil - } - - if err := m.PaymentServiceItemParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) 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 -} - -// ContextValidate validate this payment service item based on the context it is used -func (m *PaymentServiceItem) 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.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReferenceID(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 *PaymentServiceItem) 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 *PaymentServiceItem) 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 *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) 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 *PaymentServiceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { - var res PaymentServiceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/payment_service_item_param.go b/pkg/gen/internalmessages/payment_service_item_param.go deleted file mode 100644 index 7cf0fbbe90c..00000000000 --- a/pkg/gen/internalmessages/payment_service_item_param.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemParam payment service item param -// -// swagger:model PaymentServiceItemParam -type PaymentServiceItemParam struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // key - Key ServiceItemParamName `json:"key,omitempty"` - - // origin - Origin ServiceItemParamOrigin `json:"origin,omitempty"` - - // payment service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` - - // type - Type ServiceItemParamType `json:"type,omitempty"` - - // value - // Example: 3025 - Value string `json:"value,omitempty"` -} - -// Validate validates this payment service item param -func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item param based on the context it is used -func (m *PaymentServiceItemParam) 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.contextValidateKey(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) 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 *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { - var res PaymentServiceItemParam - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/payment_service_item_params.go b/pkg/gen/internalmessages/payment_service_item_params.go deleted file mode 100644 index d84f9dae6a9..00000000000 --- a/pkg/gen/internalmessages/payment_service_item_params.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItemParams payment service item params -// -// swagger:model PaymentServiceItemParams -type PaymentServiceItemParams []*PaymentServiceItemParam - -// Validate validates this payment service item params -func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service item params based on the context it is used -func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/payment_service_item_status.go b/pkg/gen/internalmessages/payment_service_item_status.go deleted file mode 100644 index 90f078aa186..00000000000 --- a/pkg/gen/internalmessages/payment_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemStatus Payment Service Item Status -// -// swagger:model PaymentServiceItemStatus -type PaymentServiceItemStatus string - -func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. -func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { - return &m -} - -const ( - - // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" - PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" - - // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" - PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" - - // PaymentServiceItemStatusDENIED captures enum value "DENIED" - PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" - - // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" - - // PaymentServiceItemStatusPAID captures enum value "PAID" - PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" - - // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" - PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" -) - -// for schema -var paymentServiceItemStatusEnum []interface{} - -func init() { - var res []PaymentServiceItemStatus - if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) - } -} - -func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment service item status -func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment service item status based on context it is used -func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/payment_service_items.go b/pkg/gen/internalmessages/payment_service_items.go deleted file mode 100644 index 0da94045578..00000000000 --- a/pkg/gen/internalmessages/payment_service_items.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItems payment service items -// -// swagger:model PaymentServiceItems -type PaymentServiceItems []*PaymentServiceItem - -// Validate validates this payment service items -func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service items based on the context it is used -func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/proof_of_service_doc.go b/pkg/gen/internalmessages/proof_of_service_doc.go deleted file mode 100644 index a80507bf548..00000000000 --- a/pkg/gen/internalmessages/proof_of_service_doc.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDoc proof of service doc -// -// swagger:model ProofOfServiceDoc -type ProofOfServiceDoc struct { - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this proof of service doc -func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this proof of service doc based on the context it is used -func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { - var res ProofOfServiceDoc - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/proof_of_service_docs.go b/pkg/gen/internalmessages/proof_of_service_docs.go deleted file mode 100644 index 3e067521f21..00000000000 --- a/pkg/gen/internalmessages/proof_of_service_docs.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDocs proof of service docs -// -// swagger:model ProofOfServiceDocs -type ProofOfServiceDocs []*ProofOfServiceDoc - -// Validate validates this proof of service docs -func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this proof of service docs based on the context it is used -func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/reweigh.go b/pkg/gen/internalmessages/reweigh.go deleted file mode 100644 index 421485115e3..00000000000 --- a/pkg/gen/internalmessages/reweigh.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. -// -// swagger:model Reweigh -type Reweigh struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // requested at - // Format: date-time - RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` - - // requested by - RequestedBy ReweighRequester `json:"requestedBy,omitempty"` - - // shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // verification provided at - // Format: date-time - VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` - - // verification reason - // Example: The reweigh was not performed due to some justification provided by the Prime - VerificationReason *string `json:"verificationReason"` - - // weight - // Example: 2000 - Weight *int64 `json:"weight"` -} - -// Validate validates this reweigh -func (m *Reweigh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedBy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVerificationProvidedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedAt) { // not required - return nil - } - - if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { - if swag.IsZero(m.VerificationProvidedAt) { // not required - return nil - } - - if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this reweigh based on the context it is used -func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedBy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) 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 *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Reweigh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Reweigh) UnmarshalBinary(b []byte) error { - var res Reweigh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/reweigh_requester.go b/pkg/gen/internalmessages/reweigh_requester.go deleted file mode 100644 index 7f07d2b8a93..00000000000 --- a/pkg/gen/internalmessages/reweigh_requester.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReweighRequester reweigh requester -// -// swagger:model ReweighRequester -type ReweighRequester string - -func NewReweighRequester(value ReweighRequester) *ReweighRequester { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReweighRequester. -func (m ReweighRequester) Pointer() *ReweighRequester { - return &m -} - -const ( - - // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" - ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" - - // ReweighRequesterPRIME captures enum value "PRIME" - ReweighRequesterPRIME ReweighRequester = "PRIME" - - // ReweighRequesterSYSTEM captures enum value "SYSTEM" - ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" - - // ReweighRequesterTOO captures enum value "TOO" - ReweighRequesterTOO ReweighRequester = "TOO" -) - -// for schema -var reweighRequesterEnum []interface{} - -func init() { - var res []ReweighRequester - if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reweighRequesterEnum = append(reweighRequesterEnum, v) - } -} - -func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { - if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this reweigh requester -func (m ReweighRequester) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReweighRequesterEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this reweigh requester based on context it is used -func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/s_i_t_extension.go b/pkg/gen/internalmessages/s_i_t_extension.go deleted file mode 100644 index 75a8faf353a..00000000000 --- a/pkg/gen/internalmessages/s_i_t_extension.go +++ /dev/null @@ -1,291 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. -// -// swagger:model SITExtension -type SITExtension struct { - - // approved days - // Example: 30 - ApprovedDays *int64 `json:"approvedDays"` - - // contractor remarks - // Example: We need SIT additional days. The customer has not found a house yet. - ContractorRemarks *string `json:"contractorRemarks"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // decision date - // Format: date-time - DecisionDate *strfmt.DateTime `json:"decisionDate"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // office remarks - OfficeRemarks *string `json:"officeRemarks"` - - // request reason - // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] - RequestReason string `json:"requestReason,omitempty"` - - // requested days - // Example: 30 - RequestedDays int64 `json:"requestedDays,omitempty"` - - // status - // Enum: [PENDING APPROVED DENIED] - Status interface{} `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this s i t extension -func (m *SITExtension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDecisionDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { - if swag.IsZero(m.DecisionDate) { // not required - return nil - } - - if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) 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 *SITExtension) 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 -} - -var sITExtensionTypeRequestReasonPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) - } -} - -const ( - - // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" - SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" - - // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" - SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" - - // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" - SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" - - // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" - SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" - - // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - - // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" - SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" - - // SITExtensionRequestReasonOTHER captures enum value "OTHER" - SITExtensionRequestReasonOTHER string = "OTHER" -) - -// prop value enum -func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { - if swag.IsZero(m.RequestReason) { // not required - return nil - } - - // value enum - if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this s i t extension based on the context it is used -func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) 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 *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SITExtension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITExtension) UnmarshalBinary(b []byte) error { - var res SITExtension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/s_i_t_extensions.go b/pkg/gen/internalmessages/s_i_t_extensions.go deleted file mode 100644 index 2f6e5e425ce..00000000000 --- a/pkg/gen/internalmessages/s_i_t_extensions.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SITExtensions s i t extensions -// -// swagger:model SITExtensions -type SITExtensions []*SITExtension - -// Validate validates this s i t extensions -func (m SITExtensions) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this s i t extensions based on the context it is used -func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/service_item_param_name.go b/pkg/gen/internalmessages/service_item_param_name.go deleted file mode 100644 index 8fc55bde8f0..00000000000 --- a/pkg/gen/internalmessages/service_item_param_name.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamName service item param name -// -// swagger:model ServiceItemParamName -type ServiceItemParamName string - -func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. -func (m ServiceItemParamName) Pointer() *ServiceItemParamName { - return &m -} - -const ( - - // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" - ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" - - // ServiceItemParamNameContractCode captures enum value "ContractCode" - ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" - - // ServiceItemParamNameContractYearName captures enum value "ContractYearName" - ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" - - // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" - ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" - - // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" - ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" - - // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" - ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" - - // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" - ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" - - // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" - ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" - - // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" - ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" - - // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" - ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" - - // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" - ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" - - // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" - ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" - - // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" - ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" - - // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" - ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" - - // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" - ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" - - // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" - ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" - - // ServiceItemParamNameIsPeak captures enum value "IsPeak" - ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" - - // ServiceItemParamNameMarketDest captures enum value "MarketDest" - ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" - - // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" - ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" - - // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" - ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" - - // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" - ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" - - // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" - ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" - - // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" - ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" - - // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" - ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" - - // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" - ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" - - // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" - ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" - - // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" - ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" - - // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" - ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" - - // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" - ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" - - // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" - ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" - - // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" - ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" - - // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" - ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" - - // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" - ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" - - // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" - ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" - - // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" - ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" - ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" - - // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" - ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" - - // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" - ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" - - // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" - - // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" - ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" - - // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" - ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" - - // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" - ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" - - // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" - ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" - - // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" - ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" - - // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" - ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" - - // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" - ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" - - // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" - ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" - - // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" - ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" - - // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" - ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" - - // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" - ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" - - // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" - ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" - - // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" - ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" - - // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" - ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" - - // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" - ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" - - // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" - ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" - - // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" - ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" - - // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" - ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" - - // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" - ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" - - // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" - ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" - - // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" - ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" - - // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" - ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" - - // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" - ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" - - // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" - ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" - - // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" - ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" -) - -// for schema -var serviceItemParamNameEnum []interface{} - -func init() { - var res []ServiceItemParamName - if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) - } -} - -func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { - if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param name -func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param name based on context it is used -func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/service_item_param_origin.go b/pkg/gen/internalmessages/service_item_param_origin.go deleted file mode 100644 index 2415c82c964..00000000000 --- a/pkg/gen/internalmessages/service_item_param_origin.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamOrigin service item param origin -// -// swagger:model ServiceItemParamOrigin -type ServiceItemParamOrigin string - -func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. -func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { - return &m -} - -const ( - - // ServiceItemParamOriginPRIME captures enum value "PRIME" - ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" - - // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" - ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" - - // ServiceItemParamOriginPRICER captures enum value "PRICER" - ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" - - // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" - ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" -) - -// for schema -var serviceItemParamOriginEnum []interface{} - -func init() { - var res []ServiceItemParamOrigin - if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) - } -} - -func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { - if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param origin -func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param origin based on context it is used -func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/service_item_param_type.go b/pkg/gen/internalmessages/service_item_param_type.go deleted file mode 100644 index 8fed68e90ab..00000000000 --- a/pkg/gen/internalmessages/service_item_param_type.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamType service item param type -// -// swagger:model ServiceItemParamType -type ServiceItemParamType string - -func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. -func (m ServiceItemParamType) Pointer() *ServiceItemParamType { - return &m -} - -const ( - - // ServiceItemParamTypeSTRING captures enum value "STRING" - ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" - - // ServiceItemParamTypeDATE captures enum value "DATE" - ServiceItemParamTypeDATE ServiceItemParamType = "DATE" - - // ServiceItemParamTypeINTEGER captures enum value "INTEGER" - ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" - - // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" - ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" - - // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" - ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" - - // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" - ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" - - // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" - ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" -) - -// for schema -var serviceItemParamTypeEnum []interface{} - -func init() { - var res []ServiceItemParamType - if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) - } -} - -func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { - if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param type -func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param type based on context it is used -func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/service_request_document.go b/pkg/gen/internalmessages/service_request_document.go deleted file mode 100644 index 0078b6a77a0..00000000000 --- a/pkg/gen/internalmessages/service_request_document.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocument service request document -// -// swagger:model ServiceRequestDocument -type ServiceRequestDocument struct { - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this service request document -func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this service request document based on the context it is used -func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { - var res ServiceRequestDocument - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/service_request_documents.go b/pkg/gen/internalmessages/service_request_documents.go deleted file mode 100644 index 0accee434c2..00000000000 --- a/pkg/gen/internalmessages/service_request_documents.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocuments service request documents -// -// swagger:model ServiceRequestDocuments -type ServiceRequestDocuments []*ServiceRequestDocument - -// Validate validates this service request documents -func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service request documents based on the context it is used -func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/shipment_address_update.go b/pkg/gen/internalmessages/shipment_address_update.go deleted file mode 100644 index f60d85c32e4..00000000000 --- a/pkg/gen/internalmessages/shipment_address_update.go +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdate This represents a destination address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. -// -// swagger:model ShipmentAddressUpdate -type ShipmentAddressUpdate struct { - - // Contractor Remarks - // - // The reason there is an address change. - // Example: This is a contractor remark - // Required: true - // Read Only: true - ContractorRemarks string `json:"contractorRemarks"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // new address - // Required: true - NewAddress *Address `json:"newAddress"` - - // Office Remarks - // - // The TOO comment on approval or rejection. - // Example: This is an office remark - OfficeRemarks *string `json:"officeRemarks,omitempty"` - - // original address - // Required: true - OriginalAddress *Address `json:"originalAddress"` - - // shipment ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID"` - - // status - // Required: true - Status ShipmentAddressUpdateStatus `json:"status"` -} - -// Validate validates this shipment address update -func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContractorRemarks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { - - if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { - - if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { - return err - } - - if m.NewAddress != nil { - if err := m.NewAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { - - if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { - return err - } - - if m.OriginalAddress != nil { - if err := m.OriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { - return err - } - - 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 -} - -// ContextValidate validate this shipment address update based on the context it is used -func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNewAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(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 *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) 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 *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.NewAddress != nil { - - if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginalAddress != nil { - - if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - 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 *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { - var res ShipmentAddressUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/shipment_address_update_status.go b/pkg/gen/internalmessages/shipment_address_update_status.go deleted file mode 100644 index bb9475488d5..00000000000 --- a/pkg/gen/internalmessages/shipment_address_update_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdateStatus Status -// -// swagger:model ShipmentAddressUpdateStatus -type ShipmentAddressUpdateStatus string - -func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. -func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { - return &m -} - -const ( - - // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" - ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" - - // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" - ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" - - // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" - ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" -) - -// for schema -var shipmentAddressUpdateStatusEnum []interface{} - -func init() { - var res []ShipmentAddressUpdateStatus - if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) - } -} - -func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { - if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this shipment address update status -func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this shipment address update status based on the context it is used -func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/storage_facility.go b/pkg/gen/internalmessages/storage_facility.go deleted file mode 100644 index e50a749dfd1..00000000000 --- a/pkg/gen/internalmessages/storage_facility.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageFacility The Storage Facility information for the shipment -// -// swagger:model StorageFacility -type StorageFacility struct { - - // address - Address *Address `json:"address,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // facility name - FacilityName string `json:"facilityName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lot number - LotNumber *string `json:"lotNumber,omitempty"` - - // phone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Phone *string `json:"phone,omitempty"` -} - -// Validate validates this storage facility -func (m *StorageFacility) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required - return nil - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this storage facility based on the context it is used -func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if swag.IsZero(m.Address) { // not required - return nil - } - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StorageFacility) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageFacility) UnmarshalBinary(b []byte) error { - var res StorageFacility - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/upload_with_omissions.go b/pkg/gen/internalmessages/upload_with_omissions.go deleted file mode 100644 index 17d77acd97c..00000000000 --- a/pkg/gen/internalmessages/upload_with_omissions.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UploadWithOmissions An uploaded file. -// -// swagger:model UploadWithOmissions -type UploadWithOmissions struct { - - // bytes - // Required: true - Bytes *int64 `json:"bytes"` - - // content type - // Example: application/pdf - // Required: true - ContentType *string `json:"contentType"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // filename - // Example: filename.pdf - // Required: true - Filename *string `json:"filename"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // status - // Enum: [INFECTED CLEAN PROCESSING] - Status string `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // url - // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uri - URL strfmt.URI `json:"url,omitempty"` -} - -// Validate validates this upload with omissions -func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBytes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFilename(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { - - if err := validate.Required("bytes", "body", m.Bytes); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { - - if err := validate.Required("contentType", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { - - if err := validate.Required("filename", "body", m.Filename); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) 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 -} - -var uploadWithOmissionsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) - } -} - -const ( - - // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" - UploadWithOmissionsStatusINFECTED string = "INFECTED" - - // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" - UploadWithOmissionsStatusCLEAN string = "CLEAN" - - // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" - UploadWithOmissionsStatusPROCESSING string = "PROCESSING" -) - -// prop value enum -func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { - if swag.IsZero(m.URL) { // not required - return nil - } - - if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this upload with omissions based on the context it is used -func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { - var res UploadWithOmissions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index 54cec9cc0e4..c3eeab311de 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -73,6 +73,58 @@ func payloadForMoveModel(storer storage.FileStorer, order models.Order, move mod return movePayload, nil } +func payloadMovesList(storer storage.FileStorer, previousMovesList models.Moves, currentMoveList models.Moves, movesList models.Moves) (*internalmessages.MovesList, error) { + + // Convert currentMoves moves to internalmessages.MoveTaskOrder + var convertedCurrentMovesList []*internalmessages.InternalMove + moves := movesList + for _, move := range moves { + + eTag := etag.GenerateEtag(move.UpdatedAt) + shipments := move.MTOShipments + var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) + // var payloadOrders *internalmessages.Order = payloads + + currentMove := &internalmessages.InternalMove{ + CreatedAt: *handlers.FmtDateTime(move.CreatedAt), + ETag: eTag, + ID: *handlers.FmtUUID(move.ID), + MtoShipments: *payloadShipments, + MoveCode: move.Locator, + Orders: move.Orders, + } + + convertedCurrentMovesList = append(convertedCurrentMovesList, currentMove) + } + + // Convert previousMoves moves to internalmessages.MoveTaskOrder + var convertedPreviousMovesList []*internalmessages.InternalMove + for _, move := range previousMovesList { + + if currentMoveList[0].ID != move.ID { + eTag := etag.GenerateEtag(move.UpdatedAt) + shipments := move.MTOShipments + var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) + + currentMove := &internalmessages.InternalMove{ + CreatedAt: *handlers.FmtDateTime(move.CreatedAt), + ETag: eTag, + ID: *handlers.FmtUUID(move.ID), + MtoShipments: *payloadShipments, + } + + convertedPreviousMovesList = append(convertedPreviousMovesList, currentMove) + } + } + + movePayload := &internalmessages.MovesList{ + CurrentMove: convertedCurrentMovesList, + PreviousMoves: convertedPreviousMovesList, + } + + return movePayload, nil +} + // ShowMoveHandler returns a move for a user and move ID type ShowMoveHandler struct { handlers.HandlerConfig @@ -364,6 +416,58 @@ func (h GetAllMovesHandler) Handle(params moveop.GetAllMovesParams) middleware.R return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, func(appCtx appcontext.AppContext) (middleware.Responder, error) { - return moveop.NewGetAllMovesOK().WithPayload(nil), nil + // Grab service member ID from params + serviceMemberID, _ := uuid.FromString(params.ServiceMemberID.String()) + + // Grab the serviceMember by serviceMemberId + serviceMember, err := models.FetchServiceMemberForUser(appCtx.DB(), appCtx.Session(), serviceMemberID) + if err != nil { + return handlers.ResponseForError(appCtx.Logger(), err), err + } + + var movesList models.Moves + var latestMove models.Move + var previousMovesList models.Moves + var currentMovesList models.Moves + + // Get All Moves for the ServiceMember + for _, order := range serviceMember.Orders { + moves, fetchErr := models.FetchMovesByOrderID(appCtx.DB(), order.ID) + if fetchErr != nil { + return handlers.ResponseForError(appCtx.Logger(), err), err + } + + movesList = append(movesList, moves...) + } + + // Find the move with the latest CreatedAt Date. That one will be the current move + var nilTime time.Time + for _, move := range movesList { + if latestMove.CreatedAt == nilTime { + latestMove = move + break + } + if move.CreatedAt.After(latestMove.CreatedAt) && move.CreatedAt != latestMove.CreatedAt { + latestMove = move + } + } + + // Place latest move in currentMovesList array + currentMovesList = append(currentMovesList, latestMove) + + // Populate previousMovesList + for _, move := range movesList { + if move.ID != latestMove.ID { + previousMovesList = append(previousMovesList, move) + } + } + + // Build MovesList Payload + payload, err := payloadMovesList(h.FileStorer(), previousMovesList, currentMovesList, movesList) + if err != nil { + return handlers.ResponseForError(appCtx.Logger(), err), err + } + + return moveop.NewGetAllMovesOK().WithPayload(payload), nil }) } diff --git a/pkg/models/move.go b/pkg/models/move.go index 452a7aafa94..739a391de95 100644 --- a/pkg/models/move.go +++ b/pkg/models/move.go @@ -408,6 +408,32 @@ func FetchMoveByOrderID(db *pop.Connection, orderID uuid.UUID) (Move, error) { return move, nil } +// FetchMovesByOrderID returns a Moves for a given id +func FetchMovesByOrderID(db *pop.Connection, orderID uuid.UUID) (Moves, error) { + var moves Moves + + query := db.Where("orders_id = ?", orderID) + err := query.Eager( + "Orders", + "Orders.ServiceMember.User", + "Orders.ServiceMember.DutyLocation.Address", + "Orders.ServiceMember.DutyLocation.TransportationOffice", + "Orders.ServiceMember.DutyLocation.TransportationOffice.Address", + "Orders.NewDutyLocation.Address", + "Orders.ServiceMember", + "Orders.NewDutyLocation.TransportationOffice", + "Orders.NewDutyLocation.TransportationOffice.Address", + "Orders.UploadedOrders", + "Orders.UploadedOrders.ServiceMember", + "Orders.UploadedOrders.ServiceMember.User", + "Orders.UploadedOrders.ServiceMember.DutyLocation", + "Orders.UploadedOrders.ServiceMember.DutyLocation.Address", + "Orders.UploadedOrders.ServiceMember.DutyLocation.TransportationOffice", + "Orders.UploadedOrders.ServiceMember.DutyLocation.TransportationOffice.Address", + ).All(&moves) + return moves, err +} + // FetchMoveByMoveID returns a Move for a given id func FetchMoveByMoveID(db *pop.Connection, moveID uuid.UUID) (Move, error) { var move Move diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 1e0cec3f900..bfa10464b5b 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2696,11 +2696,65 @@ definitions: currentMove: type: array items: - $ref: 'definitions/prime/MoveTaskOrder.yaml' + $ref: '#/definitions/InternalMove' previousMoves: type: array items: - $ref: 'definitions/prime/MoveTaskOrder.yaml' + $ref: '#/definitions/InternalMove' + InternalMove: + type: object + properties: + id: + example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + format: uuid + type: string + moveCode: + type: string + example: 'HYXFJF' + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + orderID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + order: + $ref: 'definitions/prime/Order.yaml' + orders: + type: object + referenceId: + example: 1001-3456 + type: string + updatedAt: + format: date-time + type: string + readOnly: true + primeCounselingCompletedAt: + format: date-time + type: string + x-nullable: true + readOnly: true + mtoShipments: + $ref: '#/definitions/MTOShipments' + ppmEstimatedWeight: + type: integer + excessWeightQualifiedAt: + type: string + format: date-time + readOnly: true + x-omitempty: false + x-nullable: true + excessWeightAcknowledgedAt: + type: string + format: date-time + readOnly: true + x-omitempty: false + x-nullable: true + eTag: + type: string + readOnly: true paths: /estimates/ppm: get: diff --git a/swagger/internal.yaml b/swagger/internal.yaml index c86dc32bb56..82a6adef783 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2729,11 +2729,65 @@ definitions: currentMove: type: array items: - $ref: '#/definitions/MoveTaskOrder' + $ref: '#/definitions/InternalMove' previousMoves: type: array items: - $ref: '#/definitions/MoveTaskOrder' + $ref: '#/definitions/InternalMove' + InternalMove: + type: object + properties: + id: + example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + format: uuid + type: string + moveCode: + type: string + example: HYXFJF + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + orderID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + order: + $ref: '#/definitions/Order' + orders: + type: object + referenceId: + example: 1001-3456 + type: string + updatedAt: + format: date-time + type: string + readOnly: true + primeCounselingCompletedAt: + format: date-time + type: string + x-nullable: true + readOnly: true + mtoShipments: + $ref: '#/definitions/MTOShipments' + ppmEstimatedWeight: + type: integer + excessWeightQualifiedAt: + type: string + format: date-time + readOnly: true + x-omitempty: false + x-nullable: true + excessWeightAcknowledgedAt: + type: string + format: date-time + readOnly: true + x-omitempty: false + x-nullable: true + eTag: + type: string + readOnly: true FeatureFlagBoolean: description: A feature flag type: object @@ -4035,1239 +4089,6 @@ definitions: eTag: type: string readOnly: true - PaymentRequestStatus: - type: string - enum: - - PENDING - - REVIEWED - - REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED - - SENT_TO_GEX - - RECEIVED_BY_GEX - - PAID - - EDI_ERROR - - DEPRECATED - title: Payment Request Status - UploadWithOmissions: - description: An uploaded file. - type: object - properties: - id: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - url: - type: string - format: uri - example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 - filename: - type: string - example: filename.pdf - contentType: - type: string - format: mime-type - example: application/pdf - bytes: - type: integer - status: - type: string - enum: - - INFECTED - - CLEAN - - PROCESSING - createdAt: - type: string - format: date-time - readOnly: true - updatedAt: - type: string - format: date-time - readOnly: true - required: - - filename - - contentType - - bytes - ProofOfServiceDoc: - type: object - properties: - uploads: - type: array - items: - $ref: '#/definitions/UploadWithOmissions' - ProofOfServiceDocs: - type: array - items: - $ref: '#/definitions/ProofOfServiceDoc' - PaymentServiceItemStatus: - type: string - enum: - - REQUESTED - - APPROVED - - DENIED - - SENT_TO_GEX - - PAID - - EDI_ERROR - title: Payment Service Item Status - ServiceItemParamName: - type: string - enum: - - ActualPickupDate - - ContractCode - - ContractYearName - - CubicFeetBilled - - CubicFeetCrating - - DimensionHeight - - DimensionLength - - DimensionWidth - - DistanceZip - - DistanceZipSITDest - - DistanceZipSITOrigin - - EIAFuelPrice - - EscalationCompounded - - FSCMultiplier - - FSCPriceDifferenceInCents - - FSCWeightBasedDistanceMultiplier - - IsPeak - - MarketDest - - MarketOrigin - - MTOAvailableToPrimeAt - - NTSPackingFactor - - NumberDaysSIT - - PriceAreaDest - - PriceAreaIntlDest - - PriceAreaIntlOrigin - - PriceAreaOrigin - - PriceRateOrFactor - - PSI_LinehaulDom - - PSI_LinehaulDomPrice - - PSI_LinehaulShort - - PSI_LinehaulShortPrice - - PSI_PriceDomDest - - PSI_PriceDomDestPrice - - PSI_PriceDomOrigin - - PSI_PriceDomOriginPrice - - PSI_ShippingLinehaulIntlCO - - PSI_ShippingLinehaulIntlCOPrice - - PSI_ShippingLinehaulIntlOC - - PSI_ShippingLinehaulIntlOCPrice - - PSI_ShippingLinehaulIntlOO - - PSI_ShippingLinehaulIntlOOPrice - - RateAreaNonStdDest - - RateAreaNonStdOrigin - - ReferenceDate - - RequestedPickupDate - - ServiceAreaDest - - ServiceAreaOrigin - - ServicesScheduleDest - - ServicesScheduleOrigin - - SITPaymentRequestEnd - - SITPaymentRequestStart - - SITScheduleDest - - SITScheduleOrigin - - SITServiceAreaDest - - SITServiceAreaOrigin - - WeightAdjusted - - WeightBilled - - WeightEstimated - - WeightOriginal - - WeightReweigh - - ZipDestAddress - - ZipPickupAddress - - ZipSITDestHHGFinalAddress - - ZipSITDestHHGOriginalAddress - - ZipSITOriginHHGActualAddress - - ZipSITOriginHHGOriginalAddress - ServiceItemParamType: - type: string - enum: - - STRING - - DATE - - INTEGER - - DECIMAL - - TIMESTAMP - - PaymentServiceItemUUID - - BOOLEAN - ServiceItemParamOrigin: - type: string - enum: - - PRIME - - SYSTEM - - PRICER - - PAYMENT_REQUEST - PaymentServiceItemParam: - type: object - properties: - id: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - readOnly: true - type: string - paymentServiceItemID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - key: - $ref: '#/definitions/ServiceItemParamName' - value: - example: '3025' - type: string - type: - $ref: '#/definitions/ServiceItemParamType' - origin: - $ref: '#/definitions/ServiceItemParamOrigin' - eTag: - type: string - readOnly: true - PaymentServiceItemParams: - type: array - items: - $ref: '#/definitions/PaymentServiceItemParam' - PaymentServiceItem: - type: object - properties: - id: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - readOnly: true - type: string - paymentRequestID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - mtoServiceItemID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - status: - $ref: '#/definitions/PaymentServiceItemStatus' - priceCents: - type: integer - format: cents - title: Price of the service item in cents - x-nullable: true - rejectionReason: - example: documentation was incomplete - type: string - x-nullable: true - referenceID: - example: 1234-5678-c56a4180 - readOnly: true - format: string - paymentServiceItemParams: - $ref: '#/definitions/PaymentServiceItemParams' - eTag: - type: string - readOnly: true - PaymentServiceItems: - type: array - items: - $ref: '#/definitions/PaymentServiceItem' - PaymentRequest: - type: object - properties: - id: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - readOnly: true - type: string - isFinal: - default: false - type: boolean - moveTaskOrderID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - rejectionReason: - example: documentation was incomplete - type: string - x-nullable: true - status: - $ref: '#/definitions/PaymentRequestStatus' - paymentRequestNumber: - example: 1234-5678-1 - readOnly: true - type: string - recalculationOfPaymentRequestID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - readOnly: true - x-nullable: true - proofOfServiceDocs: - $ref: '#/definitions/ProofOfServiceDocs' - paymentServiceItems: - $ref: '#/definitions/PaymentServiceItems' - eTag: - type: string - readOnly: true - PaymentRequests: - type: array - items: - $ref: '#/definitions/PaymentRequest' - MTOServiceItemStatus: - description: >- - The status of a service item, indicating where it is in the TOO's approval - process. - type: string - readOnly: true - enum: - - SUBMITTED - - APPROVED - - REJECTED - MTOServiceItemModelType: - description: > - Describes all model sub-types for a MTOServiceItem model. - - - Using this list, choose the correct modelType in the dropdown, - corresponding to the service item type. - * DOFSIT, DOASIT - MTOServiceItemOriginSIT - * DDFSIT, DDASIT - MTOServiceItemDestSIT - * DOSHUT, DDSHUT - MTOServiceItemShuttle - * DCRT, DUCRT - MTOServiceItemDomesticCrating - - The documentation will then update with the supported fields. - type: string - enum: - - MTOServiceItemBasic - - MTOServiceItemOriginSIT - - MTOServiceItemDestSIT - - MTOServiceItemShuttle - - MTOServiceItemDomesticCrating - ServiceRequestDocument: - properties: - uploads: - items: - $ref: '#/definitions/UploadWithOmissions' - type: array - type: object - ServiceRequestDocuments: - items: - $ref: '#/definitions/ServiceRequestDocument' - type: array - MTOServiceItem: - description: MTOServiceItem describes a base type of a service item. Polymorphic type. - type: object - discriminator: modelType - properties: - id: - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - description: The ID of the service item. - readOnly: true - moveTaskOrderID: - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - description: The ID of the move for this service item. - mtoShipmentID: - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - description: The ID of the shipment this service is for, if any. Optional. - reServiceName: - type: string - readOnly: true - description: The full descriptive name of the service. - status: - $ref: '#/definitions/MTOServiceItemStatus' - rejectionReason: - example: item was too heavy - type: string - x-nullable: true - readOnly: true - description: The reason why this service item was rejected by the TOO. - modelType: - $ref: '#/definitions/MTOServiceItemModelType' - serviceRequestDocuments: - $ref: '#/definitions/ServiceRequestDocuments' - eTag: - type: string - readOnly: true - description: >- - A hash unique to this service item that should be used as the - "If-Match" header for any updates. - required: - - modelType - - moveTaskOrderID - MTOAgentType-2: - title: Agent Type - description: > - The type for this agent. `RELEASING` means they have authority on pickup, - `RECEIVING` means they can receive the shipment on delivery. - type: string - example: RELEASING_AGENT - enum: - - RELEASING_AGENT - - RECEIVING_AGENT - MTOAgent-2: - properties: - id: - description: The ID of the agent. - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - readOnly: true - type: string - mtoShipmentID: - description: The ID of the shipment this agent is permitted to release/receive. - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - readOnly: true - createdAt: - format: date-time - type: string - readOnly: true - updatedAt: - format: date-time - type: string - readOnly: true - firstName: - type: string - x-nullable: true - lastName: - type: string - x-nullable: true - email: - type: string - format: x-email - pattern: ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$ - x-nullable: true - phone: - type: string - format: telephone - pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ - x-nullable: true - agentType: - $ref: '#/definitions/MTOAgentType-2' - eTag: - type: string - readOnly: true - type: object - MTOAgents-2: - description: > - A list of the agents for a shipment. Agents are the people who the Prime - contractor recognize as permitted to release (in the case of pickup) or - receive (on delivery) a shipment. - items: - $ref: '#/definitions/MTOAgent-2' - type: array - maxItems: 2 - SITExtension: - type: object - description: >- - A storage in transit (SIT) Extension is a request for an increase in the - billable number of days a shipment is allowed to be in SIT. - properties: - id: - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - mtoShipmentID: - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - requestReason: - type: string - enum: - - SERIOUS_ILLNESS_MEMBER - - SERIOUS_ILLNESS_DEPENDENT - - IMPENDING_ASSIGNEMENT - - DIRECTED_TEMPORARY_DUTY - - NONAVAILABILITY_OF_CIVILIAN_HOUSING - - AWAITING_COMPLETION_OF_RESIDENCE - - OTHER - contractorRemarks: - example: We need SIT additional days. The customer has not found a house yet. - type: string - x-nullable: true - x-omitempty: false - requestedDays: - type: integer - example: 30 - status: - enum: - - PENDING - - APPROVED - - DENIED - approvedDays: - type: integer - example: 30 - x-nullable: true - x-omitempty: false - decisionDate: - format: date-time - type: string - x-nullable: true - x-omitempty: false - officeRemarks: - type: string - x-nullable: true - x-omitempty: false - createdAt: - format: date-time - type: string - readOnly: true - updatedAt: - format: date-time - type: string - readOnly: true - eTag: - type: string - readOnly: true - SITExtensions: - type: array - items: - $ref: '#/definitions/SITExtension' - ReweighRequester: - type: string - enum: - - CUSTOMER - - PRIME - - SYSTEM - - TOO - Reweigh: - description: >- - A reweigh is when a shipment is weighed for a second time due to the - request of a customer, the contractor, system or TOO. - properties: - id: - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - requestedAt: - format: date-time - type: string - requestedBy: - $ref: '#/definitions/ReweighRequester' - verificationProvidedAt: - format: date-time - type: string - x-nullable: true - x-omitempty: false - verificationReason: - example: >- - The reweigh was not performed due to some justification provided by - the Prime - type: string - x-nullable: true - x-omitempty: false - weight: - example: 2000 - type: integer - x-formatting: weight - x-nullable: true - x-omitempty: false - shipmentID: - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - createdAt: - format: date-time - type: string - readOnly: true - updatedAt: - format: date-time - type: string - readOnly: true - eTag: - type: string - readOnly: true - DestinationType: - type: string - title: Destination Type - example: OTHER_THAN_AUTHORIZED - x-nullable: true - enum: - - HOME_OF_RECORD - - HOME_OF_SELECTION - - PLACE_ENTERED_ACTIVE_DUTY - - OTHER_THAN_AUTHORIZED - StorageFacility: - description: The Storage Facility information for the shipment - type: object - properties: - id: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - facilityName: - type: string - address: - $ref: '#/definitions/Address' - lotNumber: - type: string - x-nullable: true - phone: - type: string - format: telephone - pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - x-nullable: true - email: - type: string - format: x-email - pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - x-nullable: true - eTag: - type: string - readOnly: true - MTOShipmentType-2: - title: Shipment Type - description: | - The type of shipment. - * `HHG` = Household goods move - * `HHG_INTO_NTS_DOMESTIC` = HHG into Non-temporary storage (NTS) - * `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) - * `PPM` = Personally Procured Move also known as Do It Yourself (DITY) - type: string - example: HHG - enum: - - BOAT_HAUL_AWAY - - BOAT_TOW_AWAY - - HHG - - HHG_INTO_NTS_DOMESTIC - - HHG_OUTOF_NTS_DOMESTIC - - INTERNATIONAL_HHG - - INTERNATIONAL_UB - - MOTORHOME - - PPM - x-display-value: - HHG: Household goods move (HHG) - HHG_INTO_NTS_DOMESTIC: HHG into Non-temporary storage (NTS) - HHG_OUTOF_NTS_DOMESTIC: HHG out of Non-temporary storage (NTS Release) - PPM: Personally Procured Move also known as Do It Yourself (DITY) - PPMShipment-2: - description: >- - A personally procured move is a type of shipment that a service member - moves themselves. - x-nullable: true - properties: - id: - description: The primary unique identifier of this PPM shipment - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - readOnly: true - shipmentId: - description: The id of the parent MTOShipment record - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - readOnly: true - createdAt: - description: The timestamp of when the PPM shipment was created (UTC) - format: date-time - type: string - readOnly: true - updatedAt: - description: The timestamp of when a property of this object was last updated (UTC) - format: date-time - type: string - readOnly: true - status: - $ref: '#/definitions/PPMShipmentStatus' - expectedDepartureDate: - description: | - Date the customer expects to begin moving from their origin. - format: date - type: string - actualMoveDate: - description: The actual start date of when the PPM shipment left the origin. - format: date - type: string - x-nullable: true - x-omitempty: false - submittedAt: - description: >- - The timestamp of when the customer submitted their PPM documentation - to the counselor for review. - format: date-time - type: string - x-nullable: true - x-omitempty: false - reviewedAt: - description: >- - The timestamp of when the Service Counselor has reviewed all of the - closeout documents. - format: date-time - type: string - x-nullable: true - x-omitempty: false - approvedAt: - description: >- - The timestamp of when the shipment was approved and the service member - can begin their move. - format: date-time - type: string - x-nullable: true - x-omitempty: false - pickupPostalCode: - description: >- - The postal code of the origin location where goods are being moved - from. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - secondaryPickupPostalCode: - description: >- - An optional secondary pickup location near the origin where additional - goods exist. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false - actualPickupPostalCode: - description: > - The actual postal code where the PPM shipment started. To be filled - once the customer has moved the shipment. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false - destinationPostalCode: - description: >- - The postal code of the destination location where goods are being - delivered to. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - secondaryDestinationPostalCode: - description: >- - An optional secondary location near the destination where goods will - be dropped off. - format: zip - type: string - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false - actualDestinationPostalCode: - description: > - The actual postal code where the PPM shipment ended. To be filled once - the customer has moved the shipment. - format: zip - type: string - title: ZIP - example: '90210' - pattern: ^(\d{5})$ - x-nullable: true - x-omitempty: false - sitExpected: - description: > - Captures whether some or all of the PPM shipment will require - temporary storage at the origin or destination. - - - Must be set to `true` when providing `sitLocation`, - `sitEstimatedWeight`, `sitEstimatedEntryDate`, and - `sitEstimatedDepartureDate` values to calculate the - `sitEstimatedCost`. - type: boolean - estimatedWeight: - description: The estimated weight of the PPM shipment goods being moved in pounds. - type: integer - example: 4200 - x-nullable: true - x-omitempty: false - hasProGear: - description: > - Indicates whether PPM shipment has pro gear for themselves or their - spouse. - type: boolean - x-nullable: true - x-omitempty: false - proGearWeight: - description: >- - The estimated weight of the pro-gear being moved belonging to the - service member in pounds. - type: integer - x-nullable: true - x-omitempty: false - spouseProGearWeight: - description: >- - The estimated weight of the pro-gear being moved belonging to a spouse - in pounds. - type: integer - x-nullable: true - x-omitempty: false - estimatedIncentive: - description: >- - The estimated amount the government will pay the service member to - move their belongings based on the moving date, locations, and - shipment weight. - type: integer - format: cents - x-nullable: true - x-omitempty: false - hasRequestedAdvance: - description: | - Indicates whether an advance has been requested for the PPM shipment. - type: boolean - x-nullable: true - x-omitempty: false - advanceAmountRequested: - description: > - The amount requested as an advance by the service member, up to a - maximum percentage of the estimated incentive. - type: integer - format: cents - x-nullable: true - x-omitempty: false - hasReceivedAdvance: - description: | - Indicates whether an advance was received for the PPM shipment. - type: boolean - x-nullable: true - x-omitempty: false - advanceAmountReceived: - description: | - The amount received for an advance, or null if no advance is received. - type: integer - format: cents - x-nullable: true - x-omitempty: false - sitLocation: - allOf: - - $ref: '#/definitions/SITLocationType' - - x-nullable: true - - x-omitempty: false - sitEstimatedWeight: - description: The estimated weight of the goods being put into storage in pounds. - type: integer - example: 2000 - x-nullable: true - x-omitempty: false - sitEstimatedEntryDate: - description: The date that goods will first enter the storage location. - format: date - type: string - x-nullable: true - x-omitempty: false - sitEstimatedDepartureDate: - description: The date that goods will exit the storage location. - format: date - type: string - x-nullable: true - x-omitempty: false - sitEstimatedCost: - description: >- - The estimated amount that the government will pay the service member - to put their goods into storage. This estimated storage cost is - separate from the estimated incentive. - type: integer - format: cents - x-nullable: true - x-omitempty: false - eTag: - description: >- - A hash unique to this shipment that should be used as the "If-Match" - header for any updates. - type: string - readOnly: true - required: - - id - - shipmentId - - createdAt - - status - - expectedDepartureDate - - pickupPostalCode - - destinationPostalCode - - sitExpected - - eTag - ShipmentAddressUpdateStatus: - type: string - title: Status - readOnly: true - x-display-value: - REQUESTED: REQUESTED - REJECTED: REJECTED - APPROVED: APPROVED - enum: - - REQUESTED - - REJECTED - - APPROVED - ShipmentAddressUpdate: - description: > - This represents a destination address change request made by the Prime - that is either auto-approved or requires review if the pricing criteria - has changed. If criteria has changed, then it must be approved or rejected - by a TOO. - type: object - properties: - id: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - readOnly: true - contractorRemarks: - type: string - example: This is a contractor remark - title: Contractor Remarks - description: The reason there is an address change. - readOnly: true - officeRemarks: - type: string - example: This is an office remark - title: Office Remarks - x-nullable: true - description: The TOO comment on approval or rejection. - status: - $ref: '#/definitions/ShipmentAddressUpdateStatus' - shipmentID: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - readOnly: true - originalAddress: - $ref: '#/definitions/Address' - newAddress: - $ref: '#/definitions/Address' - required: - - id - - status - - shipmentID - - originalAddress - - newAddress - - contractorRemarks - MTOShipmentWithoutServiceItems: - type: object - properties: - id: - description: The ID of the shipment. - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - readOnly: true - moveTaskOrderID: - description: The ID of the move for this shipment. - example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - format: uuid - type: string - readOnly: true - approvedDate: - description: >- - The date when the Transportation Ordering Officer first approved this - shipment for the move. - format: date - type: string - readOnly: true - x-omitempty: false - x-nullable: true - requestedPickupDate: - description: > - The date the customer selects during onboarding as their preferred - pickup date. Other dates, such as required delivery date and (outside - MilMove) the pack date, are derived from this date. - format: date - type: string - readOnly: true - x-omitempty: false - x-nullable: true - requestedDeliveryDate: - description: The customer's preferred delivery date. - format: date - type: string - readOnly: true - x-omitempty: false - x-nullable: true - scheduledPickupDate: - description: >- - The date the Prime contractor scheduled to pick up this shipment after - consultation with the customer. - format: date - type: string - x-omitempty: false - x-nullable: true - actualPickupDate: - description: >- - The date when the Prime contractor actually picked up the shipment. - Updated after-the-fact. - format: date - type: string - x-omitempty: false - x-nullable: true - firstAvailableDeliveryDate: - description: > - The date the Prime provides to the customer as the first possible - delivery date so that they can plan their travel accordingly. - format: date - type: string - x-omitempty: false - x-nullable: true - requiredDeliveryDate: - description: > - The latest date by which the Prime can deliver a customer's shipment - without violating the contract. This is calculated based on weight, - distance, and the scheduled pickup date. It cannot be modified. - format: date - type: string - readOnly: true - x-omitempty: false - x-nullable: true - scheduledDeliveryDate: - description: >- - The date the Prime contractor scheduled to deliver this shipment after - consultation with the customer. - format: date - type: string - x-omitempty: false - x-nullable: true - actualDeliveryDate: - description: >- - The date when the Prime contractor actually delivered the shipment. - Updated after-the-fact. - format: date - type: string - x-omitempty: false - x-nullable: true - primeEstimatedWeight: - description: > - The estimated weight of this shipment, determined by the movers during - the pre-move survey. This value **can only be updated once.** If there - was an issue with estimating the weight and a mistake was made, the - Prime contracter will need to contact the TOO to change it. - type: integer - example: 4500 - minimum: 1 - x-nullable: true - primeEstimatedWeightRecordedDate: - description: >- - The date when the Prime contractor recorded the shipment's estimated - weight. - format: date - type: string - readOnly: true - x-omitempty: false - x-nullable: true - primeActualWeight: - description: >- - The actual weight of the shipment, provided after the Prime packs, - picks up, and weighs a customer's shipment. - type: integer - example: 4500 - minimum: 1 - x-nullable: true - ntsRecordedWeight: - description: >- - The previously recorded weight for the NTS Shipment. Used for NTS - Release to know what the previous primeActualWeight or billable weight - was. - type: integer - example: 4500 - x-nullable: true - x-formatting: weight - customerRemarks: - description: > - The customer can use the customer remarks field to inform the services - counselor and the movers about any - - special circumstances for this shipment. Typical examples: - * bulky or fragile items, - * weapons, - * access info for their address. - - Customer enters this information during onboarding. Optional field. - type: string - example: handle with care - x-nullable: true - readOnly: true - counselorRemarks: - description: > - The counselor can use the counselor remarks field to inform the movers - about any - - special circumstances for this shipment. Typical examples: - * bulky or fragile items, - * weapons, - * access info for their address. - - Counselors enters this information when creating or editing an MTO - Shipment. Optional field. - type: string - example: handle with care - x-nullable: true - readOnly: true - agents: - $ref: '#/definitions/MTOAgents-2' - sitExtensions: - $ref: '#/definitions/SITExtensions' - reweigh: - $ref: '#/definitions/Reweigh' - pickupAddress: - description: > - The address where the movers should pick up this shipment, entered by - the customer during onboarding when they enter shipment details. - allOf: - - $ref: '#/definitions/Address' - destinationAddress: - description: > - Where the movers should deliver this shipment. Often provided by the - customer when they enter shipment details - - during onboarding, if they know their new address already. - - - May be blank when entered by the customer, required when entered by - the Prime. May not represent the true - - final destination due to the shipment being diverted or placed in SIT. - allOf: - - $ref: '#/definitions/Address' - destinationType: - $ref: '#/definitions/DestinationType' - secondaryPickupAddress: - description: >- - A second pickup address for this shipment, if the customer entered - one. An optional field. - allOf: - - $ref: '#/definitions/Address' - secondaryDeliveryAddress: - description: >- - A second delivery address for this shipment, if the customer entered - one. An optional field. - allOf: - - $ref: '#/definitions/Address' - storageFacility: - allOf: - - x-nullable: true - - $ref: '#/definitions/StorageFacility' - shipmentType: - $ref: '#/definitions/MTOShipmentType-2' - diversion: - description: > - This value indicates whether or not this shipment is part of a - diversion. If yes, the shipment can be either the starting or ending - segment of the diversion. - type: boolean - status: - description: > - The status of a shipment, indicating where it is in the TOO's approval - process. Can only be updated by the contractor in special - circumstances. - type: string - readOnly: true - enum: - - SUBMITTED - - APPROVED - - REJECTED - - CANCELLATION_REQUESTED - - CANCELED - - DIVERSION_REQUESTED - ppmShipment: - $ref: '#/definitions/PPMShipment-2' - deliveryAddressUpdate: - $ref: '#/definitions/ShipmentAddressUpdate' - eTag: - description: >- - A hash unique to this shipment that should be used as the "If-Match" - header for any updates. - type: string - readOnly: true - createdAt: - format: date-time - type: string - readOnly: true - updatedAt: - format: date-time - type: string - readOnly: true - pointOfContact: - type: string - description: > - Email or ID of the person who will be contacted in the event of - questions or concerns about this update. May be the person performing - the update, or someone else working with the Prime contractor. - MTOShipmentsWithoutServiceObjects: - description: A list of shipments without their associated service items. - items: - $ref: '#/definitions/MTOShipmentWithoutServiceItems' - type: array - MoveTaskOrder: - type: object - required: - - mtoShipments - - mtoServiceItems - - paymentRequests - properties: - id: - example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - format: uuid - type: string - moveCode: - type: string - example: HYXFJF - readOnly: true - createdAt: - format: date-time - type: string - readOnly: true - orderID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - order: - $ref: '#/definitions/Order' - referenceId: - example: 1001-3456 - type: string - availableToPrimeAt: - format: date-time - type: string - x-nullable: true - readOnly: true - updatedAt: - format: date-time - type: string - readOnly: true - primeCounselingCompletedAt: - format: date-time - type: string - x-nullable: true - readOnly: true - paymentRequests: - $ref: '#/definitions/PaymentRequests' - mtoServiceItems: - type: array - items: - $ref: '#/definitions/MTOServiceItem' - mtoShipments: - $ref: '#/definitions/MTOShipmentsWithoutServiceObjects' - ppmType: - type: string - enum: - - PARTIAL - - FULL - ppmEstimatedWeight: - type: integer - excessWeightQualifiedAt: - type: string - format: date-time - readOnly: true - x-omitempty: false - x-nullable: true - excessWeightAcknowledgedAt: - type: string - format: date-time - readOnly: true - x-omitempty: false - x-nullable: true - excessWeightUploadId: - type: string - format: uuid - readOnly: true - x-omitempty: false - x-nullable: true - eTag: - type: string - readOnly: true PpmID: description: | The PPM Shipment ID to associate with the assigned certificate. From 1e1dd5ff7efde5c51aca23162f256796003383f8 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Thu, 25 Jan 2024 22:26:05 +0000 Subject: [PATCH 07/67] Added test for coverage --- pkg/handlers/internalapi/moves_test.go | 86 ++++++++++++++++++++++++++ pkg/models/move.go | 1 + pkg/models/move_test.go | 47 ++++++++++++++ 3 files changed, 134 insertions(+) diff --git a/pkg/handlers/internalapi/moves_test.go b/pkg/handlers/internalapi/moves_test.go index 1c3ac736efe..3fd157e21d9 100644 --- a/pkg/handlers/internalapi/moves_test.go +++ b/pkg/handlers/internalapi/moves_test.go @@ -445,3 +445,89 @@ func (suite *HandlerSuite) TestSubmitAmendedOrdersHandler() { suite.Assertions.Equal(models.MoveStatusAPPROVALSREQUESTED, move.Status) }) } + +func (suite *HandlerSuite) TestSubmitGetAllMovesHandler() { + suite.Run("Gets all moves belonging to a service member", func() { + + time := time.Now() + laterTime := time.AddDate(0, 0, 1) + // Given: A servicemember and a user + user := factory.BuildDefaultUser(suite.DB()) + + newServiceMember := factory.BuildExtendedServiceMember(suite.DB(), []factory.Customization{ + { + Model: user, + LinkOnly: true, + }, + }, nil) + suite.MustSave(&newServiceMember) + + order := factory.BuildOrder(suite.DB(), []factory.Customization{ + { + Model: newServiceMember, + LinkOnly: true, + Type: &factory.ServiceMember, + }, + }, nil) + + // Given: a set of orders, a move, user and service member + move := factory.BuildMove(suite.DB(), []factory.Customization{ + { + Model: order, + LinkOnly: true, + }, + { + Model: newServiceMember, + LinkOnly: true, + Type: &factory.ServiceMember, + }, + { + Model: models.Move{ + CreatedAt: time, + }, + }, + }, nil) + + move2 := factory.BuildMove(suite.DB(), []factory.Customization{ + { + Model: order, + LinkOnly: true, + }, + { + Model: newServiceMember, + LinkOnly: true, + Type: &factory.ServiceMember, + }, + { + Model: models.Move{ + CreatedAt: laterTime, + }, + }, + }, nil) + + // // And: the context contains the auth values + req := httptest.NewRequest("GET", "/moves/all_moves", nil) + req = suite.AuthenticateRequest(req, move.Orders.ServiceMember) + + params := moveop.GetAllMovesParams{ + HTTPRequest: req, + ServiceMemberID: strfmt.UUID(newServiceMember.ID.String()), + } + + // // And: a move is submitted + handlerConfig := suite.HandlerConfig() + + handler := GetAllMovesHandler{handlerConfig} + response := handler.Handle(params) + + // // Then: expect a 200 status code + suite.Assertions.IsType(&moveop.GetAllMovesOK{}, response) + okResponse := response.(*moveop.GetAllMovesOK) + + suite.Greater(len(okResponse.Payload.CurrentMove), 0) + suite.Greater(len(okResponse.Payload.PreviousMoves), 0) + suite.Equal(okResponse.Payload.CurrentMove[0].ID.String(), move.ID.String()) + suite.Equal(okResponse.Payload.PreviousMoves[0].ID.String(), move2.ID.String()) + + }) +} diff --git a/pkg/models/move.go b/pkg/models/move.go index 739a391de95..35fe82b01b7 100644 --- a/pkg/models/move.go +++ b/pkg/models/move.go @@ -415,6 +415,7 @@ func FetchMovesByOrderID(db *pop.Connection, orderID uuid.UUID) (Moves, error) { query := db.Where("orders_id = ?", orderID) err := query.Eager( "Orders", + "MTOShipments", "Orders.ServiceMember.User", "Orders.ServiceMember.DutyLocation.Address", "Orders.ServiceMember.DutyLocation.TransportationOffice", diff --git a/pkg/models/move_test.go b/pkg/models/move_test.go index 3dc348bf465..edf9989b160 100644 --- a/pkg/models/move_test.go +++ b/pkg/models/move_test.go @@ -284,6 +284,53 @@ func (suite *ModelSuite) TestFetchMoveByOrderID() { } } +func (suite *ModelSuite) FetchMovesByOrderID() { + // Given an order with multiple moves return all moves belonging to that order. + orderID := uuid.Must(uuid.NewV4()) + + moveID, _ := uuid.FromString("7112b18b-7e03-4b28-adde-532b541bba8d") + moveID2, _ := uuid.FromString("e76b5dae-ae00-4147-b818-07eff29fca98") + + factory.BuildMove(suite.DB(), []factory.Customization{ + { + Model: Move{ + ID: moveID, + }, + }, + { + Model: Order{ + ID: orderID, + }, + }, + }, nil) + factory.BuildMove(suite.DB(), []factory.Customization{ + { + Model: Move{ + ID: moveID2, + }, + }, + { + Model: Order{ + ID: orderID, + }, + }, + }, nil) + + tests := []struct { + lookupID uuid.UUID + resultErr bool + }{ + {lookupID: orderID, resultErr: false}, + } + + moves, err := FetchMovesByOrderID(suite.DB(), tests[0].lookupID) + if err != nil { + suite.Error(err) + } + + suite.Greater(len(moves), 1) +} + func (suite *ModelSuite) TestMoveIsPPMOnly() { move := factory.BuildMove(suite.DB(), nil, nil) isPPMOnly := move.IsPPMOnly() From f263e066e97bbd109aea1690008e22d1d2774704 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Fri, 26 Jan 2024 03:03:44 +0000 Subject: [PATCH 08/67] yaml refactor --- pkg/gen/internalapi/embedded_spec.go | 4 ++-- pkg/gen/internalapi/internaloperations/moves/get_all_moves.go | 2 +- .../internaloperations/moves/get_all_moves_urlbuilder.go | 2 +- pkg/gen/internalapi/internaloperations/mymove_api.go | 2 +- pkg/handlers/internalapi/moves_test.go | 2 +- swagger-def/internal.yaml | 2 +- swagger/internal.yaml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index f9dec64d2a6..732c06ff5d7 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -79,7 +79,7 @@ func init() { } } }, - "/all_moves/{serviceMemberId}": { + "/allmoves/{serviceMemberId}": { "get": { "description": "Gets all moves that belongs to the serviceMember\n", "produces": [ @@ -8640,7 +8640,7 @@ func init() { } } }, - "/all_moves/{serviceMemberId}": { + "/allmoves/{serviceMemberId}": { "get": { "description": "Gets all moves that belongs to the serviceMember\n", "produces": [ diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go index 8ea11457d43..4e17c8399bb 100644 --- a/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go @@ -30,7 +30,7 @@ func NewGetAllMoves(ctx *middleware.Context, handler GetAllMovesHandler) *GetAll } /* - GetAllMoves swagger:route GET /all_moves/{serviceMemberId} moves getAllMoves + GetAllMoves swagger:route GET /allmoves/{serviceMemberId} moves getAllMoves # Return the current and previous moves of a service member diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go index 24cb4d4346f..ae245e18449 100644 --- a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go @@ -42,7 +42,7 @@ func (o *GetAllMovesURL) SetBasePath(bp string) { func (o *GetAllMovesURL) Build() (*url.URL, error) { var _result url.URL - var _path = "/all_moves/{serviceMemberId}" + var _path = "/allmoves/{serviceMemberId}" serviceMemberID := o.ServiceMemberID.String() if serviceMemberID != "" { diff --git a/pkg/gen/internalapi/internaloperations/mymove_api.go b/pkg/gen/internalapi/internaloperations/mymove_api.go index 0a908162c78..935d8fb4fc3 100644 --- a/pkg/gen/internalapi/internaloperations/mymove_api.go +++ b/pkg/gen/internalapi/internaloperations/mymove_api.go @@ -959,7 +959,7 @@ func (o *MymoveAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/all_moves/{serviceMemberId}"] = moves.NewGetAllMoves(o.context, o.MovesGetAllMovesHandler) + o.handlers["GET"]["/allmoves/{serviceMemberId}"] = moves.NewGetAllMoves(o.context, o.MovesGetAllMovesHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } diff --git a/pkg/handlers/internalapi/moves_test.go b/pkg/handlers/internalapi/moves_test.go index 3fd157e21d9..9ce17c05bf2 100644 --- a/pkg/handlers/internalapi/moves_test.go +++ b/pkg/handlers/internalapi/moves_test.go @@ -506,7 +506,7 @@ func (suite *HandlerSuite) TestSubmitGetAllMovesHandler() { }, nil) // // And: the context contains the auth values - req := httptest.NewRequest("GET", "/moves/all_moves", nil) + req := httptest.NewRequest("GET", "/moves/allmoves", nil) req = suite.AuthenticateRequest(req, move.Orders.ServiceMember) params := moveop.GetAllMovesParams{ diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index bfa10464b5b..0be717d8d4c 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -3100,7 +3100,7 @@ paths: description: payload is too large '500': description: server error - /all_moves/{serviceMemberId}: + /allmoves/{serviceMemberId}: get: summary: Return the current and previous moves of a service member description: | diff --git a/swagger/internal.yaml b/swagger/internal.yaml index 82a6adef783..3d6112be913 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -4478,7 +4478,7 @@ paths: description: payload is too large '500': description: server error - /all_moves/{serviceMemberId}: + /allmoves/{serviceMemberId}: get: summary: Return the current and previous moves of a service member description: | From 9160ea504fb3283b5f78eaacfb012985afe51fd8 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Fri, 26 Jan 2024 04:13:34 +0000 Subject: [PATCH 09/67] Removed unused parameters --- pkg/gen/internalapi/embedded_spec.go | 454 ---------------------- pkg/gen/internalmessages/customer.go | 208 ---------- pkg/gen/internalmessages/duty_location.go | 173 --------- pkg/gen/internalmessages/entitlements.go | 141 ------- pkg/gen/internalmessages/internal_move.go | 160 -------- pkg/gen/internalmessages/order.go | 444 --------------------- swagger-def/internal.yaml | 24 -- swagger/internal.yaml | 171 -------- 8 files changed, 1775 deletions(-) delete mode 100644 pkg/gen/internalmessages/customer.go delete mode 100644 pkg/gen/internalmessages/duty_location.go delete mode 100644 pkg/gen/internalmessages/entitlements.go delete mode 100644 pkg/gen/internalmessages/order.go diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index 732c06ff5d7..c6908f3fc99 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4336,53 +4336,6 @@ func init() { } } }, - "Customer": { - "type": "object", - "properties": { - "branch": { - "type": "string", - "example": "COAST_GUARD" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "fake@example.com" - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, "DeptIndicator": { "type": "string", "title": "Dept. indicator", @@ -4430,32 +4383,6 @@ func init() { } } }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "addressID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, "DutyLocationPayload": { "type": "object", "required": [ @@ -4529,73 +4456,6 @@ func init() { } } }, - "Entitlements": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - } - } - }, "Error": { "type": "object", "required": [ @@ -4712,20 +4572,6 @@ func init() { "type": "string", "readOnly": true }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, "id": { "type": "string", "format": "uuid", @@ -4739,9 +4585,6 @@ func init() { "mtoShipments": { "$ref": "#/definitions/MTOShipments" }, - "order": { - "$ref": "#/definitions/Order" - }, "orderID": { "type": "string", "format": "uuid", @@ -4750,19 +4593,6 @@ func init() { "orders": { "type": "object" }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, "updatedAt": { "type": "string", "format": "date-time", @@ -5823,63 +5653,6 @@ func init() { "x-nullable": true, "x-omitempty": false }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "rank", - "linesOfAccounting" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "linesOfAccounting": { - "type": "string" - }, - "orderNumber": { - "type": "string" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "rank": { - "type": "string", - "example": "E_5" - }, - "reportByDate": { - "type": "string", - "format": "date" - } - } - }, "OrderPayGrade": { "type": "string", "title": "Rank", @@ -13327,53 +13100,6 @@ func init() { } } }, - "Customer": { - "type": "object", - "properties": { - "branch": { - "type": "string", - "example": "COAST_GUARD" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "fake@example.com" - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, "DeptIndicator": { "type": "string", "title": "Dept. indicator", @@ -13421,32 +13147,6 @@ func init() { } } }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "addressID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, "DutyLocationPayload": { "type": "object", "required": [ @@ -13520,73 +13220,6 @@ func init() { } } }, - "Entitlements": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - } - } - }, "Error": { "type": "object", "required": [ @@ -13703,20 +13336,6 @@ func init() { "type": "string", "readOnly": true }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, "id": { "type": "string", "format": "uuid", @@ -13730,9 +13349,6 @@ func init() { "mtoShipments": { "$ref": "#/definitions/MTOShipments" }, - "order": { - "$ref": "#/definitions/Order" - }, "orderID": { "type": "string", "format": "uuid", @@ -13741,19 +13357,6 @@ func init() { "orders": { "type": "object" }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, "updatedAt": { "type": "string", "format": "date-time", @@ -14816,63 +14419,6 @@ func init() { "x-nullable": true, "x-omitempty": false }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "rank", - "linesOfAccounting" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "linesOfAccounting": { - "type": "string" - }, - "orderNumber": { - "type": "string" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "rank": { - "type": "string", - "example": "E_5" - }, - "reportByDate": { - "type": "string", - "format": "date" - } - } - }, "OrderPayGrade": { "type": "string", "title": "Rank", diff --git a/pkg/gen/internalmessages/customer.go b/pkg/gen/internalmessages/customer.go deleted file mode 100644 index f9093b9eb58..00000000000 --- a/pkg/gen/internalmessages/customer.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Customer customer -// -// swagger:model Customer -type Customer struct { - - // branch - // Example: COAST_GUARD - Branch string `json:"branch,omitempty"` - - // current address - CurrentAddress *Address `json:"currentAddress,omitempty"` - - // dod ID - DodID string `json:"dodID,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Example: fake@example.com - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email string `json:"email,omitempty"` - - // first name - // Example: Vanya - FirstName string `json:"firstName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - // Example: Petrovna - LastName string `json:"lastName,omitempty"` - - // phone - Phone string `json:"phone,omitempty"` - - // user ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UserID strfmt.UUID `json:"userID,omitempty"` -} - -// Validate validates this customer -func (m *Customer) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCurrentAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Customer) validateCurrentAddress(formats strfmt.Registry) error { - if swag.IsZero(m.CurrentAddress) { // not required - return nil - } - - if m.CurrentAddress != nil { - if err := m.CurrentAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentAddress") - } - return err - } - } - - return nil -} - -func (m *Customer) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *Customer) 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 *Customer) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("userID", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this customer based on the context it is used -func (m *Customer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCurrentAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Customer) contextValidateCurrentAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.CurrentAddress != nil { - - if swag.IsZero(m.CurrentAddress) { // not required - return nil - } - - if err := m.CurrentAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentAddress") - } - return err - } - } - - return nil -} - -func (m *Customer) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Customer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Customer) UnmarshalBinary(b []byte) error { - var res Customer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/duty_location.go b/pkg/gen/internalmessages/duty_location.go deleted file mode 100644 index 759ecb63d2c..00000000000 --- a/pkg/gen/internalmessages/duty_location.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DutyLocation duty location -// -// swagger:model DutyLocation -type DutyLocation struct { - - // address - Address *Address `json:"address,omitempty"` - - // address ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - AddressID strfmt.UUID `json:"addressID,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // name - // Example: Fort Bragg North Station - Name string `json:"name,omitempty"` -} - -// Validate validates this duty location -func (m *DutyLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAddressID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DutyLocation) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required - return nil - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *DutyLocation) validateAddressID(formats strfmt.Registry) error { - if swag.IsZero(m.AddressID) { // not required - return nil - } - - if err := validate.FormatOf("addressID", "body", "uuid", m.AddressID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DutyLocation) 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 -} - -// ContextValidate validate this duty location based on the context it is used -func (m *DutyLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DutyLocation) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if swag.IsZero(m.Address) { // not required - return nil - } - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *DutyLocation) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DutyLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DutyLocation) UnmarshalBinary(b []byte) error { - var res DutyLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/entitlements.go b/pkg/gen/internalmessages/entitlements.go deleted file mode 100644 index 65873a5ca10..00000000000 --- a/pkg/gen/internalmessages/entitlements.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Entitlements entitlements -// -// swagger:model Entitlements -type Entitlements struct { - - // authorized weight - // Example: 2000 - AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` - - // dependents authorized - // Example: true - DependentsAuthorized *bool `json:"dependentsAuthorized,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 571008b1-b0de-454d-b843-d71be9f02c04 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // non temporary storage - // Example: false - NonTemporaryStorage *bool `json:"nonTemporaryStorage,omitempty"` - - // organizational clothing and individual equipment - // Example: false - OrganizationalClothingAndIndividualEquipment bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` - - // privately owned vehicle - // Example: false - PrivatelyOwnedVehicle *bool `json:"privatelyOwnedVehicle,omitempty"` - - // pro gear weight - // Example: 2000 - ProGearWeight int64 `json:"proGearWeight,omitempty"` - - // pro gear weight spouse - // Example: 500 - ProGearWeightSpouse int64 `json:"proGearWeightSpouse,omitempty"` - - // required medical equipment weight - // Example: 500 - RequiredMedicalEquipmentWeight int64 `json:"requiredMedicalEquipmentWeight,omitempty"` - - // storage in transit - // Example: 90 - StorageInTransit int64 `json:"storageInTransit,omitempty"` - - // total dependents - // Example: 2 - TotalDependents int64 `json:"totalDependents,omitempty"` - - // total weight - // Example: 500 - TotalWeight int64 `json:"totalWeight,omitempty"` -} - -// Validate validates this entitlements -func (m *Entitlements) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Entitlements) 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 -} - -// ContextValidate validate this entitlements based on the context it is used -func (m *Entitlements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Entitlements) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Entitlements) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Entitlements) UnmarshalBinary(b []byte) error { - var res Entitlements - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go index d5771a016ad..13947c3d8aa 100644 --- a/pkg/gen/internalmessages/internal_move.go +++ b/pkg/gen/internalmessages/internal_move.go @@ -28,16 +28,6 @@ type InternalMove struct { // Read Only: true ETag string `json:"eTag,omitempty"` - // excess weight acknowledged at - // Read Only: true - // Format: date-time - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - // excess weight qualified at - // Read Only: true - // Format: date-time - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - // id // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 // Format: uuid @@ -51,9 +41,6 @@ type InternalMove struct { // mto shipments MtoShipments MTOShipments `json:"mtoShipments,omitempty"` - // order - Order *Order `json:"order,omitempty"` - // order ID // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 // Format: uuid @@ -62,18 +49,6 @@ type InternalMove struct { // orders Orders interface{} `json:"orders,omitempty"` - // ppm estimated weight - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - // prime counseling completed at - // Read Only: true - // Format: date-time - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID string `json:"referenceId,omitempty"` - // updated at // Read Only: true // Format: date-time @@ -88,14 +63,6 @@ func (m *InternalMove) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightQualifiedAt(formats); err != nil { - res = append(res, err) - } - if err := m.validateID(formats); err != nil { res = append(res, err) } @@ -104,18 +71,10 @@ func (m *InternalMove) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateOrder(formats); err != nil { - res = append(res, err) - } - if err := m.validateOrderID(formats); err != nil { res = append(res, err) } - if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - if err := m.validateUpdatedAt(formats); err != nil { res = append(res, err) } @@ -138,30 +97,6 @@ func (m *InternalMove) validateCreatedAt(formats strfmt.Registry) error { return nil } -func (m *InternalMove) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { - return err - } - - return nil -} - func (m *InternalMove) validateID(formats strfmt.Registry) error { if swag.IsZero(m.ID) { // not required return nil @@ -191,25 +126,6 @@ func (m *InternalMove) validateMtoShipments(formats strfmt.Registry) error { return nil } -func (m *InternalMove) validateOrder(formats strfmt.Registry) error { - if swag.IsZero(m.Order) { // not required - return nil - } - - if m.Order != nil { - if err := m.Order.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - func (m *InternalMove) validateOrderID(formats strfmt.Registry) error { if swag.IsZero(m.OrderID) { // not required return nil @@ -222,18 +138,6 @@ func (m *InternalMove) validateOrderID(formats strfmt.Registry) error { return nil } -func (m *InternalMove) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - func (m *InternalMove) validateUpdatedAt(formats strfmt.Registry) error { if swag.IsZero(m.UpdatedAt) { // not required return nil @@ -258,14 +162,6 @@ func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } - if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateMoveCode(ctx, formats); err != nil { res = append(res, err) } @@ -274,14 +170,6 @@ func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } - if err := m.contextValidateOrder(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { res = append(res, err) } @@ -310,24 +198,6 @@ func (m *InternalMove) contextValidateETag(ctx context.Context, formats strfmt.R return nil } -func (m *InternalMove) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { - return err - } - - return nil -} - func (m *InternalMove) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { @@ -351,36 +221,6 @@ func (m *InternalMove) contextValidateMtoShipments(ctx context.Context, formats return nil } -func (m *InternalMove) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { - - if m.Order != nil { - - if swag.IsZero(m.Order) { // not required - return nil - } - - if err := m.Order.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *InternalMove) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { - return err - } - - return nil -} - func (m *InternalMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { diff --git a/pkg/gen/internalmessages/order.go b/pkg/gen/internalmessages/order.go deleted file mode 100644 index 1c7f48bf30d..00000000000 --- a/pkg/gen/internalmessages/order.go +++ /dev/null @@ -1,444 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Order order -// -// swagger:model Order -type Order struct { - - // customer - Customer *Customer `json:"customer,omitempty"` - - // customer ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - CustomerID strfmt.UUID `json:"customerID,omitempty"` - - // destination duty location - DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // entitlement - Entitlement *Entitlements `json:"entitlement,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lines of accounting - // Required: true - LinesOfAccounting *string `json:"linesOfAccounting"` - - // order number - // Required: true - OrderNumber *string `json:"orderNumber"` - - // orders type - OrdersType OrdersType `json:"ordersType,omitempty"` - - // origin duty location - OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` - - // origin duty location g b l o c - // Example: KKFA - OriginDutyLocationGBLOC string `json:"originDutyLocationGBLOC,omitempty"` - - // rank - // Example: E_5 - // Required: true - Rank *string `json:"rank"` - - // report by date - // Format: date - ReportByDate strfmt.Date `json:"reportByDate,omitempty"` -} - -// Validate validates this order -func (m *Order) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCustomer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomerID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEntitlement(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLinesOfAccounting(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderNumber(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRank(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) validateCustomer(formats strfmt.Registry) error { - if swag.IsZero(m.Customer) { // not required - return nil - } - - if m.Customer != nil { - if err := m.Customer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) validateCustomerID(formats strfmt.Registry) error { - if swag.IsZero(m.CustomerID) { // not required - return nil - } - - if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if m.DestinationDutyLocation != nil { - if err := m.DestinationDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateEntitlement(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if m.Entitlement != nil { - if err := m.Entitlement.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) 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 *Order) validateLinesOfAccounting(formats strfmt.Registry) error { - - if err := validate.Required("linesOfAccounting", "body", m.LinesOfAccounting); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrderNumber(formats strfmt.Registry) error { - - if err := validate.Required("orderNumber", "body", m.OrderNumber); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrdersType(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - - return nil -} - -func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if m.OriginDutyLocation != nil { - if err := m.OriginDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateRank(formats strfmt.Registry) error { - - if err := validate.Required("rank", "body", m.Rank); err != nil { - return err - } - - return nil -} - -func (m *Order) validateReportByDate(formats strfmt.Registry) error { - if swag.IsZero(m.ReportByDate) { // not required - return nil - } - - if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this order based on the context it is used -func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCustomer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEntitlement(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { - - if m.Customer != nil { - - if swag.IsZero(m.Customer) { // not required - return nil - } - - if err := m.Customer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationDutyLocation != nil { - - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) 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 *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { - - if m.Entitlement != nil { - - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - - return nil -} - -func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginDutyLocation != nil { - - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Order) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Order) UnmarshalBinary(b []byte) error { - var res Order - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 0be717d8d4c..2369387c0d8 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2720,38 +2720,14 @@ definitions: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid type: string - order: - $ref: 'definitions/prime/Order.yaml' orders: type: object - referenceId: - example: 1001-3456 - type: string updatedAt: format: date-time type: string readOnly: true - primeCounselingCompletedAt: - format: date-time - type: string - x-nullable: true - readOnly: true mtoShipments: $ref: '#/definitions/MTOShipments' - ppmEstimatedWeight: - type: integer - excessWeightQualifiedAt: - type: string - format: date-time - readOnly: true - x-omitempty: false - x-nullable: true - excessWeightAcknowledgedAt: - type: string - format: date-time - readOnly: true - x-omitempty: false - x-nullable: true eTag: type: string readOnly: true diff --git a/swagger/internal.yaml b/swagger/internal.yaml index 3d6112be913..efb9c6624c1 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2753,38 +2753,14 @@ definitions: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid type: string - order: - $ref: '#/definitions/Order' orders: type: object - referenceId: - example: 1001-3456 - type: string updatedAt: format: date-time type: string readOnly: true - primeCounselingCompletedAt: - format: date-time - type: string - x-nullable: true - readOnly: true mtoShipments: $ref: '#/definitions/MTOShipments' - ppmEstimatedWeight: - type: integer - excessWeightQualifiedAt: - type: string - format: date-time - readOnly: true - x-omitempty: false - x-nullable: true - excessWeightAcknowledgedAt: - type: string - format: date-time - readOnly: true - x-omitempty: false - x-nullable: true eTag: type: string readOnly: true @@ -3942,153 +3918,6 @@ definitions: - destinationPostalCode - sitExpected - eTag - Customer: - type: object - properties: - id: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - dodID: - type: string - userID: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - currentAddress: - $ref: '#/definitions/Address' - firstName: - type: string - example: Vanya - lastName: - type: string - example: Petrovna - branch: - type: string - example: COAST_GUARD - phone: - type: string - format: telephone - email: - type: string - format: x-email - pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - example: fake@example.com - eTag: - type: string - readOnly: true - Entitlements: - type: object - properties: - id: - example: 571008b1-b0de-454d-b843-d71be9f02c04 - format: uuid - type: string - authorizedWeight: - example: 2000 - type: integer - x-formatting: weight - x-nullable: true - dependentsAuthorized: - example: true - type: boolean - x-nullable: true - nonTemporaryStorage: - example: false - type: boolean - x-nullable: true - privatelyOwnedVehicle: - example: false - type: boolean - x-nullable: true - proGearWeight: - example: 2000 - type: integer - x-formatting: weight - proGearWeightSpouse: - example: 500 - type: integer - x-formatting: weight - requiredMedicalEquipmentWeight: - example: 500 - type: integer - x-formatting: weight - organizationalClothingAndIndividualEquipment: - type: boolean - example: false - storageInTransit: - example: 90 - type: integer - totalWeight: - example: 500 - type: integer - x-formatting: weight - totalDependents: - example: 2 - type: integer - eTag: - type: string - readOnly: true - DutyLocation: - type: object - properties: - id: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - name: - type: string - example: Fort Bragg North Station - addressID: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - address: - $ref: '#/definitions/Address' - eTag: - type: string - readOnly: true - Order: - type: object - required: - - orderNumber - - rank - - linesOfAccounting - properties: - id: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - customer: - $ref: '#/definitions/Customer' - customerID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - entitlement: - $ref: '#/definitions/Entitlements' - destinationDutyLocation: - $ref: '#/definitions/DutyLocation' - originDutyLocation: - $ref: '#/definitions/DutyLocation' - originDutyLocationGBLOC: - type: string - example: KKFA - rank: - type: string - example: E_5 - reportByDate: - type: string - format: date - ordersType: - $ref: '#/definitions/OrdersType' - orderNumber: - type: string - linesOfAccounting: - type: string - eTag: - type: string - readOnly: true PpmID: description: | The PPM Shipment ID to associate with the assigned certificate. From 6d3bbe9b466a99ba7287ea240e4c7f8a1fa115a3 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Fri, 26 Jan 2024 04:39:32 +0000 Subject: [PATCH 10/67] yaml edit --- pkg/gen/internalapi/embedded_spec.go | 6 ------ pkg/gen/internalmessages/internal_move.go | 3 --- pkg/handlers/internalapi/moves.go | 2 +- swagger-def/internal.yaml | 4 ++-- swagger/internal.yaml | 2 -- 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index c6908f3fc99..4cd5c07a7b3 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4590,9 +4590,6 @@ func init() { "format": "uuid", "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, - "orders": { - "type": "object" - }, "updatedAt": { "type": "string", "format": "date-time", @@ -13354,9 +13351,6 @@ func init() { "format": "uuid", "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, - "orders": { - "type": "object" - }, "updatedAt": { "type": "string", "format": "date-time", diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go index 13947c3d8aa..062dcb78685 100644 --- a/pkg/gen/internalmessages/internal_move.go +++ b/pkg/gen/internalmessages/internal_move.go @@ -46,9 +46,6 @@ type InternalMove struct { // Format: uuid OrderID strfmt.UUID `json:"orderID,omitempty"` - // orders - Orders interface{} `json:"orders,omitempty"` - // updated at // Read Only: true // Format: date-time diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index c3eeab311de..b5619aa3bcd 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -91,7 +91,7 @@ func payloadMovesList(storer storage.FileStorer, previousMovesList models.Moves, ID: *handlers.FmtUUID(move.ID), MtoShipments: *payloadShipments, MoveCode: move.Locator, - Orders: move.Orders, + // Orders: move.Orders, } convertedCurrentMovesList = append(convertedCurrentMovesList, currentMove) diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 2369387c0d8..d7e158f80f6 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2720,8 +2720,8 @@ definitions: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid type: string - orders: - type: object + # orders: + # type: object updatedAt: format: date-time type: string diff --git a/swagger/internal.yaml b/swagger/internal.yaml index efb9c6624c1..a4caadb4e03 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2753,8 +2753,6 @@ definitions: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid type: string - orders: - type: object updatedAt: format: date-time type: string From d5603d59abcf247ddedc429aa283b8184cb8a25e Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Fri, 26 Jan 2024 04:57:14 +0000 Subject: [PATCH 11/67] Yaml edits --- pkg/gen/internalapi/embedded_spec.go | 6 ---- pkg/gen/internalmessages/internal_move.go | 42 ----------------------- pkg/handlers/internalapi/moves.go | 30 ++++++++-------- swagger-def/internal.yaml | 4 +-- swagger/internal.yaml | 2 -- 5 files changed, 17 insertions(+), 67 deletions(-) diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index 4cd5c07a7b3..ccd9f927438 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4582,9 +4582,6 @@ func init() { "readOnly": true, "example": "HYXFJF" }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipments" - }, "orderID": { "type": "string", "format": "uuid", @@ -13343,9 +13340,6 @@ func init() { "readOnly": true, "example": "HYXFJF" }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipments" - }, "orderID": { "type": "string", "format": "uuid", diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go index 062dcb78685..b1659ad42ac 100644 --- a/pkg/gen/internalmessages/internal_move.go +++ b/pkg/gen/internalmessages/internal_move.go @@ -38,9 +38,6 @@ type InternalMove struct { // Read Only: true MoveCode string `json:"moveCode,omitempty"` - // mto shipments - MtoShipments MTOShipments `json:"mtoShipments,omitempty"` - // order ID // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 // Format: uuid @@ -64,10 +61,6 @@ func (m *InternalMove) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateMtoShipments(formats); err != nil { - res = append(res, err) - } - if err := m.validateOrderID(formats); err != nil { res = append(res, err) } @@ -106,23 +99,6 @@ func (m *InternalMove) validateID(formats strfmt.Registry) error { return nil } -func (m *InternalMove) validateMtoShipments(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipments) { // not required - return nil - } - - if err := m.MtoShipments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - func (m *InternalMove) validateOrderID(formats strfmt.Registry) error { if swag.IsZero(m.OrderID) { // not required return nil @@ -163,10 +139,6 @@ func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } - if err := m.contextValidateMtoShipments(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { res = append(res, err) } @@ -204,20 +176,6 @@ func (m *InternalMove) contextValidateMoveCode(ctx context.Context, formats strf return nil } -func (m *InternalMove) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - func (m *InternalMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index b5619aa3bcd..7c84b753048 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -73,7 +73,7 @@ func payloadForMoveModel(storer storage.FileStorer, order models.Order, move mod return movePayload, nil } -func payloadMovesList(storer storage.FileStorer, previousMovesList models.Moves, currentMoveList models.Moves, movesList models.Moves) (*internalmessages.MovesList, error) { +func payloadMovesList(previousMovesList models.Moves, currentMoveList models.Moves, movesList models.Moves) (*internalmessages.MovesList, error) { // Convert currentMoves moves to internalmessages.MoveTaskOrder var convertedCurrentMovesList []*internalmessages.InternalMove @@ -81,16 +81,16 @@ func payloadMovesList(storer storage.FileStorer, previousMovesList models.Moves, for _, move := range moves { eTag := etag.GenerateEtag(move.UpdatedAt) - shipments := move.MTOShipments - var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) + // shipments := move.MTOShipments + // var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) // var payloadOrders *internalmessages.Order = payloads currentMove := &internalmessages.InternalMove{ - CreatedAt: *handlers.FmtDateTime(move.CreatedAt), - ETag: eTag, - ID: *handlers.FmtUUID(move.ID), - MtoShipments: *payloadShipments, - MoveCode: move.Locator, + CreatedAt: *handlers.FmtDateTime(move.CreatedAt), + ETag: eTag, + ID: *handlers.FmtUUID(move.ID), + // MtoShipments: *payloadShipments, + MoveCode: move.Locator, // Orders: move.Orders, } @@ -103,14 +103,14 @@ func payloadMovesList(storer storage.FileStorer, previousMovesList models.Moves, if currentMoveList[0].ID != move.ID { eTag := etag.GenerateEtag(move.UpdatedAt) - shipments := move.MTOShipments - var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) + // shipments := move.MTOShipments + // var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) currentMove := &internalmessages.InternalMove{ - CreatedAt: *handlers.FmtDateTime(move.CreatedAt), - ETag: eTag, - ID: *handlers.FmtUUID(move.ID), - MtoShipments: *payloadShipments, + CreatedAt: *handlers.FmtDateTime(move.CreatedAt), + ETag: eTag, + ID: *handlers.FmtUUID(move.ID), + // MtoShipments: *payloadShipments, } convertedPreviousMovesList = append(convertedPreviousMovesList, currentMove) @@ -463,7 +463,7 @@ func (h GetAllMovesHandler) Handle(params moveop.GetAllMovesParams) middleware.R } // Build MovesList Payload - payload, err := payloadMovesList(h.FileStorer(), previousMovesList, currentMovesList, movesList) + payload, err := payloadMovesList(previousMovesList, currentMovesList, movesList) if err != nil { return handlers.ResponseForError(appCtx.Logger(), err), err } diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index d7e158f80f6..204486c5e69 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2726,8 +2726,8 @@ definitions: format: date-time type: string readOnly: true - mtoShipments: - $ref: '#/definitions/MTOShipments' + # mtoShipments: + # $ref: '#/definitions/MTOShipments' eTag: type: string readOnly: true diff --git a/swagger/internal.yaml b/swagger/internal.yaml index a4caadb4e03..467a923c61c 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2757,8 +2757,6 @@ definitions: format: date-time type: string readOnly: true - mtoShipments: - $ref: '#/definitions/MTOShipments' eTag: type: string readOnly: true From 6c927bc11bdf03c099d001058a0375bbd9125c15 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Fri, 26 Jan 2024 05:17:28 +0000 Subject: [PATCH 12/67] Swagger yaml refactor --- pkg/gen/internalapi/embedded_spec.go | 2 + pkg/gen/internalmessages/internal_move.go | 2 +- swagger-def/definitions/InternalMove.yaml | 30 +++++++++++++ swagger-def/internal.yaml | 34 +-------------- swagger/internal.yaml | 53 ++++++++++++----------- 5 files changed, 62 insertions(+), 59 deletions(-) create mode 100644 swagger-def/definitions/InternalMove.yaml diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index ccd9f927438..70e64fa8676 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4561,6 +4561,7 @@ func init() { } }, "InternalMove": { + "description": "Move informaion for a service member", "type": "object", "properties": { "createdAt": { @@ -13319,6 +13320,7 @@ func init() { } }, "InternalMove": { + "description": "Move informaion for a service member", "type": "object", "properties": { "createdAt": { diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go index b1659ad42ac..29efd64e3cc 100644 --- a/pkg/gen/internalmessages/internal_move.go +++ b/pkg/gen/internalmessages/internal_move.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// InternalMove internal move +// InternalMove Move informaion for a service member // // swagger:model InternalMove type InternalMove struct { diff --git a/swagger-def/definitions/InternalMove.yaml b/swagger-def/definitions/InternalMove.yaml new file mode 100644 index 00000000000..f6be4aa36a3 --- /dev/null +++ b/swagger-def/definitions/InternalMove.yaml @@ -0,0 +1,30 @@ +description: Move informaion for a service member +type: object +properties: + id: + example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + format: uuid + type: string + moveCode: + type: string + example: 'HYXFJF' + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + orderID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + # orders: + # type: object + updatedAt: + format: date-time + type: string + readOnly: true + # mtoShipments: + # $ref: '#/definitions/MTOShipments' + eTag: + type: string + readOnly: true \ No newline at end of file diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 204486c5e69..03ccc40742d 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2696,41 +2696,11 @@ definitions: currentMove: type: array items: - $ref: '#/definitions/InternalMove' + $ref: 'definitions/InternalMove.yaml' previousMoves: type: array items: - $ref: '#/definitions/InternalMove' - InternalMove: - type: object - properties: - id: - example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - format: uuid - type: string - moveCode: - type: string - example: 'HYXFJF' - readOnly: true - createdAt: - format: date-time - type: string - readOnly: true - orderID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - # orders: - # type: object - updatedAt: - format: date-time - type: string - readOnly: true - # mtoShipments: - # $ref: '#/definitions/MTOShipments' - eTag: - type: string - readOnly: true + $ref: 'definitions/InternalMove.yaml' paths: /estimates/ppm: get: diff --git a/swagger/internal.yaml b/swagger/internal.yaml index 467a923c61c..f72dfd5b739 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2734,32 +2734,6 @@ definitions: type: array items: $ref: '#/definitions/InternalMove' - InternalMove: - type: object - properties: - id: - example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - format: uuid - type: string - moveCode: - type: string - example: HYXFJF - readOnly: true - createdAt: - format: date-time - type: string - readOnly: true - orderID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - updatedAt: - format: date-time - type: string - readOnly: true - eTag: - type: string - readOnly: true FeatureFlagBoolean: description: A feature flag type: object @@ -3914,6 +3888,33 @@ definitions: - destinationPostalCode - sitExpected - eTag + InternalMove: + description: Move informaion for a service member + type: object + properties: + id: + example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + format: uuid + type: string + moveCode: + type: string + example: HYXFJF + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + orderID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + updatedAt: + format: date-time + type: string + readOnly: true + eTag: + type: string + readOnly: true PpmID: description: | The PPM Shipment ID to associate with the assigned certificate. From cffce079a3edf0bd7c332a3313f91643875b92b6 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Fri, 26 Jan 2024 12:23:00 +0000 Subject: [PATCH 13/67] Restored original solution --- pkg/gen/internalapi/embedded_spec.go | 14 +++++- pkg/gen/internalmessages/internal_move.go | 47 ++++++++++++++++++- pkg/handlers/internalapi/moves.go | 32 ++++++------- swagger-def/definitions/InternalMove.yaml | 30 ------------ swagger-def/internal.yaml | 34 +++++++++++++- swagger/internal.yaml | 57 ++++++++++++----------- 6 files changed, 136 insertions(+), 78 deletions(-) delete mode 100644 swagger-def/definitions/InternalMove.yaml diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index 70e64fa8676..c6908f3fc99 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4561,7 +4561,6 @@ func init() { } }, "InternalMove": { - "description": "Move informaion for a service member", "type": "object", "properties": { "createdAt": { @@ -4583,11 +4582,17 @@ func init() { "readOnly": true, "example": "HYXFJF" }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipments" + }, "orderID": { "type": "string", "format": "uuid", "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, + "orders": { + "type": "object" + }, "updatedAt": { "type": "string", "format": "date-time", @@ -13320,7 +13325,6 @@ func init() { } }, "InternalMove": { - "description": "Move informaion for a service member", "type": "object", "properties": { "createdAt": { @@ -13342,11 +13346,17 @@ func init() { "readOnly": true, "example": "HYXFJF" }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipments" + }, "orderID": { "type": "string", "format": "uuid", "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" }, + "orders": { + "type": "object" + }, "updatedAt": { "type": "string", "format": "date-time", diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go index 29efd64e3cc..13947c3d8aa 100644 --- a/pkg/gen/internalmessages/internal_move.go +++ b/pkg/gen/internalmessages/internal_move.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// InternalMove Move informaion for a service member +// InternalMove internal move // // swagger:model InternalMove type InternalMove struct { @@ -38,11 +38,17 @@ type InternalMove struct { // Read Only: true MoveCode string `json:"moveCode,omitempty"` + // mto shipments + MtoShipments MTOShipments `json:"mtoShipments,omitempty"` + // order ID // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 // Format: uuid OrderID strfmt.UUID `json:"orderID,omitempty"` + // orders + Orders interface{} `json:"orders,omitempty"` + // updated at // Read Only: true // Format: date-time @@ -61,6 +67,10 @@ func (m *InternalMove) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + if err := m.validateOrderID(formats); err != nil { res = append(res, err) } @@ -99,6 +109,23 @@ func (m *InternalMove) validateID(formats strfmt.Registry) error { return nil } +func (m *InternalMove) validateMtoShipments(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipments) { // not required + return nil + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + func (m *InternalMove) validateOrderID(formats strfmt.Registry) error { if swag.IsZero(m.OrderID) { // not required return nil @@ -139,6 +166,10 @@ func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { res = append(res, err) } @@ -176,6 +207,20 @@ func (m *InternalMove) contextValidateMoveCode(ctx context.Context, formats strf return nil } +func (m *InternalMove) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + func (m *InternalMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index 7c84b753048..c3eeab311de 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -73,7 +73,7 @@ func payloadForMoveModel(storer storage.FileStorer, order models.Order, move mod return movePayload, nil } -func payloadMovesList(previousMovesList models.Moves, currentMoveList models.Moves, movesList models.Moves) (*internalmessages.MovesList, error) { +func payloadMovesList(storer storage.FileStorer, previousMovesList models.Moves, currentMoveList models.Moves, movesList models.Moves) (*internalmessages.MovesList, error) { // Convert currentMoves moves to internalmessages.MoveTaskOrder var convertedCurrentMovesList []*internalmessages.InternalMove @@ -81,17 +81,17 @@ func payloadMovesList(previousMovesList models.Moves, currentMoveList models.Mov for _, move := range moves { eTag := etag.GenerateEtag(move.UpdatedAt) - // shipments := move.MTOShipments - // var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) + shipments := move.MTOShipments + var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) // var payloadOrders *internalmessages.Order = payloads currentMove := &internalmessages.InternalMove{ - CreatedAt: *handlers.FmtDateTime(move.CreatedAt), - ETag: eTag, - ID: *handlers.FmtUUID(move.ID), - // MtoShipments: *payloadShipments, - MoveCode: move.Locator, - // Orders: move.Orders, + CreatedAt: *handlers.FmtDateTime(move.CreatedAt), + ETag: eTag, + ID: *handlers.FmtUUID(move.ID), + MtoShipments: *payloadShipments, + MoveCode: move.Locator, + Orders: move.Orders, } convertedCurrentMovesList = append(convertedCurrentMovesList, currentMove) @@ -103,14 +103,14 @@ func payloadMovesList(previousMovesList models.Moves, currentMoveList models.Mov if currentMoveList[0].ID != move.ID { eTag := etag.GenerateEtag(move.UpdatedAt) - // shipments := move.MTOShipments - // var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) + shipments := move.MTOShipments + var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) currentMove := &internalmessages.InternalMove{ - CreatedAt: *handlers.FmtDateTime(move.CreatedAt), - ETag: eTag, - ID: *handlers.FmtUUID(move.ID), - // MtoShipments: *payloadShipments, + CreatedAt: *handlers.FmtDateTime(move.CreatedAt), + ETag: eTag, + ID: *handlers.FmtUUID(move.ID), + MtoShipments: *payloadShipments, } convertedPreviousMovesList = append(convertedPreviousMovesList, currentMove) @@ -463,7 +463,7 @@ func (h GetAllMovesHandler) Handle(params moveop.GetAllMovesParams) middleware.R } // Build MovesList Payload - payload, err := payloadMovesList(previousMovesList, currentMovesList, movesList) + payload, err := payloadMovesList(h.FileStorer(), previousMovesList, currentMovesList, movesList) if err != nil { return handlers.ResponseForError(appCtx.Logger(), err), err } diff --git a/swagger-def/definitions/InternalMove.yaml b/swagger-def/definitions/InternalMove.yaml deleted file mode 100644 index f6be4aa36a3..00000000000 --- a/swagger-def/definitions/InternalMove.yaml +++ /dev/null @@ -1,30 +0,0 @@ -description: Move informaion for a service member -type: object -properties: - id: - example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - format: uuid - type: string - moveCode: - type: string - example: 'HYXFJF' - readOnly: true - createdAt: - format: date-time - type: string - readOnly: true - orderID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - # orders: - # type: object - updatedAt: - format: date-time - type: string - readOnly: true - # mtoShipments: - # $ref: '#/definitions/MTOShipments' - eTag: - type: string - readOnly: true \ No newline at end of file diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 03ccc40742d..2369387c0d8 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2696,11 +2696,41 @@ definitions: currentMove: type: array items: - $ref: 'definitions/InternalMove.yaml' + $ref: '#/definitions/InternalMove' previousMoves: type: array items: - $ref: 'definitions/InternalMove.yaml' + $ref: '#/definitions/InternalMove' + InternalMove: + type: object + properties: + id: + example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + format: uuid + type: string + moveCode: + type: string + example: 'HYXFJF' + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + orderID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + orders: + type: object + updatedAt: + format: date-time + type: string + readOnly: true + mtoShipments: + $ref: '#/definitions/MTOShipments' + eTag: + type: string + readOnly: true paths: /estimates/ppm: get: diff --git a/swagger/internal.yaml b/swagger/internal.yaml index f72dfd5b739..efb9c6624c1 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2734,6 +2734,36 @@ definitions: type: array items: $ref: '#/definitions/InternalMove' + InternalMove: + type: object + properties: + id: + example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + format: uuid + type: string + moveCode: + type: string + example: HYXFJF + readOnly: true + createdAt: + format: date-time + type: string + readOnly: true + orderID: + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + format: uuid + type: string + orders: + type: object + updatedAt: + format: date-time + type: string + readOnly: true + mtoShipments: + $ref: '#/definitions/MTOShipments' + eTag: + type: string + readOnly: true FeatureFlagBoolean: description: A feature flag type: object @@ -3888,33 +3918,6 @@ definitions: - destinationPostalCode - sitExpected - eTag - InternalMove: - description: Move informaion for a service member - type: object - properties: - id: - example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - format: uuid - type: string - moveCode: - type: string - example: HYXFJF - readOnly: true - createdAt: - format: date-time - type: string - readOnly: true - orderID: - example: c56a4180-65aa-42ec-a945-5fd21dec0538 - format: uuid - type: string - updatedAt: - format: date-time - type: string - readOnly: true - eTag: - type: string - readOnly: true PpmID: description: | The PPM Shipment ID to associate with the assigned certificate. From a38124fbad6ffcf4664699341fb1855ab75a029f Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Fri, 26 Jan 2024 15:27:58 +0000 Subject: [PATCH 14/67] Added a more detailed description for the endpoint --- pkg/gen/internalapi/embedded_spec.go | 4 ++-- .../internalapi/internaloperations/moves/get_all_moves.go | 2 +- swagger-def/internal.yaml | 2 +- swagger/internal.yaml | 7 +++++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index c6908f3fc99..d6fd14705ed 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -81,7 +81,7 @@ func init() { }, "/allmoves/{serviceMemberId}": { "get": { - "description": "Gets all moves that belongs to the serviceMember\n", + "description": "This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array.\n", "produces": [ "application/json" ], @@ -8415,7 +8415,7 @@ func init() { }, "/allmoves/{serviceMemberId}": { "get": { - "description": "Gets all moves that belongs to the serviceMember\n", + "description": "This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array.\n", "produces": [ "application/json" ], diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go index 4e17c8399bb..709a9bb4dee 100644 --- a/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go @@ -34,7 +34,7 @@ func NewGetAllMoves(ctx *middleware.Context, handler GetAllMovesHandler) *GetAll # Return the current and previous moves of a service member -Gets all moves that belongs to the serviceMember +This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array. */ type GetAllMoves struct { Context *middleware.Context diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 2369387c0d8..db7dd6d0c13 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -3080,7 +3080,7 @@ paths: get: summary: Return the current and previous moves of a service member description: | - Gets all moves that belongs to the serviceMember + This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array. operationId: getAllMoves tags: - moves diff --git a/swagger/internal.yaml b/swagger/internal.yaml index efb9c6624c1..464f6ce139c 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -4310,8 +4310,11 @@ paths: /allmoves/{serviceMemberId}: get: summary: Return the current and previous moves of a service member - description: | - Gets all moves that belongs to the serviceMember + description: > + This endpoint gets all moves that belongs to the serviceMember by using + the service members id. In a previous moves array and the current move + in the current move array. The current move is the move with the latest + CreatedAt date. All other moves will go into the previous move array. operationId: getAllMoves tags: - moves From 92879d8bd71fc95d26f90a3c0b0ece712b05b841 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Fri, 26 Jan 2024 20:31:02 +0000 Subject: [PATCH 15/67] Added receiver to primeCounselingComplete.GetEmailData. --- .../prime_counseling_complete.go | 24 ++++---- .../prime_counseling_complete_test.go | 55 +------------------ 2 files changed, 14 insertions(+), 65 deletions(-) diff --git a/pkg/notifications/prime_counseling_complete.go b/pkg/notifications/prime_counseling_complete.go index 5634277b698..fd140715206 100644 --- a/pkg/notifications/prime_counseling_complete.go +++ b/pkg/notifications/prime_counseling_complete.go @@ -47,19 +47,19 @@ func NewPrimeCounselingComplete(moveTaskOrder primemessages.MoveTaskOrder) *Prim // NotificationSendingContext expects a `notification` with an `emails` method, // so we implement `email` to satisfy that interface -func (m PrimeCounselingComplete) emails(appCtx appcontext.AppContext) ([]emailContent, error) { +func (p PrimeCounselingComplete) emails(appCtx appcontext.AppContext) ([]emailContent, error) { var emails []emailContent appCtx.Logger().Info("MTO (Move Task Order) Locator", - zap.String("uuid", m.moveTaskOrder.MoveCode), + zap.String("uuid", p.moveTaskOrder.MoveCode), ) - emailData, err := GetEmailData(m.moveTaskOrder, appCtx) + emailData, err := p.GetEmailData(p.moveTaskOrder, appCtx) if err != nil { return nil, err } var htmlBody, textBody string - htmlBody, textBody, err = m.renderTemplates(appCtx, emailData) + htmlBody, textBody, err = p.renderTemplates(appCtx, emailData) if err != nil { appCtx.Logger().Error("error rendering template", zap.Error(err)) @@ -75,7 +75,7 @@ func (m PrimeCounselingComplete) emails(appCtx appcontext.AppContext) ([]emailCo return append(emails, primeCounselingEmail), nil } -func GetEmailData(m primemessages.MoveTaskOrder, appCtx appcontext.AppContext) (PrimeCounselingCompleteData, error) { +func (p PrimeCounselingComplete) GetEmailData(m primemessages.MoveTaskOrder, appCtx appcontext.AppContext) (PrimeCounselingCompleteData, error) { if m.Order.Customer.Email == "" { return PrimeCounselingCompleteData{}, fmt.Errorf("no email found for service member") } @@ -96,12 +96,12 @@ func GetEmailData(m primemessages.MoveTaskOrder, appCtx appcontext.AppContext) ( }, nil } -func (m PrimeCounselingComplete) renderTemplates(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, string, error) { - htmlBody, err := m.RenderHTML(appCtx, data) +func (p PrimeCounselingComplete) renderTemplates(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, string, error) { + htmlBody, err := p.RenderHTML(appCtx, data) if err != nil { return "", "", fmt.Errorf("error rendering html template using %#v", data) } - textBody, err := m.RenderText(appCtx, data) + textBody, err := p.RenderText(appCtx, data) if err != nil { return "", "", fmt.Errorf("error rendering text template using %#v", data) } @@ -109,18 +109,18 @@ func (m PrimeCounselingComplete) renderTemplates(appCtx appcontext.AppContext, d } // RenderHTML renders the html for the email -func (m PrimeCounselingComplete) RenderHTML(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error) { +func (p PrimeCounselingComplete) RenderHTML(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error) { var htmlBuffer bytes.Buffer - if err := m.htmlTemplate.Execute(&htmlBuffer, data); err != nil { + if err := p.htmlTemplate.Execute(&htmlBuffer, data); err != nil { appCtx.Logger().Error("cant render html template ", zap.Error(err)) } return htmlBuffer.String(), nil } // RenderText renders the text for the email -func (m PrimeCounselingComplete) RenderText(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error) { +func (p PrimeCounselingComplete) RenderText(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error) { var textBuffer bytes.Buffer - if err := m.textTemplate.Execute(&textBuffer, data); err != nil { + if err := p.textTemplate.Execute(&textBuffer, data); err != nil { appCtx.Logger().Error("cant render text template ", zap.Error(err)) return "", err } diff --git a/pkg/notifications/prime_counseling_complete_test.go b/pkg/notifications/prime_counseling_complete_test.go index 1acc7da686d..d7644654e8b 100644 --- a/pkg/notifications/prime_counseling_complete_test.go +++ b/pkg/notifications/prime_counseling_complete_test.go @@ -21,60 +21,9 @@ var correctPrimeCounselingData = PrimeCounselingCompleteData{ } func (suite *NotificationSuite) TestPrimeCounselingComplete() { - - // Create a move that is available to prime and has the counseling service item attached - // move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) - // reServiceCS := factory.BuildReServiceByCode(suite.DB(), models.ReServiceCodeCS) - // serviceItemCS := models.MTOServiceItem{ - // MoveTaskOrderID: move.ID, - // MoveTaskOrder: move, - // ReService: reServiceCS, - // Status: models.MTOServiceItemStatusApproved, - // } - // factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{ - // { - // Model: move, - // LinkOnly: true, - // }, - // { - // Model: serviceItemCS, - // }, - // }, nil) - //serviceMember := factory.BuildServiceMember() // "leo_spaceman_sm@example.com" - // dutyLocation := factory.FetchOrBuildCurrentDutyLocation(suite.DB()) - // dutyLocation2 := factory.FetchOrBuildOrdersDutyLocation(suite.DB()) - // order := factory.BuildOrder(suite.DB(), []factory.Customization{ - // { - // Model: dutyLocation, - // LinkOnly: true, - // Type: &factory.DutyLocations.OriginDutyLocation, - // }, - // { - // Model: dutyLocation2, - // LinkOnly: true, - // Type: &factory.DutyLocations.NewDutyLocation, - // }, - // { - // Model: serviceMember, - // Type: &factory.ServiceMember, - // }, - // }, nil) - - // member := primemessages.Customer{Email: "test@example.com"} - // primeOrder := primemessages.Order { - // OriginDutyLocation: &primemessages.DutyLocation{Name: "Fort Origin"}, - // DestinationDutyLocation: &primemessages.DutyLocation{Name: "Fort Destination"}, - // Customer: &member, - // } - // payload := primemessages.MoveTaskOrder{ - // MoveCode: "TEST00", - // Order: &primeOrder, - // } - - ///moveTaskOrder := payloads.MoveTaskOrder(&move) notification := NewPrimeCounselingComplete(payload) - primeCounselingEmailData, err := GetEmailData(notification.moveTaskOrder, suite.AppContextForTest()) + primeCounselingEmailData, err := notification.GetEmailData(notification.moveTaskOrder, suite.AppContextForTest()) suite.NoError(err) suite.NotNil(primeCounselingEmailData) suite.Equal(primeCounselingEmailData, correctPrimeCounselingData) @@ -96,7 +45,7 @@ func (suite *NotificationSuite) TestPrimeCounselingComplete() { func (suite *NotificationSuite) TestPrimeCounselingCompleteTextTemplateRender() { notification := NewPrimeCounselingComplete(payload) - primeCounselingEmailData, err := GetEmailData(notification.moveTaskOrder, suite.AppContextForTest()) + primeCounselingEmailData, err := notification.GetEmailData(notification.moveTaskOrder, suite.AppContextForTest()) suite.NoError(err) suite.NotNil(primeCounselingEmailData) suite.Equal(primeCounselingEmailData, correctPrimeCounselingData) From 3f7e5deaca7cd124c5a7f93c9852daf18dc967ad Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Fri, 26 Jan 2024 20:34:58 +0000 Subject: [PATCH 16/67] Added constants.go file with OneSource transportation office link. --- pkg/notifications/constants.go | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pkg/notifications/constants.go diff --git a/pkg/notifications/constants.go b/pkg/notifications/constants.go new file mode 100644 index 00000000000..e533a1e8ea8 --- /dev/null +++ b/pkg/notifications/constants.go @@ -0,0 +1,3 @@ +package notifications + +const OneSourceTransportationOfficeLink = "https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL" From 02d03ff4488b0a66cccbf3145bf97f1e0493cedb Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 29 Jan 2024 15:17:27 +0000 Subject: [PATCH 17/67] FIxed existing templates/tests to use new constants file --- pkg/notifications/move_issued_to_prime.go | 2 +- .../move_issued_to_prime_test.go | 24 +++++++++---------- pkg/notifications/move_submitted_test.go | 8 +++---- .../prime_counseling_complete_test.go | 8 +++---- pkg/notifications/reweigh_requested.go | 2 +- pkg/notifications/reweigh_requested_test.go | 8 +++---- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pkg/notifications/move_issued_to_prime.go b/pkg/notifications/move_issued_to_prime.go index dcac0dc81b4..6b30ccd0f14 100644 --- a/pkg/notifications/move_issued_to_prime.go +++ b/pkg/notifications/move_issued_to_prime.go @@ -76,7 +76,7 @@ func (m MoveIssuedToPrime) emails(appCtx appcontext.AppContext) ([]emailContent, } htmlBody, textBody, err := m.renderTemplates(appCtx, moveIssuedToPrimeEmailData{ - MilitaryOneSourceLink: "https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, OriginDutyLocation: originDutyLocation, DestinationDutyLocation: orders.NewDutyLocation.Name, ProvidesGovernmentCounseling: providesGovernmentCounseling, diff --git a/pkg/notifications/move_issued_to_prime_test.go b/pkg/notifications/move_issued_to_prime_test.go index 58758f7d7a7..7b8027bc5dc 100644 --- a/pkg/notifications/move_issued_to_prime_test.go +++ b/pkg/notifications/move_issued_to_prime_test.go @@ -34,7 +34,7 @@ func (suite *NotificationSuite) TestMoveIssuedToPrimeHTMLTemplateRender() { originDutyLocation := "origDutyLocation" s := moveIssuedToPrimeEmailData{ - MilitaryOneSourceLink: "https://example.com", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, OriginDutyLocation: &originDutyLocation, DestinationDutyLocation: "destDutyLocation", Locator: "abc123", @@ -96,7 +96,7 @@ func (suite *NotificationSuite) TestMoveIssuedToPrimeHTMLTemplateRender() {

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: - https://example.com. + ` + OneSourceTransportationOfficeLink + `.

Thank you,

@@ -124,7 +124,7 @@ func (suite *NotificationSuite) TestMoveIssuedToPrimeHTMLTemplateRender() { notification := NewMoveIssuedToPrime(move.ID) s := moveIssuedToPrimeEmailData{ - MilitaryOneSourceLink: "https://example.com", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, DestinationDutyLocation: "destDutyLocation", Locator: "abc123", ProvidesGovernmentCounseling: true, @@ -185,7 +185,7 @@ func (suite *NotificationSuite) TestMoveIssuedToPrimeHTMLTemplateRender() {

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: - https://example.com. + ` + OneSourceTransportationOfficeLink + `.

Thank you,

@@ -214,7 +214,7 @@ func (suite *NotificationSuite) TestMoveIssuedToPrimeHTMLTemplateRender() { originDutyLocation := "origDutyLocation" s := moveIssuedToPrimeEmailData{ - MilitaryOneSourceLink: "https://example.com", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, OriginDutyLocation: &originDutyLocation, DestinationDutyLocation: "destDutyLocation", Locator: "abc123", @@ -276,7 +276,7 @@ func (suite *NotificationSuite) TestMoveIssuedToPrimeHTMLTemplateRender() {

If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: - https://example.com. + ` + OneSourceTransportationOfficeLink + `.

Thank you,

@@ -307,7 +307,7 @@ func (suite *NotificationSuite) TestMoveIssuedToPrimeTextTemplateRender() { originDutyLocation := "origDutyLocation" s := moveIssuedToPrimeEmailData{ - MilitaryOneSourceLink: "https://example.com", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, OriginDutyLocation: &originDutyLocation, DestinationDutyLocation: "destDutyLocation", Locator: "abc123", @@ -345,7 +345,7 @@ Utilize your HomeSafe Customer Care Representative: If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: -https://example.com. +` + OneSourceTransportationOfficeLink + `. Thank you, @@ -370,7 +370,7 @@ under the Privacy Act of 1974. Failure to protect Privacy Act information could notification := NewMoveIssuedToPrime(move.ID) s := moveIssuedToPrimeEmailData{ - MilitaryOneSourceLink: "https://example.com", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, DestinationDutyLocation: "destDutyLocation", Locator: "abc123", ProvidesGovernmentCounseling: true, @@ -407,7 +407,7 @@ Utilize your HomeSafe Customer Care Representative: If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: -https://example.com. +` + OneSourceTransportationOfficeLink + `. Thank you, @@ -433,7 +433,7 @@ under the Privacy Act of 1974. Failure to protect Privacy Act information could originDutyLocation := "origDutyLocation" s := moveIssuedToPrimeEmailData{ - MilitaryOneSourceLink: "https://example.com", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, OriginDutyLocation: &originDutyLocation, DestinationDutyLocation: "destDutyLocation", Locator: "abc123", @@ -471,7 +471,7 @@ Utilize your HomeSafe Customer Care Representative: If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: -https://example.com. +` + OneSourceTransportationOfficeLink + `. Thank you, diff --git a/pkg/notifications/move_submitted_test.go b/pkg/notifications/move_submitted_test.go index c42548ecb47..5b8591c3374 100644 --- a/pkg/notifications/move_submitted_test.go +++ b/pkg/notifications/move_submitted_test.go @@ -55,7 +55,7 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithGovCounse

- To change any information about your move, or to add or cancel shipments, you should contact 555-555-5555 or visit your local transportation office. + To change any information about your move, or to add or cancel shipments, you should contact 555-555-5555 or visit your local transportation office.

@@ -155,7 +155,7 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithoutGovCou

- To change any information about your move, or to add or cancel shipments, you should contact 555-555-5555 or visit your local transportation office. + To change any information about your move, or to add or cancel shipments, you should contact 555-555-5555 or visit your local transportation office.

@@ -243,7 +243,7 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderNoDutyLocatio

- To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts. + To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts.

@@ -330,7 +330,7 @@ This is a confirmation that you have submitted the details for your move from or We have assigned you a move code: abc123. You can use this code when talking to any representative about your move. -To change any information about your move, or to add or cancel shipments, you should contact 555-555-5555 or visit your local transportation office (https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL) . +To change any information about your move, or to add or cancel shipments, you should contact 555-555-5555 or visit your local transportation office (` + OneSourceTransportationOfficeLink + `) . Your weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. diff --git a/pkg/notifications/prime_counseling_complete_test.go b/pkg/notifications/prime_counseling_complete_test.go index d7644654e8b..d90ca8d59f7 100644 --- a/pkg/notifications/prime_counseling_complete_test.go +++ b/pkg/notifications/prime_counseling_complete_test.go @@ -75,7 +75,7 @@ func getCorrectEmailTemplate(emailData PrimeCounselingCompleteData) string {

  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • -
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • +
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + `
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
  • @@ -87,7 +87,7 @@ func getCorrectEmailTemplate(emailData PrimeCounselingCompleteData) string {
  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
  • -

    If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

    +

    If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + `

    Thank you,

    USTRANSCOM MilMove Team

    @@ -107,7 +107,7 @@ Next steps for a PPM: • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. -• If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: +• If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: <` + OneSourceTransportationOfficeLink + `> • Once you complete your PPM, log into MilMove , upload your receipts and weight tickets, and submit your PPM for review. @@ -118,7 +118,7 @@ Next steps for government arranged shipments: • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove. -If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL. +If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + `. Thank you, diff --git a/pkg/notifications/reweigh_requested.go b/pkg/notifications/reweigh_requested.go index addae2d705c..619441efb1c 100644 --- a/pkg/notifications/reweigh_requested.go +++ b/pkg/notifications/reweigh_requested.go @@ -53,7 +53,7 @@ func (m ReweighRequested) emails(appCtx appcontext.AppContext) ([]emailContent, } htmlBody, textBody, err := m.renderTemplates(appCtx, reweighRequestedEmailData{ - MilitaryOneSourceLink: "https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, }) if err != nil { diff --git a/pkg/notifications/reweigh_requested_test.go b/pkg/notifications/reweigh_requested_test.go index 17ed20c67b1..0809b079679 100644 --- a/pkg/notifications/reweigh_requested_test.go +++ b/pkg/notifications/reweigh_requested_test.go @@ -51,7 +51,7 @@ func (suite *NotificationSuite) TestReweighRequestedHTMLTemplateRender() { officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) notification := NewReweighRequested(move.ID, shipment) s := reweighRequestedEmailData{ - MilitaryOneSourceLink: "https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, } expectedHTMLContent := `

    *** DO NOT REPLY directly to this email ***

    *** This is an email generated by the U.S. Government system – MilMove. ***

    @@ -81,7 +81,7 @@ func (suite *NotificationSuite) TestReweighRequestedHTMLTemplateRender() {

    Make sure your shipment has been reweighed before you accept delivery.

    The only time a reweigh cannot be performed is when the shipment has already been unloaded.

    If you believe your shipment should be reweighed and has not been, do not accept delivery. Tell your HSA Customer Care Representative that they need to reweigh the shipment before they unload it.

    -

    Remember, your HomeSafe Alliance (HSA) Customer Care Representative is your first point of contact; however, if you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL.

    +

    Remember, your HomeSafe Alliance (HSA) Customer Care Representative is your first point of contact; however, if you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + `.

    Thank you,

    USTRANSCOM MilMove Team

    The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.

    @@ -103,7 +103,7 @@ func (suite *NotificationSuite) TestReweighRequestedTextTemplateRender() { officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) notification := NewReweighRequested(move.ID, shipment) s := reweighRequestedEmailData{ - MilitaryOneSourceLink: "https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL", + MilitaryOneSourceLink: OneSourceTransportationOfficeLink, } expectedTextContent := `*** DO NOT REPLY directly to this email *** @@ -140,7 +140,7 @@ The only time a reweigh cannot be performed is when the shipment has already bee If you believe your shipment should be reweighed and has not been, do not accept delivery. Tell your HSA Customer Care Representative that they need to reweigh the shipment before they unload it. -Remember, your HomeSafe Alliance (HSA) Customer Care Representative is your first point of contact; however, if you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL. +Remember, your HomeSafe Alliance (HSA) Customer Care Representative is your first point of contact; however, if you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + `. Thank you, From 1eb72367bbce5f78835905cbc137317568ce0920 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 29 Jan 2024 15:30:23 +0000 Subject: [PATCH 18/67] Fixed tests for prime_counseling_complete --- .../templates/prime_counseling_complete_template.html | 5 +---- pkg/notifications/prime_counseling_complete_test.go | 9 ++++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.html b/pkg/assets/notifications/templates/prime_counseling_complete_template.html index 99592bba434..20f74e9479c 100644 --- a/pkg/assets/notifications/templates/prime_counseling_complete_template.html +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.html @@ -25,7 +25,4 @@

    Next steps for government arranged shipments:

    USTRANSCOM MilMove Team

    -

    - The information contained in this email may contain Privacy Act information and is therefore protected under the - Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine. -

    \ No newline at end of file +

    The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.

    \ No newline at end of file diff --git a/pkg/notifications/prime_counseling_complete_test.go b/pkg/notifications/prime_counseling_complete_test.go index d90ca8d59f7..4f9a68fc692 100644 --- a/pkg/notifications/prime_counseling_complete_test.go +++ b/pkg/notifications/prime_counseling_complete_test.go @@ -15,9 +15,10 @@ var payload = primemessages.MoveTaskOrder{ Order: &primeOrder, } var correctPrimeCounselingData = PrimeCounselingCompleteData{ - Locator: "TEST00", - OriginDutyLocation: "Fort Origin", - DestinationDutyLocation: "Fort Destination", + CustomerEmail: member.Email, + Locator: payload.MoveCode, + OriginDutyLocation: primeOrder.OriginDutyLocation.Name, + DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, } func (suite *NotificationSuite) TestPrimeCounselingComplete() { @@ -29,6 +30,7 @@ func (suite *NotificationSuite) TestPrimeCounselingComplete() { suite.Equal(primeCounselingEmailData, correctPrimeCounselingData) suite.EqualExportedValues(primeCounselingEmailData, PrimeCounselingCompleteData{ + CustomerEmail: member.Email, OriginDutyLocation: primeOrder.OriginDutyLocation.Name, DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, Locator: payload.MoveCode, @@ -51,6 +53,7 @@ func (suite *NotificationSuite) TestPrimeCounselingCompleteTextTemplateRender() suite.Equal(primeCounselingEmailData, correctPrimeCounselingData) suite.EqualExportedValues(primeCounselingEmailData, PrimeCounselingCompleteData{ + CustomerEmail: member.Email, OriginDutyLocation: primeOrder.OriginDutyLocation.Name, DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, Locator: payload.MoveCode, From ec651f6e235bcb7d0c73532692a42f43053221ba Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 29 Jan 2024 15:46:15 +0000 Subject: [PATCH 19/67] Fixed missing usage of new constant. --- .../templates/move_submitted_template.html | 4 +- .../templates/move_submitted_template.txt | 2 +- .../prime_counseling_complete_template.html | 4 +- .../prime_counseling_complete_template.txt | 4 +- pkg/notifications/move_submitted.go | 26 +++++----- pkg/notifications/move_submitted_test.go | 52 ++++++++++--------- .../prime_counseling_complete.go | 18 ++++--- .../prime_counseling_complete_test.go | 27 +++++----- 8 files changed, 74 insertions(+), 63 deletions(-) diff --git a/pkg/assets/notifications/templates/move_submitted_template.html b/pkg/assets/notifications/templates/move_submitted_template.html index be9b74ee648..1eaf2c8629f 100644 --- a/pkg/assets/notifications/templates/move_submitted_template.html +++ b/pkg/assets/notifications/templates/move_submitted_template.html @@ -12,10 +12,10 @@

    {{- if .OriginDutyLocationPhoneLine }} - To change any information about your move, or to add or cancel shipments, you should contact {{.OriginDutyLocationPhoneLine}} or visit your local transportation office. + To change any information about your move, or to add or cancel shipments, you should contact {{.OriginDutyLocationPhoneLine}} or visit your local transportation office. {{- end }} {{- if not .OriginDutyLocationPhoneLine }} - To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts. + To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts. {{- end }}

    diff --git a/pkg/assets/notifications/templates/move_submitted_template.txt b/pkg/assets/notifications/templates/move_submitted_template.txt index 99ea374b50e..78d071c2d4b 100644 --- a/pkg/assets/notifications/templates/move_submitted_template.txt +++ b/pkg/assets/notifications/templates/move_submitted_template.txt @@ -4,7 +4,7 @@ This is a confirmation that you have submitted the details for your move {{if .O We have assigned you a move code: {{.Locator}}. You can use this code when talking to any representative about your move. -{{ if .OriginDutyLocationPhoneLine -}} To change any information about your move, or to add or cancel shipments, you should contact {{.OriginDutyLocationPhoneLine}} or visit your local transportation office (https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL) . {{- end }} {{- if not .OriginDutyLocationPhoneLine }} To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts (https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL) . {{- end }} +{{ if .OriginDutyLocationPhoneLine -}} To change any information about your move, or to add or cancel shipments, you should contact {{.OriginDutyLocationPhoneLine}} or visit your local transportation office ({{.OneSourceTransportationOfficeLink}}) . {{- end }} {{- if not .OriginDutyLocationPhoneLine }} To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts ({{.OneSourceTransportationOfficeLink}}) . {{- end }} Your weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.html b/pkg/assets/notifications/templates/prime_counseling_complete_template.html index 20f74e9479c..c72f645770a 100644 --- a/pkg/assets/notifications/templates/prime_counseling_complete_template.html +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.html @@ -8,7 +8,7 @@

    Next steps for a PPM:

  • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • -
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL
  • +
  • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: {{.OneSourceTransportationOfficeLink}}
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
  • @@ -20,7 +20,7 @@

    Next steps for government arranged shipments:

  • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
  • -

    If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

    +

    If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: {{.OneSourceTransportationOfficeLink}}

    Thank you,

    USTRANSCOM MilMove Team

    diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.txt b/pkg/assets/notifications/templates/prime_counseling_complete_template.txt index ffe89d739bf..169d4dc5d57 100644 --- a/pkg/assets/notifications/templates/prime_counseling_complete_template.txt +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.txt @@ -9,7 +9,7 @@ Next steps for a PPM: • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. -• If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: +• If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: <{{.OneSourceTransportationOfficeLink}}> • Once you complete your PPM, log into MilMove , upload your receipts and weight tickets, and submit your PPM for review. @@ -20,7 +20,7 @@ Next steps for government arranged shipments: • HomeSafe is your primary point of contact. If any information changes during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove. -If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL. +If you are unsatisfied at any time, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: {{.OneSourceTransportationOfficeLink}}. Thank you, diff --git a/pkg/notifications/move_submitted.go b/pkg/notifications/move_submitted.go index ee70e74321a..6d342a1748a 100644 --- a/pkg/notifications/move_submitted.go +++ b/pkg/notifications/move_submitted.go @@ -87,12 +87,13 @@ func (m MoveSubmitted) emails(appCtx appcontext.AppContext) ([]emailContent, err } htmlBody, textBody, err := m.renderTemplates(appCtx, moveSubmittedEmailData{ - OriginDutyLocation: originDutyLocationName, - DestinationDutyLocation: orders.NewDutyLocation.Name, - OriginDutyLocationPhoneLine: originDutyLocationPhoneLine, - Locator: move.Locator, - WeightAllowance: humanize.Comma(int64(weight)), - ProvidesGovernmentCounseling: providesGovernmentCounseling, + OriginDutyLocation: originDutyLocationName, + DestinationDutyLocation: orders.NewDutyLocation.Name, + OriginDutyLocationPhoneLine: originDutyLocationPhoneLine, + Locator: move.Locator, + WeightAllowance: humanize.Comma(int64(weight)), + ProvidesGovernmentCounseling: providesGovernmentCounseling, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, }) if err != nil { @@ -126,12 +127,13 @@ func (m MoveSubmitted) renderTemplates(appCtx appcontext.AppContext, data moveSu } type moveSubmittedEmailData struct { - OriginDutyLocation *string - DestinationDutyLocation string - OriginDutyLocationPhoneLine *string - Locator string - WeightAllowance string - ProvidesGovernmentCounseling bool + OriginDutyLocation *string + DestinationDutyLocation string + OriginDutyLocationPhoneLine *string + Locator string + WeightAllowance string + ProvidesGovernmentCounseling bool + OneSourceTransportationOfficeLink string } // RenderHTML renders the html for the email diff --git a/pkg/notifications/move_submitted_test.go b/pkg/notifications/move_submitted_test.go index 5b8591c3374..8d444865a11 100644 --- a/pkg/notifications/move_submitted_test.go +++ b/pkg/notifications/move_submitted_test.go @@ -35,12 +35,13 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithGovCounse originDutyLocationPhoneLine := "555-555-5555" s := moveSubmittedEmailData{ - OriginDutyLocation: &originDutyLocation, - DestinationDutyLocation: "destDutyLocation", - OriginDutyLocationPhoneLine: &originDutyLocationPhoneLine, - Locator: "abc123", - WeightAllowance: "7,999", - ProvidesGovernmentCounseling: true, + OriginDutyLocation: &originDutyLocation, + DestinationDutyLocation: "destDutyLocation", + OriginDutyLocationPhoneLine: &originDutyLocationPhoneLine, + Locator: "abc123", + WeightAllowance: "7,999", + ProvidesGovernmentCounseling: true, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, } expectedHTMLContent := `

    *** DO NOT REPLY directly to this email *** @@ -135,12 +136,13 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithoutGovCou originDutyLocationPhoneLine := "555-555-5555" s := moveSubmittedEmailData{ - OriginDutyLocation: &originDutyLocation, - DestinationDutyLocation: "destDutyLocation", - OriginDutyLocationPhoneLine: &originDutyLocationPhoneLine, - Locator: "abc123", - WeightAllowance: "7,999", - ProvidesGovernmentCounseling: false, + OriginDutyLocation: &originDutyLocation, + DestinationDutyLocation: "destDutyLocation", + OriginDutyLocationPhoneLine: &originDutyLocationPhoneLine, + Locator: "abc123", + WeightAllowance: "7,999", + ProvidesGovernmentCounseling: false, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, } expectedHTMLContent := `

    *** DO NOT REPLY directly to this email *** @@ -223,12 +225,13 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderNoDutyLocatio notification := NewMoveSubmitted(move.ID) s := moveSubmittedEmailData{ - OriginDutyLocation: nil, - DestinationDutyLocation: "destDutyLocation", - OriginDutyLocationPhoneLine: nil, - Locator: "abc123", - WeightAllowance: "7,999", - ProvidesGovernmentCounseling: false, + OriginDutyLocation: nil, + DestinationDutyLocation: "destDutyLocation", + OriginDutyLocationPhoneLine: nil, + Locator: "abc123", + WeightAllowance: "7,999", + ProvidesGovernmentCounseling: false, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, } expectedHTMLContent := `

    *** DO NOT REPLY directly to this email *** @@ -316,12 +319,13 @@ func (suite *NotificationSuite) TestMoveSubmittedTextTemplateRender() { originDutyLocationPhoneLine := "555-555-5555" s := moveSubmittedEmailData{ - OriginDutyLocation: &originDutyLocation, - DestinationDutyLocation: "destDutyLocation", - OriginDutyLocationPhoneLine: &originDutyLocationPhoneLine, - Locator: "abc123", - WeightAllowance: "7,999", - ProvidesGovernmentCounseling: true, + OriginDutyLocation: &originDutyLocation, + DestinationDutyLocation: "destDutyLocation", + OriginDutyLocationPhoneLine: &originDutyLocationPhoneLine, + Locator: "abc123", + WeightAllowance: "7,999", + ProvidesGovernmentCounseling: true, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, } expectedTextContent := `*** DO NOT REPLY directly to this email *** diff --git a/pkg/notifications/prime_counseling_complete.go b/pkg/notifications/prime_counseling_complete.go index fd140715206..f9e9c48a81a 100644 --- a/pkg/notifications/prime_counseling_complete.go +++ b/pkg/notifications/prime_counseling_complete.go @@ -29,10 +29,11 @@ type PrimeCounselingComplete struct { // PrimeCounselingCompleteData is used to render an email template type PrimeCounselingCompleteData struct { - CustomerEmail string - OriginDutyLocation string - DestinationDutyLocation string - Locator string + CustomerEmail string + OriginDutyLocation string + DestinationDutyLocation string + Locator string + OneSourceTransportationOfficeLink string } // NewPrimeCounselingComplete returns a new payment reminder notification 14 days after actual move in date @@ -89,10 +90,11 @@ func (p PrimeCounselingComplete) GetEmailData(m primemessages.MoveTaskOrder, app ) return PrimeCounselingCompleteData{ - CustomerEmail: m.Order.Customer.Email, - OriginDutyLocation: m.Order.OriginDutyLocation.Name, - DestinationDutyLocation: m.Order.DestinationDutyLocation.Name, - Locator: m.MoveCode, + CustomerEmail: m.Order.Customer.Email, + OriginDutyLocation: m.Order.OriginDutyLocation.Name, + DestinationDutyLocation: m.Order.DestinationDutyLocation.Name, + Locator: m.MoveCode, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, }, nil } diff --git a/pkg/notifications/prime_counseling_complete_test.go b/pkg/notifications/prime_counseling_complete_test.go index 4f9a68fc692..342df7e74ab 100644 --- a/pkg/notifications/prime_counseling_complete_test.go +++ b/pkg/notifications/prime_counseling_complete_test.go @@ -15,10 +15,11 @@ var payload = primemessages.MoveTaskOrder{ Order: &primeOrder, } var correctPrimeCounselingData = PrimeCounselingCompleteData{ - CustomerEmail: member.Email, - Locator: payload.MoveCode, - OriginDutyLocation: primeOrder.OriginDutyLocation.Name, - DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, + CustomerEmail: member.Email, + Locator: payload.MoveCode, + OriginDutyLocation: primeOrder.OriginDutyLocation.Name, + DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, } func (suite *NotificationSuite) TestPrimeCounselingComplete() { @@ -30,10 +31,11 @@ func (suite *NotificationSuite) TestPrimeCounselingComplete() { suite.Equal(primeCounselingEmailData, correctPrimeCounselingData) suite.EqualExportedValues(primeCounselingEmailData, PrimeCounselingCompleteData{ - CustomerEmail: member.Email, - OriginDutyLocation: primeOrder.OriginDutyLocation.Name, - DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, - Locator: payload.MoveCode, + CustomerEmail: member.Email, + OriginDutyLocation: primeOrder.OriginDutyLocation.Name, + DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, + Locator: payload.MoveCode, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, }) expectedHTMLContent := getCorrectEmailTemplate(primeCounselingEmailData) @@ -53,10 +55,11 @@ func (suite *NotificationSuite) TestPrimeCounselingCompleteTextTemplateRender() suite.Equal(primeCounselingEmailData, correctPrimeCounselingData) suite.EqualExportedValues(primeCounselingEmailData, PrimeCounselingCompleteData{ - CustomerEmail: member.Email, - OriginDutyLocation: primeOrder.OriginDutyLocation.Name, - DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, - Locator: payload.MoveCode, + CustomerEmail: member.Email, + OriginDutyLocation: primeOrder.OriginDutyLocation.Name, + DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, + Locator: payload.MoveCode, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, }) expectedTextContent := getCorrectTextTemplate(primeCounselingEmailData) From 92a87e97085936b1e1d12105de5306742611f80c Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 29 Jan 2024 16:34:24 +0000 Subject: [PATCH 20/67] Added MyMoveLInk to constants and notificaiton files. --- .../templates/move_approved_template.html | 2 +- .../templates/move_approved_template.txt | 2 +- .../templates/move_payment_reminder_template.html | 2 +- .../templates/prime_counseling_complete_template.html | 4 ++-- .../templates/prime_counseling_complete_template.txt | 4 ++-- pkg/notifications/constants.go | 1 + pkg/notifications/move_approved.go | 2 ++ pkg/notifications/move_approved_test.go | 9 ++++++--- pkg/notifications/move_payment_reminder.go | 2 ++ pkg/notifications/move_payment_reminder_test.go | 8 ++++++-- pkg/notifications/prime_counseling_complete.go | 2 ++ pkg/notifications/prime_counseling_complete_test.go | 11 +++++++---- 12 files changed, 33 insertions(+), 16 deletions(-) diff --git a/pkg/assets/notifications/templates/move_approved_template.html b/pkg/assets/notifications/templates/move_approved_template.html index 403c7f0e524..133c1a966fc 100644 --- a/pkg/assets/notifications/templates/move_approved_template.html +++ b/pkg/assets/notifications/templates/move_approved_template.html @@ -19,4 +19,4 @@ {{if .OriginDutyLocation}}

    If you have any questions, call the {{.OriginDutyLocation}} PPPO at {{.OriginDutyLocationPhoneLine}} and reference your move locator code: {{.Locator}}

    {{end}} -

    You can check the status of your move anytime at https://my.move.mil"

    +

    You can check the status of your move anytime at {{.MyMoveLink}}"

    diff --git a/pkg/assets/notifications/templates/move_approved_template.txt b/pkg/assets/notifications/templates/move_approved_template.txt index a285a6c5b81..dea72a86c94 100644 --- a/pkg/assets/notifications/templates/move_approved_template.txt +++ b/pkg/assets/notifications/templates/move_approved_template.txt @@ -12,4 +12,4 @@ Be sure to save your weight tickets and any receipts associated with your move. {{if .OriginDutyLocation}}If you have any questions, call the {{.OriginDutyLocation}} PPPO at {{.OriginDutyLocationPhoneLine}} and reference move locator code: {{.Locator}}.{{end}} -You can check the status of your move anytime at https://my.move.mil" +You can check the status of your move anytime at {{.MyMoveLink}}" diff --git a/pkg/assets/notifications/templates/move_payment_reminder_template.html b/pkg/assets/notifications/templates/move_payment_reminder_template.html index aa3f974beb6..765928f97fe 100644 --- a/pkg/assets/notifications/templates/move_payment_reminder_template.html +++ b/pkg/assets/notifications/templates/move_payment_reminder_template.html @@ -11,7 +11,7 @@

    To do that

    diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.html b/pkg/assets/notifications/templates/prime_counseling_complete_template.html index c72f645770a..fb6b5d56341 100644 --- a/pkg/assets/notifications/templates/prime_counseling_complete_template.html +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.html @@ -6,11 +6,11 @@

    Next steps for a PPM:

    • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
    • -
    • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
    • +
    • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
    • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: {{.OneSourceTransportationOfficeLink}}
    • -
    • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
    • +
    • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.

    Next steps for government arranged shipments:

      diff --git a/pkg/assets/notifications/templates/prime_counseling_complete_template.txt b/pkg/assets/notifications/templates/prime_counseling_complete_template.txt index 169d4dc5d57..daf643b2ae8 100644 --- a/pkg/assets/notifications/templates/prime_counseling_complete_template.txt +++ b/pkg/assets/notifications/templates/prime_counseling_complete_template.txt @@ -7,11 +7,11 @@ If you are doing a Personally Procured Move (PPM), you can start moving your per Next steps for a PPM: • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected. -• If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. +• If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove <{{.MyMoveLink}}/> to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: <{{.OneSourceTransportationOfficeLink}}> -• Once you complete your PPM, log into MilMove , upload your receipts and weight tickets, and submit your PPM for review. +• Once you complete your PPM, log into MilMove <{{.MyMoveLink}}/>, upload your receipts and weight tickets, and submit your PPM for review. Next steps for government arranged shipments: • If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request. diff --git a/pkg/notifications/constants.go b/pkg/notifications/constants.go index e533a1e8ea8..4ef7f7633c4 100644 --- a/pkg/notifications/constants.go +++ b/pkg/notifications/constants.go @@ -1,3 +1,4 @@ package notifications const OneSourceTransportationOfficeLink = "https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL" +const MyMoveLink = "https://my.move.mil/" \ No newline at end of file diff --git a/pkg/notifications/move_approved.go b/pkg/notifications/move_approved.go index c334a8563a4..dfa4e6b692e 100644 --- a/pkg/notifications/move_approved.go +++ b/pkg/notifications/move_approved.go @@ -91,6 +91,7 @@ func (m MoveApproved) emails(appCtx appcontext.AppContext) ([]emailContent, erro DestinationDutyLocation: orders.NewDutyLocation.Name, OriginDutyLocationPhoneLine: originDutyLocationPhoneLine, Locator: move.Locator, + MyMoveLink: MyMoveLink, }) if err != nil { @@ -132,6 +133,7 @@ type moveApprovedEmailData struct { DestinationDutyLocation string OriginDutyLocationPhoneLine *string Locator string + MyMoveLink string } // RenderHTML renders the html for the email diff --git a/pkg/notifications/move_approved_test.go b/pkg/notifications/move_approved_test.go index b774d3e17cd..5e4a2d470dd 100644 --- a/pkg/notifications/move_approved_test.go +++ b/pkg/notifications/move_approved_test.go @@ -46,6 +46,7 @@ func (suite *NotificationSuite) TestMoveApprovedHTMLTemplateRender() { DestinationDutyLocation: "destDutyLocation", OriginDutyLocationPhoneLine: &originDutyLocationPhoneLine, Locator: "abc123", + MyMoveLink: MyMoveLink, } expectedHTMLContent := `

      You're all set to move!

      @@ -68,7 +69,7 @@ func (suite *NotificationSuite) TestMoveApprovedHTMLTemplateRender() {

      If you have any questions, call the origDutyLocation PPPO at 555-555-5555 and reference your move locator code: abc123

      -

      You can check the status of your move anytime at https://my.move.mil"

      +

      You can check the status of your move anytime at ` + MyMoveLink + `"

      ` htmlContent, err := notification.RenderHTML(suite.AppContextWithSessionForTest(&auth.Session{}), s) @@ -87,6 +88,7 @@ func (suite *NotificationSuite) TestMoveApprovedHTMLTemplateRenderNoOriginDutyLo DestinationDutyLocation: "destDutyLocation", OriginDutyLocationPhoneLine: nil, Locator: "abc123", + MyMoveLink: MyMoveLink, } expectedHTMLContent := `

      You're all set to move!

      @@ -109,7 +111,7 @@ func (suite *NotificationSuite) TestMoveApprovedHTMLTemplateRenderNoOriginDutyLo -

      You can check the status of your move anytime at https://my.move.mil"

      +

      You can check the status of your move anytime at ` + MyMoveLink + `"

      ` htmlContent, err := notification.RenderHTML(suite.AppContextWithSessionForTest(&auth.Session{}), s) @@ -131,6 +133,7 @@ func (suite *NotificationSuite) TestMoveApprovedTextTemplateRender() { DestinationDutyLocation: "destDutyLocation", OriginDutyLocationPhoneLine: &originDutyLocationPhoneLine, Locator: "abc123", + MyMoveLink: MyMoveLink, } expectedTextContent := `You're all set to move! @@ -146,7 +149,7 @@ Be sure to save your weight tickets and any receipts associated with your move. If you have any questions, call the origDutyLocation PPPO at 555-555-5555 and reference move locator code: abc123. -You can check the status of your move anytime at https://my.move.mil" +You can check the status of your move anytime at ` + MyMoveLink + `" ` textContent, err := notification.RenderText(suite.AppContextWithSessionForTest(&auth.Session{}), s) diff --git a/pkg/notifications/move_payment_reminder.go b/pkg/notifications/move_payment_reminder.go index 13a617337f1..2292f60c6ee 100644 --- a/pkg/notifications/move_payment_reminder.go +++ b/pkg/notifications/move_payment_reminder.go @@ -140,6 +140,7 @@ func (m PaymentReminder) formatEmails(appCtx appcontext.AppContext, PaymentRemin TOName: toName, TOPhone: toPhone, Locator: PaymentReminderEmailInfo.Locator, + MyMoveLink: MyMoveLink, }) if err != nil { appCtx.Logger().Error("error rendering template", zap.Error(err)) @@ -207,6 +208,7 @@ type PaymentReminderEmailData struct { TOName *string TOPhone *string Locator string + MyMoveLink string } // RenderHTML renders the html for the email diff --git a/pkg/notifications/move_payment_reminder_test.go b/pkg/notifications/move_payment_reminder_test.go index 54f3f0f6962..82cba53928f 100644 --- a/pkg/notifications/move_payment_reminder_test.go +++ b/pkg/notifications/move_payment_reminder_test.go @@ -202,6 +202,7 @@ func (suite *NotificationSuite) TestPaymentReminderHTMLTemplateRender() { TOName: &name, TOPhone: &phone, Locator: "abc123", + MyMoveLink: MyMoveLink, } expectedHTMLContent := `

      We hope your move to DestDutyLocation went well.

      @@ -216,7 +217,7 @@ func (suite *NotificationSuite) TestPaymentReminderHTMLTemplateRender() {

      To do that

      @@ -264,6 +265,7 @@ func (suite *NotificationSuite) TestPaymentReminderHTMLTemplateRenderNoOriginDut TOName: nil, TOPhone: nil, Locator: "abc123", + MyMoveLink: MyMoveLink, } expectedHTMLContent := `

      We hope your move to DestDutyLocation went well.

      @@ -278,7 +280,7 @@ func (suite *NotificationSuite) TestPaymentReminderHTMLTemplateRenderNoOriginDut

      To do that

      @@ -328,6 +330,7 @@ func (suite *NotificationSuite) TestPaymentReminderTextTemplateRender() { TOName: &name, TOPhone: &phone, Locator: "abc123", + MyMoveLink: MyMoveLink, } expectedTextContent := `We hope your move to DestDutyLocation went well. @@ -461,6 +464,7 @@ func (suite *NotificationSuite) TestFormatPaymentRequestedEmails() { TOName: emailInfo.TOName, TOPhone: emailInfo.TOPhone, Locator: emailInfo.Locator, + MyMoveLink: MyMoveLink, } htmlBody, err := pr.RenderHTML(suite.AppContextForTest(), data) suite.NoError(err) diff --git a/pkg/notifications/prime_counseling_complete.go b/pkg/notifications/prime_counseling_complete.go index f9e9c48a81a..562735fb982 100644 --- a/pkg/notifications/prime_counseling_complete.go +++ b/pkg/notifications/prime_counseling_complete.go @@ -34,6 +34,7 @@ type PrimeCounselingCompleteData struct { DestinationDutyLocation string Locator string OneSourceTransportationOfficeLink string + MyMoveLink string } // NewPrimeCounselingComplete returns a new payment reminder notification 14 days after actual move in date @@ -95,6 +96,7 @@ func (p PrimeCounselingComplete) GetEmailData(m primemessages.MoveTaskOrder, app DestinationDutyLocation: m.Order.DestinationDutyLocation.Name, Locator: m.MoveCode, OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }, nil } diff --git a/pkg/notifications/prime_counseling_complete_test.go b/pkg/notifications/prime_counseling_complete_test.go index 342df7e74ab..4ef6cfcfa1e 100644 --- a/pkg/notifications/prime_counseling_complete_test.go +++ b/pkg/notifications/prime_counseling_complete_test.go @@ -20,6 +20,7 @@ var correctPrimeCounselingData = PrimeCounselingCompleteData{ OriginDutyLocation: primeOrder.OriginDutyLocation.Name, DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, } func (suite *NotificationSuite) TestPrimeCounselingComplete() { @@ -36,6 +37,7 @@ func (suite *NotificationSuite) TestPrimeCounselingComplete() { DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, Locator: payload.MoveCode, OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }) expectedHTMLContent := getCorrectEmailTemplate(primeCounselingEmailData) @@ -60,6 +62,7 @@ func (suite *NotificationSuite) TestPrimeCounselingCompleteTextTemplateRender() DestinationDutyLocation: primeOrder.DestinationDutyLocation.Name, Locator: payload.MoveCode, OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }) expectedTextContent := getCorrectTextTemplate(primeCounselingEmailData) @@ -79,11 +82,11 @@ func getCorrectEmailTemplate(emailData PrimeCounselingCompleteData) string {
      • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
      • -
      • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
      • +
      • If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
      • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + `
      • -
      • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
      • +
      • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.

      Next steps for government arranged shipments:

        @@ -111,11 +114,11 @@ If you are doing a Personally Procured Move (PPM), you can start moving your per Next steps for a PPM: • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected. -• If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. +• If you are requesting an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove <` + MyMoveLink + `/> to download your AOA packet. You must obtain signature approval on the AOA packet from a government transportation office before submitting it to finance. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. • If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: <` + OneSourceTransportationOfficeLink + `> -• Once you complete your PPM, log into MilMove , upload your receipts and weight tickets, and submit your PPM for review. +• Once you complete your PPM, log into MilMove <` + MyMoveLink + `/>, upload your receipts and weight tickets, and submit your PPM for review. Next steps for government arranged shipments: • If additional services were identified during counseling, HomeSafe will send the request to the responsible government transportation office for review. Your HomeSafe Customer Care Representative should keep you informed on the status of the request. From 6045f642ea7351f71907909670bf27ffd2fd7f50 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 29 Jan 2024 16:59:59 +0000 Subject: [PATCH 21/67] Fix missing EOF space in constants.go --- pkg/notifications/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/notifications/constants.go b/pkg/notifications/constants.go index 4ef7f7633c4..fc7d082ce02 100644 --- a/pkg/notifications/constants.go +++ b/pkg/notifications/constants.go @@ -1,4 +1,4 @@ package notifications const OneSourceTransportationOfficeLink = "https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL" -const MyMoveLink = "https://my.move.mil/" \ No newline at end of file +const MyMoveLink = "https://my.move.mil/" From 1a8aad162a7442977a699ec8887ef8a7bd53ed04 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 7 Feb 2024 15:19:29 +0000 Subject: [PATCH 22/67] add aoa download for PPM shipment service counselor TOO --- .../Office/DefinitionLists/PPMShipmentInfoList.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/Office/DefinitionLists/PPMShipmentInfoList.jsx b/src/components/Office/DefinitionLists/PPMShipmentInfoList.jsx index 1870f584205..7e0159d900c 100644 --- a/src/components/Office/DefinitionLists/PPMShipmentInfoList.jsx +++ b/src/components/Office/DefinitionLists/PPMShipmentInfoList.jsx @@ -182,6 +182,19 @@ const PPMShipmentInfoList = ({ ); + const aoaPacketElement = ( +
        +
        AOA Packet
        +
        +

        + + Download AOA Paperwork (PDF) + +

        +
        +
        + ); + const counselorRemarksElementFlags = getDisplayFlags('counselorRemarks'); const counselorRemarksElement = (
        @@ -214,6 +227,7 @@ const PPMShipmentInfoList = ({ {showElement(estimatedIncentiveElementFlags) && estimatedIncentiveElement} {hasRequestedAdvanceElement} {hasRequestedAdvance === true && advanceStatusElement} + {advanceStatus === ADVANCE_STATUSES.APPROVED.apiValue && aoaPacketElement} {counselorRemarksElement} ); From 0630d3729265c4d3066ac60abb46013a4d55bd1f Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 7 Feb 2024 11:37:23 -0600 Subject: [PATCH 23/67] initial --- migrations/app/migrations_manifest.txt | 1 + .../app/schema/20240207173709_updateTransportationOffices.up.sql | 0 2 files changed, 1 insertion(+) create mode 100644 migrations/app/schema/20240207173709_updateTransportationOffices.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index f2f9939bebd..e8b98894dd3 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -892,3 +892,4 @@ 20240124155759_20240124-homesafeconnect-cert.up.sql 20240129153006_20240129-homesafeconnect-cert.up.sql 20240201174442_20240201_homesafe_prd_cert.up.sql +20240207173709_updateTransportationOffices.up.sql diff --git a/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql b/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql new file mode 100644 index 00000000000..e69de29bb2d From 069ae6138660eaacfdd589ecd0842ba7d84bd489 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 7 Feb 2024 15:25:19 -0600 Subject: [PATCH 24/67] B-18650 --- ...7173709_updateTransportationOffices.up.sql | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql b/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql index e69de29bb2d..59b3dbbda30 100644 --- a/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql +++ b/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql @@ -0,0 +1,65 @@ +update postal_code_to_gblocs set gbloc = 'BGAC' where gbloc = 'BKAS'; + + +INSERT INTO addresses + (id, street_address_1, city, state, postal_code, created_at, updated_at, country) + VALUES ('f933c50f-6625-4991-8c81-705a222840c6', '3376 Albacore Alley', 'San Diego', 'CA', '92136', now(), now(), 'United States'); + +insert into transportation_offices + (id, name, gbloc, address_id, created_at, updated_at, provides_ppm_closeout) +values + ('e4a02d40-2ad9-44c5-a357-202d4ff0b51d', 'PPPO NAVSUP FLC San Diego - USN', 'LKNQ', 'f933c50f-6625-4991-8c81-705a222840c6', now(), now(), TRUE); + +insert into office_phone_lines + (id, transportation_office_id, number, created_at, updated_at) +values + ('3e692f01-182d-4a7d-958d-6418e7335dd9', 'e4a02d40-2ad9-44c5-a357-202d4ff0b51d', '855-444-6683', now(), now()); + +insert into office_emails + (id, transportation_office_id, email, created_at, updated_at) +values + ('3e692f01-182d-4a7d-958d-6418e7335dd9', 'e4a02d40-2ad9-44c5-a357-202d4ff0b51d', 'jppso_SW_counseling@us.navy.mil', now(), now()); + + + +INSERT INTO addresses + (id, street_address_1, city, state, postal_code, created_at, updated_at, country) + VALUES ('6aa77b74-41a7-4a4c-ab29-986f3263495a', '626 Swift Road', 'West Point', 'NY', now(), now(), 'United States'); + +insert into transportation_offices + (id, name, gbloc, address_id, created_at, updated_at, provides_ppm_closeout) +values + ('dd043073-4f1b-460f-8f8c-74403619dbaa', 'PPPO West Point/ USMA - USA', 'BGAC', '6aa77b74-41a7-4a4c-ab29-986f3263495a', now(), now(), TRUE); +insert into office_phone_lines + (id, transportation_office_id, number, created_at, updated_at) +values + ('1adffbea-01d7-462f-bbfd-ba155e8a0844', 'dd043073-4f1b-460f-8f8c-74403619dbaa', '845-938-5911', now(), now()); + +insert into office_emails + (id, transportation_office_id, email, created_at, updated_at) +values + ('8276c5e4-461f-4ef6-a72f-0d76f7e10194', 'dd043073-4f1b-460f-8f8c-74403619dbaa', 'usarmy.jblm.404-afsb-lrc.list.west-point-transportation-ppo@army.mil', now(), now()); + + +INSERT INTO addresses + (id, street_address_1, city, state, postal_code, created_at, updated_at, country) + VALUES ('09058d36-2966-496a-aaf5-55c024404396', '15610 SW 117TH AVE', 'Miami', 'FL', '33177-1630', now(), now(), 'United States'); + +insert into transportation_offices + (id, name, gbloc, address_id, created_at, updated_at, provides_ppm_closeout) +values + ('4f10d0f5-6017-4de2-8cfb-ee9252e492d5', 'PPPO USAG Miami - USA', 'CLPK', '09058d36-2966-496a-aaf5-55c024404396', now(), now(), TRUE); + +insert into office_phone_lines + (id, transportation_office_id, number, created_at, updated_at) +values + ('bfae8dd6-3ce4-4310-a315-eeda8420f4a4', '4f10d0f5-6017-4de2-8cfb-ee9252e492d5', '1-305-216-8037', now(), now()); + +insert into office_emails + (id, transportation_office_id, email, created_at, updated_at) +values + ('afb6648e-da9d-4e6a-9322-e0aa3b99caf3', '4f10d0f5-6017-4de2-8cfb-ee9252e492d5', 'D07-SMB-BASEMIAMIBEACH-PPSO@uscg.mil', now(), now()); + + + +delete from transportation_offices where name = 'PPPO Base San Pedro - USCG'; \ No newline at end of file From d0adb567bb144724d2eb65ea38a537d503187288 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 7 Feb 2024 15:49:07 -0600 Subject: [PATCH 25/67] B-18650 --- ...240207173709_updateTransportationOffices.up.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql b/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql index 59b3dbbda30..3ccc20e3c87 100644 --- a/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql +++ b/migrations/app/schema/20240207173709_updateTransportationOffices.up.sql @@ -6,9 +6,9 @@ INSERT INTO addresses VALUES ('f933c50f-6625-4991-8c81-705a222840c6', '3376 Albacore Alley', 'San Diego', 'CA', '92136', now(), now(), 'United States'); insert into transportation_offices - (id, name, gbloc, address_id, created_at, updated_at, provides_ppm_closeout) + (id, name, gbloc, address_id, latitude, longitude, created_at, updated_at, provides_ppm_closeout) values - ('e4a02d40-2ad9-44c5-a357-202d4ff0b51d', 'PPPO NAVSUP FLC San Diego - USN', 'LKNQ', 'f933c50f-6625-4991-8c81-705a222840c6', now(), now(), TRUE); + ('e4a02d40-2ad9-44c5-a357-202d4ff0b51d', 'PPPO NAVSUP FLC San Diego - USN', 'LKNQ', 'f933c50f-6625-4991-8c81-705a222840c6','32.67540','-117.12142', now(), now(), TRUE); insert into office_phone_lines (id, transportation_office_id, number, created_at, updated_at) @@ -24,12 +24,12 @@ values INSERT INTO addresses (id, street_address_1, city, state, postal_code, created_at, updated_at, country) - VALUES ('6aa77b74-41a7-4a4c-ab29-986f3263495a', '626 Swift Road', 'West Point', 'NY', now(), now(), 'United States'); + VALUES ('6aa77b74-41a7-4a4c-ab29-986f3263495a', '626 Swift Road', 'West Point', 'NY', '10996', now(), now(), 'United States'); insert into transportation_offices - (id, name, gbloc, address_id, created_at, updated_at, provides_ppm_closeout) + (id, name, gbloc, address_id, latitude, longitude, created_at, updated_at, provides_ppm_closeout) values - ('dd043073-4f1b-460f-8f8c-74403619dbaa', 'PPPO West Point/ USMA - USA', 'BGAC', '6aa77b74-41a7-4a4c-ab29-986f3263495a', now(), now(), TRUE); + ('dd043073-4f1b-460f-8f8c-74403619dbaa', 'PPPO West Point/ USMA - USA', 'BGAC', '6aa77b74-41a7-4a4c-ab29-986f3263495a','41.39400','-73.97232', now(), now(), TRUE); insert into office_phone_lines (id, transportation_office_id, number, created_at, updated_at) values @@ -46,9 +46,9 @@ INSERT INTO addresses VALUES ('09058d36-2966-496a-aaf5-55c024404396', '15610 SW 117TH AVE', 'Miami', 'FL', '33177-1630', now(), now(), 'United States'); insert into transportation_offices - (id, name, gbloc, address_id, created_at, updated_at, provides_ppm_closeout) + (id, name, gbloc, address_id, latitude, longitude, created_at, updated_at, provides_ppm_closeout) values - ('4f10d0f5-6017-4de2-8cfb-ee9252e492d5', 'PPPO USAG Miami - USA', 'CLPK', '09058d36-2966-496a-aaf5-55c024404396', now(), now(), TRUE); + ('4f10d0f5-6017-4de2-8cfb-ee9252e492d5', 'PPPO USAG Miami - USA', 'CLPK', '09058d36-2966-496a-aaf5-55c024404396','25.59788','-80.40353', now(), now(), TRUE); insert into office_phone_lines (id, transportation_office_id, number, created_at, updated_at) From ba2652e9ac84f463d1e37fd7ca82dcf18b5fc652 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 7 Feb 2024 22:54:47 +0000 Subject: [PATCH 26/67] added test for office aoa packet download link --- .../ShipmentDisplay/ShipmentDisplay.test.jsx | 16 ++++++++++++++++ .../ShipmentDisplay/ShipmentDisplayTestData.js | 1 + 2 files changed, 17 insertions(+) diff --git a/src/components/Office/ShipmentDisplay/ShipmentDisplay.test.jsx b/src/components/Office/ShipmentDisplay/ShipmentDisplay.test.jsx index 68706587a72..718091f6c4b 100644 --- a/src/components/Office/ShipmentDisplay/ShipmentDisplay.test.jsx +++ b/src/components/Office/ShipmentDisplay/ShipmentDisplay.test.jsx @@ -204,6 +204,22 @@ describe('Shipment Container', () => { expect(screen.getByText('PPM')).toBeInTheDocument(); expect(screen.queryByRole('button', { name: 'Review documents' })).toBeInTheDocument(); }); + it('renders aoa packet link when approved', () => { + render( + + + , + ); + expect(screen.getByTestId('aoaPacketDownload')).toBeInTheDocument(); + }); describe("renders the 'packet ready for download' tag when", () => { it('approved', () => { render( diff --git a/src/components/Office/ShipmentDisplay/ShipmentDisplayTestData.js b/src/components/Office/ShipmentDisplay/ShipmentDisplayTestData.js index ba10fd3b66b..c88af77bfb6 100644 --- a/src/components/Office/ShipmentDisplay/ShipmentDisplayTestData.js +++ b/src/components/Office/ShipmentDisplay/ShipmentDisplayTestData.js @@ -159,6 +159,7 @@ export const ppmInfo = { shipmentId: 'b5c2d9a1-d1e6-485d-9678-8b62deb0d801', spouseProGearWeight: 498, status: 'SUBMITTED', + advanceStatus: 'APPROVED', submittedAt: '2022-04-29T21:48:21.573Z', updatedAt: '2022-04-29T21:48:21.581Z', }, From fb40d62b1d2780d0e4d2228460f415897c56e8dc Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 00:47:17 +0000 Subject: [PATCH 27/67] advance request links for customer, download still needs updating --- .../internal/payloads/model_to_payload.go | 1 + src/hooks/queries.js | 54 +++++++++ src/pages/MyMove/Home/index.jsx | 112 +++++++++++++++++- 3 files changed, 165 insertions(+), 2 deletions(-) diff --git a/pkg/handlers/internalapi/internal/payloads/model_to_payload.go b/pkg/handlers/internalapi/internal/payloads/model_to_payload.go index 464d36267e9..f0b5fd06ed3 100644 --- a/pkg/handlers/internalapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/internalapi/internal/payloads/model_to_payload.go @@ -104,6 +104,7 @@ func PPMShipment(storer storage.FileStorer, ppmShipment *models.PPMShipment) *in AdvanceAmountRequested: handlers.FmtCost(ppmShipment.AdvanceAmountRequested), HasReceivedAdvance: ppmShipment.HasReceivedAdvance, AdvanceAmountReceived: handlers.FmtCost(ppmShipment.AdvanceAmountReceived), + AdvanceStatus: (*internalmessages.PPMAdvanceStatus)(ppmShipment.AdvanceStatus), WeightTickets: WeightTickets(storer, ppmShipment.WeightTickets), MovingExpenses: MovingExpenses(storer, ppmShipment.MovingExpenses), ProGearWeightTickets: ProGearWeightTickets(storer, ppmShipment.ProgearWeightTickets), diff --git a/src/hooks/queries.js b/src/hooks/queries.js index 92aa2ad6dc0..c05e71f8985 100644 --- a/src/hooks/queries.js +++ b/src/hooks/queries.js @@ -428,6 +428,60 @@ export const useOrdersDocumentQueries = (moveCode) => { }; }; +export const useAOADocumentQueries = (moveCode) => { + // Get the ppm shipment info so we can get the aoa_packet_id (which is a document id) + + + + // const { data: move, ...moveQuery } = useQuery([MOVES, moveCode], ({ queryKey }) => getMove(...queryKey)); + + // const orderId = move?.ordersId; + + // // get orders + // const { data: { orders } = {}, ...orderQuery } = useQuery( + // [ORDERS, orderId], + // ({ queryKey }) => getOrder(...queryKey), + // { + // enabled: !!orderId, + // }, + // ); + + // const order = orders && orders[`${orderId}`]; + // // eslint-disable-next-line camelcase + // const documentId = order?.uploaded_order_id; + + // Get the AOA packet document + const staleTime = 15 * 60000; // 15 * 60000 milliseconds = 15 mins + const cacheTime = staleTime; + const { data: { documents, upload } = {}, ...aoaPacketDocumentQuery } = useQuery( + [ORDERS_DOCUMENTS, documentId], + ({ queryKey }) => getDocument(...queryKey), + { + enabled: !!documentId, + staleTime, + cacheTime, + refetchOnWindowFocus: false, + }, + ); + + // Check the status of all queries we have made + const { isLoading, isError, isSuccess } = getQueriesStatus([ + moveQuery, + orderQuery, + aoaPacketDocumentQuery, + ]); + + return { + move, + orders, + documents, + upload, + isLoading, + isError, + isSuccess, + }; +}; + export const useMovesQueueQueries = ({ sort, order, diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 293c1ce9db6..c16bb28fd76 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -141,6 +141,26 @@ export class Home extends Component { return mtoShipments?.filter((s) => s.shipmentType === SHIPMENT_OPTIONS.PPM)?.every((s) => isPPMShipmentComplete(s)); } + get hasAdvanceApproved() { + const { mtoShipments } = this.props; + // determine if at least one advance was APPROVED (advance_status in ppm_shipments table is not nil) + const appovedAdvances = mtoShipments.filter((shipment) => shipment?.ppmShipment?.advanceStatus === 'APPROVED'); + return !!appovedAdvances.length; + } + + get hasAllAdvancesRejected() { + // check to see if all advance_status are REJECTED + const { mtoShipments } = this.props; + const rejectedAdvances = mtoShipments.filter((shipment) => shipment?.ppmShipment?.advanceStatus === 'REJECTED'); + return !this.hasAdvanceApproved && rejectedAdvances.length > 0; + } + + get hasAdvanceRequested() { + const { mtoShipments } = this.props; + const requestedAdvances = mtoShipments.filter((shipment) => shipment?.ppmShipment?.hasRequestedAdvance); + return !!requestedAdvances.length; + } + get isMoveApproved() { const { move } = this.props; return move.status === MOVE_STATUSES.APPROVED; @@ -348,6 +368,17 @@ export class Home extends Component { window.print(); }; + // return a link to use to download the AOA packet + // getAOAPacketFileUrl = (moveCode) => { + // // TODO: B-18061 will change this to download the actual AOA packet to include the SSW + // // For now we just provide a link to download the order documents as a placeholder + // const { upload, amendedUpload, isLoading, isError } = useOrdersDocumentQueries(moveCode); + // if (isLoading) return ; + // if (isError) return ; + // const orderDocuments = Object.values(upload || {}).concat(Object.values(amendedUpload || {})); + // const sortedFiles = orderDocuments.sort((a, b) => moment(b.createdAt) - moment(a.createdAt)); + // }; + render() { const { isProfileComplete, move, mtoShipments, serviceMember, signedCertification, uploadedOrderDocuments } = this.props; @@ -384,7 +415,7 @@ export class Home extends Component { // eslint-disable-next-line camelcase const currentLocation = current_location; - + const shipmentNumbersByType = {}; return ( <> )} + {!!ppmShipments.length && this.hasSubmittedMove && this.hasAdvanceRequested && ( + + + {this.hasAdvanceApproved && ( + <> + + Your Advance Operating Allowance (AOA) request has been reviewed. Download the paperwork + for approved requests and submit it to your Finance Office to receive your advance. +
        +
        The amount you receive will be deducted from your PPM incentive payment. If your + incentive ends up being less than your advance, you will be required to pay back the + difference. +
        +
        +
        + {allSortedShipments.map((shipment) => { + const { shipmentType } = shipment; + if (shipmentNumbersByType[shipmentType]) { + shipmentNumbersByType[shipmentType] += 1; + } else { + shipmentNumbersByType[shipmentType] = 1; + } + const shipmentNumber = shipmentNumbersByType[shipmentType]; + return ( + <> + + {shipmentTypes[shipment.shipmentType]} + {` ${shipmentNumber} `} + + {shipment?.ppmShipment?.advanceStatus === 'APPROVED' && ( + //

        + // + // Download AOA Paperwork (PDF) + // + //

        + Advance request approved + )} + {shipment?.ppmShipment?.advanceStatus === 'REJECTED' && ( + Advance request denied + )} + + ); + })} + + )} + {this.hasAllAdvancesRejected && ( + + Your Advance Operating Allowance (AOA) request has been denied. You may be able to use your + Government Travel Charge Card (GTCC). Contact your local transportation office to verify + GTCC usage authorization or ask any questions. + + )} + {!this.hasAdvanceApproved && !this.hasAllAdvancesRejected && ( + + Your service will review your request for an Advance Operating Allowance (AOA). If approved, + you will be able to download the paperwork for your request and submit it to your Finance + Office to receive your advance. +
        +
        The amount you receive will be deducted from your PPM incentive payment. If your + incentive ends up being less than your advance, you will be required to pay back the + difference. +
        + )} +
        +
        + )} {!!ppmShipments.length && this.hasSubmittedMove && ( - + )} From ccc5bd8365fb7da4ef433493d3a7c2fd6c9714da Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 00:54:13 +0000 Subject: [PATCH 28/67] updates to retrieve aoa_packet_id from ppm_shipment --- .../internal/payloads/model_to_payload.go | 1 + src/hooks/queries.js | 41 ++++--------------- src/pages/MyMove/Home/index.jsx | 30 ++++++-------- swagger-def/definitions/PPMShipment.yaml | 4 ++ 4 files changed, 24 insertions(+), 52 deletions(-) diff --git a/pkg/handlers/internalapi/internal/payloads/model_to_payload.go b/pkg/handlers/internalapi/internal/payloads/model_to_payload.go index f0b5fd06ed3..a0e43b074d5 100644 --- a/pkg/handlers/internalapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/internalapi/internal/payloads/model_to_payload.go @@ -105,6 +105,7 @@ func PPMShipment(storer storage.FileStorer, ppmShipment *models.PPMShipment) *in HasReceivedAdvance: ppmShipment.HasReceivedAdvance, AdvanceAmountReceived: handlers.FmtCost(ppmShipment.AdvanceAmountReceived), AdvanceStatus: (*internalmessages.PPMAdvanceStatus)(ppmShipment.AdvanceStatus), + AoaPacketID: *handlers.FmtUUID(*ppmShipment.AOAPacketID), WeightTickets: WeightTickets(storer, ppmShipment.WeightTickets), MovingExpenses: MovingExpenses(storer, ppmShipment.MovingExpenses), ProGearWeightTickets: ProGearWeightTickets(storer, ppmShipment.ProgearWeightTickets), diff --git a/src/hooks/queries.js b/src/hooks/queries.js index c05e71f8985..80d7a05e984 100644 --- a/src/hooks/queries.js +++ b/src/hooks/queries.js @@ -428,36 +428,15 @@ export const useOrdersDocumentQueries = (moveCode) => { }; }; -export const useAOADocumentQueries = (moveCode) => { - // Get the ppm shipment info so we can get the aoa_packet_id (which is a document id) - - - - // const { data: move, ...moveQuery } = useQuery([MOVES, moveCode], ({ queryKey }) => getMove(...queryKey)); - - // const orderId = move?.ordersId; - - // // get orders - // const { data: { orders } = {}, ...orderQuery } = useQuery( - // [ORDERS, orderId], - // ({ queryKey }) => getOrder(...queryKey), - // { - // enabled: !!orderId, - // }, - // ); - - // const order = orders && orders[`${orderId}`]; - // // eslint-disable-next-line camelcase - // const documentId = order?.uploaded_order_id; - - // Get the AOA packet document +export const useAOAPacketDocumentQueries = (aoaPacketId) => { + // Get the packet using the aoa_packet_id (which is a document id) const staleTime = 15 * 60000; // 15 * 60000 milliseconds = 15 mins const cacheTime = staleTime; - const { data: { documents, upload } = {}, ...aoaPacketDocumentQuery } = useQuery( - [ORDERS_DOCUMENTS, documentId], + const { data: { documents, aoaPacket } = {}, ...aoaPacketDocumentQuery } = useQuery( + [ORDERS_DOCUMENTS, aoaPacketId], ({ queryKey }) => getDocument(...queryKey), { - enabled: !!documentId, + enabled: !!aoaPacketId, staleTime, cacheTime, refetchOnWindowFocus: false, @@ -465,17 +444,11 @@ export const useAOADocumentQueries = (moveCode) => { ); // Check the status of all queries we have made - const { isLoading, isError, isSuccess } = getQueriesStatus([ - moveQuery, - orderQuery, - aoaPacketDocumentQuery, - ]); + const { isLoading, isError, isSuccess } = getQueriesStatus([aoaPacketDocumentQuery]); return { - move, - orders, documents, - upload, + aoaPacket, isLoading, isError, isSuccess, diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index c16bb28fd76..8875654370b 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -38,6 +38,7 @@ import { selectSignedCertification, } from 'shared/Entities/modules/signed_certifications'; import LoadingPlaceholder from 'shared/LoadingPlaceholder'; +import SomethingWentWrong from 'shared/SomethingWentWrong'; import { updateMTOShipments } from 'store/entities/actions'; import { selectCurrentMove, @@ -52,6 +53,7 @@ import { MoveShape, OrdersShape, UploadShape } from 'types/customerShapes'; import { ShipmentShape } from 'types/shipment'; import { formatCustomerDate, formatWeight } from 'utils/formatters'; import { isPPMAboutInfoComplete, isPPMShipmentComplete, isWeightTicketComplete } from 'utils/shipments'; +import { useAOAPacketDocumentQueries } from 'hooks/queries'; import withRouter from 'utils/routing'; import { RouterShape } from 'types/router'; @@ -368,17 +370,6 @@ export class Home extends Component { window.print(); }; - // return a link to use to download the AOA packet - // getAOAPacketFileUrl = (moveCode) => { - // // TODO: B-18061 will change this to download the actual AOA packet to include the SSW - // // For now we just provide a link to download the order documents as a placeholder - // const { upload, amendedUpload, isLoading, isError } = useOrdersDocumentQueries(moveCode); - // if (isLoading) return ; - // if (isError) return ; - // const orderDocuments = Object.values(upload || {}).concat(Object.values(amendedUpload || {})); - // const sortedFiles = orderDocuments.sort((a, b) => moment(b.createdAt) - moment(a.createdAt)); - // }; - render() { const { isProfileComplete, move, mtoShipments, serviceMember, signedCertification, uploadedOrderDocuments } = this.props; @@ -416,6 +407,7 @@ export class Home extends Component { // eslint-disable-next-line camelcase const currentLocation = current_location; const shipmentNumbersByType = {}; + return ( <>
        - {allSortedShipments.map((shipment) => { + {ppmShipments.map((shipment) => { const { shipmentType } = shipment; if (shipmentNumbersByType[shipmentType]) { shipmentNumbersByType[shipmentType] += 1; } else { shipmentNumbersByType[shipmentType] = 1; } + // if(shipment?.ppmShipment?.advanceStatus === 'APPROVED') { + // aoaPacketNumber += 1; + // } const shipmentNumber = shipmentNumbersByType[shipmentType]; return ( <> @@ -603,12 +598,11 @@ export class Home extends Component { {` ${shipmentNumber} `} {shipment?.ppmShipment?.advanceStatus === 'APPROVED' && ( - //

        - // - // Download AOA Paperwork (PDF) - // - //

        - Advance request approved +

        + + Download AOA Paperwork (PDF) NEED AOA PACKET URL HERE + +

        )} {shipment?.ppmShipment?.advanceStatus === 'REJECTED' && ( Advance request denied diff --git a/swagger-def/definitions/PPMShipment.yaml b/swagger-def/definitions/PPMShipment.yaml index 93a18901a71..117a3d6ed53 100644 --- a/swagger-def/definitions/PPMShipment.yaml +++ b/swagger-def/definitions/PPMShipment.yaml @@ -225,6 +225,10 @@ properties: description: A hash unique to this shipment that should be used as the "If-Match" header for any updates. type: string readOnly: true + aoa_packet_id: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 required: - id - shipmentId From 04b7f3c0d06ac3af8ffff3ce29b6aba24c4e0472 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 00:54:50 +0000 Subject: [PATCH 29/67] blank download link --- src/pages/MyMove/Home/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 8875654370b..1c6203cdb90 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -599,8 +599,8 @@ export class Home extends Component { {shipment?.ppmShipment?.advanceStatus === 'APPROVED' && (

        - - Download AOA Paperwork (PDF) NEED AOA PACKET URL HERE + + Download AOA Paperwork (PDF)

        )} From 6f6168b93bc2223940cc9206bf4f13e60bc121f6 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 00:55:17 +0000 Subject: [PATCH 30/67] code cleanup --- src/hooks/queries.js | 27 --------------------------- src/pages/MyMove/Home/index.jsx | 5 ----- 2 files changed, 32 deletions(-) diff --git a/src/hooks/queries.js b/src/hooks/queries.js index 80d7a05e984..92aa2ad6dc0 100644 --- a/src/hooks/queries.js +++ b/src/hooks/queries.js @@ -428,33 +428,6 @@ export const useOrdersDocumentQueries = (moveCode) => { }; }; -export const useAOAPacketDocumentQueries = (aoaPacketId) => { - // Get the packet using the aoa_packet_id (which is a document id) - const staleTime = 15 * 60000; // 15 * 60000 milliseconds = 15 mins - const cacheTime = staleTime; - const { data: { documents, aoaPacket } = {}, ...aoaPacketDocumentQuery } = useQuery( - [ORDERS_DOCUMENTS, aoaPacketId], - ({ queryKey }) => getDocument(...queryKey), - { - enabled: !!aoaPacketId, - staleTime, - cacheTime, - refetchOnWindowFocus: false, - }, - ); - - // Check the status of all queries we have made - const { isLoading, isError, isSuccess } = getQueriesStatus([aoaPacketDocumentQuery]); - - return { - documents, - aoaPacket, - isLoading, - isError, - isSuccess, - }; -}; - export const useMovesQueueQueries = ({ sort, order, diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 1c6203cdb90..60f54328d21 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -38,7 +38,6 @@ import { selectSignedCertification, } from 'shared/Entities/modules/signed_certifications'; import LoadingPlaceholder from 'shared/LoadingPlaceholder'; -import SomethingWentWrong from 'shared/SomethingWentWrong'; import { updateMTOShipments } from 'store/entities/actions'; import { selectCurrentMove, @@ -53,7 +52,6 @@ import { MoveShape, OrdersShape, UploadShape } from 'types/customerShapes'; import { ShipmentShape } from 'types/shipment'; import { formatCustomerDate, formatWeight } from 'utils/formatters'; import { isPPMAboutInfoComplete, isPPMShipmentComplete, isWeightTicketComplete } from 'utils/shipments'; -import { useAOAPacketDocumentQueries } from 'hooks/queries'; import withRouter from 'utils/routing'; import { RouterShape } from 'types/router'; @@ -587,9 +585,6 @@ export class Home extends Component { } else { shipmentNumbersByType[shipmentType] = 1; } - // if(shipment?.ppmShipment?.advanceStatus === 'APPROVED') { - // aoaPacketNumber += 1; - // } const shipmentNumber = shipmentNumbersByType[shipmentType]; return ( <> From 2249c7e63936da6d561a52d837ea767cf0ceea45 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 00:58:36 +0000 Subject: [PATCH 31/67] added tests for advance request --- .../internal/payloads/model_to_payload.go | 1 - src/pages/MyMove/Home/index.jsx | 3 +- src/pages/MyMove/Home/index.test.jsx | 103 +++++++++++++++++- swagger-def/definitions/PPMShipment.yaml | 4 - 4 files changed, 100 insertions(+), 11 deletions(-) diff --git a/pkg/handlers/internalapi/internal/payloads/model_to_payload.go b/pkg/handlers/internalapi/internal/payloads/model_to_payload.go index a0e43b074d5..f0b5fd06ed3 100644 --- a/pkg/handlers/internalapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/internalapi/internal/payloads/model_to_payload.go @@ -105,7 +105,6 @@ func PPMShipment(storer storage.FileStorer, ppmShipment *models.PPMShipment) *in HasReceivedAdvance: ppmShipment.HasReceivedAdvance, AdvanceAmountReceived: handlers.FmtCost(ppmShipment.AdvanceAmountReceived), AdvanceStatus: (*internalmessages.PPMAdvanceStatus)(ppmShipment.AdvanceStatus), - AoaPacketID: *handlers.FmtUUID(*ppmShipment.AOAPacketID), WeightTickets: WeightTickets(storer, ppmShipment.WeightTickets), MovingExpenses: MovingExpenses(storer, ppmShipment.MovingExpenses), ProGearWeightTickets: ProGearWeightTickets(storer, ppmShipment.ProgearWeightTickets), diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 60f54328d21..09cfff0e623 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -593,8 +593,9 @@ export class Home extends Component { {` ${shipmentNumber} `} {shipment?.ppmShipment?.advanceStatus === 'APPROVED' && ( + // TODO: B-18060 will add link to method that will create the AOA packet and return for download

        - + Download AOA Paperwork (PDF)

        diff --git a/src/pages/MyMove/Home/index.test.jsx b/src/pages/MyMove/Home/index.test.jsx index 1201d8d6c3d..f46d7a221b6 100644 --- a/src/pages/MyMove/Home/index.test.jsx +++ b/src/pages/MyMove/Home/index.test.jsx @@ -194,6 +194,40 @@ const ppmShipmentWithCompleteWeightTicket = { }, }; +const approvedAdvancePPMShipment = { + ...incompletePPMShipment, + ppmShipment: { + ...incompletePPMShipment.ppmShipment, + sitExpected: false, + estimatedWeight: 4000, + hasProGear: false, + estimatedIncentive: 10000000, + hasRequestedAdvance: true, + advanceAmountRequested: 30000, + advanceStatus: 'APPROVED', + status: ppmShipmentStatuses.SUBMITTED, + updatedAt: ppmShipmentUpdatedDate.toISOString(), + eTag: window.btoa(ppmShipmentUpdatedDate.toISOString()), + }, +}; + +const rejectedAdvancePPMShipment = { + ...incompletePPMShipment, + ppmShipment: { + ...incompletePPMShipment.ppmShipment, + sitExpected: false, + estimatedWeight: 4000, + hasProGear: false, + estimatedIncentive: 10000000, + hasRequestedAdvance: true, + advanceAmountRequested: 30000, + advanceStatus: 'REJECTED', + status: ppmShipmentStatuses.SUBMITTED, + updatedAt: ppmShipmentUpdatedDate.toISOString(), + eTag: window.btoa(ppmShipmentUpdatedDate.toISOString()), + }, +}; + const mountHomeWithProviders = (props = {}) => { return mount( @@ -493,7 +527,7 @@ describe('Home component', () => { const mtoShipments = [submittedPPMShipment]; const wrapper = mountHomeWithProviders({ ...propUpdates, mtoShipments }); - + const props = { ...defaultProps, ...propUpdates, mtoShipments }; it('renders the SubmittedMove helper', () => { @@ -510,7 +544,7 @@ describe('Home component', () => { expect(ordersStep.prop('editBtnLabel')).toEqual('Upload documents'); }); - it('renders Step 5', () => { + it('renders Manage your PPM Step', () => { render(); expect(screen.getByText('Manage your PPM')).toBeInTheDocument(); }); @@ -521,6 +555,65 @@ describe('Home component', () => { }); }); + describe('for advance request approved PPM', () => { + it('renders advance request submitted for PPM', () => { + const mtoShipments = [submittedPPMShipment]; + const props = { ...defaultProps, ...propUpdates, mtoShipments }; + render(); + expect(screen.getByText('Advance request submitted')).toBeInTheDocument(); + }); + + it('renders advance request submitted for PPM', () => { + const mtoShipments = [approvedAdvancePPMShipment]; + const props = { ...defaultProps, ...propUpdates, mtoShipments }; + render(); + expect(screen.getByText('Download AOA Paperwork (PDF)')).toBeInTheDocument(); + }); + + it('renders advance request reviewed with 1 approved PPM', () => { + const mtoShipments = [approvedAdvancePPMShipment]; + const wrapper = mountHomeWithProviders({...propUpdates, mtoShipments }); + const advanceStep = wrapper.find('Step[step="5"]'); + expect(advanceStep.prop('completedHeaderText')).toEqual('Advance request reviewed'); + + const props = { ...defaultProps, ...propUpdates, mtoShipments }; + render(); + expect(screen.getByText('Download AOA Paperwork (PDF)')).toBeInTheDocument(); + }); + + it('renders advance request reviewed for approved advance for PPM with HHG', () => { + const mtoShipments = [{ id: v4(), shipmentType: SHIPMENT_OPTIONS.HHG }, approvedAdvancePPMShipment]; + const wrapper = mountHomeWithProviders({...propUpdates, mtoShipments }); + const advanceStep = wrapper.find('Step[step="5"]'); + expect(advanceStep.prop('completedHeaderText')).toEqual('Advance request reviewed'); + + const props = { ...defaultProps, ...propUpdates, mtoShipments }; + render(); + expect(screen.getByText('Download AOA Paperwork (PDF)')).toBeInTheDocument(); + }); + + it('renders advance request reviewed with 1 approved and 1 rejected advance', () => { + const mtoShipments = [approvedAdvancePPMShipment, rejectedAdvancePPMShipment]; + const wrapper = mountHomeWithProviders({ ...propUpdates, mtoShipments }); + const advanceStep = wrapper.find('Step[step="5"]'); + + expect(advanceStep.prop('completedHeaderText')).toEqual('Advance request reviewed'); + + const props = { ...defaultProps, ...propUpdates, mtoShipments }; + render(); + expect(screen.getByText('Download AOA Paperwork (PDF)')).toBeInTheDocument(); + expect(screen.getByText('Advance request denied')).toBeInTheDocument(); + }); + + it('renders advance request denied for PPM', () => { + const mtoShipments = [rejectedAdvancePPMShipment]; + const wrapper = mountHomeWithProviders({ ...propUpdates, mtoShipments }); + const advanceStep = wrapper.find('Step[step="5"]'); + + expect(advanceStep.prop('completedHeaderText')).toEqual('Advance request denied'); + }); + }); + describe('for HHG moves (no PPM)', () => { const mtoShipments = [{ id: v4(), shipmentType: SHIPMENT_OPTIONS.HHG }]; @@ -542,7 +635,7 @@ describe('Home component', () => { expect(ordersStep.prop('editBtnLabel')).toEqual('Upload documents'); }); - it('does not render Step 5', () => { + it('does not render Manage your PPM Step', () => { render(); expect(screen.queryByText('Manage your PPM')).not.toBeInTheDocument(); }); @@ -574,7 +667,7 @@ describe('Home component', () => { expect(ordersStep.prop('editBtnLabel')).toEqual('Upload documents'); }); - it('does not render Step 5', () => { + it('does not render Manage your PPM Step', () => { render(); expect(screen.queryByText('Manage your PPM')).not.toBeInTheDocument(); }); @@ -618,7 +711,7 @@ describe('Home component', () => { expect(ordersStep.prop('editBtnLabel')).toEqual('Upload documents'); }); - it('renders Step 5', () => { + it('renders Manage your PPM Step', () => { render(); expect(screen.getByText('Manage your PPM')).toBeInTheDocument(); }); diff --git a/swagger-def/definitions/PPMShipment.yaml b/swagger-def/definitions/PPMShipment.yaml index 117a3d6ed53..93a18901a71 100644 --- a/swagger-def/definitions/PPMShipment.yaml +++ b/swagger-def/definitions/PPMShipment.yaml @@ -225,10 +225,6 @@ properties: description: A hash unique to this shipment that should be used as the "If-Match" header for any updates. type: string readOnly: true - aoa_packet_id: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 required: - id - shipmentId From df4b6250fbdc6081d49e4a28766cacd1a5107621 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 00:59:12 +0000 Subject: [PATCH 32/67] lint cleanup --- src/pages/MyMove/Home/index.test.jsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/MyMove/Home/index.test.jsx b/src/pages/MyMove/Home/index.test.jsx index f46d7a221b6..10faf81d6b1 100644 --- a/src/pages/MyMove/Home/index.test.jsx +++ b/src/pages/MyMove/Home/index.test.jsx @@ -527,7 +527,7 @@ describe('Home component', () => { const mtoShipments = [submittedPPMShipment]; const wrapper = mountHomeWithProviders({ ...propUpdates, mtoShipments }); - + const props = { ...defaultProps, ...propUpdates, mtoShipments }; it('renders the SubmittedMove helper', () => { @@ -565,29 +565,29 @@ describe('Home component', () => { it('renders advance request submitted for PPM', () => { const mtoShipments = [approvedAdvancePPMShipment]; - const props = { ...defaultProps, ...propUpdates, mtoShipments }; + const props = { ...defaultProps, ...propUpdates, mtoShipments }; render(); expect(screen.getByText('Download AOA Paperwork (PDF)')).toBeInTheDocument(); }); it('renders advance request reviewed with 1 approved PPM', () => { const mtoShipments = [approvedAdvancePPMShipment]; - const wrapper = mountHomeWithProviders({...propUpdates, mtoShipments }); + const wrapper = mountHomeWithProviders({ ...propUpdates, mtoShipments }); const advanceStep = wrapper.find('Step[step="5"]'); expect(advanceStep.prop('completedHeaderText')).toEqual('Advance request reviewed'); - - const props = { ...defaultProps, ...propUpdates, mtoShipments }; + + const props = { ...defaultProps, ...propUpdates, mtoShipments }; render(); expect(screen.getByText('Download AOA Paperwork (PDF)')).toBeInTheDocument(); }); it('renders advance request reviewed for approved advance for PPM with HHG', () => { const mtoShipments = [{ id: v4(), shipmentType: SHIPMENT_OPTIONS.HHG }, approvedAdvancePPMShipment]; - const wrapper = mountHomeWithProviders({...propUpdates, mtoShipments }); + const wrapper = mountHomeWithProviders({ ...propUpdates, mtoShipments }); const advanceStep = wrapper.find('Step[step="5"]'); expect(advanceStep.prop('completedHeaderText')).toEqual('Advance request reviewed'); - - const props = { ...defaultProps, ...propUpdates, mtoShipments }; + + const props = { ...defaultProps, ...propUpdates, mtoShipments }; render(); expect(screen.getByText('Download AOA Paperwork (PDF)')).toBeInTheDocument(); }); @@ -599,7 +599,7 @@ describe('Home component', () => { expect(advanceStep.prop('completedHeaderText')).toEqual('Advance request reviewed'); - const props = { ...defaultProps, ...propUpdates, mtoShipments }; + const props = { ...defaultProps, ...propUpdates, mtoShipments }; render(); expect(screen.getByText('Download AOA Paperwork (PDF)')).toBeInTheDocument(); expect(screen.getByText('Advance request denied')).toBeInTheDocument(); From 83401e9d526c6ed0e80df82a0b3770e85408d4b4 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 00:59:40 +0000 Subject: [PATCH 33/67] updated playwright test for 6 steps --- .../tests/my/milmove/ppms/customerPpmTestFixture.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js b/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js index 35f5d59400c..9763b57cf1f 100644 --- a/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js +++ b/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js @@ -5,6 +5,7 @@ */ // @ts-check +import { isNil } from 'lodash'; import { expect, test as customerTest, @@ -908,7 +909,12 @@ export class CustomerPpmPage extends CustomerPage { await expect(this.page.locator('.usa-alert--success')).toContainText('You submitted documentation for review.'); - const stepContainer = this.page.locator('[data-testid="stepContainer5"]'); + const stepContainer = this.page.locator('[data-testid="stepContainer6"]'); + + if (stepContainer == null) { + this.page.locator('[data-testid="stepContainer5"]'); + } + await expect(stepContainer.getByRole('button', { name: 'Download Incentive Packet' })).toBeDisabled(); await expect(stepContainer.getByText(/PPM documentation submitted: \d{2} \w{3} \d{4}/)).toBeVisible(); } From ceace22bae9a1cd56a143814c1973af5d70bc593 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 01:00:01 +0000 Subject: [PATCH 34/67] added Pending label --- src/pages/MyMove/Home/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 09cfff0e623..4c6bc90bce9 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -603,6 +603,7 @@ export class Home extends Component { {shipment?.ppmShipment?.advanceStatus === 'REJECTED' && ( Advance request denied )} + {shipment?.ppmShipment?.advanceStatus == null && Pending} ); })} From 597391f6542dce82757c749315d0c3fd0ad66101 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 01:00:22 +0000 Subject: [PATCH 35/67] unused import --- playwright/tests/my/milmove/ppms/customerPpmTestFixture.js | 1 - 1 file changed, 1 deletion(-) diff --git a/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js b/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js index 9763b57cf1f..80cdce0cf26 100644 --- a/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js +++ b/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js @@ -5,7 +5,6 @@ */ // @ts-check -import { isNil } from 'lodash'; import { expect, test as customerTest, From 122ca0278f591d904107671c5a42b9d11232590c Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 17:32:23 +0000 Subject: [PATCH 36/67] changed Pending to Advance request pending --- src/pages/MyMove/Home/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 4c6bc90bce9..c524ee1a930 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -603,7 +603,7 @@ export class Home extends Component { {shipment?.ppmShipment?.advanceStatus === 'REJECTED' && ( Advance request denied )} - {shipment?.ppmShipment?.advanceStatus == null && Pending} + {shipment?.ppmShipment?.advanceStatus == null && Advance request pending} ); })} From a0e9c4c35b940f9eb067fd043dea9645e129765c Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 31 Jan 2024 17:56:38 +0000 Subject: [PATCH 37/67] fixed formatting error --- src/pages/MyMove/Home/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index c524ee1a930..8ca71328708 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -603,7 +603,9 @@ export class Home extends Component { {shipment?.ppmShipment?.advanceStatus === 'REJECTED' && ( Advance request denied )} - {shipment?.ppmShipment?.advanceStatus == null && Advance request pending} + {shipment?.ppmShipment?.advanceStatus == null && ( + Advance request pending + )} ); })} From a6194988524571799a529c47c994c1991057954b Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Fri, 2 Feb 2024 17:43:41 +0000 Subject: [PATCH 38/67] use ADVANCE_STATUSES enum --- src/pages/MyMove/Home/index.jsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 8ca71328708..f89ab76078a 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -54,6 +54,7 @@ import { formatCustomerDate, formatWeight } from 'utils/formatters'; import { isPPMAboutInfoComplete, isPPMShipmentComplete, isWeightTicketComplete } from 'utils/shipments'; import withRouter from 'utils/routing'; import { RouterShape } from 'types/router'; +import { ADVANCE_STATUSES } from 'constants/ppms'; const Description = ({ className, children, dataTestId }) => (

        @@ -144,14 +145,18 @@ export class Home extends Component { get hasAdvanceApproved() { const { mtoShipments } = this.props; // determine if at least one advance was APPROVED (advance_status in ppm_shipments table is not nil) - const appovedAdvances = mtoShipments.filter((shipment) => shipment?.ppmShipment?.advanceStatus === 'APPROVED'); + const appovedAdvances = mtoShipments.filter( + (shipment) => shipment?.ppmShipment?.advanceStatus === ADVANCE_STATUSES.APPROVED.apiValue, + ); return !!appovedAdvances.length; } get hasAllAdvancesRejected() { // check to see if all advance_status are REJECTED const { mtoShipments } = this.props; - const rejectedAdvances = mtoShipments.filter((shipment) => shipment?.ppmShipment?.advanceStatus === 'REJECTED'); + const rejectedAdvances = mtoShipments.filter( + (shipment) => shipment?.ppmShipment?.advanceStatus === ADVANCE_STATUSES.REJECTED.apiValue, + ); return !this.hasAdvanceApproved && rejectedAdvances.length > 0; } @@ -592,7 +597,7 @@ export class Home extends Component { {shipmentTypes[shipment.shipmentType]} {` ${shipmentNumber} `} - {shipment?.ppmShipment?.advanceStatus === 'APPROVED' && ( + {shipment?.ppmShipment?.advanceStatus === ADVANCE_STATUSES.APPROVED.apiValue && ( // TODO: B-18060 will add link to method that will create the AOA packet and return for download

        @@ -600,7 +605,7 @@ export class Home extends Component {

        )} - {shipment?.ppmShipment?.advanceStatus === 'REJECTED' && ( + {shipment?.ppmShipment?.advanceStatus === ADVANCE_STATUSES.REJECTED.apiValue && ( Advance request denied )} {shipment?.ppmShipment?.advanceStatus == null && ( From bc3061598dedf7db0ad42ece38d49aa561870c2b Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 14 Feb 2024 19:45:42 +0000 Subject: [PATCH 39/67] Fixed EOF missing line break. --- pkg/notifications/prime_counseling_complete.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/notifications/prime_counseling_complete.go b/pkg/notifications/prime_counseling_complete.go index 562735fb982..97f7b3e82d9 100644 --- a/pkg/notifications/prime_counseling_complete.go +++ b/pkg/notifications/prime_counseling_complete.go @@ -129,4 +129,4 @@ func (p PrimeCounselingComplete) RenderText(appCtx appcontext.AppContext, data P return "", err } return textBuffer.String(), nil -} \ No newline at end of file +} From 212e73e2be7c8e866d2ba520d19e7aa32562833e Mon Sep 17 00:00:00 2001 From: Michael Inthavongsay Date: Wed, 14 Feb 2024 20:15:00 +0000 Subject: [PATCH 40/67] enhance error message to use message from response. This is a compromise because cannot hide button. Hiding will require schema change on GET response. --- .../PrimeUI/MoveTaskOrder/MoveDetails.jsx | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx b/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx index b12a86f38e1..44b2826375c 100644 --- a/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx +++ b/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx @@ -95,22 +95,25 @@ const MoveDetails = ({ setFlashMessage }) => { }, onError: (error) => { const { response: { body } = {} } = error; - if (body) { setErrorMessage({ title: `Prime API: ${body.title} `, detail: `${body.detail}`, }); - } else if (error.response.status === 422) { - setErrorMessage({ - title: 'Unprocessable Entity Error: ', - detail: `There are no ${documentTypeKey} for this move to download.`, - }); } else { - setErrorMessage({ - title: 'Unexpected error: ', - detail: 'Please check the move order document user uploads for this move.', - }); + // Error message is coming in as byte array(PDF). + // Need to convert byte array into text/json. + (async () => { + let title = 'Unexpected Error: '; + if (error.response.status === 422) { + title = 'Unprocessable Entity Error: '; + } + const text = await error.response.data.text(); + setErrorMessage({ + title, + detail: JSON.parse(text).detail, + }); + })(); } }, }); From df30c652d10566e72575d68a32ac3d04ef175982 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Tue, 13 Feb 2024 20:18:49 +0000 Subject: [PATCH 41/67] fixed playwright tests with upload PPM tests --- .../my/milmove/ppms/customerPpmTestFixture.js | 4 ++-- .../ppms/entireShipmentOnboarding.spec.js | 17 +++++++++++------ .../milmove/ppms/navigateToUploadDocs.spec.js | 11 ++++++++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js b/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js index 80cdce0cf26..1ab2ec588e3 100644 --- a/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js +++ b/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js @@ -908,10 +908,10 @@ export class CustomerPpmPage extends CustomerPage { await expect(this.page.locator('.usa-alert--success')).toContainText('You submitted documentation for review.'); - const stepContainer = this.page.locator('[data-testid="stepContainer6"]'); + var stepContainer = this.page.locator('[data-testid="stepContainer6"]'); if (stepContainer == null) { - this.page.locator('[data-testid="stepContainer5"]'); + stepContainer = this.page.locator('[data-testid="stepContainer5"]'); } await expect(stepContainer.getByRole('button', { name: 'Download Incentive Packet' })).toBeDisabled(); diff --git a/playwright/tests/my/milmove/ppms/entireShipmentOnboarding.spec.js b/playwright/tests/my/milmove/ppms/entireShipmentOnboarding.spec.js index d330106d3c7..ea57a703ae2 100644 --- a/playwright/tests/my/milmove/ppms/entireShipmentOnboarding.spec.js +++ b/playwright/tests/my/milmove/ppms/entireShipmentOnboarding.spec.js @@ -45,11 +45,16 @@ class CustomerPpmOnboardingPage extends CustomerPpmPage { /** */ - async verifyStep5ExistsAndBtnIsDisabled() { - const stepContainer5 = this.page.locator('[data-testid="stepContainer5"]'); - await expect(stepContainer5.getByRole('button', { name: 'Upload PPM Documents' })).toBeDisabled(); + async verifyManagePPMStepExistsAndBtnIsDisabled() { + const stepContainer = this.page.locator('[data-testid="stepContainer6"]'); + + if (stepContainer == null) { + this.page.locator('[data-testid="stepContainer5"]'); + } + + await expect(stepContainer.getByRole('button', { name: 'Upload PPM Documents' })).toBeDisabled(); await expect( - stepContainer5.locator('p').getByText('After a counselor approves your PPM, you will be able to:'), + stepContainer.locator('p').getByText('After a counselor approves your PPM, you will be able to:'), ).toBeVisible(); } @@ -119,7 +124,7 @@ test.describe('Entire PPM onboarding flow', () => { await customerPpmOnboardingPage.submitsAdvancePage({ addAdvance: true, isMobile }); await customerPpmOnboardingPage.navigateToAgreementAndSign(); await customerPpmOnboardingPage.submitMove(); - await customerPpmOnboardingPage.verifyStep5ExistsAndBtnIsDisabled(); + await customerPpmOnboardingPage.verifyManagePPMStepExistsAndBtnIsDisabled(); }); test('happy path with edits and backs', async () => { @@ -138,7 +143,7 @@ test.describe('Entire PPM onboarding flow', () => { await customerPpmOnboardingPage.navigateToAgreementAndSign(); await customerPpmOnboardingPage.submitMove(); - await customerPpmOnboardingPage.verifyStep5ExistsAndBtnIsDisabled(); + await customerPpmOnboardingPage.verifyManagePPMStepExistsAndBtnIsDisabled(); }); }); }); diff --git a/playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js b/playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js index bc12f20a022..d46a68a0db9 100644 --- a/playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js +++ b/playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js @@ -16,9 +16,14 @@ test.describe('PPM Request Payment - Begin providing documents flow', () => { test('has upload documents button enabled', async ({ page }) => { await expect(page.getByRole('heading', { name: 'Your move is in progress.' })).toBeVisible(); - const stepContainer5 = page.getByTestId('stepContainer5'); - await expect(stepContainer5.locator('p').getByText('15 Apr 2022')).toBeVisible(); - await stepContainer5.getByRole('button', { name: 'Upload PPM Documents' }).click(); + var stepContainer = page.getByTestId('stepContainer6'); + + if (stepContainer == null) { + stepContainer = page.getByTestId('stepContainer5'); + } + + await expect(stepContainer.locator('p').getByText('15 Apr 2022')).toBeVisible(); + await stepContainer.getByRole('button', { name: 'Upload PPM Documents' }).click(); await expect(page).toHaveURL(/\/moves\/[^/]+\/shipments\/[^/]+\/about/); }); }); From b757cb3d7f7b95b1b41042c7351c45115081c859 Mon Sep 17 00:00:00 2001 From: Ricky Mettler Date: Wed, 14 Feb 2024 22:23:31 +0000 Subject: [PATCH 42/67] change var to let --- playwright/tests/my/milmove/ppms/customerPpmTestFixture.js | 2 +- playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js b/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js index 1ab2ec588e3..392ea75d374 100644 --- a/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js +++ b/playwright/tests/my/milmove/ppms/customerPpmTestFixture.js @@ -908,7 +908,7 @@ export class CustomerPpmPage extends CustomerPage { await expect(this.page.locator('.usa-alert--success')).toContainText('You submitted documentation for review.'); - var stepContainer = this.page.locator('[data-testid="stepContainer6"]'); + let stepContainer = this.page.locator('[data-testid="stepContainer6"]'); if (stepContainer == null) { stepContainer = this.page.locator('[data-testid="stepContainer5"]'); diff --git a/playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js b/playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js index d46a68a0db9..a40b8dfe36d 100644 --- a/playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js +++ b/playwright/tests/my/milmove/ppms/navigateToUploadDocs.spec.js @@ -16,7 +16,7 @@ test.describe('PPM Request Payment - Begin providing documents flow', () => { test('has upload documents button enabled', async ({ page }) => { await expect(page.getByRole('heading', { name: 'Your move is in progress.' })).toBeVisible(); - var stepContainer = page.getByTestId('stepContainer6'); + let stepContainer = page.getByTestId('stepContainer6'); if (stepContainer == null) { stepContainer = page.getByTestId('stepContainer5'); From b8e0a6b42a175125835bd80a313a04478b5a2d50 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 16 Feb 2024 16:16:30 +0000 Subject: [PATCH 43/67] B-18560 --- ...47_updateTransportationOfficesGbloc.up.sql | 71 ++++++++++++++++++- pkg/services/order/order_fetcher.go | 2 +- 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/migrations/app/schema/20240214213247_updateTransportationOfficesGbloc.up.sql b/migrations/app/schema/20240214213247_updateTransportationOfficesGbloc.up.sql index 43e4369b456..88befc1afc6 100644 --- a/migrations/app/schema/20240214213247_updateTransportationOfficesGbloc.up.sql +++ b/migrations/app/schema/20240214213247_updateTransportationOfficesGbloc.up.sql @@ -1 +1,70 @@ -update transportation_offices set gbloc = 'BGAC' where gbloc = 'BKAS'; \ No newline at end of file +update + transportation_offices +set + gbloc = 'BGAC' +where + gbloc = 'BKAS'; + +insert + into + duty_locations(id, + name, + address_id, + created_at, + updated_at, + transportation_office_id, + provides_services_counseling ) +values( + '9f7a1c83-26ad-4ba3-b30f-1a2e62f250f6', + 'PPPO West Point/ USMA - USA', +'6aa77b74-41a7-4a4c-ab29-986f3263495a', +now(), +now(), +'dd043073-4f1b-460f-8f8c-74403619dbaa', +true); + +insert + into duty_location_names(id, + name, + duty_location_id, + created_at, + updated_at) +values ( + '47cfbfa1-4633-440e-928e-92a6f462826e', + 'PPPO West Point/ USMA - USA', +'9f7a1c83-26ad-4ba3-b30f-1a2e62f250f6', +now(), +now() +); + +insert + into + duty_locations(id, + name, + address_id, + created_at, + updated_at, + transportation_office_id, + provides_services_counseling ) +values( + '0f420f7b-72ac-43cf-bc93-f24d44ba8f93', + 'PPPO USAG Miami - USA', +'09058d36-2966-496a-aaf5-55c024404396', +now(), +now(), +'4f10d0f5-6017-4de2-8cfb-ee9252e492d5', +true); + +insert + into duty_location_names(id, + name, + duty_location_id, + created_at, + updated_at) +values ( + 'fbe7677f-e1ec-47d2-bf33-57e83eded778', + 'PPPO USAG Miami - USA', +'0f420f7b-72ac-43cf-bc93-f24d44ba8f93', +now(), +now() +); diff --git a/pkg/services/order/order_fetcher.go b/pkg/services/order/order_fetcher.go index 6ca449f8f5a..a2d34e1402c 100644 --- a/pkg/services/order/order_fetcher.go +++ b/pkg/services/order/order_fetcher.go @@ -49,7 +49,7 @@ func (f orderFetcher) ListOrders(appCtx appcontext.AppContext, officeUserID uuid needsCounseling := false if len(params.Status) > 0 { for _, status := range params.Status { - if status == string(models.MoveStatusNeedsServiceCounseling) || status == string(models.MoveStatusServiceCounselingCompleted) { + if status == string(models.MoveStatusNeedsServiceCounseling) { needsCounseling = true } } From 269cae4ccbe576f0dc0b4decbfa3d63cd8e16fb8 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 29 Jan 2024 16:50:19 +0000 Subject: [PATCH 44/67] Added MilMoveLink constant to current Integration branch notifications. --- .../templates/move_counseled_template.html | 24 +++ .../templates/move_counseled_template.txt | 21 ++ .../templates/ppm_packet_email_template.html | 4 +- .../templates/ppm_packet_email_template.txt | 4 +- pkg/notifications/move_counseled.go | 134 +++++++++++++ pkg/notifications/move_counseled_test.go | 180 ++++++++++++++++++ pkg/notifications/ppm_packet_email.go | 72 +++---- pkg/notifications/ppm_packet_email_test.go | 82 ++++---- 8 files changed, 447 insertions(+), 74 deletions(-) create mode 100644 pkg/assets/notifications/templates/move_counseled_template.html create mode 100644 pkg/assets/notifications/templates/move_counseled_template.txt create mode 100644 pkg/notifications/move_counseled.go create mode 100644 pkg/notifications/move_counseled_test.go diff --git a/pkg/assets/notifications/templates/move_counseled_template.html b/pkg/assets/notifications/templates/move_counseled_template.html new file mode 100644 index 00000000000..272f7e4d2b8 --- /dev/null +++ b/pkg/assets/notifications/templates/move_counseled_template.html @@ -0,0 +1,24 @@ +

        *** DO NOT REPLY directly to this email ***

        + +

        This is a confirmation that your counselor has approved move details for the assigned move code{{if or (not .Locator) (not .OriginDutyLocation) (not .DestinationDutyLocation)}}{{end}}{{if and .Locator .OriginDutyLocation .DestinationDutyLocation}} {{.Locator}} from {{.OriginDutyLocation}} to {{.DestinationDutyLocation}} in the MilMove system{{end}}.

        + +

        What this means to you:
        +If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

        + +

        Next steps for a PPM: +

          +
        • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
        • +
        • If your counselor approved an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA Packet, and submit it to finance according to the instructions provided by your counselor. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
        • +
        • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
        • +
        + +

        Next steps for government arranged shipments:
        +

          +
        • Your move request will be reviewed by the responsible personal property shipping office and a move task order for services will be placed with HomeSafe Alliance.
        • +
        • Once this order is placed, you will receive an e-mail invitation to create an account in HomeSafe Connect (check your spam or junk folder). This is the system you will use to schedule your pre-move survey.
        • +
        • HomeSafe is required to contact you within 24 hours of receiving your move task order. Once contact has been established, HomeSafe is your primary point of contact. If any information about your move changes at any point during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
        • +
        +

        Thank you,
        +USTRANSCOM MilMove Team

        + +

        The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.

        \ No newline at end of file diff --git a/pkg/assets/notifications/templates/move_counseled_template.txt b/pkg/assets/notifications/templates/move_counseled_template.txt new file mode 100644 index 00000000000..d972543fa1d --- /dev/null +++ b/pkg/assets/notifications/templates/move_counseled_template.txt @@ -0,0 +1,21 @@ +*** DO NOT REPLY directly to this email *** + +This is a confirmation that your counselor has approved move details for the assigned move code{{if and .Locator .OriginDutyLocation .DestinationDutyLocation}} {{.Locator}} from {{.OriginDutyLocation}} to {{.DestinationDutyLocation}} in the MilMove system{{end}}. + +What this means to you: +If you are doing a Personally Procured Move (PPM), you can start moving your personal property. + +Next steps for a PPM: + * Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected. + * If your counselor approved an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove <{{.MyMoveLink}}/> to download your AOA Packet, and submit it to finance according to the instructions provided by your counselor. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. + * Once you complete your PPM, log into MilMove <{{.MyMoveLink}}/>, upload your receipts and weight tickets, and submit your PPM for review. + +Next steps for government arranged shipments: + * Your move request will be reviewed by the responsible personal property shipping office and a move task order for services will be placed with HomeSafe Alliance. + * Once this order is placed, you will receive an e-mail invitation to create an account in HomeSafe Connect (check your spam or junk folder). This is the system you will use to schedule your pre-move survey. + * HomeSafe is required to contact you within 24 hours of receiving your move task order. Once contact has been established, HomeSafe is your primary point of contact. If any information about your move changes at any point during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove. + +Thank you, +USTRANSCOM MilMove Team + +The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine. \ No newline at end of file diff --git a/pkg/assets/notifications/templates/ppm_packet_email_template.html b/pkg/assets/notifications/templates/ppm_packet_email_template.html index 6131b8e9fcf..03684b9c140 100644 --- a/pkg/assets/notifications/templates/ppm_packet_email_template.html +++ b/pkg/assets/notifications/templates/ppm_packet_email_template.html @@ -3,11 +3,11 @@

        Next steps:

        {{if eq .ServiceBranch "Marine Corps, Navy, and Coast Guard"}}

        For Marine Corps, Navy, and Coast Guard personnel:

        -

        You can now log into MilMove https://my.move.mil/ and view your payment packet; however, you do not need to forward your packet to finance as your closeout location is associated with your finance office and they will handle this step for you.

        +

        You can now log into MilMove {{.MyMoveLink}}/ and view your payment packet; however, you do not need to forward your packet to finance as your closeout location is associated with your finance office and they will handle this step for you.

        Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense.

        {{else}}

        For {{.ServiceBranch}} personnel (FURTHER ACTION REQUIRED):

        -

        You can now log into MilMove https://my.move.mil/ and download your payment packet to submit to {{.SubmitLocation}}. You must complete this step to receive final settlement of your PPM.

        +

        You can now log into MilMove {{.MyMoveLink}}/ and download your payment packet to submit to {{.SubmitLocation}}. You must complete this step to receive final settlement of your PPM.

        {{if eq .ServiceBranch "Air Force and Space Force"}}Note: The Transportation Office does not determine claimable expenses. Claimable expenses will be determined by finance{{else if eq .ServiceBranch "Army"}}Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense{{end}}.

        {{end}}

        If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

        diff --git a/pkg/assets/notifications/templates/ppm_packet_email_template.txt b/pkg/assets/notifications/templates/ppm_packet_email_template.txt index 83c17652064..daadd1633b6 100644 --- a/pkg/assets/notifications/templates/ppm_packet_email_template.txt +++ b/pkg/assets/notifications/templates/ppm_packet_email_template.txt @@ -6,13 +6,13 @@ Next steps: {{if eq .ServiceBranch "Marine Corps, Navy, and Coast Guard"}} For Marine Corps, Navy, and Coast Guard personnel: -You can now log into MilMove and view your payment packet; however, you do not need to forward your packet to finance as your closeout location is associated with your finance office and they will handle this step for you. +You can now log into MilMove <{{.MyMoveLink}}/> and view your payment packet; however, you do not need to forward your packet to finance as your closeout location is associated with your finance office and they will handle this step for you. Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense. {{else}} For {{.ServiceBranch}} personnel (FURTHER ACTION REQUIRED): -You can now log into MilMove and download your payment packet to submit to {{.SubmitLocation}}. You must complete this step to receive final settlement of your PPM. +You can now log into MilMove <{{.MyMoveLink}}/> and download your payment packet to submit to {{.SubmitLocation}}. You must complete this step to receive final settlement of your PPM. {{if eq .ServiceBranch "Air Force and Space Force"}}Note: The Transportation Office does not determine claimable expenses. Claimable expenses will be determined by finance{{else if eq .ServiceBranch "Army"}}Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense.{{end}}{{end}} diff --git a/pkg/notifications/move_counseled.go b/pkg/notifications/move_counseled.go new file mode 100644 index 00000000000..cf306aff54f --- /dev/null +++ b/pkg/notifications/move_counseled.go @@ -0,0 +1,134 @@ +package notifications + +import ( + "bytes" + "fmt" + html "html/template" + text "text/template" + + "github.com/gofrs/uuid" + "go.uber.org/zap" + + "github.com/transcom/mymove/pkg/appcontext" + "github.com/transcom/mymove/pkg/assets" + "github.com/transcom/mymove/pkg/models" +) + +var ( + moveCounseledRawTextTemplate = string(assets.MustAsset("notifications/templates/move_counseled_template.txt")) + moveCounseledTextTemplate = text.Must(text.New("text_template").Parse(moveCounseledRawTextTemplate)) + moveCounseledRawHTMLTemplate = string(assets.MustAsset("notifications/templates/move_counseled_template.html")) + moveCounseledHTMLTemplate = html.Must(html.New("text_template").Parse(moveCounseledRawHTMLTemplate)) +) + +// MoveCounseled has notification content for counseled moves (before TOO approval) +type MoveCounseled struct { + moveID uuid.UUID + htmlTemplate *html.Template + textTemplate *text.Template +} + +// NewMoveCounseled returns a new move counseled notification (before TOO approval) +func NewMoveCounseled(moveID uuid.UUID) *MoveCounseled { + + return &MoveCounseled{ + moveID: moveID, + htmlTemplate: moveCounseledHTMLTemplate, + textTemplate: moveCounseledTextTemplate, + } +} + +func (m MoveCounseled) emails(appCtx appcontext.AppContext) ([]emailContent, error) { + var emails []emailContent + + move, err := models.FetchMove(appCtx.DB(), appCtx.Session(), m.moveID) + if err != nil { + return emails, err + } + + orders, err := models.FetchOrderForUser(appCtx.DB(), appCtx.Session(), move.OrdersID) + if err != nil { + return emails, err + } + + serviceMember, err := models.FetchServiceMemberForUser(appCtx.DB(), appCtx.Session(), orders.ServiceMemberID) + if err != nil { + return emails, err + } + + originDSTransportInfo, err := models.FetchDLContactInfo(appCtx.DB(), serviceMember.DutyLocationID) + if err != nil { + return emails, err + } + + var originDutyLocationName *string + if originDSTransportInfo != nil { + originDutyLocationName = &originDSTransportInfo.Name + } + + if serviceMember.PersonalEmail == nil { + return emails, fmt.Errorf("no email found for service member") + } + + htmlBody, textBody, err := m.renderTemplates(appCtx, MoveCounseledEmailData{ + OriginDutyLocation: originDutyLocationName, + DestinationDutyLocation: orders.NewDutyLocation.Name, + Locator: move.Locator, + MyMoveLink: MyMoveLink, + }) + + if err != nil { + appCtx.Logger().Error("error rendering template", zap.Error(err)) + } + + smEmail := emailContent{ + recipientEmail: *serviceMember.PersonalEmail, + subject: "Your counselor has approved your move details", + htmlBody: htmlBody, + textBody: textBody, + } + + appCtx.Logger().Info("Generated move counseled email", + zap.String("moveLocator", move.Locator)) + + // TODO: Send email to trusted contacts when that's supported + return append(emails, smEmail), nil +} + +func (m MoveCounseled) renderTemplates(appCtx appcontext.AppContext, data MoveCounseledEmailData) (string, string, error) { + htmlBody, err := m.RenderHTML(appCtx, data) + if err != nil { + return "", "", fmt.Errorf("error rendering html template using %#v", data) + } + textBody, err := m.RenderText(appCtx, data) + if err != nil { + return "", "", fmt.Errorf("error rendering text template using %#v", data) + } + return htmlBody, textBody, nil +} + +type MoveCounseledEmailData struct { + OriginDutyLocation *string + DestinationDutyLocation string + Locator string + MyMoveLink string +} + +// RenderHTML renders the html for the email +func (m MoveCounseled) RenderHTML(appCtx appcontext.AppContext, data MoveCounseledEmailData) (string, error) { + var htmlBuffer bytes.Buffer + if err := m.htmlTemplate.Execute(&htmlBuffer, data); err != nil { + appCtx.Logger().Error("cant render html template ", zap.Error(err)) + } + return htmlBuffer.String(), nil +} + +// RenderText renders the text for the email +func (m MoveCounseled) RenderText(appCtx appcontext.AppContext, data MoveCounseledEmailData) (string, error) { + var textBuffer bytes.Buffer + if err := m.textTemplate.Execute(&textBuffer, data); err != nil { + appCtx.Logger().Error("cant render text template ", zap.Error(err)) + return "", err + } + return textBuffer.String(), nil +} diff --git a/pkg/notifications/move_counseled_test.go b/pkg/notifications/move_counseled_test.go new file mode 100644 index 00000000000..7d934580a2e --- /dev/null +++ b/pkg/notifications/move_counseled_test.go @@ -0,0 +1,180 @@ +package notifications + +import ( + "regexp" + "strings" + + "github.com/transcom/mymove/pkg/auth" + "github.com/transcom/mymove/pkg/factory" +) + +func (suite *NotificationSuite) TestMoveCounseled() { + move := factory.BuildMove(suite.DB(), nil, nil) + notification := NewMoveCounseled(move.ID) + + emails, err := notification.emails(suite.AppContextWithSessionForTest(&auth.Session{ + ServiceMemberID: move.Orders.ServiceMember.ID, + ApplicationName: auth.MilApp, + })) + subject := "Your counselor has approved your move details" + + suite.NoError(err) + suite.Equal(len(emails), 1) + + email := emails[0] + sm := move.Orders.ServiceMember + suite.Equal(email.recipientEmail, *sm.PersonalEmail) + suite.Equal(email.subject, subject) + suite.NotEmpty(email.htmlBody) + suite.NotEmpty(email.textBody) +} + +func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRender() { + approver := factory.BuildUser(nil, nil, nil) + move := factory.BuildMove(suite.DB(), nil, nil) + notification := NewMoveCounseled(move.ID) + + originDutyLocation := "origDutyLocation" + + s := MoveCounseledEmailData{ + OriginDutyLocation: &originDutyLocation, + DestinationDutyLocation: "destDutyLocation", + Locator: "abc123", + MyMoveLink: MyMoveLink, + } + expectedHTMLContent := `

        *** DO NOT REPLY directly to this email ***

        + +

        This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system.

        + +

        What this means to you:
        +If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

        + +

        Next steps for a PPM: +

          +
        • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected.
        • +
        • If your counselor approved an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA Packet, and submit it to finance according to the instructions provided by your counselor. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
        • +
        • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
        • +
        + +

        Next steps for government arranged shipments:
        +

          +
        • Your move request will be reviewed by the responsible personal property shipping office and a move task order for services will be placed with HomeSafe Alliance.
        • +
        • Once this order is placed, you will receive an e-mail invitation to create an account in HomeSafe Connect (check your spam or junk folder). This is the system you will use to schedule your pre-move survey.
        • +
        • HomeSafe is required to contact you within 24 hours of receiving your move task order. Once contact has been established, HomeSafe is your primary point of contact. If any information about your move changes at any point during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
        • +
        +

        Thank you,
        +USTRANSCOM MilMove Team

        + +

        The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.

        +` + + htmlContent, err := notification.RenderHTML(suite.AppContextWithSessionForTest(&auth.Session{ + UserID: approver.ID, + ApplicationName: auth.OfficeApp, + }), s) + + suite.NoError(err) + suite.Equal(trimExtraSpaces(expectedHTMLContent), trimExtraSpaces(htmlContent)) +} + +func (suite *NotificationSuite) TestMoveCounseledTextTemplateRender() { + + approver := factory.BuildUser(nil, nil, nil) + move := factory.BuildMove(suite.DB(), nil, nil) + notification := NewMoveCounseled(move.ID) + + originDutyLocation := "origDutyLocation" + + s := MoveCounseledEmailData{ + OriginDutyLocation: &originDutyLocation, + DestinationDutyLocation: "destDutyLocation", + Locator: "abc123", + MyMoveLink: MyMoveLink, + } + + expectedTextContent := `*** DO NOT REPLY directly to this email *** + +This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system. + +What this means to you: +If you are doing a Personally Procured Move (PPM), you can start moving your personal property. + +Next steps for a PPM: + * Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected. + * If your counselor approved an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove <` + MyMoveLink + `/> to download your AOA Packet, and submit it to finance according to the instructions provided by your counselor. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. + * Once you complete your PPM, log into MilMove <` + MyMoveLink + `/>, upload your receipts and weight tickets, and submit your PPM for review. + +Next steps for government arranged shipments: + * Your move request will be reviewed by the responsible personal property shipping office and a move task order for services will be placed with HomeSafe Alliance. + * Once this order is placed, you will receive an e-mail invitation to create an account in HomeSafe Connect (check your spam or junk folder). This is the system you will use to schedule your pre-move survey. + * HomeSafe is required to contact you within 24 hours of receiving your move task order. Once contact has been established, HomeSafe is your primary point of contact. If any information about your move changes at any point during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove. + +Thank you, +USTRANSCOM MilMove Team + +The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine. +` + + textContent, err := notification.RenderText(suite.AppContextWithSessionForTest(&auth.Session{ + UserID: approver.ID, + ApplicationName: auth.OfficeApp, + }), s) + + suite.NoError(err) + suite.Equal(trimExtraSpaces(expectedTextContent), trimExtraSpaces(textContent)) +} + +func (suite *NotificationSuite) TestMoveCounseledTextTemplateRenderWithMissingMoveInfo() { + + approver := factory.BuildUser(nil, nil, nil) + move := factory.BuildMove(suite.DB(), nil, nil) + notification := NewMoveCounseled(move.ID) + + var originDutyLocation string + var locator string + + s := MoveCounseledEmailData{ + OriginDutyLocation: &originDutyLocation, + DestinationDutyLocation: "", + Locator: locator, + MyMoveLink: MyMoveLink, + } + + expectedTextContent := `*** DO NOT REPLY directly to this email *** + +This is a confirmation that your counselor has approved move details for the assigned move code. + +What this means to you: +If you are doing a Personally Procured Move (PPM), you can start moving your personal property. + +Next steps for a PPM: + * Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive could be affected. + * If your counselor approved an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove <` + MyMoveLink + `/> to download your AOA Packet, and submit it to finance according to the instructions provided by your counselor. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required. + * Once you complete your PPM, log into MilMove <` + MyMoveLink + `/>, upload your receipts and weight tickets, and submit your PPM for review. + +Next steps for government arranged shipments: + * Your move request will be reviewed by the responsible personal property shipping office and a move task order for services will be placed with HomeSafe Alliance. + * Once this order is placed, you will receive an e-mail invitation to create an account in HomeSafe Connect (check your spam or junk folder). This is the system you will use to schedule your pre-move survey. + * HomeSafe is required to contact you within 24 hours of receiving your move task order. Once contact has been established, HomeSafe is your primary point of contact. If any information about your move changes at any point during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove. + +Thank you, +USTRANSCOM MilMove Team + +The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine. +` + + textContent, err := notification.RenderText(suite.AppContextWithSessionForTest(&auth.Session{ + UserID: approver.ID, + ApplicationName: auth.OfficeApp, + }), s) + + suite.NoError(err) + suite.Equal(trimExtraSpaces(expectedTextContent), trimExtraSpaces(textContent)) +} + +func trimExtraSpaces(input string) string { + // Replace consecutive white spaces with a single space + re := regexp.MustCompile(`\s+`) + // return the result without leading or trailing spaces + return strings.TrimSpace(re.ReplaceAllString(input, " ")) +} diff --git a/pkg/notifications/ppm_packet_email.go b/pkg/notifications/ppm_packet_email.go index 7179bdc4fa6..587c3b63a91 100644 --- a/pkg/notifications/ppm_packet_email.go +++ b/pkg/notifications/ppm_packet_email.go @@ -31,15 +31,17 @@ type PpmPacketEmail struct { // ppmPacketEmailData is used to render an email template // Uses ZIPs only if no city/state data is provided type PpmPacketEmailData struct { - OriginZIP *string - OriginCity *string - OriginState *string - DestinationZIP *string - DestinationCity *string - DestinationState *string - SubmitLocation string - ServiceBranch string - Locator string + OriginZIP *string + OriginCity *string + OriginState *string + DestinationZIP *string + DestinationCity *string + DestinationState *string + SubmitLocation string + ServiceBranch string + Locator string + OneSourceTransportationOfficeLink string + MyMoveLink string } // Used to get logging data from GetEmailData @@ -61,14 +63,14 @@ func NewPpmPacketEmail(ppmShipmentID uuid.UUID) *PpmPacketEmail { // NotificationSendingContext expects a `notification` with an `emails` method, // so we implement `email` to satisfy that interface -func (m PpmPacketEmail) emails(appCtx appcontext.AppContext) ([]emailContent, error) { +func (p PpmPacketEmail) emails(appCtx appcontext.AppContext) ([]emailContent, error) { var emails []emailContent appCtx.Logger().Info("ppm SHIPMENT UUID", - zap.String("uuid", m.ppmShipmentID.String()), + zap.String("uuid", p.ppmShipmentID.String()), ) - emailData, loggerData, err := GetEmailData(m, appCtx) + emailData, loggerData, err := p.GetEmailData(appCtx) if err != nil { return nil, err } @@ -80,7 +82,7 @@ func (m PpmPacketEmail) emails(appCtx appcontext.AppContext) ([]emailContent, er ) var htmlBody, textBody string - htmlBody, textBody, err = m.renderTemplates(appCtx, emailData) + htmlBody, textBody, err = p.renderTemplates(appCtx, emailData) if err != nil { appCtx.Logger().Error("error rendering template", zap.Error(err)) @@ -96,7 +98,7 @@ func (m PpmPacketEmail) emails(appCtx appcontext.AppContext) ([]emailContent, er return append(emails, ppmEmail), nil } -func GetEmailData(p PpmPacketEmail, appCtx appcontext.AppContext) (PpmPacketEmailData, LoggerData, error) { +func (p PpmPacketEmail) GetEmailData(appCtx appcontext.AppContext) (PpmPacketEmailData, LoggerData, error) { var ppmShipment models.PPMShipment err := appCtx.DB().Find(&ppmShipment, p.ppmShipmentID) if err != nil { @@ -156,13 +158,15 @@ func GetEmailData(p PpmPacketEmail, appCtx appcontext.AppContext) (PpmPacketEmai } return PpmPacketEmailData{ - OriginCity: &pickupAddress.City, - OriginState: &pickupAddress.State, - DestinationCity: &destinationAddress.City, - DestinationState: &destinationAddress.State, - SubmitLocation: submitLocation, - ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], - Locator: move.Locator, + OriginCity: &pickupAddress.City, + OriginState: &pickupAddress.State, + DestinationCity: &destinationAddress.City, + DestinationState: &destinationAddress.State, + SubmitLocation: submitLocation, + ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], + Locator: move.Locator, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }, LoggerData{ ServiceMember: *serviceMember, @@ -173,11 +177,13 @@ func GetEmailData(p PpmPacketEmail, appCtx appcontext.AppContext) (PpmPacketEmai // Fallback to using ZIPs if the above if-block for city,state doesn't happen return PpmPacketEmailData{ - OriginZIP: &ppmShipment.PickupPostalCode, - DestinationZIP: &ppmShipment.DestinationPostalCode, - SubmitLocation: submitLocation, - ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], - Locator: move.Locator, + OriginZIP: &ppmShipment.PickupPostalCode, + DestinationZIP: &ppmShipment.DestinationPostalCode, + SubmitLocation: submitLocation, + ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], + Locator: move.Locator, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }, LoggerData{ ServiceMember: *serviceMember, @@ -187,12 +193,12 @@ func GetEmailData(p PpmPacketEmail, appCtx appcontext.AppContext) (PpmPacketEmai } -func (m PpmPacketEmail) renderTemplates(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, string, error) { - htmlBody, err := m.RenderHTML(appCtx, data) +func (p PpmPacketEmail) renderTemplates(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, string, error) { + htmlBody, err := p.RenderHTML(appCtx, data) if err != nil { return "", "", fmt.Errorf("error rendering html template using %#v", data) } - textBody, err := m.RenderText(appCtx, data) + textBody, err := p.RenderText(appCtx, data) if err != nil { return "", "", fmt.Errorf("error rendering text template using %#v", data) } @@ -200,18 +206,18 @@ func (m PpmPacketEmail) renderTemplates(appCtx appcontext.AppContext, data PpmPa } // RenderHTML renders the html for the email -func (m PpmPacketEmail) RenderHTML(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, error) { +func (p PpmPacketEmail) RenderHTML(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, error) { var htmlBuffer bytes.Buffer - if err := m.htmlTemplate.Execute(&htmlBuffer, data); err != nil { + if err := p.htmlTemplate.Execute(&htmlBuffer, data); err != nil { appCtx.Logger().Error("cant render html template ", zap.Error(err)) } return htmlBuffer.String(), nil } // RenderText renders the text for the email -func (m PpmPacketEmail) RenderText(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, error) { +func (p PpmPacketEmail) RenderText(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, error) { var textBuffer bytes.Buffer - if err := m.textTemplate.Execute(&textBuffer, data); err != nil { + if err := p.textTemplate.Execute(&textBuffer, data); err != nil { appCtx.Logger().Error("cant render text template ", zap.Error(err)) return "", err } diff --git a/pkg/notifications/ppm_packet_email_test.go b/pkg/notifications/ppm_packet_email_test.go index 6e3eb4a615f..a2f85a6fdda 100644 --- a/pkg/notifications/ppm_packet_email_test.go +++ b/pkg/notifications/ppm_packet_email_test.go @@ -107,18 +107,20 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForAirAndSpa }) notification := NewPpmPacketEmail(ppmShipment.ID) - ppmEmailData, _, err := GetEmailData(*notification, suite.AppContextForTest()) + ppmEmailData, _, err := notification.GetEmailData(suite.AppContextForTest()) suite.NoError(err) suite.NotNil(ppmEmailData) suite.EqualExportedValues(ppmEmailData, PpmPacketEmailData{ - OriginCity: &pickupAddress.City, - OriginState: &pickupAddress.State, - DestinationCity: &destinationAddress.City, - DestinationState: &destinationAddress.State, - SubmitLocation: allOtherSubmitLocation, - ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], - Locator: move.Locator, + OriginCity: &pickupAddress.City, + OriginState: &pickupAddress.State, + DestinationCity: &destinationAddress.City, + DestinationState: &destinationAddress.State, + SubmitLocation: allOtherSubmitLocation, + ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], + Locator: move.Locator, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }) expectedHTMLContent := `

        *** DO NOT REPLY directly to this email ***

        @@ -126,7 +128,7 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForAirAndSpa

        Next steps:

        For ` + affiliationDisplayValue[*serviceMember.Affiliation] + ` personnel (FURTHER ACTION REQUIRED):

        -

        You can now log into MilMove https://my.move.mil/ and download your payment packet to submit to ` + allOtherSubmitLocation + `. You must complete this step to receive final settlement of your PPM.

        +

        You can now log into MilMove ` + MyMoveLink + `/ and download your payment packet to submit to ` + allOtherSubmitLocation + `. You must complete this step to receive final settlement of your PPM.

        Note: The Transportation Office does not determine claimable expenses. Claimable expenses will be determined by finance.

        If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

        @@ -193,18 +195,20 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForArmy() { }) notification := NewPpmPacketEmail(ppmShipment.ID) - ppmEmailData, _, err := GetEmailData(*notification, suite.AppContextForTest()) + ppmEmailData, _, err := notification.GetEmailData(suite.AppContextForTest()) suite.NoError(err) suite.NotNil(ppmEmailData) suite.EqualExportedValues(ppmEmailData, PpmPacketEmailData{ - OriginCity: &pickupAddress.City, - OriginState: &pickupAddress.State, - DestinationCity: &destinationAddress.City, - DestinationState: &destinationAddress.State, - SubmitLocation: armySubmitLocation, - ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], - Locator: move.Locator, + OriginCity: &pickupAddress.City, + OriginState: &pickupAddress.State, + DestinationCity: &destinationAddress.City, + DestinationState: &destinationAddress.State, + SubmitLocation: armySubmitLocation, + ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], + Locator: move.Locator, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }) expectedHTMLContent := `

        *** DO NOT REPLY directly to this email ***

        @@ -212,7 +216,7 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForArmy() {

        Next steps:

        For ` + affiliationDisplayValue[*serviceMember.Affiliation] + ` personnel (FURTHER ACTION REQUIRED):

        -

        You can now log into MilMove https://my.move.mil/ and download your payment packet to submit to ` + armySubmitLocation + `. You must complete this step to receive final settlement of your PPM.

        +

        You can now log into MilMove ` + MyMoveLink + `/ and download your payment packet to submit to ` + armySubmitLocation + `. You must complete this step to receive final settlement of your PPM.

        Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense.

        If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

        @@ -279,18 +283,20 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForNavalBran }) notification := NewPpmPacketEmail(ppmShipment.ID) - ppmEmailData, _, err := GetEmailData(*notification, suite.AppContextForTest()) + ppmEmailData, _, err := notification.GetEmailData(suite.AppContextForTest()) suite.NoError(err) suite.NotNil(ppmEmailData) suite.EqualExportedValues(ppmEmailData, PpmPacketEmailData{ - OriginCity: &pickupAddress.City, - OriginState: &pickupAddress.State, - DestinationCity: &destinationAddress.City, - DestinationState: &destinationAddress.State, - SubmitLocation: allOtherSubmitLocation, - ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], - Locator: move.Locator, + OriginCity: &pickupAddress.City, + OriginState: &pickupAddress.State, + DestinationCity: &destinationAddress.City, + DestinationState: &destinationAddress.State, + SubmitLocation: allOtherSubmitLocation, + ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], + Locator: move.Locator, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }) expectedHTMLContent := `

        *** DO NOT REPLY directly to this email ***

        @@ -298,7 +304,7 @@ func (suite *NotificationSuite) TestPpmPacketEmailHTMLTemplateRenderForNavalBran

        Next steps:

        For ` + affiliationDisplayValue[*serviceMember.Affiliation] + ` personnel:

        -

        You can now log into MilMove https://my.move.mil/ and view your payment packet; however, you do not need to forward your packet to finance as your closeout location is associated with your finance office and they will handle this step for you.

        +

        You can now log into MilMove ` + MyMoveLink + `/ and view your payment packet; however, you do not need to forward your packet to finance as your closeout location is associated with your finance office and they will handle this step for you.

        Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense.

        If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

        @@ -367,7 +373,7 @@ func (suite *NotificationSuite) TestPpmPacketEmailTextTemplateRender() { notification := NewPpmPacketEmail(ppmShipment.ID) - ppmEmailData, _, err := GetEmailData(*notification, suite.AppContextForTest()) + ppmEmailData, _, err := notification.GetEmailData(suite.AppContextForTest()) suite.NoError(err) expectedTextContent := `*** DO NOT REPLY directly to this email *** @@ -378,11 +384,11 @@ Next steps: For ` + affiliationDisplayValue[*serviceMember.Affiliation] + ` personnel (FURTHER ACTION REQUIRED): -You can now log into MilMove and download your payment packet to submit to ` + armySubmitLocation + `. You must complete this step to receive final settlement of your PPM. +You can now log into MilMove <` + MyMoveLink + `/> and download your payment packet to submit to ` + armySubmitLocation + `. You must complete this step to receive final settlement of your PPM. Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense. -If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: +If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + ` Thank you, @@ -432,16 +438,18 @@ func (suite *NotificationSuite) TestPpmPacketEmailZipcodeFallback() { }) notification := NewPpmPacketEmail(ppmShipment.ID) - ppmEmailData, _, err := GetEmailData(*notification, suite.AppContextForTest()) + ppmEmailData, _, err := notification.GetEmailData(suite.AppContextForTest()) suite.NoError(err) suite.NotNil(ppmEmailData) suite.EqualExportedValues(ppmEmailData, PpmPacketEmailData{ - OriginZIP: &customPPM.PickupPostalCode, - DestinationZIP: &customPPM.DestinationPostalCode, - SubmitLocation: allOtherSubmitLocation, - ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], - Locator: move.Locator, + OriginZIP: &customPPM.PickupPostalCode, + DestinationZIP: &customPPM.DestinationPostalCode, + SubmitLocation: allOtherSubmitLocation, + ServiceBranch: affiliationDisplayValue[*serviceMember.Affiliation], + Locator: move.Locator, + OneSourceTransportationOfficeLink: OneSourceTransportationOfficeLink, + MyMoveLink: MyMoveLink, }) expectedHTMLContent := `

        *** DO NOT REPLY directly to this email ***

        @@ -449,7 +457,7 @@ func (suite *NotificationSuite) TestPpmPacketEmailZipcodeFallback() {

        Next steps:

        For ` + affiliationDisplayValue[*serviceMember.Affiliation] + ` personnel (FURTHER ACTION REQUIRED):

        -

        You can now log into MilMove https://my.move.mil/ and download your payment packet to submit to ` + allOtherSubmitLocation + `. You must complete this step to receive final settlement of your PPM.

        +

        You can now log into MilMove ` + MyMoveLink + `/ and download your payment packet to submit to ` + allOtherSubmitLocation + `. You must complete this step to receive final settlement of your PPM.

        Note: The Transportation Office does not determine claimable expenses. Claimable expenses will be determined by finance.

        If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

        From 7c7df3b5da15820170762cc1547fdabb74e4ca72 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 29 Jan 2024 16:50:19 +0000 Subject: [PATCH 45/67] added bracket missing from email test. --- pkg/notifications/ppm_packet_email_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/notifications/ppm_packet_email_test.go b/pkg/notifications/ppm_packet_email_test.go index a2f85a6fdda..42c63cd320e 100644 --- a/pkg/notifications/ppm_packet_email_test.go +++ b/pkg/notifications/ppm_packet_email_test.go @@ -388,7 +388,7 @@ You can now log into MilMove <` + MyMoveLink + `/> and download your payment pac Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense. -If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + ` +If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: <` + OneSourceTransportationOfficeLink + `> Thank you, From 2f827ae81bb508c258f20c8f70474af2a5735bea Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 29 Jan 2024 15:59:27 +0000 Subject: [PATCH 46/67] Added usage of new consant to ppm packet email --- .../notifications/templates/ppm_packet_email_template.html | 2 +- .../notifications/templates/ppm_packet_email_template.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/assets/notifications/templates/ppm_packet_email_template.html b/pkg/assets/notifications/templates/ppm_packet_email_template.html index 03684b9c140..fdb78050302 100644 --- a/pkg/assets/notifications/templates/ppm_packet_email_template.html +++ b/pkg/assets/notifications/templates/ppm_packet_email_template.html @@ -10,7 +10,7 @@

        Next steps:

        You can now log into MilMove {{.MyMoveLink}}/ and download your payment packet to submit to {{.SubmitLocation}}. You must complete this step to receive final settlement of your PPM.

        {{if eq .ServiceBranch "Air Force and Space Force"}}Note: The Transportation Office does not determine claimable expenses. Claimable expenses will be determined by finance{{else if eq .ServiceBranch "Army"}}Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense{{end}}.

        {{end}} -

        If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL

        +

        If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: {{.OneSourceTransportationOfficeLink}}

        Thank you,

        diff --git a/pkg/assets/notifications/templates/ppm_packet_email_template.txt b/pkg/assets/notifications/templates/ppm_packet_email_template.txt index daadd1633b6..6bfd0b148fc 100644 --- a/pkg/assets/notifications/templates/ppm_packet_email_template.txt +++ b/pkg/assets/notifications/templates/ppm_packet_email_template.txt @@ -16,7 +16,7 @@ You can now log into MilMove <{{.MyMoveLink}}/> and download your payment packet {{if eq .ServiceBranch "Air Force and Space Force"}}Note: The Transportation Office does not determine claimable expenses. Claimable expenses will be determined by finance{{else if eq .ServiceBranch "Army"}}Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense.{{end}}{{end}} -If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: +If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: {{.OneSourceTransportationOfficeLink}} Thank you, From 5e02175006ae0d573ab0ae99c41817bc28e8ba1a Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 21 Feb 2024 13:20:34 -0600 Subject: [PATCH 47/67] add workflow to clean up prs --- .../workflows/stale-issues-pull-requests.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/stale-issues-pull-requests.yml diff --git a/.github/workflows/stale-issues-pull-requests.yml b/.github/workflows/stale-issues-pull-requests.yml new file mode 100644 index 00000000000..4822d881f0d --- /dev/null +++ b/.github/workflows/stale-issues-pull-requests.yml @@ -0,0 +1,19 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' + stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.' + close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.' + close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.' + days-before-issue-stale: 30 + days-before-pr-stale: 45 + days-before-issue-close: 5 + days-before-pr-close: 10 \ No newline at end of file From e0a71c1cbc35ee375d99189c30e97ec4dd934b3d Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 21 Feb 2024 19:43:54 +0000 Subject: [PATCH 48/67] Revert "added bracket missing from email test." This reverts commit 7c7df3b5da15820170762cc1547fdabb74e4ca72. --- pkg/notifications/ppm_packet_email_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/notifications/ppm_packet_email_test.go b/pkg/notifications/ppm_packet_email_test.go index 42c63cd320e..a2f85a6fdda 100644 --- a/pkg/notifications/ppm_packet_email_test.go +++ b/pkg/notifications/ppm_packet_email_test.go @@ -388,7 +388,7 @@ You can now log into MilMove <` + MyMoveLink + `/> and download your payment pac Note: Not all claimed expenses may have been accepted during PPM closeout if they did not meet the definition of a valid expense. -If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: <` + OneSourceTransportationOfficeLink + `> +If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military One Source here: ` + OneSourceTransportationOfficeLink + ` Thank you, From fe351aee1a05d3fd702b06c3525bd20694ebfe51 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Thu, 22 Feb 2024 17:20:45 +0000 Subject: [PATCH 49/67] moves implementation refactor --- pkg/handlers/internalapi/moves.go | 53 +++++++++++-------------------- pkg/models/move.go | 17 +++------- 2 files changed, 24 insertions(+), 46 deletions(-) diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index 3042b029fd1..fb156c9348c 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -142,17 +142,19 @@ func payloadForMoveModel(storer storage.FileStorer, order models.Order, move mod return movePayload, nil } -func payloadMovesList(storer storage.FileStorer, previousMovesList models.Moves, currentMoveList models.Moves, movesList models.Moves) (*internalmessages.MovesList, error) { +func payloadForInternalMove(storer storage.FileStorer, list models.Moves) []*internalmessages.InternalMove { + var convertedCurrentMovesList []*internalmessages.InternalMove = []*internalmessages.InternalMove{} - // Convert currentMoves moves to internalmessages.MoveTaskOrder - var convertedCurrentMovesList []*internalmessages.InternalMove - moves := movesList - for _, move := range moves { + if len(list) == 0 { + return convertedCurrentMovesList + } + + // Convert moveList to internalmessages.InternalMove + for _, move := range list { eTag := etag.GenerateEtag(move.UpdatedAt) shipments := move.MTOShipments var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) - // var payloadOrders *internalmessages.Order = payloads currentMove := &internalmessages.InternalMove{ CreatedAt: *handlers.FmtDateTime(move.CreatedAt), @@ -165,33 +167,22 @@ func payloadMovesList(storer storage.FileStorer, previousMovesList models.Moves, convertedCurrentMovesList = append(convertedCurrentMovesList, currentMove) } + return convertedCurrentMovesList +} - // Convert previousMoves moves to internalmessages.MoveTaskOrder - var convertedPreviousMovesList []*internalmessages.InternalMove - for _, move := range previousMovesList { - - if currentMoveList[0].ID != move.ID { - eTag := etag.GenerateEtag(move.UpdatedAt) - shipments := move.MTOShipments - var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) - - currentMove := &internalmessages.InternalMove{ - CreatedAt: *handlers.FmtDateTime(move.CreatedAt), - ETag: eTag, - ID: *handlers.FmtUUID(move.ID), - MtoShipments: *payloadShipments, - } +func payloadForMovesList(storer storage.FileStorer, previousMovesList models.Moves, currentMoveList models.Moves, movesList models.Moves) *internalmessages.MovesList { - convertedPreviousMovesList = append(convertedPreviousMovesList, currentMove) + if len(movesList) == 0 { + return &internalmessages.MovesList{ + CurrentMove: []*internalmessages.InternalMove{}, + PreviousMoves: []*internalmessages.InternalMove{}, } } - movePayload := &internalmessages.MovesList{ - CurrentMove: convertedCurrentMovesList, - PreviousMoves: convertedPreviousMovesList, + return &internalmessages.MovesList{ + CurrentMove: payloadForInternalMove(storer, currentMoveList), + PreviousMoves: payloadForInternalMove(storer, previousMovesList), } - - return movePayload, nil } // ShowMoveHandler returns a move for a user and move ID @@ -531,12 +522,6 @@ func (h GetAllMovesHandler) Handle(params moveop.GetAllMovesParams) middleware.R } } - // Build MovesList Payload - payload, err := payloadMovesList(h.FileStorer(), previousMovesList, currentMovesList, movesList) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - return moveop.NewGetAllMovesOK().WithPayload(payload), nil + return moveop.NewGetAllMovesOK().WithPayload(payloadForMovesList(h.FileStorer(), previousMovesList, currentMovesList, movesList)), nil }) } diff --git a/pkg/models/move.go b/pkg/models/move.go index efb63dee14b..265b3e1c0ad 100644 --- a/pkg/models/move.go +++ b/pkg/models/move.go @@ -411,23 +411,16 @@ func FetchMovesByOrderID(db *pop.Connection, orderID uuid.UUID) (Moves, error) { query := db.Where("orders_id = ?", orderID) err := query.Eager( - "Orders", "MTOShipments", + "Orders", + "Orders.UploadedOrders", + "Orders.ServiceMember", "Orders.ServiceMember.User", - "Orders.ServiceMember.DutyLocation.Address", - "Orders.ServiceMember.DutyLocation.TransportationOffice", - "Orders.ServiceMember.DutyLocation.TransportationOffice.Address", + "Orders.OriginDutyLocation.TransportationOffice", + "Orders.OriginDutyLocation.TransportationOffice.Address", "Orders.NewDutyLocation.Address", - "Orders.ServiceMember", "Orders.NewDutyLocation.TransportationOffice", "Orders.NewDutyLocation.TransportationOffice.Address", - "Orders.UploadedOrders", - "Orders.UploadedOrders.ServiceMember", - "Orders.UploadedOrders.ServiceMember.User", - "Orders.UploadedOrders.ServiceMember.DutyLocation", - "Orders.UploadedOrders.ServiceMember.DutyLocation.Address", - "Orders.UploadedOrders.ServiceMember.DutyLocation.TransportationOffice", - "Orders.UploadedOrders.ServiceMember.DutyLocation.TransportationOffice.Address", ).All(&moves) return moves, err } From 45dc86ae017941d5fd8f9a2a2850a781f922d012 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Wed, 31 Jan 2024 14:25:36 +0000 Subject: [PATCH 50/67] initial commit, began adding data to redux until api endpoint is merged --- .../Multi-Moves/MultiMovesLandingPage.jsx | 36 +++++++++++++++++-- src/sagas/onboarding.js | 13 +++++++ src/services/internalApi.js | 12 +++++++ src/shared/Entities/modules/moves.js | 6 ++++ src/shared/Entities/modules/oktaUser.js | 2 -- src/shared/Entities/reducer.js | 2 ++ src/shared/Entities/schema.js | 8 +++++ 7 files changed, 75 insertions(+), 4 deletions(-) diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx index 33bc7c01b2e..9038575e5db 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx @@ -21,9 +21,17 @@ import { loadInternalSchema } from 'shared/Swagger/ducks'; import { loadUser } from 'store/auth/actions'; import { initOnboarding } from 'store/onboarding/actions'; import Helper from 'components/Customer/Home/Helper'; +import { customerRoutes } from 'constants/routes'; +import { withContext } from 'shared/AppContext'; +import withRouter from 'utils/routing'; +import requireCustomerState from 'containers/requireCustomerState/requireCustomerState'; +import { selectIsProfileComplete, selectServiceMemberFromLoggedInUser } from 'store/entities/selectors'; -const MultiMovesLandingPage = () => { +const MultiMovesLandingPage = ({ serviceMemberMoves }) => { const [setErrorState] = useState({ hasError: false, error: undefined, info: undefined }); + const navigate = useNavigate(); + console.log('serviceMemberMoves', serviceMemberMoves); + // ! This is just used for testing and viewing different variations of data that MilMove will use // user can add params of ?moveData=PCS, etc to view different views let moves; @@ -146,4 +154,28 @@ const MultiMovesLandingPage = () => { ); }; -export default MultiMovesLandingPage; +MultiMovesLandingPage.defaultProps = { + serviceMember: null, +}; + +const mapStateToProps = (state) => { + const serviceMember = selectServiceMemberFromLoggedInUser(state); + const { serviceMemberMoves } = state.entities; + + return { + isProfileComplete: selectIsProfileComplete(state), + serviceMember, + serviceMemberMoves, + }; +}; + +// in order to avoid setting up proxy server only for storybook, pass in stub function so API requests don't fail +const mergeProps = (stateProps, dispatchProps, ownProps) => ({ + ...stateProps, + ...dispatchProps, + ...ownProps, +}); + +export default withContext( + withRouter(connect(mapStateToProps, mergeProps)(requireCustomerState(MultiMovesLandingPage))), +); diff --git a/src/sagas/onboarding.js b/src/sagas/onboarding.js index f4a4ff0a48c..2f8908b3bff 100644 --- a/src/sagas/onboarding.js +++ b/src/sagas/onboarding.js @@ -11,6 +11,7 @@ import { getLoggedInUser, getMTOShipmentsForMove, createServiceMember as createServiceMemberApi, + getOrdersForServiceMember, } from 'services/internalApi'; import { addEntities } from 'shared/Entities/actions'; @@ -29,6 +30,18 @@ export function* fetchCustomerData() { yield put(addEntities(mtoShipments)); } + // if we have user data, we can load multiple move data + if (user) { + const currentMove = []; + const previousMoves = []; + const { serviceMembers } = user; + const [serviceMemberId] = Object.keys(serviceMembers); + const currentMoveData = yield call(getOrdersForServiceMember, serviceMemberId); + currentMove.push(currentMoveData); + const serviceMemberMoves = { currentMove: currentMoveData, previousMoves }; + yield put(addEntities({ serviceMemberMoves })); + } + return user; } diff --git a/src/services/internalApi.js b/src/services/internalApi.js index 43c65e78bc2..7d1aef9c78e 100644 --- a/src/services/internalApi.js +++ b/src/services/internalApi.js @@ -239,6 +239,18 @@ export async function deleteUpload(uploadId) { } /** MOVES */ +export async function getAllMoves(serviceMemberId) { + return makeInternalRequest( + 'moves.getAllMoves', + { + serviceMemberId, + }, + { + normalize: false, + }, + ); +} + export async function getMove(moveId) { return makeInternalRequest( 'moves.showMove', diff --git a/src/shared/Entities/modules/moves.js b/src/shared/Entities/modules/moves.js index be25b95ffb3..1b65bd243bb 100644 --- a/src/shared/Entities/modules/moves.js +++ b/src/shared/Entities/modules/moves.js @@ -18,6 +18,7 @@ const cancelMoveLabel = 'Moves.CancelMove'; export const loadMoveLabel = 'Moves.loadMove'; export const getMoveDatesSummaryLabel = 'Moves.getMoveDatesSummary'; export const getMoveByLocatorOperation = 'move.getMove'; +export const getAllMovesLabel = 'move.getAllMoves'; export default function reducer(state = {}, action) { switch (action.type) { @@ -32,6 +33,11 @@ export default function reducer(state = {}, action) { } } +export function getAllMoves(serviceMemberId, label = getAllMovesLabel) { + const swaggerTag = 'moves.getAllMoves'; + return swaggerRequest(getClient, swaggerTag, { serviceMemberId }, { label }); +} + export function getMoveByLocator(locator, label = getMoveByLocatorOperation) { return swaggerRequest(getGHCClient, getMoveByLocatorOperation, { locator }, { label }); } diff --git a/src/shared/Entities/modules/oktaUser.js b/src/shared/Entities/modules/oktaUser.js index 8ae9edc6e8c..1ed6c6615db 100644 --- a/src/shared/Entities/modules/oktaUser.js +++ b/src/shared/Entities/modules/oktaUser.js @@ -10,7 +10,5 @@ export function getOktaUser() { // load Okta user export function selectOktaUser(state) { - // console.log('loading from entities', state); - return get(state, `entities.oktaUser`); } diff --git a/src/shared/Entities/reducer.js b/src/shared/Entities/reducer.js index b791602d280..92717f52d73 100644 --- a/src/shared/Entities/reducer.js +++ b/src/shared/Entities/reducer.js @@ -45,6 +45,7 @@ const initialState = { personallyProcuredMoves: {}, mtoShipments: {}, reimbursements: {}, + serviceMemberMoves: {}, signedCertifications: {}, oktaUser: {}, }; @@ -77,5 +78,6 @@ export function entitiesReducer(state = initialState, action) { oktaUser: action.oktaUser || {}, }; } + return state; } diff --git a/src/shared/Entities/schema.js b/src/shared/Entities/schema.js index 72635713ab5..c3b895e74f1 100644 --- a/src/shared/Entities/schema.js +++ b/src/shared/Entities/schema.js @@ -42,6 +42,14 @@ export const move = new schema.Entity('moves', { }); export const moves = new schema.Array(move); +export const currentMove = new schema.Array(move); +export const previousMoves = new schema.Array(move); + +export const multiMoves = new schema.Entity('multiMoves', { + currentMove: currentMove, + previousMoves: previousMoves, +}); + // Orders export const order = new schema.Entity('orders'); From 421d632fe0f310ed6a77f9f00b950ab44596d6cc Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Wed, 31 Jan 2024 22:41:12 +0000 Subject: [PATCH 51/67] changed some values of dashboard due to API object returning different values, updated swagger to allow for move status, need to finish tests --- pkg/gen/internalapi/embedded_spec.go | 8 + pkg/gen/internalmessages/internal_move.go | 17 ++ pkg/handlers/internalapi/moves.go | 1 + pkg/models/move.go | 1 + .../Multi-Moves/MultiMovesLandingPage.jsx | 107 +++++------ .../MultiMovesLandingPage.test.jsx | 167 +++++++++++++++++- .../MultiMovesMoveContainer.jsx | 38 ++-- .../MultiMovesMoveInfoList.jsx | 53 +++++- src/sagas/onboarding.js | 20 +-- src/store/entities/selectors.js | 5 + swagger-def/internal.yaml | 3 + swagger/internal.yaml | 3 + 12 files changed, 325 insertions(+), 98 deletions(-) diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index e3735537ce7..c86f85a6dac 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4203,6 +4203,10 @@ func init() { "orders": { "type": "object" }, + "status": { + "type": "string", + "readOnly": true + }, "updatedAt": { "type": "string", "format": "date-time", @@ -12308,6 +12312,10 @@ func init() { "orders": { "type": "object" }, + "status": { + "type": "string", + "readOnly": true + }, "updatedAt": { "type": "string", "format": "date-time", diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go index 13947c3d8aa..723d1c2b0b9 100644 --- a/pkg/gen/internalmessages/internal_move.go +++ b/pkg/gen/internalmessages/internal_move.go @@ -49,6 +49,10 @@ type InternalMove struct { // orders Orders interface{} `json:"orders,omitempty"` + // status + // Read Only: true + Status string `json:"status,omitempty"` + // updated at // Read Only: true // Format: date-time @@ -170,6 +174,10 @@ func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { res = append(res, err) } @@ -221,6 +229,15 @@ func (m *InternalMove) contextValidateMtoShipments(ctx context.Context, formats return nil } +func (m *InternalMove) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + func (m *InternalMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index 03705f53526..5508aabb389 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -159,6 +159,7 @@ func payloadForInternalMove(storer storage.FileStorer, list models.Moves) []*int CreatedAt: *handlers.FmtDateTime(move.CreatedAt), ETag: eTag, ID: *handlers.FmtUUID(move.ID), + Status: string(move.Status), MtoShipments: *payloadShipments, MoveCode: move.Locator, Orders: move.Orders, diff --git a/pkg/models/move.go b/pkg/models/move.go index 265b3e1c0ad..b8bf7f2ce60 100644 --- a/pkg/models/move.go +++ b/pkg/models/move.go @@ -416,6 +416,7 @@ func FetchMovesByOrderID(db *pop.Connection, orderID uuid.UUID) (Moves, error) { "Orders.UploadedOrders", "Orders.ServiceMember", "Orders.ServiceMember.User", + "Orders.OriginDutyLocation.Address", "Orders.OriginDutyLocation.TransportationOffice", "Orders.OriginDutyLocation.TransportationOffice.Address", "Orders.NewDutyLocation.Address", diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx index 9038575e5db..ea109f8ef24 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx @@ -5,15 +5,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import styles from './MultiMovesLandingPage.module.scss'; import MultiMovesMoveHeader from './MultiMovesMoveHeader/MultiMovesMoveHeader'; import MultiMovesMoveContainer from './MultiMovesMoveContainer/MultiMovesMoveContainer'; -import { - mockMovesPCS, - mockMovesSeparation, - mockMovesRetirement, - mockMovesNoPreviousMoves, - mockMovesNoCurrentMoveWithPreviousMoves, - mockMovesNoCurrentOrPreviousMoves, -} from './MultiMovesTestData'; +import { detectFlags } from 'utils/featureFlags'; import { generatePageTitle } from 'hooks/custom'; import { milmoveLogger } from 'utils/milmoveLog'; import retryPageLoading from 'utils/retryPageLoading'; @@ -25,42 +18,11 @@ import { customerRoutes } from 'constants/routes'; import { withContext } from 'shared/AppContext'; import withRouter from 'utils/routing'; import requireCustomerState from 'containers/requireCustomerState/requireCustomerState'; -import { selectIsProfileComplete, selectServiceMemberFromLoggedInUser } from 'store/entities/selectors'; +import { selectAllMoves, selectIsProfileComplete, selectServiceMemberFromLoggedInUser } from 'store/entities/selectors'; -const MultiMovesLandingPage = ({ serviceMemberMoves }) => { +const MultiMovesLandingPage = ({ serviceMember, serviceMemberMoves }) => { const [setErrorState] = useState({ hasError: false, error: undefined, info: undefined }); const navigate = useNavigate(); - console.log('serviceMemberMoves', serviceMemberMoves); - - // ! This is just used for testing and viewing different variations of data that MilMove will use - // user can add params of ?moveData=PCS, etc to view different views - let moves; - const currentUrl = new URL(window.location.href); - const moveDataSource = currentUrl.searchParams.get('moveData'); - switch (moveDataSource) { - case 'PCS': - moves = mockMovesPCS; - break; - case 'retirement': - moves = mockMovesRetirement; - break; - case 'separation': - moves = mockMovesSeparation; - break; - case 'noPreviousMoves': - moves = mockMovesNoPreviousMoves; - break; - case 'noCurrentMove': - moves = mockMovesNoCurrentMoveWithPreviousMoves; - break; - case 'noMoves': - moves = mockMovesNoCurrentOrPreviousMoves; - break; - default: - moves = mockMovesPCS; - break; - } - // ! end of test data useEffect(() => { const fetchData = async () => { @@ -69,11 +31,6 @@ const MultiMovesLandingPage = ({ serviceMemberMoves }) => { loadUser(); initOnboarding(); document.title = generatePageTitle('MilMove'); - - const script = document.createElement('script'); - script.src = '//rum-static.pingdom.net/pa-6567b05deff3250012000426.js'; - script.async = true; - document.body.appendChild(script); } catch (error) { const { message } = error; milmoveLogger.error({ message, info: null }); @@ -89,21 +46,53 @@ const MultiMovesLandingPage = ({ serviceMemberMoves }) => { fetchData(); }, [setErrorState]); - return ( + const flags = detectFlags(process.env.NODE_ENV, window.location.host, window.location.search); + + // handles logic when user clicks "Create a Move" button + // if they have previous moves, they'll need to validate their profile + // if they do not have previous moves, then they don't need to validate + const handleCreateMoveBtnClick = () => { + if (serviceMemberMoves && serviceMemberMoves.previousMoves && serviceMemberMoves.previousMoves.length !== 0) { + const profileEditPath = customerRoutes.PROFILE_PATH; + navigate(profileEditPath, { state: { needsToVerifyProfile: true } }); + } else { + navigate(customerRoutes.MOVE_HOME_PAGE); + } + }; + + // ! WILL ONLY SHOW IF MULTIMOVE FLAG IS TRUE + return flags.multiMove ? (
        -

        First Last

        +

        + {serviceMember.first_name} {serviceMember.last_name} +

        - -

        - We can put information at the top here - potentially important contact info or basic instructions on how - to start a move? -

        -
        + {serviceMemberMoves && serviceMemberMoves.previousMoves && serviceMemberMoves.previousMoves.length === 0 ? ( + +

        + Select "Create a Move" to get started.
        +
        + If you encounter any issues please contact your local Transportation Office or the Help Desk for further + assistance. +

        +
        + ) : ( + +

        + Select "Create a Move" to get started.
        +
        + Once you have validated your profile, pleasee click the "Validate" button and proceed to + starting your move.
        + If you encounter any issues please contact your local Transportation Office or the Help Desk for further + assistance. +

        +
        + )}
        - {moves.currentMove.length > 0 ? ( + {serviceMemberMoves && serviceMemberMoves.currentMove && serviceMemberMoves.currentMove.length !== 0 ? ( <>
        - +
        ) : ( @@ -130,13 +119,13 @@ const MultiMovesLandingPage = ({ serviceMemberMoves }) => {
        You do not have a current move.
        )} - {moves.previousMoves.length > 0 ? ( + {serviceMemberMoves && serviceMemberMoves.previousMoves && serviceMemberMoves.previousMoves.length !== 0 ? ( <>
        - +
        ) : ( @@ -160,7 +149,7 @@ MultiMovesLandingPage.defaultProps = { const mapStateToProps = (state) => { const serviceMember = selectServiceMemberFromLoggedInUser(state); - const { serviceMemberMoves } = state.entities; + const serviceMemberMoves = selectAllMoves(state); return { isProfileComplete: selectIsProfileComplete(state), diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx index e19c56cff35..0af53508496 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx @@ -4,6 +4,8 @@ import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; // For additional matchers like toBeInTheDocument import MultiMovesLandingPage from './MultiMovesLandingPage'; +import { MockProviders } from 'testUtils'; + // Mock external dependencies jest.mock('utils/featureFlags', () => ({ detectFlags: jest.fn(() => ({ multiMove: true })), @@ -21,13 +23,166 @@ jest.mock('shared/Swagger/ducks', () => ({ loadInternalSchema: jest.fn(), })); +const defaultProps = { + serviceMember: { + id: v4(), + first_name: 'Jim', + last_name: 'Bean', + }, + showLoggedInUser: jest.fn(), + isLoggedIn: true, + loggedInUserIsLoading: false, + loggedInUserSuccess: true, + isProfileComplete: true, + serviceMemberMoves: { + currentMove: [ + { + createdAt: '2024-01-31T16:29:53.290Z', + eTag: 'MjAyNC0wMS0zMVQxNjoyOTo1My4yOTA0OTRa', + id: '9211d4e2-5b92-42bb-9758-7ac1f329a8d6', + moveCode: 'YJ9M34', + orders: { + id: '40475a80-5340-4722-88d1-3cc9764414d6', + created_at: '2024-01-31T16:29:53.285657Z', + updated_at: '2024-01-31T16:29:53.285657Z', + service_member_id: '6686d242-e7af-4a06-afd7-7be423bfca2d', + issue_date: '2024-01-31T00:00:00Z', + report_by_date: '2024-02-09T00:00:00Z', + orders_type: 'PERMANENT_CHANGE_OF_STATION', + orders_type_detail: null, + has_dependents: false, + spouse_has_pro_gear: false, + OriginDutyLocation: { + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + name: 'Tinker AFB, OK 73145', + affiliation: 'AIR_FORCE', + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + Address: { + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + street_address_1: 'n/a', + street_address_2: null, + street_address_3: null, + city: 'Tinker AFB', + state: 'OK', + postal_code: '73145', + country: 'United States', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + TransportationOffice: { + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + shipping_office_id: 'c2c440ae-5394-4483-84fb-f872e32126bb', + ShippingOffice: null, + name: 'PPPO Tinker AFB - USAF', + Address: { + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + created_at: '2018-05-28T14:27:40.597383Z', + updated_at: '2018-05-28T14:27:40.597383Z', + street_address_1: '7330 Century Blvd', + street_address_2: 'Bldg 469', + street_address_3: null, + city: 'Tinker AFB', + state: 'OK', + postal_code: '73145', + country: 'United States', + }, + address_id: '410b18bc-b270-4b52-9211-532fffc6f59e', + latitude: 35.429035, + longitude: -97.39955, + PhoneLines: null, + Emails: null, + hours: 'Monday – Friday: 0715 – 1600; Limited Service from 1130-1230', + services: 'Walk-In Help; Briefings; Appointments; QA Inspections', + note: null, + gbloc: 'HAFC', + created_at: '2018-05-28T14:27:40.605679Z', + updated_at: '2018-05-28T14:27:40.60568Z', + provides_ppm_closeout: true, + }, + provides_services_counseling: true, + }, + origin_duty_location_id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + new_duty_location_id: '5c182566-0e6e-46f2-9eef-f07963783575', + NewDutyLocation: { + id: '5c182566-0e6e-46f2-9eef-f07963783575', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + name: 'Fort Sill, OK 73503', + affiliation: 'ARMY', + address_id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + Address: { + id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + street_address_1: 'n/a', + street_address_2: null, + street_address_3: null, + city: 'Fort Sill', + state: 'OK', + postal_code: '73503', + country: 'United States', + }, + transportation_office_id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + TransportationOffice: { + id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + shipping_office_id: '5a3388e1-6d46-4639-ac8f-a8937dc26938', + ShippingOffice: null, + name: 'PPPO Fort Sill - USA', + Address: { + id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + created_at: '2018-05-28T14:27:35.538742Z', + updated_at: '2018-05-28T14:27:35.538743Z', + street_address_1: '4700 Mow Way Rd', + street_address_2: 'Room 110', + street_address_3: null, + city: 'Fort Sill', + state: 'OK', + postal_code: '73503', + country: 'United States', + }, + address_id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + latitude: 34.647964, + longitude: -98.41231, + PhoneLines: null, + Emails: null, + hours: 'Monday - Friday 0830-1530; Sat/Sun/Federal Holidays closed', + services: 'Walk-In Help; Appointments; QA Inspections; Appointments 06 and above', + note: null, + gbloc: 'JEAT', + created_at: '2018-05-28T14:27:35.547257Z', + updated_at: '2018-05-28T14:27:35.547257Z', + provides_ppm_closeout: true, + }, + provides_services_counseling: true, + }, + uploaded_orders_id: 'f779f6a2-48e2-47fe-87be-d93e8aa711fe', + status: 'DRAFT', + grade: 'E_7', + Entitlement: null, + entitlement_id: 'a1bf0035-4f28-45b8-af1a-556848d29e44', + UploadedAmendedOrders: null, + uploaded_amended_orders_id: null, + amended_orders_acknowledged_at: null, + origin_duty_location_gbloc: 'HAFC', + }, + status: 'DRAFT', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + previousMoves: [], + }, +}; + describe('MultiMovesLandingPage', () => { it('renders the component with retirement moves', () => { render(); // Check for specific elements expect(screen.getByTestId('customerHeader')).toBeInTheDocument(); - expect(screen.getByText('First Last')).toBeInTheDocument(); + expect(screen.getByTestId('welcomeHeader')).toBeInTheDocument(); expect(screen.getByText('Welcome to MilMove!')).toBeInTheDocument(); expect(screen.getByText('Create a Move')).toBeInTheDocument(); @@ -37,11 +192,17 @@ describe('MultiMovesLandingPage', () => { }); it('renders move data correctly', () => { - render(); + render( + + + , + ); + expect(screen.getByText('Jim Bean')).toBeInTheDocument(); + expect(screen.getByText('#YJ9M34')).toBeInTheDocument(); expect(screen.getByTestId('currentMoveHeader')).toBeInTheDocument(); expect(screen.getByTestId('currentMoveContainer')).toBeInTheDocument(); expect(screen.getByTestId('prevMovesHeader')).toBeInTheDocument(); - expect(screen.getByTestId('prevMovesContainer')).toBeInTheDocument(); + expect(screen.getByText('You have no previous moves.')).toBeInTheDocument(); }); }); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx index 6c523feeded..e1ff51c889c 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx @@ -96,24 +96,28 @@ const MultiMovesMoveContainer = ({ moves }) => {

        Shipments

        - {m.mtoShipments.map((s, sIndex) => ( - -
        - -
        -
        -

        {generateShipmentTypeTitle(s.shipmentType)}

        -
        #{m.moveCode}
        + {m.mtoShipments && m.mtoShipments.length > 0 ? ( + m.mtoShipments.map((s, sIndex) => ( + +
        + +
        +
        +

        {generateShipmentTypeTitle(s.shipmentType)}

        +
        #{m.moveCode}
        +
        -
        - -
        - - ))} + +
        + + )) + ) : ( +
        No shipments in move yet.
        + )}
        )}
        diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx index 53bfb959e37..23bf245d0c5 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx @@ -3,7 +3,7 @@ import React from 'react'; import styles from './MultiMovesMoveInfoList.module.scss'; import descriptionListStyles from 'styles/descriptionList.module.scss'; -import { formatAddress } from 'utils/shipmentDisplay'; +import { formatDateForDatePicker } from 'shared/dates'; const MultiMovesMoveInfoList = ({ move }) => { const { orders } = move; @@ -19,6 +19,17 @@ const MultiMovesMoveInfoList = ({ move }) => { return 'Report by Date'; }; + // function that determines label based on order type + const getOrdersTypeLabel = (ordersType) => { + if (ordersType === 'SEPARATION') { + return 'Separation'; + } + if (ordersType === 'RETIREMENT') { + return 'Retirement'; + } + return 'Permanent Change of Station'; + }; + // destination duty location label will differ based on order type const getDestinationDutyLocationLabel = (ordersType) => { if (ordersType === 'SEPARATION') { @@ -30,6 +41,36 @@ const MultiMovesMoveInfoList = ({ move }) => { return 'Destination Duty Location'; }; + const toCamelCase = (str) => { + return str.replace(/_([a-z])/g, (match, letter) => letter.toUpperCase()); + }; + + const formatAddress = (address) => { + const camelCaseAddress = Object.keys(address).reduce((acc, key) => { + acc[toCamelCase(key)] = address[key]; + return acc; + }, {}); + + const { streetAddress1, streetAddress2, streetAddress3, city, state, postalCode, id } = camelCaseAddress; + + // Check for empty UUID + const isIdEmpty = id === '00000000-0000-0000-0000-000000000000'; + + // Check for null values and empty UUID + if (isIdEmpty) { + return '-'; + } + + return ( + <> + {streetAddress1 && <>{streetAddress1}, } + {streetAddress2 && <>{streetAddress2}, } + {streetAddress3 && <>{streetAddress3}, } + {city ? `${city}, ${state} ${postalCode}` : postalCode} + + ); + }; + return (
        @@ -41,27 +82,27 @@ const MultiMovesMoveInfoList = ({ move }) => {
        Orders Issue Date
        -
        {orders.date_issued || '-'}
        +
        {formatDateForDatePicker(orders.issue_date) || '-'}
        Orders Type
        -
        {orders.ordersType || '-'}
        +
        {getOrdersTypeLabel(orders.orders_type) || '-'}
        {getReportByLabel(orders.ordersType)}
        -
        {orders.reportByDate || '-'}
        +
        {formatDateForDatePicker(orders.report_by_date) || '-'}
        Current Duty Location
        -
        {formatAddress(orders.originDutyLocation.address) || '-'}
        +
        {formatAddress(orders.OriginDutyLocation.Address) || '-'}
        {getDestinationDutyLocationLabel(orders.ordersType)}
        -
        {formatAddress(orders.destinationDutyLocation.address) || '-'}
        +
        {formatAddress(orders.NewDutyLocation.Address) || '-'}
        diff --git a/src/sagas/onboarding.js b/src/sagas/onboarding.js index 2f8908b3bff..6b862d2bcbc 100644 --- a/src/sagas/onboarding.js +++ b/src/sagas/onboarding.js @@ -11,7 +11,7 @@ import { getLoggedInUser, getMTOShipmentsForMove, createServiceMember as createServiceMemberApi, - getOrdersForServiceMember, + getAllMoves, } from 'services/internalApi'; import { addEntities } from 'shared/Entities/actions'; @@ -20,7 +20,6 @@ export function* fetchCustomerData() { const user = yield call(getLoggedInUser); yield put(addEntities(user)); - // TODO - fork/spawn additional API calls // Load MTO shipments if there is a move const { moves } = user; if (moves && Object.keys(moves).length > 0) { @@ -30,17 +29,12 @@ export function* fetchCustomerData() { yield put(addEntities(mtoShipments)); } - // if we have user data, we can load multiple move data - if (user) { - const currentMove = []; - const previousMoves = []; - const { serviceMembers } = user; - const [serviceMemberId] = Object.keys(serviceMembers); - const currentMoveData = yield call(getOrdersForServiceMember, serviceMemberId); - currentMove.push(currentMoveData); - const serviceMemberMoves = { currentMove: currentMoveData, previousMoves }; - yield put(addEntities({ serviceMemberMoves })); - } + // loading serviceMemberMoves for the user + const { serviceMembers } = user; + const key = Object.keys(serviceMembers)[0]; + const serviceMemberId = serviceMembers[key].id; + const allMoves = yield call(getAllMoves, serviceMemberId); + yield put(addEntities({ serviceMemberMoves: allMoves })); return user; } diff --git a/src/store/entities/selectors.js b/src/store/entities/selectors.js index fa12c58ed03..60a2057fe20 100644 --- a/src/store/entities/selectors.js +++ b/src/store/entities/selectors.js @@ -145,6 +145,11 @@ export const selectCurrentMove = (state) => { return activeMove || moves[0] || null; }; +export const selectAllMoves = (state) => { + if (state.entities.serviceMemberMoves) return state.entities.serviceMemberMoves; + return { currentMove: [], previousMoves: [] }; +}; + export const selectMoveIsApproved = createSelector(selectCurrentMove, (move) => move?.status === 'APPROVED'); export const selectMoveIsInDraft = createSelector(selectCurrentMove, (move) => move?.status === MOVE_STATUSES.DRAFT); diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index fb222c631b8..28d89f05997 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2411,6 +2411,9 @@ definitions: type: string orders: type: object + status: + type: string + readOnly: true updatedAt: format: date-time type: string diff --git a/swagger/internal.yaml b/swagger/internal.yaml index e68fb98f2a2..dedb987c234 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2444,6 +2444,9 @@ definitions: type: string orders: type: object + status: + type: string + readOnly: true updatedAt: format: date-time type: string From ae1bd4b7114a99d5beef5215dc1645660062a8cf Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Fri, 2 Feb 2024 14:52:00 +0000 Subject: [PATCH 52/67] updated tests to pass --- .../MultiMovesInfoList.test.jsx | 60 ++++++------ .../MultiMovesMoveInfoList.jsx | 7 +- .../MyMove/Multi-Moves/MultiMovesTestData.js | 96 +++++++++---------- src/sagas/onboarding.test.js | 52 ++++++++++ 4 files changed, 134 insertions(+), 81 deletions(-) diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx index 0fd14653ba2..e8be89ef030 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx @@ -8,12 +8,12 @@ describe('MultiMovesMoveInfoList', () => { const mockMoveSeparation = { status: 'DRAFT', orders: { - date_issued: '2022-01-01', - ordersType: 'SEPARATION', - reportByDate: '2022-02-01', - originDutyLocation: { + issue_date: '2022-01-01', + orders_type: 'SEPARATION', + report_by_date: '2022-02-01', + OriginDutyLocation: { name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -23,9 +23,9 @@ describe('MultiMovesMoveInfoList', () => { country: 'USA', }, }, - destinationDutyLocation: { + NewDutyLocation: { name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -41,12 +41,12 @@ describe('MultiMovesMoveInfoList', () => { const mockMoveRetirement = { status: 'DRAFT', orders: { - date_issued: '2022-01-01', - ordersType: 'RETIREMENT', - reportByDate: '2022-02-01', - originDutyLocation: { + issue_date: '2022-01-01', + orders_type: 'RETIREMENT', + report_by_date: '2022-02-01', + OriginDutyLocation: { name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -56,9 +56,9 @@ describe('MultiMovesMoveInfoList', () => { country: 'USA', }, }, - destinationDutyLocation: { + NewDutyLocation: { name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -74,12 +74,12 @@ describe('MultiMovesMoveInfoList', () => { const mockMovePCS = { status: 'DRAFT', orders: { - date_issued: '2022-01-01', - ordersType: 'PERMANENT_CHANGE_OF_DUTY_STATION', - reportByDate: '2022-02-01', - originDutyLocation: { + issue_date: '2022-01-01', + orders_type: 'PERMANENT_CHANGE_OF_DUTY_STATION', + report_by_date: '2022-02-01', + OriginDutyLocation: { name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -89,9 +89,9 @@ describe('MultiMovesMoveInfoList', () => { country: 'USA', }, }, - destinationDutyLocation: { + NewDutyLocation: { name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -111,13 +111,13 @@ describe('MultiMovesMoveInfoList', () => { expect(getByText('DRAFT')).toBeInTheDocument(); expect(getByText('Orders Issue Date')).toBeInTheDocument(); - expect(getByText('2022-01-01')).toBeInTheDocument(); + expect(getByText('01 Jan 2022')).toBeInTheDocument(); expect(getByText('Orders Type')).toBeInTheDocument(); - expect(getByText('SEPARATION')).toBeInTheDocument(); + expect(getByText('Separation')).toBeInTheDocument(); expect(getByText('Separation Date')).toBeInTheDocument(); - expect(getByText('2022-02-01')).toBeInTheDocument(); + expect(getByText('01 Feb 2022')).toBeInTheDocument(); expect(getByText('Current Duty Location')).toBeInTheDocument(); expect(getByText('HOR or PLEAD')).toBeInTheDocument(); @@ -130,13 +130,13 @@ describe('MultiMovesMoveInfoList', () => { expect(getByText('DRAFT')).toBeInTheDocument(); expect(getByText('Orders Issue Date')).toBeInTheDocument(); - expect(getByText('2022-01-01')).toBeInTheDocument(); + expect(getByText('01 Jan 2022')).toBeInTheDocument(); expect(getByText('Orders Type')).toBeInTheDocument(); - expect(getByText('RETIREMENT')).toBeInTheDocument(); + expect(getByText('Retirement')).toBeInTheDocument(); expect(getByText('Retirement Date')).toBeInTheDocument(); - expect(getByText('2022-02-01')).toBeInTheDocument(); + expect(getByText('01 Feb 2022')).toBeInTheDocument(); expect(getByText('Current Duty Location')).toBeInTheDocument(); expect(getByText('HOR, HOS, or PLEAD')).toBeInTheDocument(); @@ -149,13 +149,13 @@ describe('MultiMovesMoveInfoList', () => { expect(getByText('DRAFT')).toBeInTheDocument(); expect(getByText('Orders Issue Date')).toBeInTheDocument(); - expect(getByText('2022-01-01')).toBeInTheDocument(); + expect(getByText('01 Jan 2022')).toBeInTheDocument(); expect(getByText('Orders Type')).toBeInTheDocument(); - expect(getByText('PERMANENT_CHANGE_OF_DUTY_STATION')).toBeInTheDocument(); + expect(getByText('Permanent Change of Station')).toBeInTheDocument(); expect(getByText('Report by Date')).toBeInTheDocument(); - expect(getByText('2022-02-01')).toBeInTheDocument(); + expect(getByText('01 Feb 2022')).toBeInTheDocument(); expect(getByText('Current Duty Location')).toBeInTheDocument(); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx index 23bf245d0c5..90b205f9d59 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx @@ -41,6 +41,7 @@ const MultiMovesMoveInfoList = ({ move }) => { return 'Destination Duty Location'; }; + // converts return from API to camelCase to avoid linter errors const toCamelCase = (str) => { return str.replace(/_([a-z])/g, (match, letter) => letter.toUpperCase()); }; @@ -53,7 +54,7 @@ const MultiMovesMoveInfoList = ({ move }) => { const { streetAddress1, streetAddress2, streetAddress3, city, state, postalCode, id } = camelCaseAddress; - // Check for empty UUID + // Check for empty UUID (no address provided) const isIdEmpty = id === '00000000-0000-0000-0000-000000000000'; // Check for null values and empty UUID @@ -91,7 +92,7 @@ const MultiMovesMoveInfoList = ({ move }) => {
        -
        {getReportByLabel(orders.ordersType)}
        +
        {getReportByLabel(orders.orders_type)}
        {formatDateForDatePicker(orders.report_by_date) || '-'}
        @@ -101,7 +102,7 @@ const MultiMovesMoveInfoList = ({ move }) => {
        -
        {getDestinationDutyLocationLabel(orders.ordersType)}
        +
        {getDestinationDutyLocationLabel(orders.orders_type)}
        {formatAddress(orders.NewDutyLocation.Address) || '-'}
        diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesTestData.js b/src/pages/MyMove/Multi-Moves/MultiMovesTestData.js index e726b3fd346..e02213f3620 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesTestData.js +++ b/src/pages/MyMove/Multi-Moves/MultiMovesTestData.js @@ -7,10 +7,10 @@ export const mockMovesPCS = { status: 'DRAFT', orders: { id: 'testOrder1', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL1', name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -20,10 +20,10 @@ export const mockMovesPCS = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL1', name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -93,10 +93,10 @@ export const mockMovesPCS = { status: 'APPROVED', orders: { id: 'testOrder2', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL2', name: 'Fort Bragg South Station', - address: { + Address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -106,10 +106,10 @@ export const mockMovesPCS = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL2', name: 'Fort Bragg South Station', - address: { + Address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -177,10 +177,10 @@ export const mockMovesPCS = { status: 'APPROVED', orders: { id: 'testOrder3', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL3', name: 'Fort Bragg East Station', - address: { + Address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -190,10 +190,10 @@ export const mockMovesPCS = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL3', name: 'Fort Bragg East Station', - address: { + Address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -266,10 +266,10 @@ export const mockMovesRetirement = { status: 'SUBMITTED', orders: { id: 'testOrder1', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL1', name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -279,10 +279,10 @@ export const mockMovesRetirement = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL1', name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -352,10 +352,10 @@ export const mockMovesRetirement = { status: 'APPROVED', orders: { id: 'testOrder2', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL2', name: 'Fort Bragg South Station', - address: { + Address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -365,10 +365,10 @@ export const mockMovesRetirement = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL2', name: 'Fort Bragg South Station', - address: { + Address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -436,10 +436,10 @@ export const mockMovesRetirement = { status: 'APPROVED', orders: { id: 'testOrder3', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL3', name: 'Fort Bragg East Station', - address: { + Address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -449,10 +449,10 @@ export const mockMovesRetirement = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL3', name: 'Fort Bragg East Station', - address: { + Address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -525,10 +525,10 @@ export const mockMovesSeparation = { status: 'DRAFT', orders: { id: 'testOrder1', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL1', name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -538,10 +538,10 @@ export const mockMovesSeparation = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL1', name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -611,10 +611,10 @@ export const mockMovesSeparation = { status: 'APPROVED', orders: { id: 'testOrder2', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL2', name: 'Fort Bragg South Station', - address: { + Address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -624,10 +624,10 @@ export const mockMovesSeparation = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL2', name: 'Fort Bragg South Station', - address: { + Address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -695,10 +695,10 @@ export const mockMovesSeparation = { status: 'APPROVED', orders: { id: 'testOrder3', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL3', name: 'Fort Bragg East Station', - address: { + Address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -708,10 +708,10 @@ export const mockMovesSeparation = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL3', name: 'Fort Bragg East Station', - address: { + Address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -784,10 +784,10 @@ export const mockMovesNoPreviousMoves = { status: 'DRAFT', orders: { id: 'testOrder1', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL1', name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -797,10 +797,10 @@ export const mockMovesNoPreviousMoves = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL1', name: 'Fort Bragg North Station', - address: { + Address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -875,10 +875,10 @@ export const mockMovesNoCurrentMoveWithPreviousMoves = { status: 'APPROVED', orders: { id: 'testOrder2', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL2', name: 'Fort Bragg South Station', - address: { + Address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -888,10 +888,10 @@ export const mockMovesNoCurrentMoveWithPreviousMoves = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL2', name: 'Fort Bragg South Station', - address: { + Address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -959,10 +959,10 @@ export const mockMovesNoCurrentMoveWithPreviousMoves = { status: 'APPROVED', orders: { id: 'testOrder3', - destinationDutyLocation: { + NewDutyLocation: { id: 'testDDL3', name: 'Fort Bragg East Station', - address: { + Address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -972,10 +972,10 @@ export const mockMovesNoCurrentMoveWithPreviousMoves = { country: 'USA', }, }, - originDutyLocation: { + OriginDutyLocation: { id: 'testODL3', name: 'Fort Bragg East Station', - address: { + Address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', diff --git a/src/sagas/onboarding.test.js b/src/sagas/onboarding.test.js index 988fc5ace2a..edfd14a86f5 100644 --- a/src/sagas/onboarding.test.js +++ b/src/sagas/onboarding.test.js @@ -19,6 +19,7 @@ import { getLoggedInUser, createServiceMember as createServiceMemberApi, getMTOShipmentsForMove, + getAllMoves, } from 'services/internalApi'; import { addEntities } from 'shared/Entities/actions'; @@ -53,6 +54,15 @@ describe('fetchCustomerData', () => { email: 'testuser@example.com', }, }, + serviceMembers: { + serviceMemberId: { + id: 'serviceMemberId', + }, + }, + }; + const mockMultipleMoveResponseData = { + currentMove: [], + previousMoves: [], }; it('makes an API call to request the logged in user', () => { @@ -63,6 +73,20 @@ describe('fetchCustomerData', () => { expect(generator.next(mockResponseData).value).toEqual(put(addEntities(mockResponseData))); }); + it('makes an API call to request multiple moves', () => { + expect(generator.next().value).toEqual(call(getAllMoves, 'serviceMemberId')); + }); + + it('stores the multiple move data in entities', () => { + expect(generator.next(mockMultipleMoveResponseData).value).toEqual( + put( + addEntities({ + serviceMemberMoves: mockMultipleMoveResponseData, + }), + ), + ); + }); + it('yields the user data to the caller', () => { expect(generator.next().value).toEqual(mockResponseData); }); @@ -82,11 +106,20 @@ describe('fetchCustomerData', () => { email: 'testuser@example.com', }, }, + serviceMembers: { + serviceMemberId: { + id: 'serviceMemberId', + }, + }, moves: { testMoveId: { id: 'testMoveId', }, }, + serviceMemberMoves: { + currentMove: [], + previousMoves: [], + }, }; const mockMTOResponseData = { @@ -97,6 +130,11 @@ describe('fetchCustomerData', () => { }, }; + const mockMultipleMoveResponseData = { + currentMove: [], + previousMoves: [], + }; + it('makes an API call to request the logged in user', () => { expect(generator.next().value).toEqual(call(getLoggedInUser)); }); @@ -113,6 +151,20 @@ describe('fetchCustomerData', () => { expect(generator.next(mockMTOResponseData).value).toEqual(put(addEntities(mockMTOResponseData))); }); + it('makes an API call to request multiple moves', () => { + expect(generator.next().value).toEqual(call(getAllMoves, 'serviceMemberId')); + }); + + it('stores the multiple move data in entities', () => { + expect(generator.next(mockMultipleMoveResponseData).value).toEqual( + put( + addEntities({ + serviceMemberMoves: mockMultipleMoveResponseData, + }), + ), + ); + }); + it('yields the user data to the caller', () => { expect(generator.next().value).toEqual(mockResponseData); }); From 73e2c748052a522fa9a679c59006fa984c49d689 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Thu, 22 Feb 2024 18:07:23 +0000 Subject: [PATCH 53/67] resolving conflicts --- .../MyMove/Multi-Moves/MultiMovesLandingPage.jsx | 6 ++++-- .../Multi-Moves/MultiMovesLandingPage.test.jsx | 12 +++++++++--- .../MultiMovesMoveContainer.jsx | 16 +++++++++++++++- .../MultiMovesInfoList.test.jsx | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx index ea109f8ef24..e0bd7b625b3 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx @@ -1,6 +1,8 @@ import React, { useEffect, useState } from 'react'; import { Button } from '@trussworks/react-uswds'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { useNavigate } from 'react-router'; +import { connect } from 'react-redux'; import styles from './MultiMovesLandingPage.module.scss'; import MultiMovesMoveHeader from './MultiMovesMoveHeader/MultiMovesMoveHeader'; @@ -94,7 +96,7 @@ const MultiMovesLandingPage = ({ serviceMember, serviceMemberMoves }) => { )}
        -
        - ); + ) : null; }; MultiMovesLandingPage.defaultProps = { diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx index 0af53508496..8a685fde18c 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx @@ -1,7 +1,9 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; +import { v4 } from 'uuid'; + +import '@testing-library/jest-dom/extend-expect'; -import '@testing-library/jest-dom/extend-expect'; // For additional matchers like toBeInTheDocument import MultiMovesLandingPage from './MultiMovesLandingPage'; import { MockProviders } from 'testUtils'; @@ -177,8 +179,12 @@ const defaultProps = { }; describe('MultiMovesLandingPage', () => { - it('renders the component with retirement moves', () => { - render(); + it('renders the component with moves', () => { + render( + + + , + ); // Check for specific elements expect(screen.getByTestId('customerHeader')).toBeInTheDocument(); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx index e1ff51c889c..022c5a827ac 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classnames from 'classnames'; import { Button } from '@trussworks/react-uswds'; +import { useNavigate } from 'react-router'; import MultiMovesMoveInfoList from '../MultiMovesMoveInfoList/MultiMovesMoveInfoList'; import ButtonDropdownMenu from '../../../../components/ButtonDropdownMenu/ButtonDropdownMenu'; @@ -9,9 +10,11 @@ import ButtonDropdownMenu from '../../../../components/ButtonDropdownMenu/Button import styles from './MultiMovesMoveContainer.module.scss'; import ShipmentContainer from 'components/Office/ShipmentContainer/ShipmentContainer'; +import { customerRoutes } from 'constants/routes'; const MultiMovesMoveContainer = ({ moves }) => { const [expandedMoves, setExpandedMoves] = useState({}); + const navigate = useNavigate(); // this expands the moves when the arrow is clicked const handleExpandClick = (index) => { @@ -63,13 +66,24 @@ const MultiMovesMoveContainer = ({ moves }) => { return 'Shipment'; }; + // sends user to the move page when clicking "Go to Move" btn + const handleGoToMoveClick = () => { + navigate(customerRoutes.MOVE_HOME_PAGE); + }; + const moveList = moves.map((m, index) => (

        #{m.moveCode}

        {m.status !== 'APPROVED' ? ( - ) : ( diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx index e8be89ef030..df800ea5369 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { render } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; // For expect assertions +import '@testing-library/jest-dom/extend-expect'; import MultiMovesMoveInfoList from './MultiMovesMoveInfoList'; From 08321bf5477b7e74f26e34bd7bbcdf93540f0590 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Thu, 22 Feb 2024 19:03:25 +0000 Subject: [PATCH 54/67] updated tests --- .../MultiMovesMoveContainer.test.jsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.test.jsx index d5a5d4555dc..f8755028ba1 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.test.jsx @@ -6,12 +6,18 @@ import { mockMovesPCS } from '../MultiMovesTestData'; import MultiMovesMoveContainer from './MultiMovesMoveContainer'; +import { MockProviders } from 'testUtils'; + describe('MultiMovesMoveContainer', () => { const mockCurrentMoves = mockMovesPCS.currentMove; const mockPreviousMoves = mockMovesPCS.previousMoves; it('renders current move list correctly', () => { - render(); + render( + + + , + ); expect(screen.getByTestId('move-info-container')).toBeInTheDocument(); expect(screen.getByText('#MOVECO')).toBeInTheDocument(); @@ -19,7 +25,11 @@ describe('MultiMovesMoveContainer', () => { }); it('renders previous move list correctly', () => { - render(); + render( + + + , + ); expect(screen.queryByText('#SAMPLE')).toBeInTheDocument(); expect(screen.queryByText('#EXAMPL')).toBeInTheDocument(); @@ -27,7 +37,11 @@ describe('MultiMovesMoveContainer', () => { }); it('expands and collapses moves correctly', () => { - render(); + render( + + + , + ); // Initially, the move details should not be visible expect(screen.queryByText('Shipment')).not.toBeInTheDocument(); From 7892c3395f24b4779b5c2cdee5aa5766b58f9375 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Wed, 24 Jan 2024 17:37:50 +0000 Subject: [PATCH 55/67] matching files up compared to integration pr --- .../ContactInfoDisplay/ContactInfoDisplay.jsx | 8 +- .../OktaInfoDisplay/OktaInfoDisplay.jsx | 6 +- .../ServiceInfoDisplay/ServiceInfoDisplay.jsx | 10 +- .../Multi-Moves/MultiMovesLandingPage.jsx | 64 +++++++++- .../MultiMovesLandingPage.test.jsx | 55 ++++++++- .../MultiMovesMoveContainer.jsx | 16 ++- .../MultiMovesMoveContainer.test.jsx | 20 ++- .../MultiMovesInfoList.test.jsx | 2 +- src/pages/MyMove/Profile/EditContactInfo.jsx | 9 +- .../MyMove/Profile/EditContactInfo.test.jsx | 77 ++++++++++-- src/pages/MyMove/Profile/EditOktaInfo.jsx | 7 +- .../MyMove/Profile/EditOktaInfo.test.jsx | 2 +- ...itOrdersPayGradeAndOriginLocation.test.jsx | 13 +- src/pages/MyMove/Profile/EditServiceInfo.jsx | 9 +- .../MyMove/Profile/EditServiceInfo.test.jsx | 84 ++++++++----- src/pages/MyMove/Profile/Profile.jsx | 48 +++++++- src/pages/MyMove/Profile/Profile.module.scss | 35 ++++++ src/pages/MyMove/Profile/Profile.test.jsx | 114 ++++++++++++++++++ 18 files changed, 494 insertions(+), 85 deletions(-) create mode 100644 src/pages/MyMove/Profile/Profile.module.scss diff --git a/src/components/Customer/Profile/ContactInfoDisplay/ContactInfoDisplay.jsx b/src/components/Customer/Profile/ContactInfoDisplay/ContactInfoDisplay.jsx index 88afa53c7d0..16c78942da1 100644 --- a/src/components/Customer/Profile/ContactInfoDisplay/ContactInfoDisplay.jsx +++ b/src/components/Customer/Profile/ContactInfoDisplay/ContactInfoDisplay.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Link } from 'react-router-dom'; +import { Link, useLocation } from 'react-router-dom'; import styles from './ContactInfoDisplay.module.scss'; @@ -28,11 +28,15 @@ const ContactInfoDisplay = ({ preferredContactMethod = 'Email'; } + const { state } = useLocation(); + return (

        Contact info

        - Edit + + Edit +
        diff --git a/src/components/Customer/Profile/OktaInfoDisplay/OktaInfoDisplay.jsx b/src/components/Customer/Profile/OktaInfoDisplay/OktaInfoDisplay.jsx index 8c2a6d68d13..adf6ad6ae32 100644 --- a/src/components/Customer/Profile/OktaInfoDisplay/OktaInfoDisplay.jsx +++ b/src/components/Customer/Profile/OktaInfoDisplay/OktaInfoDisplay.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { string, PropTypes } from 'prop-types'; -import { Link } from 'react-router-dom'; +import { Link, useLocation } from 'react-router-dom'; import oktaLogo from '../../../../shared/images/okta_logo.png'; @@ -9,11 +9,13 @@ import oktaInfoDisplayStyles from './OktaInfoDisplay.module.scss'; import descriptionListStyles from 'styles/descriptionList.module.scss'; const OktaInfoDisplay = ({ editURL, oktaUsername, oktaEmail, oktaFirstName, oktaLastName, oktaEdipi }) => { + const { state } = useLocation(); + return (
        Okta logo - + Edit
        diff --git a/src/components/Customer/Review/ServiceInfoDisplay/ServiceInfoDisplay.jsx b/src/components/Customer/Review/ServiceInfoDisplay/ServiceInfoDisplay.jsx index 24576645bf9..2776b76e07e 100644 --- a/src/components/Customer/Review/ServiceInfoDisplay/ServiceInfoDisplay.jsx +++ b/src/components/Customer/Review/ServiceInfoDisplay/ServiceInfoDisplay.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { string, bool } from 'prop-types'; -import { Link } from 'react-router-dom'; +import { Link, useLocation } from 'react-router-dom'; import serviceInfoDisplayStyles from './ServiceInfoDisplay.module.scss'; @@ -19,11 +19,17 @@ const ServiceInfoDisplay = ({ editURL, payGrade, }) => { + const { state } = useLocation(); + return (

        Service info

        - {isEditable && Edit} + {isEditable && ( + + Edit + + )}
        {!isEditable && showMessage && (
        diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx index 33bc7c01b2e..187ce5cf681 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx @@ -1,6 +1,8 @@ import React, { useEffect, useState } from 'react'; import { Button } from '@trussworks/react-uswds'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { useNavigate } from 'react-router'; +import { connect } from 'react-redux'; import styles from './MultiMovesLandingPage.module.scss'; import MultiMovesMoveHeader from './MultiMovesMoveHeader/MultiMovesMoveHeader'; @@ -14,6 +16,7 @@ import { mockMovesNoCurrentOrPreviousMoves, } from './MultiMovesTestData'; +import { detectFlags } from 'utils/featureFlags'; import { generatePageTitle } from 'hooks/custom'; import { milmoveLogger } from 'utils/milmoveLog'; import retryPageLoading from 'utils/retryPageLoading'; @@ -21,9 +24,20 @@ import { loadInternalSchema } from 'shared/Swagger/ducks'; import { loadUser } from 'store/auth/actions'; import { initOnboarding } from 'store/onboarding/actions'; import Helper from 'components/Customer/Home/Helper'; +import { customerRoutes } from 'constants/routes'; +import { withContext } from 'shared/AppContext'; +import withRouter from 'utils/routing'; +import requireCustomerState from 'containers/requireCustomerState/requireCustomerState'; +import { + selectCurrentMove, + selectIsProfileComplete, + selectServiceMemberFromLoggedInUser, +} from 'store/entities/selectors'; const MultiMovesLandingPage = () => { const [setErrorState] = useState({ hasError: false, error: undefined, info: undefined }); + const navigate = useNavigate(); + // ! This is just used for testing and viewing different variations of data that MilMove will use // user can add params of ?moveData=PCS, etc to view different views let moves; @@ -53,7 +67,6 @@ const MultiMovesLandingPage = () => { break; } // ! end of test data - useEffect(() => { const fetchData = async () => { try { @@ -81,7 +94,22 @@ const MultiMovesLandingPage = () => { fetchData(); }, [setErrorState]); - return ( + const flags = detectFlags(process.env.NODE_ENV, window.location.host, window.location.search); + + // handles logic when user clicks "Create a Move" button + // if they have previous moves, they'll need to validate their profile + // if they do not have previous moves, then they don't need to validate + const handleCreateMoveBtnClick = () => { + if (moves.previousMoves.length > 0) { + const profileEditPath = customerRoutes.PROFILE_PATH; + navigate(profileEditPath, { state: { needsToVerifyProfile: true } }); + } else { + navigate(customerRoutes.MOVE_HOME_PAGE); + } + }; + + // ! WILL ONLY SHOW IF MULTIMOVE FLAG IS TRUE + return flags.multiMove ? (
        @@ -91,13 +119,13 @@ const MultiMovesLandingPage = () => {
        -

        +

        We can put information at the top here - potentially important contact info or basic instructions on how to start a move?

        -
        - ); + ) : null; }; -export default MultiMovesLandingPage; +MultiMovesLandingPage.defaultProps = { + serviceMember: null, +}; + +const mapStateToProps = (state) => { + const serviceMember = selectServiceMemberFromLoggedInUser(state); + const move = selectCurrentMove(state) || {}; + + return { + isProfileComplete: selectIsProfileComplete(state), + serviceMember, + move, + }; +}; + +// in order to avoid setting up proxy server only for storybook, pass in stub function so API requests don't fail +const mergeProps = (stateProps, dispatchProps, ownProps) => ({ + ...stateProps, + ...dispatchProps, + ...ownProps, +}); + +export default withContext( + withRouter(connect(mapStateToProps, mergeProps)(requireCustomerState(MultiMovesLandingPage))), +); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx index e19c56cff35..7357ba5434c 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx @@ -1,9 +1,14 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; +import { v4 } from 'uuid'; + +import '@testing-library/jest-dom/extend-expect'; -import '@testing-library/jest-dom/extend-expect'; // For additional matchers like toBeInTheDocument import MultiMovesLandingPage from './MultiMovesLandingPage'; +import { MockProviders } from 'testUtils'; +import { MOVE_STATUSES } from 'shared/constants'; + // Mock external dependencies jest.mock('utils/featureFlags', () => ({ detectFlags: jest.fn(() => ({ multiMove: true })), @@ -21,12 +26,50 @@ jest.mock('shared/Swagger/ducks', () => ({ loadInternalSchema: jest.fn(), })); +const defaultProps = { + serviceMember: { + id: v4(), + current_location: { + transportation_office: { + name: 'Test Transportation Office Name', + phone_lines: ['555-555-5555'], + }, + }, + weight_allotment: { + total_weight_self: 8000, + total_weight_self_plus_dependents: 11000, + }, + }, + showLoggedInUser: jest.fn(), + createServiceMember: jest.fn(), + getSignedCertification: jest.fn(), + mtoShipments: [], + mtoShipment: {}, + isLoggedIn: true, + loggedInUserIsLoading: false, + loggedInUserSuccess: true, + isProfileComplete: true, + loadMTOShipments: jest.fn(), + updateShipmentList: jest.fn(), + move: { + id: v4(), + status: MOVE_STATUSES.DRAFT, + }, + uploadedOrderDocuments: [], + uploadedAmendedOrderDocuments: [], +}; + describe('MultiMovesLandingPage', () => { - it('renders the component with retirement moves', () => { - render(); + it('renders the component with moves', () => { + render( + + + , + ); // Check for specific elements expect(screen.getByTestId('customerHeader')).toBeInTheDocument(); + expect(screen.getByTestId('welcomeHeader')).toBeInTheDocument(); expect(screen.getByText('First Last')).toBeInTheDocument(); expect(screen.getByText('Welcome to MilMove!')).toBeInTheDocument(); expect(screen.getByText('Create a Move')).toBeInTheDocument(); @@ -37,7 +80,11 @@ describe('MultiMovesLandingPage', () => { }); it('renders move data correctly', () => { - render(); + render( + + + , + ); expect(screen.getByTestId('currentMoveHeader')).toBeInTheDocument(); expect(screen.getByTestId('currentMoveContainer')).toBeInTheDocument(); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx index 6c523feeded..1ffe09bd2ec 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classnames from 'classnames'; import { Button } from '@trussworks/react-uswds'; +import { useNavigate } from 'react-router'; import MultiMovesMoveInfoList from '../MultiMovesMoveInfoList/MultiMovesMoveInfoList'; import ButtonDropdownMenu from '../../../../components/ButtonDropdownMenu/ButtonDropdownMenu'; @@ -9,9 +10,11 @@ import ButtonDropdownMenu from '../../../../components/ButtonDropdownMenu/Button import styles from './MultiMovesMoveContainer.module.scss'; import ShipmentContainer from 'components/Office/ShipmentContainer/ShipmentContainer'; +import { customerRoutes } from 'constants/routes'; const MultiMovesMoveContainer = ({ moves }) => { const [expandedMoves, setExpandedMoves] = useState({}); + const navigate = useNavigate(); // this expands the moves when the arrow is clicked const handleExpandClick = (index) => { @@ -63,13 +66,24 @@ const MultiMovesMoveContainer = ({ moves }) => { return 'Shipment'; }; + // sends user to the move page when clicking "Go to Move" btn + const handleGoToMoveClick = () => { + navigate(customerRoutes.MOVE_HOME_PAGE); + }; + const moveList = moves.map((m, index) => (

        #{m.moveCode}

        {m.status !== 'APPROVED' ? ( - ) : ( diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.test.jsx index d5a5d4555dc..f8755028ba1 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.test.jsx @@ -6,12 +6,18 @@ import { mockMovesPCS } from '../MultiMovesTestData'; import MultiMovesMoveContainer from './MultiMovesMoveContainer'; +import { MockProviders } from 'testUtils'; + describe('MultiMovesMoveContainer', () => { const mockCurrentMoves = mockMovesPCS.currentMove; const mockPreviousMoves = mockMovesPCS.previousMoves; it('renders current move list correctly', () => { - render(); + render( + + + , + ); expect(screen.getByTestId('move-info-container')).toBeInTheDocument(); expect(screen.getByText('#MOVECO')).toBeInTheDocument(); @@ -19,7 +25,11 @@ describe('MultiMovesMoveContainer', () => { }); it('renders previous move list correctly', () => { - render(); + render( + + + , + ); expect(screen.queryByText('#SAMPLE')).toBeInTheDocument(); expect(screen.queryByText('#EXAMPL')).toBeInTheDocument(); @@ -27,7 +37,11 @@ describe('MultiMovesMoveContainer', () => { }); it('expands and collapses moves correctly', () => { - render(); + render( + + + , + ); // Initially, the move details should not be visible expect(screen.queryByText('Shipment')).not.toBeInTheDocument(); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx index 0fd14653ba2..d3c90547514 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { render } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; // For expect assertions +import '@testing-library/jest-dom/extend-expect'; import MultiMovesMoveInfoList from './MultiMovesMoveInfoList'; diff --git a/src/pages/MyMove/Profile/EditContactInfo.jsx b/src/pages/MyMove/Profile/EditContactInfo.jsx index 0615dc23d69..820ffb1b997 100644 --- a/src/pages/MyMove/Profile/EditContactInfo.jsx +++ b/src/pages/MyMove/Profile/EditContactInfo.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import React, { useState } from 'react'; import { connect } from 'react-redux'; -import { useNavigate } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router-dom'; import { Alert, Grid, GridContainer } from '@trussworks/react-uswds'; import EditContactInfoForm, { @@ -28,6 +28,7 @@ export const EditContactInfo = ({ updateServiceMember, }) => { const navigate = useNavigate(); + const { state } = useLocation(); const [serverError, setServerError] = useState(null); const initialValues = { @@ -58,7 +59,7 @@ export const EditContactInfo = ({ }; const handleCancel = () => { - navigate(customerRoutes.PROFILE_PATH); + navigate(customerRoutes.PROFILE_PATH, { state }); }; const handleSubmit = async (values) => { @@ -117,11 +118,9 @@ export const EditContactInfo = ({ .then(updateServiceMember) .then(() => { setFlashMessage('EDIT_CONTACT_INFO_SUCCESS', 'success', "You've updated your information."); - navigate(customerRoutes.PROFILE_PATH); + navigate(customerRoutes.PROFILE_PATH, { state }); }) .catch((e) => { - // // TODO - error handling - below is rudimentary error handling to approximate existing UX - // // Error shape: https://github.com/swagger-api/swagger-js/blob/master/docs/usage/http-client.md#errors const { response } = e; const errorMessage = getResponseError(response, 'Failed to update service member due to server error'); diff --git a/src/pages/MyMove/Profile/EditContactInfo.test.jsx b/src/pages/MyMove/Profile/EditContactInfo.test.jsx index 60496e1f611..2ef1a74120b 100644 --- a/src/pages/MyMove/Profile/EditContactInfo.test.jsx +++ b/src/pages/MyMove/Profile/EditContactInfo.test.jsx @@ -6,6 +6,7 @@ import { EditContactInfo } from './EditContactInfo'; import { patchBackupContact, patchServiceMember } from 'services/internalApi'; import { customerRoutes } from 'constants/routes'; +import { MockProviders } from 'testUtils'; const mockNavigate = jest.fn(); jest.mock('react-router-dom', () => ({ @@ -62,7 +63,11 @@ describe('EditContactInfo page', () => { }; it('renders the EditContactInfo form', async () => { - render(); + render( + + + , + ); const h1 = await screen.findByRole('heading', { name: 'Edit contact info', level: 1 }); expect(h1).toBeInTheDocument(); @@ -81,13 +86,17 @@ describe('EditContactInfo page', () => { }); it('goes back to the profile page when the cancel button is clicked', async () => { - render(); + render( + + + , + ); const cancelButton = await screen.findByRole('button', { name: 'Cancel' }); await userEvent.click(cancelButton); - expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.PROFILE_PATH); + expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.PROFILE_PATH, { state: null }); }); it('saves backup contact info when it is updated and the save button is clicked', async () => { @@ -105,7 +114,11 @@ describe('EditContactInfo page', () => { patchBackupContact.mockImplementation(() => Promise.resolve(patchResponse)); patchServiceMember.mockImplementation(() => Promise.resolve()); - render(); + render( + + + , + ); const backupNameInput = await screen.findByLabelText('Name'); @@ -138,7 +151,11 @@ describe('EditContactInfo page', () => { }), ); - render(); + render( + + + , + ); const backupNameInput = await screen.findByLabelText('Name'); @@ -165,7 +182,11 @@ describe('EditContactInfo page', () => { it('does not save backup contact info if it is not updated and the save button is clicked', async () => { patchServiceMember.mockImplementation(() => Promise.resolve()); - render(); + render( + + + , + ); const saveButton = screen.getByRole('button', { name: 'Save' }); @@ -191,7 +212,11 @@ describe('EditContactInfo page', () => { patchServiceMember.mockImplementation(() => Promise.resolve(patchResponse)); - render(); + render( + + + , + ); const secondaryPhoneInput = await screen.findByLabelText(/Alt. phone/); @@ -213,7 +238,11 @@ describe('EditContactInfo page', () => { it('sets a flash message when the save button is clicked', async () => { patchServiceMember.mockImplementation(() => Promise.resolve()); - render(); + render( + + + , + ); const saveButton = screen.getByRole('button', { name: 'Save' }); @@ -231,14 +260,36 @@ describe('EditContactInfo page', () => { it('routes to the profile page when the save button is clicked', async () => { patchServiceMember.mockImplementation(() => Promise.resolve()); - render(); + render( + + + , + ); const saveButton = screen.getByRole('button', { name: 'Save' }); await userEvent.click(saveButton); await waitFor(() => { - expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.PROFILE_PATH); + expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.PROFILE_PATH, { state: null }); + }); + }); + + it('routes to the profile page when the cancel button is clicked', async () => { + patchServiceMember.mockImplementation(() => Promise.resolve()); + + render( + + + , + ); + + const cancelButton = screen.getByRole('button', { name: 'Cancel' }); + + await userEvent.click(cancelButton); + + await waitFor(() => { + expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.PROFILE_PATH, { state: null }); }); }); @@ -256,7 +307,11 @@ describe('EditContactInfo page', () => { }), ); - render(); + render( + + + , + ); const saveButton = screen.getByRole('button', { name: 'Save' }); diff --git a/src/pages/MyMove/Profile/EditOktaInfo.jsx b/src/pages/MyMove/Profile/EditOktaInfo.jsx index 5fc41e7d3a9..1a003446f9f 100644 --- a/src/pages/MyMove/Profile/EditOktaInfo.jsx +++ b/src/pages/MyMove/Profile/EditOktaInfo.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import React, { useState } from 'react'; import { connect } from 'react-redux'; -import { useNavigate } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router-dom'; import { Alert, Grid, GridContainer } from '@trussworks/react-uswds'; import { OktaUserInfoShape } from 'types/user'; @@ -15,6 +15,7 @@ import { setFlashMessage as setFlashMessageAction } from 'store/flash/actions'; export const EditOktaInfo = ({ serviceMember, setFlashMessage, oktaUser, updateOktaUserState }) => { const navigate = useNavigate(); + const { state } = useLocation(); const [serverError, setServerError] = useState(null); const [noChangeError, setNoChangeError] = useState(null); @@ -28,7 +29,7 @@ export const EditOktaInfo = ({ serviceMember, setFlashMessage, oktaUser, updateO }; const handleCancel = () => { - navigate(customerRoutes.PROFILE_PATH); + navigate(customerRoutes.PROFILE_PATH, { state }); }; // sends POST request to Okta API with form values @@ -60,7 +61,7 @@ export const EditOktaInfo = ({ serviceMember, setFlashMessage, oktaUser, updateO .then((response) => { updateOktaUserState(response); setFlashMessage('EDIT_OKTA_PROFILE_SUCCESS', 'success', "You've updated your Okta profile."); - navigate(customerRoutes.PROFILE_PATH); + navigate(customerRoutes.PROFILE_PATH, { state }); }) .catch((e) => { const { response } = e; diff --git a/src/pages/MyMove/Profile/EditOktaInfo.test.jsx b/src/pages/MyMove/Profile/EditOktaInfo.test.jsx index 0623168cb7c..26ff8777fa8 100644 --- a/src/pages/MyMove/Profile/EditOktaInfo.test.jsx +++ b/src/pages/MyMove/Profile/EditOktaInfo.test.jsx @@ -101,7 +101,7 @@ describe('EditOktaInfo page', () => { await userEvent.click(cancelButton); - expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.PROFILE_PATH); + expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.PROFILE_PATH, { state: null }); }); afterEach(jest.resetAllMocks); diff --git a/src/pages/MyMove/Profile/EditOrdersPayGradeAndOriginLocation.test.jsx b/src/pages/MyMove/Profile/EditOrdersPayGradeAndOriginLocation.test.jsx index baa25b860ba..52bb9579b29 100644 --- a/src/pages/MyMove/Profile/EditOrdersPayGradeAndOriginLocation.test.jsx +++ b/src/pages/MyMove/Profile/EditOrdersPayGradeAndOriginLocation.test.jsx @@ -1,6 +1,7 @@ import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { MemoryRouter } from 'react-router'; import { EditServiceInfo } from './EditServiceInfo'; @@ -86,7 +87,11 @@ describe('EditServiceInfo page updates orders table information', () => { }; createOrders.mockImplementation(() => Promise.resolve(testOrdersValues)); - render(); + render( + + + , + ); getOrdersForServiceMember.mockImplementation(() => Promise.resolve(testOrdersValues)); patchOrders.mockImplementation(() => Promise.resolve(testOrdersValues)); @@ -169,7 +174,11 @@ describe('EditServiceInfo page updates orders table information', () => { }; createOrders.mockImplementation(() => Promise.resolve(testOrdersValues)); - render(); + render( + + + , + ); getOrdersForServiceMember.mockImplementation(() => Promise.resolve(testOrdersValues)); patchOrders.mockImplementation(() => Promise.resolve(testOrdersValues)); diff --git a/src/pages/MyMove/Profile/EditServiceInfo.jsx b/src/pages/MyMove/Profile/EditServiceInfo.jsx index 78d5b9a5db6..7c932137451 100644 --- a/src/pages/MyMove/Profile/EditServiceInfo.jsx +++ b/src/pages/MyMove/Profile/EditServiceInfo.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import PropTypes from 'prop-types'; import { GridContainer, Alert } from '@trussworks/react-uswds'; import { connect } from 'react-redux'; -import { useNavigate } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router-dom'; import ServiceInfoForm from 'components/Customer/ServiceInfoForm/ServiceInfoForm'; import { patchServiceMember, patchOrders, getResponseError } from 'services/internalApi'; @@ -32,6 +32,7 @@ export const EditServiceInfo = ({ }) => { const navigate = useNavigate(); const [serverError, setServerError] = useState(null); + const { state } = useLocation(); useEffect(() => { if (!moveIsInDraft) { @@ -84,7 +85,7 @@ export const EditServiceInfo = ({ setFlashMessage('EDIT_SERVICE_INFO_SUCCESS', 'success', '', 'Your changes have been saved.'); } - navigate(customerRoutes.PROFILE_PATH); + navigate(customerRoutes.PROFILE_PATH, { state }); }) .catch((e) => { // Error shape: https://github.com/swagger-api/swagger-js/blob/master/docs/usage/http-client.md#errors @@ -122,7 +123,7 @@ export const EditServiceInfo = ({ setFlashMessage('EDIT_SERVICE_INFO_SUCCESS', 'success', '', 'Your changes have been saved.'); } - navigate(customerRoutes.PROFILE_PATH); + navigate(customerRoutes.PROFILE_PATH, { state }); }) .catch((e) => { // Error shape: https://github.com/swagger-api/swagger-js/blob/master/docs/usage/http-client.md#errors @@ -133,7 +134,7 @@ export const EditServiceInfo = ({ }; const handleCancel = () => { - navigate(customerRoutes.PROFILE_PATH); + navigate(customerRoutes.PROFILE_PATH, { state }); }; return ( diff --git a/src/pages/MyMove/Profile/EditServiceInfo.test.jsx b/src/pages/MyMove/Profile/EditServiceInfo.test.jsx index a4a2827ddbf..a2c0b622bbe 100644 --- a/src/pages/MyMove/Profile/EditServiceInfo.test.jsx +++ b/src/pages/MyMove/Profile/EditServiceInfo.test.jsx @@ -5,6 +5,7 @@ import userEvent from '@testing-library/user-event'; import { EditServiceInfo } from './EditServiceInfo'; import { patchServiceMember } from 'services/internalApi'; +import { MockProviders } from 'testUtils'; const mockNavigate = jest.fn(); jest.mock('react-router-dom', () => ({ @@ -33,21 +34,28 @@ describe('EditServiceInfo page', () => { }; it('renders the EditServiceInfo form', async () => { - render(); + render( + + + , + ); expect(await screen.findByRole('heading', { name: 'Edit service info', level: 1 })).toBeInTheDocument(); }); it('the cancel button goes back to the profile page', async () => { - render(); - + render( + + + , + ); const cancelButton = await screen.findByText('Cancel'); await waitFor(() => { expect(cancelButton).toBeInTheDocument(); }); await userEvent.click(cancelButton); - expect(mockNavigate).toHaveBeenCalledWith('/service-member/profile'); + expect(mockNavigate).toHaveBeenCalledWith('/service-member/profile', { state: null }); }); it('save button submits the form and goes to the profile page', async () => { @@ -79,15 +87,17 @@ describe('EditServiceInfo page', () => { // Need to provide initial values because we aren't testing the form here, and just want to submit immediately render( - , + + + , ); const submitButton = await screen.findByText('Save'); @@ -106,7 +116,7 @@ describe('EditServiceInfo page', () => { 'Your changes have been saved.', ); - expect(mockNavigate).toHaveBeenCalledWith('/service-member/profile'); + expect(mockNavigate).toHaveBeenCalledWith('/service-member/profile', { state: null }); }); it('displays a flash message about entitlement when the pay grade changes', async () => { @@ -174,15 +184,17 @@ describe('EditServiceInfo page', () => { // Need to provide initial values because we aren't testing the form here, and just want to submit immediately render( - , + + + , ); const payGradeInput = await screen.findByLabelText('Pay grade'); @@ -204,7 +216,7 @@ describe('EditServiceInfo page', () => { 'Your changes have been saved. Note that the entitlement has also changed.', ); - expect(mockNavigate).toHaveBeenCalledWith('/service-member/profile'); + expect(mockNavigate).toHaveBeenCalledWith('/service-member/profile', { state: null }); }); it('shows an error if the API returns an error', async () => { @@ -253,14 +265,16 @@ describe('EditServiceInfo page', () => { // Need to provide complete & valid initial values because we aren't testing the form here, and just want to submit immediately render( - , + + + , ); const submitButton = await screen.findByText('Save'); @@ -279,7 +293,11 @@ describe('EditServiceInfo page', () => { describe('if the current move has been submitted', () => { it('redirects to the home page', async () => { - render(); + render( + + + , + ); await waitFor(() => { expect(mockNavigate).toHaveBeenCalledWith('/'); diff --git a/src/pages/MyMove/Profile/Profile.jsx b/src/pages/MyMove/Profile/Profile.jsx index 33b5c2cbfb4..0dce8fba818 100644 --- a/src/pages/MyMove/Profile/Profile.jsx +++ b/src/pages/MyMove/Profile/Profile.jsx @@ -1,8 +1,11 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { arrayOf, bool } from 'prop-types'; -import { Alert } from '@trussworks/react-uswds'; -import { Link } from 'react-router-dom'; +import { Alert, Button } from '@trussworks/react-uswds'; +import { Link, useLocation, useNavigate } from 'react-router-dom'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; + +import styles from './Profile.module.scss'; import ConnectedFlashMessage from 'containers/FlashMessage/FlashMessage'; import ContactInfoDisplay from 'components/Customer/Profile/ContactInfoDisplay/ContactInfoDisplay'; @@ -33,6 +36,22 @@ const Profile = ({ serviceMember, currentOrders, currentBackupContacts, moveIsIn telephone: currentBackupContacts[0]?.telephone || '', email: currentBackupContacts[0]?.email || '', }; + const [needsToVerifyProfile, setNeedsToVerifyProfile] = useState(false); + + const navigate = useNavigate(); + const { state } = useLocation(); + + useEffect(() => { + if (state && state.needsToVerifyProfile) { + setNeedsToVerifyProfile(state.needsToVerifyProfile); + } else { + setNeedsToVerifyProfile(false); + } + }, [state]); + + const handleCreateMoveClick = () => { + navigate(customerRoutes.MOVE_HOME_PAGE); + }; // displays the profile data for MilMove & Okta // Profile w/contact info for servicemember & backup contact @@ -43,13 +62,32 @@ const Profile = ({ serviceMember, currentOrders, currentBackupContacts, moveIsIn
        - Return to Move -

        Profile

        + {needsToVerifyProfile ? ( + Return to Dashboard + ) : ( + Return to Move + )} +
        +

        Profile

        + {needsToVerifyProfile && ( + + )} +
        {showMessages && ( You can change these details later by talking to a move counselor or customer care representative. )} + {needsToVerifyProfile && ( + + Please verify & confirm your profile before starting the process of creating your move. + + )} ({ + ...jest.requireActual('react-router-dom'), + useLocation: jest.fn(), +})); + describe('Profile component', () => { const testProps = {}; @@ -82,6 +88,8 @@ describe('Profile component', () => { }, }, }; + useLocation.mockReturnValue({}); + render( @@ -107,6 +115,16 @@ describe('Profile component', () => { const homeLink = screen.getByText('Return to Move'); expect(homeLink).toBeInTheDocument(); + + // these should be false since needsToVerifyProfile is not true + const returnToDashboardLink = screen.queryByText('Return to Dashboard'); + expect(returnToDashboardLink).not.toBeInTheDocument(); + + const createMoveBtn = screen.queryByText('createMoveBtn'); + expect(createMoveBtn).not.toBeInTheDocument(); + + const profileConfirmAlert = screen.queryByText('profileConfirmAlert'); + expect(profileConfirmAlert).not.toBeInTheDocument(); }); it('renders the Profile Page when there are no orders', async () => { @@ -161,6 +179,8 @@ describe('Profile component', () => { }, }, }; + useLocation.mockReturnValue({}); + render( @@ -266,6 +286,8 @@ describe('Profile component', () => { }, }, }; + useLocation.mockReturnValue({}); + render( @@ -290,4 +312,96 @@ describe('Profile component', () => { expect(homeLink).toBeInTheDocument(); }); + + it('renders the Profile Page with needsToVerifyProfile set to true', async () => { + const mockState = { + entities: { + user: { + testUserId: { + id: 'testUserId', + email: 'testuser@example.com', + service_member: 'testServiceMemberId', + }, + }, + orders: { + test: { + new_duty_location: { + name: 'Test Duty Location', + }, + status: 'DRAFT', + moves: ['testMove'], + }, + }, + moves: { + testMove: { + created_at: '2020-12-17T15:54:48.873Z', + id: 'testMove', + locator: 'test', + orders_id: 'test', + selected_move_type: '', + service_member_id: 'testServiceMemberId', + status: 'DRAFT', + }, + }, + serviceMembers: { + testServiceMemberId: { + id: 'testServiceMemberId', + rank: 'test rank', + edipi: '1234567890', + affiliation: 'ARMY', + first_name: 'Tester', + last_name: 'Testperson', + telephone: '1234567890', + personal_email: 'test@example.com', + email_is_preferred: true, + residential_address: { + city: 'San Diego', + state: 'CA', + postalCode: '92131', + streetAddress1: 'Some Street', + country: 'USA', + }, + backup_mailing_address: { + city: 'San Diego', + state: 'CA', + postalCode: '92131', + streetAddress1: 'Some Backup Street', + country: 'USA', + }, + current_location: { + origin_duty_location: { + name: 'Current Station', + }, + grade: 'E-5', + }, + backup_contacts: [ + { + name: 'Backup Contact', + telephone: '555-555-5555', + email: 'backup@test.com', + }, + ], + orders: ['test'], + }, + }, + }, + }; + + useLocation.mockReturnValue({ state: { needsToVerifyProfile: true } }); + + render( + + + , + ); + + const returnToDashboardLink = screen.getByText('Return to Dashboard'); + expect(returnToDashboardLink).toBeInTheDocument(); + + const createMoveBtn = screen.getByTestId('createMoveBtn'); + expect(createMoveBtn).toBeInTheDocument(); + + const profileConfirmAlert = screen.getByTestId('profileConfirmAlert'); + expect(profileConfirmAlert).toBeInTheDocument(); + }); }); From 2b9832ae19ec52c76371951cc2df6b69e3cdc617 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Thu, 22 Feb 2024 19:28:18 +0000 Subject: [PATCH 56/67] adding update PR changes --- src/pages/MyMove/Profile/Profile.jsx | 40 +++++++++++++++----- src/pages/MyMove/Profile/Profile.module.scss | 6 ++- src/pages/MyMove/Profile/Profile.test.jsx | 16 +++++++- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/src/pages/MyMove/Profile/Profile.jsx b/src/pages/MyMove/Profile/Profile.jsx index 0dce8fba818..5780553f066 100644 --- a/src/pages/MyMove/Profile/Profile.jsx +++ b/src/pages/MyMove/Profile/Profile.jsx @@ -3,7 +3,6 @@ import { connect } from 'react-redux'; import { arrayOf, bool } from 'prop-types'; import { Alert, Button } from '@trussworks/react-uswds'; import { Link, useLocation, useNavigate } from 'react-router-dom'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import styles from './Profile.module.scss'; @@ -37,6 +36,7 @@ const Profile = ({ serviceMember, currentOrders, currentBackupContacts, moveIsIn email: currentBackupContacts[0]?.email || '', }; const [needsToVerifyProfile, setNeedsToVerifyProfile] = useState(false); + const [profileValidated, setProfileValidated] = useState(false); const navigate = useNavigate(); const { state } = useLocation(); @@ -53,6 +53,10 @@ const Profile = ({ serviceMember, currentOrders, currentBackupContacts, moveIsIn navigate(customerRoutes.MOVE_HOME_PAGE); }; + const handleValidateProfileClick = () => { + setProfileValidated(true); + }; + // displays the profile data for MilMove & Okta // Profile w/contact info for servicemember & backup contact // Service info that displays name, branch, pay grade, DoDID/EDIPI, and current duty location @@ -69,14 +73,6 @@ const Profile = ({ serviceMember, currentOrders, currentBackupContacts, moveIsIn )}

        Profile

        - {needsToVerifyProfile && ( - - )}
        {showMessages && ( @@ -85,7 +81,11 @@ const Profile = ({ serviceMember, currentOrders, currentBackupContacts, moveIsIn )} {needsToVerifyProfile && ( - Please verify & confirm your profile before starting the process of creating your move. + + Please confirm your profile information is accurate prior to starting a new move. When all information + is up to date, click the "Validate Profile" button at the bottom of the page and you may begin + your move. + )} @@ -126,6 +126,26 @@ const Profile = ({ serviceMember, currentOrders, currentBackupContacts, moveIsIn editURL={customerRoutes.EDIT_OKTA_PROFILE_PATH} /> + {needsToVerifyProfile && ( + + + + + )}
        diff --git a/src/pages/MyMove/Profile/Profile.module.scss b/src/pages/MyMove/Profile/Profile.module.scss index 20f1cd83dda..1f9cc550fcc 100644 --- a/src/pages/MyMove/Profile/Profile.module.scss +++ b/src/pages/MyMove/Profile/Profile.module.scss @@ -12,7 +12,6 @@ display: flex; justify-content: space-between; align-items: center; - @include u-margin-top(-1); span { @include u-margin-right(.5em) } @@ -32,4 +31,9 @@ .verifyProfileAlert { margin-bottom: -1rem; +} + +.validateProfileBtnContainer { + display: flex; + justify-content: center; } \ No newline at end of file diff --git a/src/pages/MyMove/Profile/Profile.test.jsx b/src/pages/MyMove/Profile/Profile.test.jsx index 4ab302ef50f..9edd59f33b8 100644 --- a/src/pages/MyMove/Profile/Profile.test.jsx +++ b/src/pages/MyMove/Profile/Profile.test.jsx @@ -1,6 +1,6 @@ /* eslint-disable react/jsx-props-no-spreading */ import React from 'react'; -import { render, screen } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import { useLocation } from 'react-router-dom'; import ConnectedProfile from './Profile'; @@ -398,10 +398,24 @@ describe('Profile component', () => { const returnToDashboardLink = screen.getByText('Return to Dashboard'); expect(returnToDashboardLink).toBeInTheDocument(); + const validateProfileContainer = screen.getByTestId('validateProfileContainer'); + expect(validateProfileContainer).toBeInTheDocument(); + const createMoveBtn = screen.getByTestId('createMoveBtn'); expect(createMoveBtn).toBeInTheDocument(); + expect(createMoveBtn).toBeDisabled(); + + const validateProfileBtn = screen.getByTestId('validateProfileBtn'); + expect(validateProfileBtn).toBeInTheDocument(); + expect(validateProfileBtn).toBeEnabled(); const profileConfirmAlert = screen.getByTestId('profileConfirmAlert'); expect(profileConfirmAlert).toBeInTheDocument(); + + // user validates their profile, which enables create move btn + fireEvent.click(validateProfileBtn); + expect(createMoveBtn).toBeEnabled(); + expect(validateProfileBtn).toBeDisabled(); + expect(screen.getByText('Profile Validated')).toBeInTheDocument(); }); }); From 834d27523d3795714e47530145ceb68b5751ada5 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Thu, 22 Feb 2024 19:38:38 +0000 Subject: [PATCH 57/67] updating forgotten about storybooks --- .../MultiMovesMoveContainer.stories.jsx | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.stories.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.stories.jsx index aa8d532ac87..aa59e8da8ac 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.stories.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.stories.jsx @@ -4,18 +4,44 @@ import { mockMovesPCS, mockMovesRetirement, mockMovesSeparation } from '../Multi import MultiMovesMoveContainer from './MultiMovesMoveContainer'; +import { MockProviders } from 'testUtils'; + export default { title: 'Customer Components / MultiMovesContainer', }; -export const PCSCurrentMove = () => ; - -export const PCSPreviousMoves = () => ; - -export const RetirementCurrentMove = () => ; - -export const RetirementPreviousMoves = () => ; - -export const SeparationCurrentMove = () => ; - -export const SeparationPreviousMoves = () => ; +export const PCSCurrentMove = () => ( + + + +); + +export const PCSPreviousMoves = () => ( + + + +); + +export const RetirementCurrentMove = () => ( + + + +); + +export const RetirementPreviousMoves = () => ( + + + +); + +export const SeparationCurrentMove = () => ( + + + +); + +export const SeparationPreviousMoves = () => ( + + + +); From c87b960c1f6ab8c2fb0c37edf0aa04d1b781315c Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Thu, 22 Feb 2024 19:44:20 +0000 Subject: [PATCH 58/67] updating forgotten about storybooks --- .../MultiMovesMoveContainer.stories.jsx | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.stories.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.stories.jsx index aa8d532ac87..aa59e8da8ac 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.stories.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.stories.jsx @@ -4,18 +4,44 @@ import { mockMovesPCS, mockMovesRetirement, mockMovesSeparation } from '../Multi import MultiMovesMoveContainer from './MultiMovesMoveContainer'; +import { MockProviders } from 'testUtils'; + export default { title: 'Customer Components / MultiMovesContainer', }; -export const PCSCurrentMove = () => ; - -export const PCSPreviousMoves = () => ; - -export const RetirementCurrentMove = () => ; - -export const RetirementPreviousMoves = () => ; - -export const SeparationCurrentMove = () => ; - -export const SeparationPreviousMoves = () => ; +export const PCSCurrentMove = () => ( + + + +); + +export const PCSPreviousMoves = () => ( + + + +); + +export const RetirementCurrentMove = () => ( + + + +); + +export const RetirementPreviousMoves = () => ( + + + +); + +export const SeparationCurrentMove = () => ( + + + +); + +export const SeparationPreviousMoves = () => ( + + + +); From 545d7d4cf4123ed7ef669740ba21bb2128ecbee1 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Fri, 16 Feb 2024 21:04:57 +0000 Subject: [PATCH 59/67] initial commit, lots working with zero tests, need to update a lot and double check work --- pkg/gen/internalapi/embedded_spec.go | 10 + pkg/gen/internalmessages/internal_move.go | 34 + pkg/handlers/internalapi/moves.go | 6 +- pkg/models/move.go | 42 ++ src/components/ShipmentList/ShipmentList.jsx | 2 +- src/constants/routes.js | 2 + src/pages/MyMove/Home/MoveHome.jsx | 684 ++++++++++++++++++ .../Multi-Moves/MultiMovesLandingPage.jsx | 31 +- .../MultiMovesLandingPage.test.jsx | 49 +- .../MultiMovesMoveContainer.jsx | 13 +- .../MultiMovesMoveInfoList.jsx | 25 +- src/pages/MyMove/Orders.jsx | 11 +- src/pages/MyMove/UploadOrders.jsx | 8 +- src/sagas/entities.js | 9 + src/scenes/MyMove/index.jsx | 4 + src/store/entities/actions.js | 6 + swagger-def/internal.yaml | 4 + swagger/internal.yaml | 4 + 18 files changed, 903 insertions(+), 41 deletions(-) create mode 100644 src/pages/MyMove/Home/MoveHome.jsx diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index c86f85a6dac..0e3f67048e4 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4207,6 +4207,11 @@ func init() { "type": "string", "readOnly": true }, + "submittedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, "updatedAt": { "type": "string", "format": "date-time", @@ -12316,6 +12321,11 @@ func init() { "type": "string", "readOnly": true }, + "submittedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, "updatedAt": { "type": "string", "format": "date-time", diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go index 723d1c2b0b9..478a2f7771d 100644 --- a/pkg/gen/internalmessages/internal_move.go +++ b/pkg/gen/internalmessages/internal_move.go @@ -53,6 +53,11 @@ type InternalMove struct { // Read Only: true Status string `json:"status,omitempty"` + // submitted at + // Read Only: true + // Format: date-time + SubmittedAt strfmt.DateTime `json:"submittedAt,omitempty"` + // updated at // Read Only: true // Format: date-time @@ -79,6 +84,10 @@ func (m *InternalMove) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + if err := m.validateUpdatedAt(formats); err != nil { res = append(res, err) } @@ -142,6 +151,18 @@ func (m *InternalMove) validateOrderID(formats strfmt.Registry) error { return nil } +func (m *InternalMove) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + func (m *InternalMove) validateUpdatedAt(formats strfmt.Registry) error { if swag.IsZero(m.UpdatedAt) { // not required return nil @@ -178,6 +199,10 @@ func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } + if err := m.contextValidateSubmittedAt(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { res = append(res, err) } @@ -238,6 +263,15 @@ func (m *InternalMove) contextValidateStatus(ctx context.Context, formats strfmt return nil } +func (m *InternalMove) contextValidateSubmittedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "submittedAt", "body", strfmt.DateTime(m.SubmittedAt)); err != nil { + return err + } + + return nil +} + func (m *InternalMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index 5508aabb389..9c5f29bf725 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -154,15 +154,17 @@ func payloadForInternalMove(storer storage.FileStorer, list models.Moves) []*int eTag := etag.GenerateEtag(move.UpdatedAt) shipments := move.MTOShipments var payloadShipments *internalmessages.MTOShipments = payloads.MTOShipments(storer, &shipments) + orders, _ := payloadForOrdersModel(storer, move.Orders) + moveID := *handlers.FmtUUID(move.ID) currentMove := &internalmessages.InternalMove{ CreatedAt: *handlers.FmtDateTime(move.CreatedAt), ETag: eTag, - ID: *handlers.FmtUUID(move.ID), + ID: moveID, Status: string(move.Status), MtoShipments: *payloadShipments, MoveCode: move.Locator, - Orders: move.Orders, + Orders: orders, } convertedCurrentMovesList = append(convertedCurrentMovesList, currentMove) diff --git a/pkg/models/move.go b/pkg/models/move.go index b8bf7f2ce60..129f6b88a97 100644 --- a/pkg/models/move.go +++ b/pkg/models/move.go @@ -412,8 +412,19 @@ func FetchMovesByOrderID(db *pop.Connection, orderID uuid.UUID) (Moves, error) { query := db.Where("orders_id = ?", orderID) err := query.Eager( "MTOShipments", + "MTOShipments.PPMShipment", + "MTOShipments.PPMShipment.WeightTickets", + "MTOShipments.DestinationAddress", + "MTOShipments.SecondaryDeliveryAddress", + "MTOShipments.PickupAddress", + "MTOShipments.SecondaryPickupAddress", + "MTOShipments.PPMShipment.MovingExpenses", + "MTOShipments.PPMShipment.ProgearWeightTickets", "Orders", "Orders.UploadedOrders", + "Orders.UploadedOrders.UserUploads", + "Orders.UploadedAmendedOrders", + "Orders.Entitlement", "Orders.ServiceMember", "Orders.ServiceMember.User", "Orders.OriginDutyLocation.Address", @@ -423,6 +434,37 @@ func FetchMovesByOrderID(db *pop.Connection, orderID uuid.UUID) (Moves, error) { "Orders.NewDutyLocation.TransportationOffice", "Orders.NewDutyLocation.TransportationOffice.Address", ).All(&moves) + if err != nil { + return moves, err + } + + order := moves[0].Orders + + // Eager loading of nested has_many associations is broken + var userUploads UserUploads + err = db.Q(). + Scope(utilities.ExcludeDeletedScope()).EagerPreload("Upload"). + Where("document_id = ?", order.UploadedOrders.ID). + All(&userUploads) + if err != nil { + return moves, err + } + + moves[0].Orders.UploadedOrders.UserUploads = userUploads + + // Eager loading of nested has_many associations is broken + if order.UploadedAmendedOrders != nil { + var amendedUserUploads UserUploads + err = db.Q(). + Scope(utilities.ExcludeDeletedScope()).EagerPreload("Upload"). + Where("document_id = ?", order.UploadedAmendedOrdersID). + All(&amendedUserUploads) + if err != nil { + return moves, err + } + moves[0].Orders.UploadedAmendedOrders.UserUploads = amendedUserUploads + } + return moves, err } diff --git a/src/components/ShipmentList/ShipmentList.jsx b/src/components/ShipmentList/ShipmentList.jsx index d77dad9799a..586583ce57b 100644 --- a/src/components/ShipmentList/ShipmentList.jsx +++ b/src/components/ShipmentList/ShipmentList.jsx @@ -37,7 +37,7 @@ export const ShipmentListItem = ({ const actual = 'Actual'; let requestedWeightPPM = 0; if (shipment.shipmentType === SHIPMENT_OPTIONS.PPM) { - if (shipment.ppmShipment.weightTickets !== undefined) { + if (shipment.ppmShipment?.weightTickets !== undefined) { const wt = shipment.ppmShipment.weightTickets; for (let i = 0; i < wt.length; i += 1) { requestedWeightPPM += wt[i].fullWeight - wt[i].emptyWeight; diff --git a/src/constants/routes.js b/src/constants/routes.js index 9b44d7c0c05..d40c4b44b64 100644 --- a/src/constants/routes.js +++ b/src/constants/routes.js @@ -7,6 +7,8 @@ export const generalRoutes = { }; export const customerRoutes = { + MOVE_HOME_PAGE: '/move', + MOVE_HOME_PATH: '/move/:moveId', CONUS_OCONUS_PATH: '/service-member/conus-oconus', DOD_INFO_PATH: '/service-member/dod-info', NAME_PATH: '/service-member/name', diff --git a/src/pages/MyMove/Home/MoveHome.jsx b/src/pages/MyMove/Home/MoveHome.jsx new file mode 100644 index 00000000000..10b2c361619 --- /dev/null +++ b/src/pages/MyMove/Home/MoveHome.jsx @@ -0,0 +1,684 @@ +import React, { useState } from 'react'; +import { node, string } from 'prop-types'; +import moment from 'moment'; +import { connect } from 'react-redux'; +import { Alert, Button } from '@trussworks/react-uswds'; +import { generatePath, useNavigate, useParams } from 'react-router-dom'; + +import styles from './Home.module.scss'; +import { + HelperAmendedOrders, + HelperApprovedMove, + HelperNeedsOrders, + HelperNeedsShipment, + HelperNeedsSubmitMove, + HelperSubmittedMove, + HelperPPMCloseoutSubmitted, +} from './HomeHelpers'; + +import ConnectedDestructiveShipmentConfirmationModal from 'components/ConfirmationModals/DestructiveShipmentConfirmationModal'; +import Contact from 'components/Customer/Home/Contact'; +import DocsUploaded from 'components/Customer/Home/DocsUploaded'; +import PrintableLegalese from 'components/Customer/Home/PrintableLegalese'; +import Step from 'components/Customer/Home/Step'; +import SectionWrapper from 'components/Customer/SectionWrapper'; +import PPMSummaryList from 'components/PPMSummaryList/PPMSummaryList'; +import ShipmentList from 'components/ShipmentList/ShipmentList'; +import requireCustomerState from 'containers/requireCustomerState/requireCustomerState'; +import { profileStates } from 'constants/customerStates'; +import MOVE_STATUSES from 'constants/moves'; +import { customerRoutes } from 'constants/routes'; +import { ppmShipmentStatuses, shipmentTypes } from 'constants/shipments'; +import ConnectedFlashMessage from 'containers/FlashMessage/FlashMessage'; +import { deleteMTOShipment, getMTOShipmentsForMove } from 'services/internalApi'; +import { withContext } from 'shared/AppContext'; +import { SHIPMENT_OPTIONS } from 'shared/constants'; +import { + getSignedCertification as getSignedCertificationAction, + selectSignedCertification, +} from 'shared/Entities/modules/signed_certifications'; +import LoadingPlaceholder from 'shared/LoadingPlaceholder'; +import { updateMTOShipments } from 'store/entities/actions'; +import { + selectAllMoves, + selectCurrentOrders, + selectIsProfileComplete, + selectMTOShipmentsForCurrentMove, + selectServiceMemberFromLoggedInUser, + selectUploadsForCurrentAmendedOrders, + selectUploadsForCurrentOrders, +} from 'store/entities/selectors'; +import { formatCustomerDate, formatWeight } from 'utils/formatters'; +import { isPPMAboutInfoComplete, isPPMShipmentComplete, isWeightTicketComplete } from 'utils/shipments'; +import withRouter from 'utils/routing'; +import { ADVANCE_STATUSES } from 'constants/ppms'; + +const Description = ({ className, children, dataTestId }) => ( +

        + {children} +

        +); + +Description.propTypes = { + className: string, + children: node.isRequired, + dataTestId: string, +}; + +Description.defaultProps = { + className: '', + dataTestId: '', +}; + +const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signedCertification }) => { + // loading the moveId in params to select move details from serviceMemberMoves in state + const { moveId } = useParams(); + const navigate = useNavigate(); + + const [showDeleteModal, setShowDeleteModal] = useState(false); + const [targetShipmentId, setTargetShipmentId] = useState(null); + const [showDeleteSuccessAlert, setShowDeleteSuccessAlert] = useState(false); + const [showDeleteErrorAlert, setShowDeleteErrorAlert] = useState(false); + + // loading placeholder while data loads - this handles any async issues + if (!serviceMemberMoves || !serviceMemberMoves.currentMove || !serviceMemberMoves.previousMoves) { + return ( +
        +
        + +
        +
        + ); + } + + // Find the move in the currentMove array + const currentMove = serviceMemberMoves.currentMove.find((move) => move.id === moveId); + // Find the move in the previousMoves array if not found in currentMove + const previousMove = serviceMemberMoves.previousMoves.find((move) => move.id === moveId); + // the move will either be in the currentMove or previousMove object + const move = currentMove || previousMove; + const { orders } = move; + const uploadedOrderDocuments = orders?.uploaded_orders?.uploads || []; + let mtoShipments; + if (!move.mtoShipments) { + mtoShipments = []; + } else { + mtoShipments = move.mtoShipments; + } + + // checking to see if the orders object has a length + const hasOrdersAndUpload = () => { + return !!Object.keys(orders).length && !!uploadedOrderDocuments.length; + }; + + // checking if there are amended orders and if the move status is not approved + const hasUnapprovedAmendedOrders = () => { + const amendedOrders = orders?.uploaded_amended_orders || {}; + return !!Object.keys(amendedOrders).length && move.status !== 'APPROVED'; + }; + + // checking if the user has order info, but no uploads + const hasOrdersNoUpload = () => { + return !!Object.keys(orders).length && !uploadedOrderDocuments.length; + }; + + // checking if there are any shipments in the move object + const hasAnyShipments = () => { + return !!Object.keys(orders).length && !!mtoShipments.length; + }; + + // checking status of the move is in any status other than DRAFT + const hasSubmittedMove = () => { + return !!Object.keys(move).length && move.status !== 'DRAFT'; + }; + + // checking if the move contains ppm shipments + const hasPPMShipments = () => { + return mtoShipments?.some((shipment) => shipment.ppmShipment); + }; + + // checking if a PPM shipment is waiting on payment approval + const hasSubmittedPPMCloseout = () => { + const finishedCloseout = mtoShipments.filter( + (shipment) => shipment?.ppmShipment?.status === ppmShipmentStatuses.NEEDS_PAYMENT_APPROVAL, + ); + return !!finishedCloseout.length; + }; + + // checking every PPM shipment to see if they are all complete + const hasAllCompletedPPMShipments = () => { + return mtoShipments?.filter((s) => s.shipmentType === SHIPMENT_OPTIONS.PPM)?.every((s) => isPPMShipmentComplete(s)); + }; + + // determine if at least one advance was APPROVED (advance_status in ppm_shipments table is not nil) + const hasAdvanceApproved = () => { + const appovedAdvances = mtoShipments.filter( + (shipment) => shipment?.ppmShipment?.advanceStatus === ADVANCE_STATUSES.APPROVED.apiValue, + ); + return !!appovedAdvances.length; + }; + + // checking if the customer has requested an advance + const hasAdvanceRequested = () => { + const requestedAdvances = mtoShipments.filter((shipment) => shipment?.ppmShipment?.hasRequestedAdvance); + return !!requestedAdvances.length; + }; + + // check to see if all advance_status are REJECTED + const hasAllAdvancesRejected = () => { + const rejectedAdvances = mtoShipments.filter( + (shipment) => shipment?.ppmShipment?.advanceStatus === ADVANCE_STATUSES.REJECTED.apiValue, + ); + return !hasAdvanceApproved() && rejectedAdvances.length > 0; + }; + + // checking the move status, if approved, return true + const isMoveApproved = () => { + return move.status === MOVE_STATUSES.APPROVED; + }; + + // logic that handles deleting a shipment + // calls internal API and updates shipments + const handleDeleteShipmentConfirmation = (shipmentId) => { + deleteMTOShipment(shipmentId) + .then(() => { + getMTOShipmentsForMove(move.id).then((response) => { + updateMTOShipments(response); + setShowDeleteErrorAlert(false); + setShowDeleteSuccessAlert(true); + }); + }) + .catch(() => { + setShowDeleteErrorAlert(true); + setShowDeleteSuccessAlert(false); + }) + .finally(() => { + setShowDeleteModal(false); + }); + }; + + const shipmentActionBtnLabel = () => { + if (hasSubmittedMove()) { + return ''; + } + if (hasAnyShipments()) { + return 'Add another shipment'; + } + return 'Set up your shipments'; + }; + + const reportByLabel = () => { + switch (orders.orders_type) { + case 'RETIREMENT': + return 'Retirement date'; + case 'SEPARATION': + return 'Separation date'; + default: + return 'Report by'; + } + }; + + const hideDeleteModal = () => { + setShowDeleteModal(false); + }; + + const handleShipmentClick = (shipmentId, shipmentNumber, shipmentType) => { + let queryString = ''; + if (shipmentNumber) { + queryString = `?shipmentNumber=${shipmentNumber}`; + } + + let destLink = ''; + if (shipmentType === shipmentTypes.HHG || shipmentType === shipmentTypes.PPM) { + destLink = `${generatePath(customerRoutes.SHIPMENT_EDIT_PATH, { + moveId: move.id, + mtoShipmentId: shipmentId, + })}${queryString}`; + } else { + // this will handle nts/ntsr shipments + destLink = generatePath(customerRoutes.SHIPMENT_EDIT_PATH, { + moveId: move.id, + mtoShipmentId: shipmentId, + }); + } + + navigate(destLink); + }; + + const handleDeleteClick = (shipmentId) => { + setShowDeleteModal(true); + setTargetShipmentId(shipmentId); + }; + + const handlePPMUploadClick = (shipmentId) => { + const shipment = mtoShipments.find((mtoShipment) => mtoShipment.id === shipmentId); + + const aboutInfoComplete = isPPMAboutInfoComplete(shipment.ppmShipment); + + let path = generatePath(customerRoutes.SHIPMENT_PPM_ABOUT_PATH, { + moveId: move.id, + mtoShipmentId: shipmentId, + }); + + if (aboutInfoComplete) { + if (shipment.ppmShipment.weightTickets.length === 0) { + path = generatePath(customerRoutes.SHIPMENT_PPM_WEIGHT_TICKETS_PATH, { + moveId: move.id, + mtoShipmentId: shipmentId, + }); + } else if (!shipment.ppmShipment.weightTickets.some(isWeightTicketComplete)) { + path = generatePath(customerRoutes.SHIPMENT_PPM_WEIGHT_TICKETS_EDIT_PATH, { + moveId: move.id, + mtoShipmentId: shipmentId, + weightTicketId: shipment.ppmShipment.weightTickets[0].id, + }); + } else { + path = generatePath(customerRoutes.SHIPMENT_PPM_REVIEW_PATH, { + moveId: move.id, + mtoShipmentId: shipmentId, + }); + } + } + + navigate(path); + }; + + // eslint-disable-next-line class-methods-use-this + const sortAllShipments = () => { + const allShipments = JSON.parse(JSON.stringify(mtoShipments)); + allShipments.sort((a, b) => moment(a.createdAt) - moment(b.createdAt)); + + return allShipments; + }; + + // eslint-disable-next-line class-methods-use-this + const handlePrintLegalese = (e) => { + e.preventDefault(); + window.print(); + }; + + const handleNewPathClick = (path) => { + navigate(path); + }; + + // if the move has amended orders that aren't approved, it will display an info box at the top of the page + const renderAlert = () => { + if (hasUnapprovedAmendedOrders()) { + return ( + + + The transportation office will review your new documents and update your move info. Contact your movers to + coordinate any changes to your move. + + You don't need to do anything else in MilMove. + + ); + } + return null; + }; + + // handles logic of which helper boxes to render + const renderHelper = () => { + if (!hasOrdersAndUpload()) return ; + if (!hasAnyShipments()) return ; + if (!hasSubmittedMove()) return ; + if (hasSubmittedPPMCloseout()) return ; + if (hasUnapprovedAmendedOrders()) return ; + if (isMoveApproved()) return ; + return ; + }; + + const renderCustomerHeaderText = () => { + return ( + <> +

        + You’re moving to {orders.new_duty_location.name} from{' '} + {orders.origin_duty_location?.name}. +
        + {` ${reportByLabel()} `} + {moment(orders.report_by_date).format('DD MMM YYYY')}. +

        + +
        +
        +
        Weight allowance
        +
        {formatWeight(orders.authorizedWeight)}.
        +
        + {move.moveCode && ( +
        +
        Move code
        +
        #{move.moveCode}
        +
        + )} +
        + + ); + }; + + // early return if loading user/service member + if (!serviceMember) { + return ( +
        +
        + +
        +
        + ); + } + + // eslint-disable-next-line camelcase + const { current_location } = serviceMember; + const ordersPath = hasOrdersNoUpload() ? customerRoutes.ORDERS_UPLOAD_PATH : customerRoutes.ORDERS_INFO_PATH; + + const shipmentSelectionPath = + move?.id && + (hasAnyShipments() + ? generatePath(customerRoutes.SHIPMENT_SELECT_TYPE_PATH, { moveId: move.id }) + : generatePath(customerRoutes.SHIPMENT_MOVING_INFO_PATH, { moveId: move.id })); + + const confirmationPath = move?.id && generatePath(customerRoutes.MOVE_REVIEW_PATH, { moveId: move.id }); + const profileEditPath = customerRoutes.PROFILE_PATH; + const ordersEditPath = `/moves/${move.id}/review/edit-orders`; + const ordersAmendPath = customerRoutes.ORDERS_AMEND_PATH; + const allSortedShipments = sortAllShipments(mtoShipments); + const ppmShipments = allSortedShipments.filter((shipment) => shipment.shipmentType === SHIPMENT_OPTIONS.PPM); + + // eslint-disable-next-line camelcase + const currentLocation = current_location; + const shipmentNumbersByType = {}; + + return ( + <> + +
        +
        +
        +

        + {serviceMember.first_name} {serviceMember.last_name} +

        + {(hasOrdersNoUpload() || hasOrdersAndUpload()) && renderCustomerHeaderText()} +
        +
        +
        + {showDeleteSuccessAlert && ( + + The shipment was deleted. + + )} + {showDeleteErrorAlert && ( + + Something went wrong, and your changes were not saved. Please try again later or contact your counselor. + + )} + + + {isProfileComplete && ( + <> + {renderAlert()} + {renderHelper()} + + handleNewPathClick(profileEditPath)} + > + Make sure to keep your personal information up to date during your move. + + {!hasSubmittedMove() && ( + handleNewPathClick(ordersEditPath)} + headerText="Upload orders" + actionBtnLabel={!hasOrdersAndUpload() ? 'Add orders' : ''} + onActionBtnClick={() => handleNewPathClick(ordersPath)} + step="2" + > + {hasOrdersAndUpload() && !hasSubmittedMove() ? ( + + ) : ( + Upload photos of each page, or upload a PDF. + )} + + )} + {hasSubmittedMove() && hasOrdersAndUpload() && ( + handleNewPathClick(ordersAmendPath)} + headerText="Orders" + step="2" + containerClassName="step-amended-orders" + > +

        If you receive amended orders

        +
          +
        • Upload the new document(s) here
        • +
        • If you have not had a counseling session talk to your local transportation office
        • +
        • If you have been assigned a Customer Care Representative, you can speak directly to them
        • +
        • They will update your move info to reflect the new orders
        • +
        +
        + )} + handleNewPathClick(shipmentSelectionPath)} + complete={hasPPMShipments() ? hasAllCompletedPPMShipments() : hasAnyShipments()} + completedHeaderText="Shipments" + headerText="Set up shipments" + secondaryBtn={hasAnyShipments()} + secondaryClassName="margin-top-2" + step="3" + > + {hasAnyShipments() ? ( +
        + + {hasSubmittedMove() && ( +

        + If you need to change, add, or cancel shipments, talk to your move counselor or Customer Care + Representative +

        + )} +
        + ) : ( + + We will collect addresses, dates, and how you want to move your personal property. +
        Note: You can change these details later by talking to a move counselor or customer care + representative. +
        + )} +
        + handleNewPathClick(confirmationPath)} + secondaryBtn={hasSubmittedMove()} + secondaryBtnClassName={styles.secondaryBtn} + step="4" + > + {hasSubmittedMove() ? ( + + Move submitted {formatCustomerDate(move.submittedAt)}.
        + +
        + ) : ( + + Review your move details and sign the legal paperwork, then send the info on to your move + counselor. + + )} +
        + {!!ppmShipments.length && hasSubmittedMove() && hasAdvanceRequested() && ( + + + {hasAdvanceApproved() && ( + <> + + Your Advance Operating Allowance (AOA) request has been reviewed. Download the paperwork for + approved requests and submit it to your Finance Office to receive your advance. +
        +
        The amount you receive will be deducted from your PPM incentive payment. If your + incentive ends up being less than your advance, you will be required to pay back the + difference. +
        +
        +
        + {ppmShipments.map((shipment) => { + const { shipmentType } = shipment; + if (shipmentNumbersByType[shipmentType]) { + shipmentNumbersByType[shipmentType] += 1; + } else { + shipmentNumbersByType[shipmentType] = 1; + } + const shipmentNumber = shipmentNumbersByType[shipmentType]; + return ( + <> + + {shipmentTypes[shipment.shipmentType]} + {` ${shipmentNumber} `} + + {shipment?.ppmShipment?.advanceStatus === ADVANCE_STATUSES.APPROVED.apiValue && ( + // TODO: B-18060 will add link to method that will create the AOA packet and return for download +

        + + Download AOA Paperwork (PDF) + +

        + )} + {shipment?.ppmShipment?.advanceStatus === ADVANCE_STATUSES.REJECTED.apiValue && ( + Advance request denied + )} + {shipment?.ppmShipment?.advanceStatus == null && ( + Advance request pending + )} + + ); + })} + + )} + {hasAllAdvancesRejected() && ( + + Your Advance Operating Allowance (AOA) request has been denied. You may be able to use your + Government Travel Charge Card (GTCC). Contact your local transportation office to verify GTCC + usage authorization or ask any questions. + + )} + {!hasAdvanceApproved() && !hasAllAdvancesRejected() && ( + + Your service will review your request for an Advance Operating Allowance (AOA). If approved, + you will be able to download the paperwork for your request and submit it to your Finance + Office to receive your advance. +
        +
        The amount you receive will be deducted from your PPM incentive payment. If your + incentive ends up being less than your advance, you will be required to pay back the + difference. +
        + )} +
        +
        + )} + {!!ppmShipments.length && hasSubmittedMove() && ( + + + + )} +
        + + + )} +
        +
        + + + ); +}; + +MoveHome.defaultProps = { + orders: {}, + serviceMember: null, + signedCertification: {}, + uploadedAmendedOrderDocuments: [], + router: {}, +}; + +const mapStateToProps = (state) => { + const serviceMember = selectServiceMemberFromLoggedInUser(state); + const serviceMemberMoves = selectAllMoves(state); + + return { + isProfileComplete: selectIsProfileComplete(state), + orders: selectCurrentOrders(state) || {}, + uploadedOrderDocuments: selectUploadsForCurrentOrders(state), + uploadedAmendedOrderDocuments: selectUploadsForCurrentAmendedOrders(state), + serviceMember, + serviceMemberMoves, + backupContacts: serviceMember?.backup_contacts || [], + signedCertification: selectSignedCertification(state), + mtoShipments: selectMTOShipmentsForCurrentMove(state), + }; +}; + +const mapDispatchToProps = { + getSignedCertification: getSignedCertificationAction, + updateShipmentList: updateMTOShipments, +}; + +// in order to avoid setting up proxy server only for storybook, pass in stub function so API requests don't fail +const mergeProps = (stateProps, dispatchProps, ownProps) => ({ + ...stateProps, + ...dispatchProps, + ...ownProps, +}); + +export default withContext( + withRouter( + connect( + mapStateToProps, + mapDispatchToProps, + mergeProps, + )(requireCustomerState(MoveHome, profileStates.BACKUP_CONTACTS_COMPLETE)), + ), +); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx index e0bd7b625b3..41f5344449b 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx @@ -21,17 +21,27 @@ import { withContext } from 'shared/AppContext'; import withRouter from 'utils/routing'; import requireCustomerState from 'containers/requireCustomerState/requireCustomerState'; import { selectAllMoves, selectIsProfileComplete, selectServiceMemberFromLoggedInUser } from 'store/entities/selectors'; +import LoadingPlaceholder from 'shared/LoadingPlaceholder'; +import { updateAllMoves } from 'store/entities/actions'; +import { profileStates } from 'constants/customerStates'; +import { getAllMoves } from 'services/internalApi'; const MultiMovesLandingPage = ({ serviceMember, serviceMemberMoves }) => { const [setErrorState] = useState({ hasError: false, error: undefined, info: undefined }); const navigate = useNavigate(); + // this will run on page load + // loads user info and move and updates if the serviceMember object in state changes useEffect(() => { const fetchData = async () => { try { loadInternalSchema(); loadUser(); initOnboarding(); + if (serviceMember) { + const response = getAllMoves(serviceMember.id); + updateAllMoves(response); + } document.title = generatePageTitle('MilMove'); } catch (error) { const { message } = error; @@ -44,9 +54,8 @@ const MultiMovesLandingPage = ({ serviceMember, serviceMemberMoves }) => { retryPageLoading(error); } }; - fetchData(); - }, [setErrorState]); + }, [setErrorState, serviceMember]); const flags = detectFlags(process.env.NODE_ENV, window.location.host, window.location.search); @@ -62,6 +71,17 @@ const MultiMovesLandingPage = ({ serviceMember, serviceMemberMoves }) => { } }; + // early return while api call loads object + if (Object.keys(serviceMemberMoves).length === 0) { + return ( +
        +
        + +
        +
        + ); + } + // ! WILL ONLY SHOW IF MULTIMOVE FLAG IS TRUE return flags.multiMove ? (
        @@ -168,5 +188,10 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => ({ }); export default withContext( - withRouter(connect(mapStateToProps, mergeProps)(requireCustomerState(MultiMovesLandingPage))), + withRouter( + connect( + mapStateToProps, + mergeProps, + )(requireCustomerState(MultiMovesLandingPage, profileStates.BACKUP_CONTACTS_COMPLETE)), + ), ); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx index 8a685fde18c..38b7ba1f9d1 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx @@ -17,6 +17,14 @@ jest.mock('store/auth/actions', () => ({ loadUser: jest.fn(), })); +jest.mock('store/entities/actions', () => ({ + updateAllMoves: jest.fn(), +})); + +jest.mock('services/internalApi', () => ({ + getAllMoves: jest.fn(), +})); + jest.mock('store/onboarding/actions', () => ({ initOnboarding: jest.fn(), })); @@ -26,16 +34,47 @@ jest.mock('shared/Swagger/ducks', () => ({ })); const defaultProps = { - serviceMember: { - id: v4(), - first_name: 'Jim', - last_name: 'Bean', - }, showLoggedInUser: jest.fn(), isLoggedIn: true, loggedInUserIsLoading: false, loggedInUserSuccess: true, isProfileComplete: true, + serviceMember: { + affiliation: 'COAST_GUARD', + backup_contacts: ['bc0c2ec7-252f-41f6-b1ff-4c9bb270ef41'], + backup_mailing_address: { + city: 'Beverly Hills', + id: 'b1adf427-7743-4fbd-950c-d0fcc25168b9', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + }, + created_at: '2024-02-15T14:43:31.492Z', + edipi: '8362534852', + email_is_preferred: true, + first_name: 'Tori', + id: v4(), + is_profile_complete: true, + last_name: 'Ross', + orders: [ + '444de44f-608e-4b99-b66b-dc1fce8a12fd', + 'c1786dd4-771c-4b66-bdec-39960f57f890', + 'a6ca098a-effd-492e-bb1c-edd76568c66b', + ], + personal_email: 'multiplemoves@PPM.com', + residential_address: { + city: 'Beverly Hills', + id: '8ace1b49-a1ea-4dd0-aa66-e786b2d220f9', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + }, + telephone: '212-123-4567', + updated_at: '2024-02-16T20:41:19.454Z', + user_id: '68f8baa7-ed00-4ad9-ad3c-a849688cb537', + }, serviceMemberMoves: { currentMove: [ { diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx index 022c5a827ac..6b6b1409782 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx @@ -11,6 +11,7 @@ import styles from './MultiMovesMoveContainer.module.scss'; import ShipmentContainer from 'components/Office/ShipmentContainer/ShipmentContainer'; import { customerRoutes } from 'constants/routes'; +import { getMoveCodeLabel } from 'utils/shipmentDisplay'; const MultiMovesMoveContainer = ({ moves }) => { const [expandedMoves, setExpandedMoves] = useState({}); @@ -67,8 +68,8 @@ const MultiMovesMoveContainer = ({ moves }) => { }; // sends user to the move page when clicking "Go to Move" btn - const handleGoToMoveClick = () => { - navigate(customerRoutes.MOVE_HOME_PAGE); + const handleGoToMoveClick = (id) => { + navigate(`${customerRoutes.MOVE_HOME_PAGE}/${id}`); }; const moveList = moves.map((m, index) => ( @@ -76,13 +77,15 @@ const MultiMovesMoveContainer = ({ moves }) => {

        #{m.moveCode}

        - {m.status !== 'APPROVED' ? ( + {m.status ? ( @@ -122,7 +125,7 @@ const MultiMovesMoveContainer = ({ moves }) => {

        {generateShipmentTypeTitle(s.shipmentType)}

        -
        #{m.moveCode}
        +
        #{getMoveCodeLabel(s.id)}
        diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx index 90b205f9d59..639502a9c09 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesMoveInfoList.jsx @@ -41,18 +41,8 @@ const MultiMovesMoveInfoList = ({ move }) => { return 'Destination Duty Location'; }; - // converts return from API to camelCase to avoid linter errors - const toCamelCase = (str) => { - return str.replace(/_([a-z])/g, (match, letter) => letter.toUpperCase()); - }; - const formatAddress = (address) => { - const camelCaseAddress = Object.keys(address).reduce((acc, key) => { - acc[toCamelCase(key)] = address[key]; - return acc; - }, {}); - - const { streetAddress1, streetAddress2, streetAddress3, city, state, postalCode, id } = camelCaseAddress; + const { city, state, postalCode, id } = address; // Check for empty UUID (no address provided) const isIdEmpty = id === '00000000-0000-0000-0000-000000000000'; @@ -62,14 +52,7 @@ const MultiMovesMoveInfoList = ({ move }) => { return '-'; } - return ( - <> - {streetAddress1 && <>{streetAddress1}, } - {streetAddress2 && <>{streetAddress2}, } - {streetAddress3 && <>{streetAddress3}, } - {city ? `${city}, ${state} ${postalCode}` : postalCode} - - ); + return `${city}, ${state} ${postalCode}`; }; return ( @@ -98,12 +81,12 @@ const MultiMovesMoveInfoList = ({ move }) => {
        Current Duty Location
        -
        {formatAddress(orders.OriginDutyLocation.Address) || '-'}
        +
        {formatAddress(orders.origin_duty_location.address) || '-'}
        {getDestinationDutyLocationLabel(orders.orders_type)}
        -
        {formatAddress(orders.NewDutyLocation.Address) || '-'}
        +
        {formatAddress(orders.new_duty_location.address) || '-'}
        diff --git a/src/pages/MyMove/Orders.jsx b/src/pages/MyMove/Orders.jsx index 08da4a9f55b..98f97a4472f 100644 --- a/src/pages/MyMove/Orders.jsx +++ b/src/pages/MyMove/Orders.jsx @@ -12,8 +12,10 @@ import { patchOrders, patchServiceMember, getResponseError, + getAllMoves, } from 'services/internalApi'; import { + updateAllMoves, updateOrders as updateOrdersAction, updateServiceMember as updateServiceMemberAction, } from 'store/entities/actions'; @@ -74,6 +76,11 @@ export class Orders extends Component { navigate(customerRoutes.ORDERS_UPLOAD_PATH); }; + const getAndUpdateAllMoves = (id) => { + const response = getAllMoves(id); + updateAllMoves(response); + }; + const submitOrders = (values) => { const pendingValues = { ...values, @@ -106,7 +113,8 @@ export class Orders extends Component { pendingValues.id = currentOrders.id; return patchOrders(pendingValues) .then(updateOrders) - .then(handleNext) + .then(getAndUpdateAllMoves(serviceMemberId)) + .then.then(handleNext) .catch((e) => { // Error shape: https://github.com/swagger-api/swagger-js/blob/master/docs/usage/http-client.md#errors const { response } = e; @@ -119,6 +127,7 @@ export class Orders extends Component { .then(updateOrders) .then(() => getServiceMember(serviceMemberId)) .then(updateServiceMember) + .then(getAndUpdateAllMoves(serviceMemberId)) .then(handleNext) .catch((e) => { // Error shape: https://github.com/swagger-api/swagger-js/blob/master/docs/usage/http-client.md#errors diff --git a/src/pages/MyMove/UploadOrders.jsx b/src/pages/MyMove/UploadOrders.jsx index 84fce6cc03e..e59a26bd690 100644 --- a/src/pages/MyMove/UploadOrders.jsx +++ b/src/pages/MyMove/UploadOrders.jsx @@ -9,8 +9,8 @@ import NotificationScrollToTop from 'components/NotificationScrollToTop'; import FileUpload from 'components/FileUpload/FileUpload'; import UploadsTable from 'components/UploadsTable/UploadsTable'; import { documentSizeLimitMsg } from 'shared/constants'; -import { getOrdersForServiceMember, createUploadForDocument, deleteUpload } from 'services/internalApi'; -import { updateOrders as updateOrdersAction } from 'store/entities/actions'; +import { getOrdersForServiceMember, createUploadForDocument, deleteUpload, getAllMoves } from 'services/internalApi'; +import { updateAllMoves, updateOrders as updateOrdersAction } from 'store/entities/actions'; import { selectServiceMemberFromLoggedInUser, selectCurrentOrders, @@ -53,10 +53,12 @@ export class UploadOrders extends Component { handleUploadComplete() { const { serviceMemberId, updateOrders } = this.props; - getOrdersForServiceMember(serviceMemberId).then((response) => { updateOrders(response); }); + getAllMoves(serviceMemberId).then((response) => { + updateAllMoves(response); + }); } handleDeleteFile(uploadId) { diff --git a/src/sagas/entities.js b/src/sagas/entities.js index 6f6f86b383d..74c869ca9b7 100644 --- a/src/sagas/entities.js +++ b/src/sagas/entities.js @@ -7,9 +7,11 @@ import { UPDATE_MTO_SHIPMENT, UPDATE_MTO_SHIPMENTS, UPDATE_ORDERS, + UPDATE_ALL_MOVES, } from 'store/entities/actions'; import { normalizeResponse } from 'services/swaggerRequest'; import { addEntities, updateMTOShipmentsEntity, setOktaUser } from 'shared/Entities/actions'; +import { getAllMoves } from 'services/internalApi'; export function* updateOktaUserState(action) { const { payload } = action; @@ -56,6 +58,12 @@ export function* updateMTOShipments(action) { yield put(updateMTOShipmentsEntity(payload)); } +export function* updateAllMoves(action) { + const { payload } = action; + const allMoves = yield call(getAllMoves, payload); + yield put(addEntities({ serviceMemberMoves: allMoves })); +} + export function* watchUpdateEntities() { yield all([ takeLatest(UPDATE_SERVICE_MEMBER, updateServiceMember), @@ -64,5 +72,6 @@ export function* watchUpdateEntities() { takeLatest(UPDATE_MOVE, updateMove), takeLatest(UPDATE_MTO_SHIPMENT, updateMTOShipment), takeLatest(UPDATE_MTO_SHIPMENTS, updateMTOShipments), + takeLatest(UPDATE_ALL_MOVES, updateAllMoves), ]); } diff --git a/src/scenes/MyMove/index.jsx b/src/scenes/MyMove/index.jsx index 6287cb3ae4f..7ccdc08f6b2 100644 --- a/src/scenes/MyMove/index.jsx +++ b/src/scenes/MyMove/index.jsx @@ -48,6 +48,7 @@ import ConnectedCreateOrEditMtoShipment from 'pages/MyMove/CreateOrEditMtoShipme import Home from 'pages/MyMove/Home'; import TitleAnnouncer from 'components/TitleAnnouncer/TitleAnnouncer'; import MultiMovesLandingPage from 'pages/MyMove/Multi-Moves/MultiMovesLandingPage'; +import MoveHome from 'pages/MyMove/Home/MoveHome'; // Pages should be lazy-loaded (they correspond to unique routes & only need to be loaded when that URL is accessed) const SignIn = lazy(() => import('pages/SignIn/SignIn')); const InvalidPermissions = lazy(() => import('pages/InvalidPermissions/InvalidPermissions')); @@ -200,6 +201,9 @@ export class CustomerApp extends Component { )} {getWorkflowRoutes(props)} + + } /> + } /> } /> } /> } /> diff --git a/src/store/entities/actions.js b/src/store/entities/actions.js index fc09b9c44e1..7aa29615e48 100644 --- a/src/store/entities/actions.js +++ b/src/store/entities/actions.js @@ -5,6 +5,7 @@ export const UPDATE_MTO_SHIPMENT = 'UPDATE_MTO_SHIPMENT'; export const UPDATE_MTO_SHIPMENTS = 'UPDATE_MTO_SHIPMENTS'; export const UPDATE_ORDERS = 'UPDATE_ORDERS'; export const UPDATE_OKTA_USER_STATE = 'SET_OKTA_USER'; +export const UPDATE_ALL_MOVES = 'UPDATE_ALL_MOVES'; export const updateOktaUserState = (oktaUser) => ({ type: UPDATE_OKTA_USER_STATE, @@ -40,3 +41,8 @@ export const updateOrders = (payload) => ({ type: UPDATE_ORDERS, payload, }); + +export const updateAllMoves = (payload) => ({ + type: UPDATE_ALL_MOVES, + payload, +}); diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 28d89f05997..8aaa1f38d20 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -2418,6 +2418,10 @@ definitions: format: date-time type: string readOnly: true + submittedAt: + format: date-time + type: string + readOnly: true mtoShipments: $ref: '#/definitions/MTOShipments' eTag: diff --git a/swagger/internal.yaml b/swagger/internal.yaml index dedb987c234..65242a21cd2 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -2451,6 +2451,10 @@ definitions: format: date-time type: string readOnly: true + submittedAt: + format: date-time + type: string + readOnly: true mtoShipments: $ref: '#/definitions/MTOShipments' eTag: From b1d58217b0e777ffbedf7187f1da5a37e4933999 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 20 Feb 2024 15:45:46 +0000 Subject: [PATCH 60/67] fixing tests that broke with enhancements, still need tests for MoveHome --- .../Multi-Moves/MultiMovesLandingPage.jsx | 2 +- .../MultiMovesLandingPage.test.jsx | 563 +++++++++++++++++- .../MultiMovesInfoList.test.jsx | 24 +- .../MyMove/Multi-Moves/MultiMovesTestData.js | 96 +-- 4 files changed, 617 insertions(+), 68 deletions(-) diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx index 41f5344449b..ea9c01584d1 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.jsx @@ -105,7 +105,7 @@ const MultiMovesLandingPage = ({ serviceMember, serviceMemberMoves }) => { ) : ( -

        +

        Select "Create a Move" to get started.

        Once you have validated your profile, pleasee click the "Validate" button and proceed to diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx index 38b7ba1f9d1..3eb6fd6e13f 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesLandingPage.test.jsx @@ -9,6 +9,18 @@ import MultiMovesLandingPage from './MultiMovesLandingPage'; import { MockProviders } from 'testUtils'; // Mock external dependencies +jest.mock('containers/FlashMessage/FlashMessage', () => { + const MockFlash = () =>

        Flash message
        ; + MockFlash.displayName = 'ConnectedFlashMessage'; + return MockFlash; +}); + +const mockNavigate = jest.fn(); +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useNavigate: () => mockNavigate, +})); + jest.mock('utils/featureFlags', () => ({ detectFlags: jest.fn(() => ({ multiMove: true })), })); @@ -53,10 +65,10 @@ const defaultProps = { created_at: '2024-02-15T14:43:31.492Z', edipi: '8362534852', email_is_preferred: true, - first_name: 'Tori', + first_name: 'Jim', id: v4(), is_profile_complete: true, - last_name: 'Ross', + last_name: 'Bean', orders: [ '444de44f-608e-4b99-b66b-dc1fce8a12fd', 'c1786dd4-771c-4b66-bdec-39960f57f890', @@ -93,14 +105,14 @@ const defaultProps = { orders_type_detail: null, has_dependents: false, spouse_has_pro_gear: false, - OriginDutyLocation: { + origin_duty_location: { id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', created_at: '2024-01-26T16:46:34.047004Z', updated_at: '2024-01-26T16:46:34.047004Z', name: 'Tinker AFB, OK 73145', affiliation: 'AIR_FORCE', address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', - Address: { + address: { id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', created_at: '2024-01-26T16:46:34.047004Z', updated_at: '2024-01-26T16:46:34.047004Z', @@ -147,14 +159,14 @@ const defaultProps = { }, origin_duty_location_id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', new_duty_location_id: '5c182566-0e6e-46f2-9eef-f07963783575', - NewDutyLocation: { + new_duty_location: { id: '5c182566-0e6e-46f2-9eef-f07963783575', created_at: '2024-01-26T16:46:34.047004Z', updated_at: '2024-01-26T16:46:34.047004Z', name: 'Fort Sill, OK 73503', affiliation: 'ARMY', address_id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', - Address: { + address: { id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', created_at: '2024-01-26T16:46:34.047004Z', updated_at: '2024-01-26T16:46:34.047004Z', @@ -217,6 +229,509 @@ const defaultProps = { }, }; +const defaultPropsNoMoves = { + showLoggedInUser: jest.fn(), + isLoggedIn: true, + loggedInUserIsLoading: false, + loggedInUserSuccess: true, + isProfileComplete: true, + serviceMember: { + affiliation: 'COAST_GUARD', + backup_contacts: ['bc0c2ec7-252f-41f6-b1ff-4c9bb270ef41'], + backup_mailing_address: { + city: 'Beverly Hills', + id: 'b1adf427-7743-4fbd-950c-d0fcc25168b9', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + }, + created_at: '2024-02-15T14:43:31.492Z', + edipi: '8362534852', + email_is_preferred: true, + first_name: 'Jim', + id: v4(), + is_profile_complete: true, + last_name: 'Bean', + orders: [ + '444de44f-608e-4b99-b66b-dc1fce8a12fd', + 'c1786dd4-771c-4b66-bdec-39960f57f890', + 'a6ca098a-effd-492e-bb1c-edd76568c66b', + ], + personal_email: 'multiplemoves@PPM.com', + residential_address: { + city: 'Beverly Hills', + id: '8ace1b49-a1ea-4dd0-aa66-e786b2d220f9', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + }, + telephone: '212-123-4567', + updated_at: '2024-02-16T20:41:19.454Z', + user_id: '68f8baa7-ed00-4ad9-ad3c-a849688cb537', + }, + serviceMemberMoves: { + currentMove: [], + previousMoves: [], + }, +}; + +const defaultPropsMultipleMove = { + showLoggedInUser: jest.fn(), + isLoggedIn: true, + loggedInUserIsLoading: false, + loggedInUserSuccess: true, + isProfileComplete: true, + serviceMember: { + affiliation: 'COAST_GUARD', + backup_contacts: ['bc0c2ec7-252f-41f6-b1ff-4c9bb270ef41'], + backup_mailing_address: { + city: 'Beverly Hills', + id: 'b1adf427-7743-4fbd-950c-d0fcc25168b9', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + }, + created_at: '2024-02-15T14:43:31.492Z', + edipi: '8362534852', + email_is_preferred: true, + first_name: 'Jim', + id: v4(), + is_profile_complete: true, + last_name: 'Bean', + orders: [ + '444de44f-608e-4b99-b66b-dc1fce8a12fd', + 'c1786dd4-771c-4b66-bdec-39960f57f890', + 'a6ca098a-effd-492e-bb1c-edd76568c66b', + ], + personal_email: 'multiplemoves@PPM.com', + residential_address: { + city: 'Beverly Hills', + id: '8ace1b49-a1ea-4dd0-aa66-e786b2d220f9', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + }, + telephone: '212-123-4567', + updated_at: '2024-02-16T20:41:19.454Z', + user_id: '68f8baa7-ed00-4ad9-ad3c-a849688cb537', + }, + serviceMemberMoves: { + currentMove: [ + { + createdAt: '2024-01-31T16:29:53.290Z', + eTag: 'MjAyNC0wMS0zMVQxNjoyOTo1My4yOTA0OTRa', + id: '9211d4e2-5b92-42bb-9758-7ac1f329a8d6', + moveCode: 'YJ9M34', + orders: { + id: '40475a80-5340-4722-88d1-3cc9764414d6', + created_at: '2024-01-31T16:29:53.285657Z', + updated_at: '2024-01-31T16:29:53.285657Z', + service_member_id: '6686d242-e7af-4a06-afd7-7be423bfca2d', + issue_date: '2024-01-31T00:00:00Z', + report_by_date: '2024-02-09T00:00:00Z', + orders_type: 'PERMANENT_CHANGE_OF_STATION', + orders_type_detail: null, + has_dependents: false, + spouse_has_pro_gear: false, + origin_duty_location: { + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + name: 'Tinker AFB, OK 73145', + affiliation: 'AIR_FORCE', + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + address: { + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + street_address_1: 'n/a', + street_address_2: null, + street_address_3: null, + city: 'Tinker AFB', + state: 'OK', + postal_code: '73145', + country: 'United States', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + TransportationOffice: { + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + shipping_office_id: 'c2c440ae-5394-4483-84fb-f872e32126bb', + ShippingOffice: null, + name: 'PPPO Tinker AFB - USAF', + Address: { + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + created_at: '2018-05-28T14:27:40.597383Z', + updated_at: '2018-05-28T14:27:40.597383Z', + street_address_1: '7330 Century Blvd', + street_address_2: 'Bldg 469', + street_address_3: null, + city: 'Tinker AFB', + state: 'OK', + postal_code: '73145', + country: 'United States', + }, + address_id: '410b18bc-b270-4b52-9211-532fffc6f59e', + latitude: 35.429035, + longitude: -97.39955, + PhoneLines: null, + Emails: null, + hours: 'Monday – Friday: 0715 – 1600; Limited Service from 1130-1230', + services: 'Walk-In Help; Briefings; Appointments; QA Inspections', + note: null, + gbloc: 'HAFC', + created_at: '2018-05-28T14:27:40.605679Z', + updated_at: '2018-05-28T14:27:40.60568Z', + provides_ppm_closeout: true, + }, + provides_services_counseling: true, + }, + origin_duty_location_id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + new_duty_location_id: '5c182566-0e6e-46f2-9eef-f07963783575', + new_duty_location: { + id: '5c182566-0e6e-46f2-9eef-f07963783575', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + name: 'Fort Sill, OK 73503', + affiliation: 'ARMY', + address_id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + address: { + id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + street_address_1: 'n/a', + street_address_2: null, + street_address_3: null, + city: 'Fort Sill', + state: 'OK', + postal_code: '73503', + country: 'United States', + }, + transportation_office_id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + TransportationOffice: { + id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + shipping_office_id: '5a3388e1-6d46-4639-ac8f-a8937dc26938', + ShippingOffice: null, + name: 'PPPO Fort Sill - USA', + Address: { + id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + created_at: '2018-05-28T14:27:35.538742Z', + updated_at: '2018-05-28T14:27:35.538743Z', + street_address_1: '4700 Mow Way Rd', + street_address_2: 'Room 110', + street_address_3: null, + city: 'Fort Sill', + state: 'OK', + postal_code: '73503', + country: 'United States', + }, + address_id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + latitude: 34.647964, + longitude: -98.41231, + PhoneLines: null, + Emails: null, + hours: 'Monday - Friday 0830-1530; Sat/Sun/Federal Holidays closed', + services: 'Walk-In Help; Appointments; QA Inspections; Appointments 06 and above', + note: null, + gbloc: 'JEAT', + created_at: '2018-05-28T14:27:35.547257Z', + updated_at: '2018-05-28T14:27:35.547257Z', + provides_ppm_closeout: true, + }, + provides_services_counseling: true, + }, + uploaded_orders_id: 'f779f6a2-48e2-47fe-87be-d93e8aa711fe', + status: 'DRAFT', + grade: 'E_7', + Entitlement: null, + entitlement_id: 'a1bf0035-4f28-45b8-af1a-556848d29e44', + UploadedAmendedOrders: null, + uploaded_amended_orders_id: null, + amended_orders_acknowledged_at: null, + origin_duty_location_gbloc: 'HAFC', + }, + status: 'DRAFT', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + previousMoves: [ + { + createdAt: '2024-01-31T16:29:53.290Z', + eTag: 'MjAyNC0wMS0zMVQxNjoyOTo1My4yOTA0OTRa', + id: '9211d4e2-5b92-42bb-9758-7ac1f329a8d6', + moveCode: 'ABC123', + orders: { + id: '40475a80-5340-4722-88d1-3cc9764414d6', + created_at: '2024-01-31T16:29:53.285657Z', + updated_at: '2024-01-31T16:29:53.285657Z', + service_member_id: '6686d242-e7af-4a06-afd7-7be423bfca2d', + issue_date: '2024-01-31T00:00:00Z', + report_by_date: '2024-02-09T00:00:00Z', + orders_type: 'PERMANENT_CHANGE_OF_STATION', + orders_type_detail: null, + has_dependents: false, + spouse_has_pro_gear: false, + origin_duty_location: { + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + name: 'Tinker AFB, OK 73145', + affiliation: 'AIR_FORCE', + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + address: { + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + street_address_1: 'n/a', + street_address_2: null, + street_address_3: null, + city: 'Tinker AFB', + state: 'OK', + postal_code: '73145', + country: 'United States', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + TransportationOffice: { + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + shipping_office_id: 'c2c440ae-5394-4483-84fb-f872e32126bb', + ShippingOffice: null, + name: 'PPPO Tinker AFB - USAF', + Address: { + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + created_at: '2018-05-28T14:27:40.597383Z', + updated_at: '2018-05-28T14:27:40.597383Z', + street_address_1: '7330 Century Blvd', + street_address_2: 'Bldg 469', + street_address_3: null, + city: 'Tinker AFB', + state: 'OK', + postal_code: '73145', + country: 'United States', + }, + address_id: '410b18bc-b270-4b52-9211-532fffc6f59e', + latitude: 35.429035, + longitude: -97.39955, + PhoneLines: null, + Emails: null, + hours: 'Monday – Friday: 0715 – 1600; Limited Service from 1130-1230', + services: 'Walk-In Help; Briefings; Appointments; QA Inspections', + note: null, + gbloc: 'HAFC', + created_at: '2018-05-28T14:27:40.605679Z', + updated_at: '2018-05-28T14:27:40.60568Z', + provides_ppm_closeout: true, + }, + provides_services_counseling: true, + }, + origin_duty_location_id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + new_duty_location_id: '5c182566-0e6e-46f2-9eef-f07963783575', + new_duty_location: { + id: '5c182566-0e6e-46f2-9eef-f07963783575', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + name: 'Fort Sill, OK 73503', + affiliation: 'ARMY', + address_id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + address: { + id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + street_address_1: 'n/a', + street_address_2: null, + street_address_3: null, + city: 'Fort Sill', + state: 'OK', + postal_code: '73503', + country: 'United States', + }, + transportation_office_id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + TransportationOffice: { + id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + shipping_office_id: '5a3388e1-6d46-4639-ac8f-a8937dc26938', + ShippingOffice: null, + name: 'PPPO Fort Sill - USA', + Address: { + id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + created_at: '2018-05-28T14:27:35.538742Z', + updated_at: '2018-05-28T14:27:35.538743Z', + street_address_1: '4700 Mow Way Rd', + street_address_2: 'Room 110', + street_address_3: null, + city: 'Fort Sill', + state: 'OK', + postal_code: '73503', + country: 'United States', + }, + address_id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + latitude: 34.647964, + longitude: -98.41231, + PhoneLines: null, + Emails: null, + hours: 'Monday - Friday 0830-1530; Sat/Sun/Federal Holidays closed', + services: 'Walk-In Help; Appointments; QA Inspections; Appointments 06 and above', + note: null, + gbloc: 'JEAT', + created_at: '2018-05-28T14:27:35.547257Z', + updated_at: '2018-05-28T14:27:35.547257Z', + provides_ppm_closeout: true, + }, + provides_services_counseling: true, + }, + uploaded_orders_id: 'f779f6a2-48e2-47fe-87be-d93e8aa711fe', + status: 'DRAFT', + grade: 'E_7', + Entitlement: null, + entitlement_id: 'a1bf0035-4f28-45b8-af1a-556848d29e44', + UploadedAmendedOrders: null, + uploaded_amended_orders_id: null, + amended_orders_acknowledged_at: null, + origin_duty_location_gbloc: 'HAFC', + }, + status: 'APPROVED', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + { + createdAt: '2024-02-18T16:29:53.290Z', + eTag: 'MjAyNC0wMS0zMVQxNjoyOTo1My4yOTA0OTRb', + id: '9211d4e2-5b92-42bb-9758-7ac1f329a8d7', + moveCode: 'DEF456', + orders: { + id: '40475a80-5340-4722-88d1-3cc9764414d7', + created_at: '2024-01-31T16:29:53.285657Z', + updated_at: '2024-01-31T16:29:53.285657Z', + service_member_id: '6686d242-e7af-4a06-afd7-7be423bfca2d', + issue_date: '2024-01-31T00:00:00Z', + report_by_date: '2024-02-09T00:00:00Z', + orders_type: 'PERMANENT_CHANGE_OF_STATION', + orders_type_detail: null, + has_dependents: false, + spouse_has_pro_gear: false, + origin_duty_location: { + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + name: 'Tinker AFB, OK 73145', + affiliation: 'AIR_FORCE', + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + address: { + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + street_address_1: 'n/a', + street_address_2: null, + street_address_3: null, + city: 'Tinker AFB', + state: 'OK', + postal_code: '73145', + country: 'United States', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + TransportationOffice: { + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + shipping_office_id: 'c2c440ae-5394-4483-84fb-f872e32126bb', + ShippingOffice: null, + name: 'PPPO Tinker AFB - USAF', + Address: { + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + created_at: '2018-05-28T14:27:40.597383Z', + updated_at: '2018-05-28T14:27:40.597383Z', + street_address_1: '7330 Century Blvd', + street_address_2: 'Bldg 469', + street_address_3: null, + city: 'Tinker AFB', + state: 'OK', + postal_code: '73145', + country: 'United States', + }, + address_id: '410b18bc-b270-4b52-9211-532fffc6f59e', + latitude: 35.429035, + longitude: -97.39955, + PhoneLines: null, + Emails: null, + hours: 'Monday – Friday: 0715 – 1600; Limited Service from 1130-1230', + services: 'Walk-In Help; Briefings; Appointments; QA Inspections', + note: null, + gbloc: 'HAFC', + created_at: '2018-05-28T14:27:40.605679Z', + updated_at: '2018-05-28T14:27:40.60568Z', + provides_ppm_closeout: true, + }, + provides_services_counseling: true, + }, + origin_duty_location_id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + new_duty_location_id: '5c182566-0e6e-46f2-9eef-f07963783575', + new_duty_location: { + id: '5c182566-0e6e-46f2-9eef-f07963783575', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + name: 'Fort Sill, OK 73503', + affiliation: 'ARMY', + address_id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + address: { + id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + created_at: '2024-01-26T16:46:34.047004Z', + updated_at: '2024-01-26T16:46:34.047004Z', + street_address_1: 'n/a', + street_address_2: null, + street_address_3: null, + city: 'Fort Sill', + state: 'OK', + postal_code: '73503', + country: 'United States', + }, + transportation_office_id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + TransportationOffice: { + id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + shipping_office_id: '5a3388e1-6d46-4639-ac8f-a8937dc26938', + ShippingOffice: null, + name: 'PPPO Fort Sill - USA', + Address: { + id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + created_at: '2018-05-28T14:27:35.538742Z', + updated_at: '2018-05-28T14:27:35.538743Z', + street_address_1: '4700 Mow Way Rd', + street_address_2: 'Room 110', + street_address_3: null, + city: 'Fort Sill', + state: 'OK', + postal_code: '73503', + country: 'United States', + }, + address_id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + latitude: 34.647964, + longitude: -98.41231, + PhoneLines: null, + Emails: null, + hours: 'Monday - Friday 0830-1530; Sat/Sun/Federal Holidays closed', + services: 'Walk-In Help; Appointments; QA Inspections; Appointments 06 and above', + note: null, + gbloc: 'JEAT', + created_at: '2018-05-28T14:27:35.547257Z', + updated_at: '2018-05-28T14:27:35.547257Z', + provides_ppm_closeout: true, + }, + provides_services_counseling: true, + }, + uploaded_orders_id: 'f779f6a2-48e2-47fe-87be-d93e8aa711fe', + status: 'DRAFT', + grade: 'E_7', + Entitlement: null, + entitlement_id: 'a1bf0035-4f28-45b8-af1a-556848d29e44', + UploadedAmendedOrders: null, + uploaded_amended_orders_id: null, + amended_orders_acknowledged_at: null, + origin_duty_location_gbloc: 'HAFC', + }, + status: 'DRAFT', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + }, +}; + describe('MultiMovesLandingPage', () => { it('renders the component with moves', () => { render( @@ -236,7 +751,7 @@ describe('MultiMovesLandingPage', () => { expect(screen.getAllByText('Previous Moves')).toHaveLength(1); }); - it('renders move data correctly', () => { + it('renders move data correctly if one move', () => { render( @@ -245,9 +760,43 @@ describe('MultiMovesLandingPage', () => { expect(screen.getByText('Jim Bean')).toBeInTheDocument(); expect(screen.getByText('#YJ9M34')).toBeInTheDocument(); + expect(screen.getByTestId('welcomeHeader')).toBeInTheDocument(); + expect(screen.getByTestId('createMoveBtn')).toBeInTheDocument(); expect(screen.getByTestId('currentMoveHeader')).toBeInTheDocument(); expect(screen.getByTestId('currentMoveContainer')).toBeInTheDocument(); expect(screen.getByTestId('prevMovesHeader')).toBeInTheDocument(); expect(screen.getByText('You have no previous moves.')).toBeInTheDocument(); }); + + it('renders move data correctly if multiple moves', () => { + render( + + + , + ); + + expect(screen.getByText('Jim Bean')).toBeInTheDocument(); + expect(screen.getByText('#YJ9M34')).toBeInTheDocument(); + expect(screen.getByTestId('welcomeHeaderPrevMoves')).toBeInTheDocument(); + expect(screen.getByTestId('createMoveBtn')).toBeInTheDocument(); + expect(screen.getByTestId('currentMoveHeader')).toBeInTheDocument(); + expect(screen.getByTestId('currentMoveContainer')).toBeInTheDocument(); + expect(screen.getByTestId('prevMovesHeader')).toBeInTheDocument(); + expect(screen.getByText('#ABC123')).toBeInTheDocument(); + expect(screen.getByText('#DEF456')).toBeInTheDocument(); + }); + + it('renders move data correctly if no moves', () => { + render( + + + , + ); + + expect(screen.getByText('Jim Bean')).toBeInTheDocument(); + expect(screen.getByTestId('currentMoveHeader')).toBeInTheDocument(); + expect(screen.getByText('You do not have a current move.')).toBeInTheDocument(); + expect(screen.getByTestId('prevMovesHeader')).toBeInTheDocument(); + expect(screen.getByText('You have no previous moves.')).toBeInTheDocument(); + }); }); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx index df800ea5369..29b04a18823 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveInfoList/MultiMovesInfoList.test.jsx @@ -11,9 +11,9 @@ describe('MultiMovesMoveInfoList', () => { issue_date: '2022-01-01', orders_type: 'SEPARATION', report_by_date: '2022-02-01', - OriginDutyLocation: { + origin_duty_location: { name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -23,9 +23,9 @@ describe('MultiMovesMoveInfoList', () => { country: 'USA', }, }, - NewDutyLocation: { + new_duty_location: { name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -44,9 +44,9 @@ describe('MultiMovesMoveInfoList', () => { issue_date: '2022-01-01', orders_type: 'RETIREMENT', report_by_date: '2022-02-01', - OriginDutyLocation: { + origin_duty_location: { name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -56,9 +56,9 @@ describe('MultiMovesMoveInfoList', () => { country: 'USA', }, }, - NewDutyLocation: { + new_duty_location: { name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -77,9 +77,9 @@ describe('MultiMovesMoveInfoList', () => { issue_date: '2022-01-01', orders_type: 'PERMANENT_CHANGE_OF_DUTY_STATION', report_by_date: '2022-02-01', - OriginDutyLocation: { + origin_duty_location: { name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -89,9 +89,9 @@ describe('MultiMovesMoveInfoList', () => { country: 'USA', }, }, - NewDutyLocation: { + new_duty_location: { name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesTestData.js b/src/pages/MyMove/Multi-Moves/MultiMovesTestData.js index e02213f3620..239ce11e578 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesTestData.js +++ b/src/pages/MyMove/Multi-Moves/MultiMovesTestData.js @@ -7,10 +7,10 @@ export const mockMovesPCS = { status: 'DRAFT', orders: { id: 'testOrder1', - NewDutyLocation: { + new_duty_location: { id: 'testDDL1', name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -20,10 +20,10 @@ export const mockMovesPCS = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL1', name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -93,10 +93,10 @@ export const mockMovesPCS = { status: 'APPROVED', orders: { id: 'testOrder2', - NewDutyLocation: { + new_duty_location: { id: 'testDDL2', name: 'Fort Bragg South Station', - Address: { + address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -106,10 +106,10 @@ export const mockMovesPCS = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL2', name: 'Fort Bragg South Station', - Address: { + address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -177,10 +177,10 @@ export const mockMovesPCS = { status: 'APPROVED', orders: { id: 'testOrder3', - NewDutyLocation: { + new_duty_location: { id: 'testDDL3', name: 'Fort Bragg East Station', - Address: { + address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -190,10 +190,10 @@ export const mockMovesPCS = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL3', name: 'Fort Bragg East Station', - Address: { + address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -266,10 +266,10 @@ export const mockMovesRetirement = { status: 'SUBMITTED', orders: { id: 'testOrder1', - NewDutyLocation: { + new_duty_location: { id: 'testDDL1', name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -279,10 +279,10 @@ export const mockMovesRetirement = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL1', name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -352,10 +352,10 @@ export const mockMovesRetirement = { status: 'APPROVED', orders: { id: 'testOrder2', - NewDutyLocation: { + new_duty_location: { id: 'testDDL2', name: 'Fort Bragg South Station', - Address: { + address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -365,10 +365,10 @@ export const mockMovesRetirement = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL2', name: 'Fort Bragg South Station', - Address: { + address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -436,10 +436,10 @@ export const mockMovesRetirement = { status: 'APPROVED', orders: { id: 'testOrder3', - NewDutyLocation: { + new_duty_location: { id: 'testDDL3', name: 'Fort Bragg East Station', - Address: { + address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -449,10 +449,10 @@ export const mockMovesRetirement = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL3', name: 'Fort Bragg East Station', - Address: { + address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -525,10 +525,10 @@ export const mockMovesSeparation = { status: 'DRAFT', orders: { id: 'testOrder1', - NewDutyLocation: { + new_duty_location: { id: 'testDDL1', name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -538,10 +538,10 @@ export const mockMovesSeparation = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL1', name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -611,10 +611,10 @@ export const mockMovesSeparation = { status: 'APPROVED', orders: { id: 'testOrder2', - NewDutyLocation: { + new_duty_location: { id: 'testDDL2', name: 'Fort Bragg South Station', - Address: { + address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -624,10 +624,10 @@ export const mockMovesSeparation = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL2', name: 'Fort Bragg South Station', - Address: { + address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -695,10 +695,10 @@ export const mockMovesSeparation = { status: 'APPROVED', orders: { id: 'testOrder3', - NewDutyLocation: { + new_duty_location: { id: 'testDDL3', name: 'Fort Bragg East Station', - Address: { + address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -708,10 +708,10 @@ export const mockMovesSeparation = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL3', name: 'Fort Bragg East Station', - Address: { + address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -784,10 +784,10 @@ export const mockMovesNoPreviousMoves = { status: 'DRAFT', orders: { id: 'testOrder1', - NewDutyLocation: { + new_duty_location: { id: 'testDDL1', name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -797,10 +797,10 @@ export const mockMovesNoPreviousMoves = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL1', name: 'Fort Bragg North Station', - Address: { + address: { streetAddress1: '123 Main Ave', streetAddress2: 'Apartment 9000', streetAddress3: '', @@ -875,10 +875,10 @@ export const mockMovesNoCurrentMoveWithPreviousMoves = { status: 'APPROVED', orders: { id: 'testOrder2', - NewDutyLocation: { + new_duty_location: { id: 'testDDL2', name: 'Fort Bragg South Station', - Address: { + address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -888,10 +888,10 @@ export const mockMovesNoCurrentMoveWithPreviousMoves = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL2', name: 'Fort Bragg South Station', - Address: { + address: { streetAddress1: '456 Oak St', streetAddress2: 'Apartment 8000', streetAddress3: '', @@ -959,10 +959,10 @@ export const mockMovesNoCurrentMoveWithPreviousMoves = { status: 'APPROVED', orders: { id: 'testOrder3', - NewDutyLocation: { + new_duty_location: { id: 'testDDL3', name: 'Fort Bragg East Station', - Address: { + address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', @@ -972,10 +972,10 @@ export const mockMovesNoCurrentMoveWithPreviousMoves = { country: 'USA', }, }, - OriginDutyLocation: { + origin_duty_location: { id: 'testODL3', name: 'Fort Bragg East Station', - Address: { + address: { streetAddress1: '789 Pine Ave', streetAddress2: 'Apartment 7000', streetAddress3: '', From d5cc20595ae380eddf76de1ed0468905d0b89a75 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 20 Feb 2024 19:14:50 +0000 Subject: [PATCH 61/67] updated and added tests for new component, holy cow --- src/pages/MyMove/Home/MoveHome.jsx | 17 +- src/pages/MyMove/Home/MoveHome.test.jsx | 1252 +++++++++++++++++ .../MultiMovesMoveContainer.jsx | 2 +- src/pages/MyMove/Orders.jsx | 14 +- src/pages/MyMove/Orders.test.jsx | 2 +- src/sagas/entities.js | 5 +- src/sagas/entities.test.js | 3 + 7 files changed, 1277 insertions(+), 18 deletions(-) create mode 100644 src/pages/MyMove/Home/MoveHome.test.jsx diff --git a/src/pages/MyMove/Home/MoveHome.jsx b/src/pages/MyMove/Home/MoveHome.jsx index 10b2c361619..98b54006903 100644 --- a/src/pages/MyMove/Home/MoveHome.jsx +++ b/src/pages/MyMove/Home/MoveHome.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { node, string } from 'prop-types'; import moment from 'moment'; import { connect } from 'react-redux'; @@ -30,7 +30,7 @@ import MOVE_STATUSES from 'constants/moves'; import { customerRoutes } from 'constants/routes'; import { ppmShipmentStatuses, shipmentTypes } from 'constants/shipments'; import ConnectedFlashMessage from 'containers/FlashMessage/FlashMessage'; -import { deleteMTOShipment, getMTOShipmentsForMove } from 'services/internalApi'; +import { deleteMTOShipment, getAllMoves, getMTOShipmentsForMove } from 'services/internalApi'; import { withContext } from 'shared/AppContext'; import { SHIPMENT_OPTIONS } from 'shared/constants'; import { @@ -38,7 +38,7 @@ import { selectSignedCertification, } from 'shared/Entities/modules/signed_certifications'; import LoadingPlaceholder from 'shared/LoadingPlaceholder'; -import { updateMTOShipments } from 'store/entities/actions'; +import { updateMTOShipments, updateAllMoves as updateAllMovesAction } from 'store/entities/actions'; import { selectAllMoves, selectCurrentOrders, @@ -70,7 +70,7 @@ Description.defaultProps = { dataTestId: '', }; -const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signedCertification }) => { +const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signedCertification, updateAllMoves }) => { // loading the moveId in params to select move details from serviceMemberMoves in state const { moveId } = useParams(); const navigate = useNavigate(); @@ -80,6 +80,14 @@ const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signed const [showDeleteSuccessAlert, setShowDeleteSuccessAlert] = useState(false); const [showDeleteErrorAlert, setShowDeleteErrorAlert] = useState(false); + // fetching all move data on load since this component is dependent on that data + // this will run each time the component is loaded/accessed + useEffect(() => { + getAllMoves(serviceMember.id).then((response) => { + updateAllMoves(response); + }); + }, [updateAllMoves, serviceMember]); + // loading placeholder while data loads - this handles any async issues if (!serviceMemberMoves || !serviceMemberMoves.currentMove || !serviceMemberMoves.previousMoves) { return ( @@ -664,6 +672,7 @@ const mapStateToProps = (state) => { const mapDispatchToProps = { getSignedCertification: getSignedCertificationAction, updateShipmentList: updateMTOShipments, + updateAllMoves: updateAllMovesAction, }; // in order to avoid setting up proxy server only for storybook, pass in stub function so API requests don't fail diff --git a/src/pages/MyMove/Home/MoveHome.test.jsx b/src/pages/MyMove/Home/MoveHome.test.jsx new file mode 100644 index 00000000000..67fdb864546 --- /dev/null +++ b/src/pages/MyMove/Home/MoveHome.test.jsx @@ -0,0 +1,1252 @@ +/* eslint-disable react/jsx-props-no-spreading */ +import React from 'react'; +import { v4 } from 'uuid'; +import { mount } from 'enzyme'; + +import MoveHome from './MoveHome'; + +import { customerRoutes } from 'constants/routes'; +import { MockProviders } from 'testUtils'; + +jest.mock('containers/FlashMessage/FlashMessage', () => { + const MockFlash = () =>
        Flash message
        ; + MockFlash.displayName = 'ConnectedFlashMessage'; + return MockFlash; +}); + +const mockNavigate = jest.fn(); +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useNavigate: () => mockNavigate, +})); + +jest.mock('store/entities/actions', () => ({ + updateMTOShipments: jest.fn(), + updateAllMoves: jest.fn(), +})); + +jest.mock('services/internalApi', () => ({ + deleteMTOShipment: jest.fn(), + getMTOShipmentsForMove: jest.fn(), + getAllMoves: jest.fn().mockImplementation(() => Promise.resolve()), +})); + +const props = { + serviceMember: { + id: v4(), + current_location: { + transportation_office: { + name: 'Test Transportation Office Name', + phone_lines: ['555-555-5555'], + }, + }, + }, + showLoggedInUser: jest.fn(), + createServiceMember: jest.fn(), + getSignedCertification: jest.fn(), + updateAllMoves: jest.fn(), + mtoShipments: [], + mtoShipment: {}, + isLoggedIn: true, + loggedInUserIsLoading: false, + loggedInUserSuccess: true, + isProfileComplete: true, + loadMTOShipments: jest.fn(), + updateShipmentList: jest.fn(), +}; + +const defaultPropsNoOrders = { + ...props, + serviceMemberMoves: { + currentMove: [ + { + createdAt: '2024-02-16T15:55:20.639Z', + eTag: 'MjAyNC0wMi0xNlQxNTo1NToyMC42Mzk5MDRa', + id: '6dad799c-4567-4a7d-9419-1a686797768f', + moveCode: '4H8VCD', + orders: {}, + status: 'DRAFT', + submittedAt: '0001-01-01T00:00:00.000Z', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + previousMoves: [], + }, + uploadedOrderDocuments: [], + uploadedAmendedOrderDocuments: [], +}; + +const defaultPropsOrdersWithUploads = { + ...props, + serviceMemberMoves: { + currentMove: [ + { + createdAt: '2024-02-16T15:55:20.639Z', + eTag: 'MjAyNC0wMi0xNlQxNTo1NToyMC42Mzk5MDRa', + id: '6dad799c-4567-4a7d-9419-1a686797768f', + moveCode: '4H8VCD', + orders: { + authorizedWeight: 11000, + created_at: '2024-02-16T15:55:20.634Z', + entitlement: { + proGear: 2000, + proGearSpouse: 500, + }, + grade: 'E_7', + has_dependents: false, + id: '667b1ca7-f904-43c4-8f2d-a2ea2375d7d3', + issue_date: '2024-02-22', + new_duty_location: { + address: { + city: 'Fort Knox', + country: 'United States', + id: '31ed530d-4b59-42d7-9ea9-88ccc2978723', + postalCode: '40121', + state: 'KY', + streetAddress1: 'n/a', + }, + address_id: '31ed530d-4b59-42d7-9ea9-88ccc2978723', + affiliation: 'ARMY', + created_at: '2024-02-15T14:42:58.875Z', + id: '866ac8f6-94f5-4fa0-b7d1-be7fcf9d51e9', + name: 'Fort Knox, KY 40121', + transportation_office: { + address: { + city: 'Fort Knox', + country: 'United States', + id: 'ca758d13-b3b7-48a5-93bd-64912f0e2434', + postalCode: '40121', + state: 'KY', + streetAddress1: 'LRC 25 W. Chaffee Ave', + streetAddress2: 'Bldg 1384, 2nd Floor', + }, + created_at: '2018-05-28T14:27:36.193Z', + gbloc: 'BGAC', + id: '0357f830-2f32-41f3-9ca2-268dd70df5cb', + name: 'PPPO Fort Knox - USA', + phone_lines: [], + updated_at: '2018-05-28T14:27:36.193Z', + }, + transportation_office_id: '0357f830-2f32-41f3-9ca2-268dd70df5cb', + updated_at: '2024-02-15T14:42:58.875Z', + }, + orders_type: 'PERMANENT_CHANGE_OF_STATION', + originDutyLocationGbloc: 'HAFC', + origin_duty_location: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + postalCode: '73145', + state: 'OK', + streetAddress1: 'n/a', + }, + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + affiliation: 'AIR_FORCE', + created_at: '2024-02-15T14:42:58.875Z', + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + name: 'Tinker AFB, OK 73145', + transportation_office: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + postalCode: '73145', + state: 'OK', + streetAddress1: '7330 Century Blvd', + streetAddress2: 'Bldg 469', + }, + created_at: '2018-05-28T14:27:40.605Z', + gbloc: 'HAFC', + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + name: 'PPPO Tinker AFB - USAF', + phone_lines: [], + updated_at: '2018-05-28T14:27:40.605Z', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + updated_at: '2024-02-15T14:42:58.875Z', + }, + report_by_date: '2024-02-29', + service_member_id: '856fec24-a70b-4860-9ba8-98d25676317e', + spouse_has_pro_gear: false, + status: 'DRAFT', + updated_at: '2024-02-16T15:55:20.634Z', + uploaded_orders: { + id: '573a2d22-8edf-467c-90dc-3885de10e2d2', + service_member_id: '856fec24-a70b-4860-9ba8-98d25676317e', + uploads: [ + { + bytes: 84847, + contentType: 'image/png', + createdAt: '2024-02-20T17:12:56.328Z', + filename: 'myUpload.png', + id: '99fab296-ad63-4e34-8724-a8b73e357480', + status: 'PROCESSING', + updatedAt: '2024-02-20T17:12:56.328Z', + url: '/storage/user/9e16e5d7-4548-4f70-8a2a-b87d34ab3067/uploads/99fab296-ad63-4e34-8724-a8b73e357480?contentType=image%2Fpng', + }, + ], + }, + }, + status: 'DRAFT', + submittedAt: '0001-01-01T00:00:00.000Z', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + previousMoves: [], + }, + uploadedOrderDocuments: [], + uploadedAmendedOrderDocuments: [], +}; + +const defaultPropsOrdersWithUnsubmittedShipments = { + ...props, + serviceMemberMoves: { + currentMove: [ + { + createdAt: '2024-02-16T15:55:20.639Z', + eTag: 'MjAyNC0wMi0xNlQxNTo1NToyMC42Mzk5MDRa', + id: '6dad799c-4567-4a7d-9419-1a686797768f', + moveCode: '4H8VCD', + mtoShipments: [ + { + createdAt: '2024-02-20T17:21:05.318Z', + customerRemarks: 'some remarks', + destinationAddress: { + city: 'Fort Sill', + country: 'United States', + id: '7787c25e-fe15-4e13-8e38-23397e5dbfb3', + postalCode: '73503', + state: 'OK', + streetAddress1: 'N/A', + }, + eTag: 'MjAyNC0wMi0yMFQxNzoyMTowNS4zMTgwODNa', + hasSecondaryDeliveryAddress: false, + hasSecondaryPickupAddress: false, + id: 'be807bb2-572b-4677-9896-c7f670ac72fa', + moveTaskOrderID: 'cf2508aa-2b0a-47e9-8688-37b41623837d', + pickupAddress: { + city: 'Oklahoma City', + id: 'c8ef1288-1588-44ee-b9fb-b38c703d2ca5', + postalCode: '74133', + state: 'OK', + streetAddress1: '1234 S Somewhere Street', + streetAddress2: '', + }, + requestedDeliveryDate: '2024-03-15', + requestedPickupDate: '2024-02-29', + shipmentType: 'HHG', + status: 'SUBMITTED', + updatedAt: '2024-02-20T17:21:05.318Z', + }, + { + createdAt: '2024-02-20T17:21:48.242Z', + eTag: 'MjAyNC0wMi0yMFQxNzoyMjowMy4wMzk2Njla', + hasSecondaryDeliveryAddress: false, + hasSecondaryPickupAddress: false, + id: '0c7f88b8-75a9-41fe-b884-ea39e6024f24', + moveTaskOrderID: 'cf2508aa-2b0a-47e9-8688-37b41623837d', + ppmShipment: { + actualDestinationPostalCode: null, + actualMoveDate: null, + actualPickupPostalCode: null, + advanceAmountReceived: null, + advanceAmountRequested: null, + approvedAt: null, + createdAt: '2024-02-20T17:21:48.248Z', + destinationPostalCode: '73503', + eTag: 'MjAyNC0wMi0yMFQxNzoyMjowMy4wODU5Mzda', + estimatedIncentive: 339123, + estimatedWeight: 2000, + expectedDepartureDate: '2024-02-23', + finalIncentive: null, + hasProGear: false, + hasReceivedAdvance: null, + hasRequestedAdvance: false, + id: '5f1f0b88-9cb9-4b48-a9ad-2af6c1113ca2', + movingExpenses: [], + pickupPostalCode: '74133', + proGearWeight: null, + proGearWeightTickets: [], + reviewedAt: null, + secondaryDestinationPostalCode: null, + secondaryPickupPostalCode: null, + shipmentId: '0c7f88b8-75a9-41fe-b884-ea39e6024f24', + sitEstimatedCost: null, + sitEstimatedDepartureDate: null, + sitEstimatedEntryDate: null, + sitEstimatedWeight: null, + sitExpected: false, + spouseProGearWeight: null, + status: 'DRAFT', + submittedAt: null, + updatedAt: '2024-02-20T17:22:03.085Z', + weightTickets: [], + }, + shipmentType: 'PPM', + status: 'DRAFT', + updatedAt: '2024-02-20T17:22:03.039Z', + }, + ], + orders: { + authorizedWeight: 11000, + created_at: '2024-02-16T15:55:20.634Z', + entitlement: { + proGear: 2000, + proGearSpouse: 500, + }, + grade: 'E_7', + has_dependents: false, + id: '667b1ca7-f904-43c4-8f2d-a2ea2375d7d3', + issue_date: '2024-02-22', + new_duty_location: { + address: { + city: 'Fort Knox', + country: 'United States', + id: '31ed530d-4b59-42d7-9ea9-88ccc2978723', + postalCode: '40121', + state: 'KY', + streetAddress1: 'n/a', + }, + address_id: '31ed530d-4b59-42d7-9ea9-88ccc2978723', + affiliation: 'ARMY', + created_at: '2024-02-15T14:42:58.875Z', + id: '866ac8f6-94f5-4fa0-b7d1-be7fcf9d51e9', + name: 'Fort Knox, KY 40121', + transportation_office: { + address: { + city: 'Fort Knox', + country: 'United States', + id: 'ca758d13-b3b7-48a5-93bd-64912f0e2434', + postalCode: '40121', + state: 'KY', + streetAddress1: 'LRC 25 W. Chaffee Ave', + streetAddress2: 'Bldg 1384, 2nd Floor', + }, + created_at: '2018-05-28T14:27:36.193Z', + gbloc: 'BGAC', + id: '0357f830-2f32-41f3-9ca2-268dd70df5cb', + name: 'PPPO Fort Knox - USA', + phone_lines: [], + updated_at: '2018-05-28T14:27:36.193Z', + }, + transportation_office_id: '0357f830-2f32-41f3-9ca2-268dd70df5cb', + updated_at: '2024-02-15T14:42:58.875Z', + }, + orders_type: 'PERMANENT_CHANGE_OF_STATION', + originDutyLocationGbloc: 'HAFC', + origin_duty_location: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + postalCode: '73145', + state: 'OK', + streetAddress1: 'n/a', + }, + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + affiliation: 'AIR_FORCE', + created_at: '2024-02-15T14:42:58.875Z', + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + name: 'Tinker AFB, OK 73145', + transportation_office: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + postalCode: '73145', + state: 'OK', + streetAddress1: '7330 Century Blvd', + streetAddress2: 'Bldg 469', + }, + created_at: '2018-05-28T14:27:40.605Z', + gbloc: 'HAFC', + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + name: 'PPPO Tinker AFB - USAF', + phone_lines: [], + updated_at: '2018-05-28T14:27:40.605Z', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + updated_at: '2024-02-15T14:42:58.875Z', + }, + report_by_date: '2024-02-29', + service_member_id: '856fec24-a70b-4860-9ba8-98d25676317e', + spouse_has_pro_gear: false, + status: 'DRAFT', + updated_at: '2024-02-16T15:55:20.634Z', + uploaded_orders: { + id: '573a2d22-8edf-467c-90dc-3885de10e2d2', + service_member_id: '856fec24-a70b-4860-9ba8-98d25676317e', + uploads: [ + { + bytes: 84847, + contentType: 'image/png', + createdAt: '2024-02-20T17:12:56.328Z', + filename: 'myUpload.png', + id: '99fab296-ad63-4e34-8724-a8b73e357480', + status: 'PROCESSING', + updatedAt: '2024-02-20T17:12:56.328Z', + url: '/storage/user/9e16e5d7-4548-4f70-8a2a-b87d34ab3067/uploads/99fab296-ad63-4e34-8724-a8b73e357480?contentType=image%2Fpng', + }, + ], + }, + }, + status: 'DRAFT', + submittedAt: '0001-01-01T00:00:00.000Z', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + previousMoves: [], + }, + uploadedOrderDocuments: [], + uploadedAmendedOrderDocuments: [], +}; + +const defaultPropsOrdersWithSubmittedShipments = { + ...props, + serviceMemberMoves: { + currentMove: [ + { + createdAt: '2024-02-16T15:55:20.639Z', + eTag: 'MjAyNC0wMi0xNlQxNTo1NToyMC42Mzk5MDRa', + id: '6dad799c-4567-4a7d-9419-1a686797768f', + moveCode: '4H8VCD', + mtoShipments: [ + { + createdAt: '2024-02-20T17:21:05.318Z', + customerRemarks: 'some remarks', + destinationAddress: { + city: 'Fort Sill', + country: 'United States', + id: '7787c25e-fe15-4e13-8e38-23397e5dbfb3', + postalCode: '73503', + state: 'OK', + streetAddress1: 'N/A', + }, + eTag: 'MjAyNC0wMi0yMFQxNzoyMTowNS4zMTgwODNa', + hasSecondaryDeliveryAddress: false, + hasSecondaryPickupAddress: false, + id: 'be807bb2-572b-4677-9896-c7f670ac72fa', + moveTaskOrderID: 'cf2508aa-2b0a-47e9-8688-37b41623837d', + pickupAddress: { + city: 'Oklahoma City', + id: 'c8ef1288-1588-44ee-b9fb-b38c703d2ca5', + postalCode: '74133', + state: 'OK', + streetAddress1: '1234 S Somewhere Street', + streetAddress2: '', + }, + requestedDeliveryDate: '2024-03-15', + requestedPickupDate: '2024-02-29', + shipmentType: 'HHG', + status: 'SUBMITTED', + updatedAt: '2024-02-20T17:21:05.318Z', + }, + { + createdAt: '2024-02-20T17:21:48.242Z', + eTag: 'MjAyNC0wMi0yMFQxNzoyMjowMy4wMzk2Njla', + hasSecondaryDeliveryAddress: false, + hasSecondaryPickupAddress: false, + id: '0c7f88b8-75a9-41fe-b884-ea39e6024f24', + moveTaskOrderID: 'cf2508aa-2b0a-47e9-8688-37b41623837d', + ppmShipment: { + actualDestinationPostalCode: null, + actualMoveDate: null, + actualPickupPostalCode: null, + advanceAmountReceived: null, + advanceAmountRequested: null, + approvedAt: null, + createdAt: '2024-02-20T17:21:48.248Z', + destinationPostalCode: '73503', + eTag: 'MjAyNC0wMi0yMFQxNzoyMjowMy4wODU5Mzda', + estimatedIncentive: 339123, + estimatedWeight: 2000, + expectedDepartureDate: '2024-02-23', + finalIncentive: null, + hasProGear: false, + hasReceivedAdvance: null, + hasRequestedAdvance: false, + id: '5f1f0b88-9cb9-4b48-a9ad-2af6c1113ca2', + movingExpenses: [], + pickupPostalCode: '74133', + proGearWeight: null, + proGearWeightTickets: [], + reviewedAt: null, + secondaryDestinationPostalCode: null, + secondaryPickupPostalCode: null, + shipmentId: '0c7f88b8-75a9-41fe-b884-ea39e6024f24', + sitEstimatedCost: null, + sitEstimatedDepartureDate: null, + sitEstimatedEntryDate: null, + sitEstimatedWeight: null, + sitExpected: false, + spouseProGearWeight: null, + status: 'DRAFT', + submittedAt: null, + updatedAt: '2024-02-20T17:22:03.085Z', + weightTickets: [], + }, + shipmentType: 'PPM', + status: 'DRAFT', + updatedAt: '2024-02-20T17:22:03.039Z', + }, + ], + orders: { + authorizedWeight: 11000, + created_at: '2024-02-16T15:55:20.634Z', + entitlement: { + proGear: 2000, + proGearSpouse: 500, + }, + grade: 'E_7', + has_dependents: false, + id: '667b1ca7-f904-43c4-8f2d-a2ea2375d7d3', + issue_date: '2024-02-22', + new_duty_location: { + address: { + city: 'Fort Knox', + country: 'United States', + id: '31ed530d-4b59-42d7-9ea9-88ccc2978723', + postalCode: '40121', + state: 'KY', + streetAddress1: 'n/a', + }, + address_id: '31ed530d-4b59-42d7-9ea9-88ccc2978723', + affiliation: 'ARMY', + created_at: '2024-02-15T14:42:58.875Z', + id: '866ac8f6-94f5-4fa0-b7d1-be7fcf9d51e9', + name: 'Fort Knox, KY 40121', + transportation_office: { + address: { + city: 'Fort Knox', + country: 'United States', + id: 'ca758d13-b3b7-48a5-93bd-64912f0e2434', + postalCode: '40121', + state: 'KY', + streetAddress1: 'LRC 25 W. Chaffee Ave', + streetAddress2: 'Bldg 1384, 2nd Floor', + }, + created_at: '2018-05-28T14:27:36.193Z', + gbloc: 'BGAC', + id: '0357f830-2f32-41f3-9ca2-268dd70df5cb', + name: 'PPPO Fort Knox - USA', + phone_lines: [], + updated_at: '2018-05-28T14:27:36.193Z', + }, + transportation_office_id: '0357f830-2f32-41f3-9ca2-268dd70df5cb', + updated_at: '2024-02-15T14:42:58.875Z', + }, + orders_type: 'PERMANENT_CHANGE_OF_STATION', + originDutyLocationGbloc: 'HAFC', + origin_duty_location: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + postalCode: '73145', + state: 'OK', + streetAddress1: 'n/a', + }, + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + affiliation: 'AIR_FORCE', + created_at: '2024-02-15T14:42:58.875Z', + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + name: 'Tinker AFB, OK 73145', + transportation_office: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + postalCode: '73145', + state: 'OK', + streetAddress1: '7330 Century Blvd', + streetAddress2: 'Bldg 469', + }, + created_at: '2018-05-28T14:27:40.605Z', + gbloc: 'HAFC', + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + name: 'PPPO Tinker AFB - USAF', + phone_lines: [], + updated_at: '2018-05-28T14:27:40.605Z', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + updated_at: '2024-02-15T14:42:58.875Z', + }, + report_by_date: '2024-02-29', + service_member_id: '856fec24-a70b-4860-9ba8-98d25676317e', + spouse_has_pro_gear: false, + status: 'DRAFT', + updated_at: '2024-02-16T15:55:20.634Z', + uploaded_orders: { + id: '573a2d22-8edf-467c-90dc-3885de10e2d2', + service_member_id: '856fec24-a70b-4860-9ba8-98d25676317e', + uploads: [ + { + bytes: 84847, + contentType: 'image/png', + createdAt: '2024-02-20T17:12:56.328Z', + filename: 'myUpload.png', + id: '99fab296-ad63-4e34-8724-a8b73e357480', + status: 'PROCESSING', + updatedAt: '2024-02-20T17:12:56.328Z', + url: '/storage/user/9e16e5d7-4548-4f70-8a2a-b87d34ab3067/uploads/99fab296-ad63-4e34-8724-a8b73e357480?contentType=image%2Fpng', + }, + ], + }, + }, + status: 'NEEDS_SERVICE_COUNSELING', + submittedAt: '0001-01-01T00:00:00.000Z', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + previousMoves: [], + }, + uploadedOrderDocuments: [], + uploadedAmendedOrderDocuments: [], +}; + +const defaultPropsAmendedOrdersWithAdvanceRequested = { + ...props, + serviceMemberMoves: { + currentMove: [ + { + createdAt: '2024-02-16T15:55:20.639Z', + eTag: 'MjAyNC0wMi0xNlQxNTo1NToyMC42Mzk5MDRa', + id: '6dad799c-4567-4a7d-9419-1a686797768f', + moveCode: '4H8VCD', + mtoShipments: [ + { + createdAt: '2024-02-20T17:40:25.836Z', + eTag: 'MjAyNC0wMi0yMFQxNzo0MDo0Ny43NzA5NjVa', + hasSecondaryDeliveryAddress: false, + hasSecondaryPickupAddress: false, + id: '322ebc9f-0ca8-4943-a7a8-39235f4e680b', + moveTaskOrderID: '4918b8c9-5e0a-4d65-a6b8-6a7a6ce265d4', + ppmShipment: { + actualDestinationPostalCode: null, + actualMoveDate: null, + actualPickupPostalCode: null, + advanceAmountReceived: null, + advanceAmountRequested: 400000, + approvedAt: null, + createdAt: '2024-02-20T17:40:25.842Z', + destinationPostalCode: '73503', + eTag: 'MjAyNC0wMi0yMFQxNzo0MDo0Ny43NzI5MzNa', + estimatedIncentive: 678255, + estimatedWeight: 4000, + expectedDepartureDate: '2024-02-24', + finalIncentive: null, + hasProGear: false, + hasReceivedAdvance: null, + hasRequestedAdvance: true, + id: 'd18b865f-fd12-495d-91fa-65b53d72705a', + movingExpenses: [], + pickupPostalCode: '74133', + proGearWeight: null, + proGearWeightTickets: [], + reviewedAt: null, + secondaryDestinationPostalCode: null, + secondaryPickupPostalCode: null, + shipmentId: '322ebc9f-0ca8-4943-a7a8-39235f4e680b', + sitEstimatedCost: null, + sitEstimatedDepartureDate: null, + sitEstimatedEntryDate: null, + sitEstimatedWeight: null, + sitExpected: false, + spouseProGearWeight: null, + status: 'SUBMITTED', + submittedAt: null, + updatedAt: '2024-02-20T17:40:47.772Z', + weightTickets: [], + }, + shipmentType: 'PPM', + status: 'SUBMITTED', + updatedAt: '2024-02-20T17:40:47.770Z', + }, + ], + orders: { + authorizedWeight: 11000, + created_at: '2024-02-20T17:11:08.815Z', + entitlement: { + proGear: 2000, + proGearSpouse: 500, + }, + grade: 'E_7', + has_dependents: false, + id: '9db91886-40eb-4910-9c87-968fecd44d4b', + issue_date: '2024-02-22', + new_duty_location: { + address: { + city: 'Fort Sill', + country: 'United States', + id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + postalCode: '73503', + state: 'OK', + streetAddress1: 'n/a', + }, + address_id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + affiliation: 'ARMY', + created_at: '2024-02-15T14:42:58.875Z', + id: '5c182566-0e6e-46f2-9eef-f07963783575', + name: 'Fort Sill, OK 73503', + transportation_office: { + address: { + city: 'Fort Sill', + country: 'United States', + id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + postalCode: '73503', + state: 'OK', + streetAddress1: '4700 Mow Way Rd', + streetAddress2: 'Room 110', + }, + created_at: '2018-05-28T14:27:35.547Z', + gbloc: 'JEAT', + id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + name: 'PPPO Fort Sill - USA', + phone_lines: [], + updated_at: '2018-05-28T14:27:35.547Z', + }, + transportation_office_id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + updated_at: '2024-02-15T14:42:58.875Z', + }, + orders_type: 'PERMANENT_CHANGE_OF_STATION', + originDutyLocationGbloc: 'HAFC', + origin_duty_location: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + postalCode: '73145', + state: 'OK', + streetAddress1: 'n/a', + }, + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + affiliation: 'AIR_FORCE', + created_at: '2024-02-15T14:42:58.875Z', + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + name: 'Tinker AFB, OK 73145', + transportation_office: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + postalCode: '73145', + state: 'OK', + streetAddress1: '7330 Century Blvd', + streetAddress2: 'Bldg 469', + }, + created_at: '2018-05-28T14:27:40.605Z', + gbloc: 'HAFC', + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + name: 'PPPO Tinker AFB - USAF', + phone_lines: [], + updated_at: '2018-05-28T14:27:40.605Z', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + updated_at: '2024-02-15T14:42:58.875Z', + }, + report_by_date: '2024-02-24', + service_member_id: 'd6d26f51-a8f2-4294-aba4-2f38a759afe2', + spouse_has_pro_gear: false, + status: 'DRAFT', + updated_at: '2024-02-20T17:40:58.221Z', + uploaded_amended_orders: { + id: '33c8773e-3409-457f-b94e-b8683514cbcd', + service_member_id: 'd6d26f51-a8f2-4294-aba4-2f38a759afe2', + uploads: [ + { + bytes: 1578588, + contentType: 'image/png', + createdAt: '2024-02-20T17:40:58.233Z', + filename: 'Screenshot 2024-02-15 at 12.22.53 PM (2).png', + id: 'f26f3427-a289-4faf-90da-2d02f3094a00', + status: 'PROCESSING', + updatedAt: '2024-02-20T17:40:58.233Z', + url: '/storage/user/9e16e5d7-4548-4f70-8a2a-b87d34ab3067/uploads/f26f3427-a289-4faf-90da-2d02f3094a00?contentType=image%2Fpng', + }, + ], + }, + uploaded_orders: { + id: 'fa2e5695-8c95-4460-91d5-e7d29dafa0b0', + service_member_id: 'd6d26f51-a8f2-4294-aba4-2f38a759afe2', + uploads: [ + { + bytes: 84847, + contentType: 'image/png', + createdAt: '2024-02-20T17:12:56.328Z', + filename: 'Screenshot 2024-02-12 at 8.26.20 AM.png', + id: '99fab296-ad63-4e34-8724-a8b73e357480', + status: 'PROCESSING', + updatedAt: '2024-02-20T17:12:56.328Z', + url: '/storage/user/9e16e5d7-4548-4f70-8a2a-b87d34ab3067/uploads/99fab296-ad63-4e34-8724-a8b73e357480?contentType=image%2Fpng', + }, + ], + }, + }, + status: 'NEEDS SERVICE COUNSELING', + submittedAt: '0001-01-01T00:00:00.000Z', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + previousMoves: [], + }, + uploadedOrderDocuments: [], + uploadedAmendedOrderDocuments: [], +}; + +const defaultPropsWithAdvanceAndPPMApproved = { + ...props, + serviceMemberMoves: { + currentMove: [ + { + createdAt: '2024-02-16T15:55:20.639Z', + eTag: 'MjAyNC0wMi0xNlQxNTo1NToyMC42Mzk5MDRa', + id: '6dad799c-4567-4a7d-9419-1a686797768f', + moveCode: '4H8VCD', + mtoShipments: [ + { + createdAt: '2024-02-20T17:40:25.836Z', + eTag: 'MjAyNC0wMi0yMFQxODowMToxNC43NTY1MTJa', + hasSecondaryDeliveryAddress: false, + hasSecondaryPickupAddress: false, + id: '322ebc9f-0ca8-4943-a7a8-39235f4e680b', + moveTaskOrderID: '4918b8c9-5e0a-4d65-a6b8-6a7a6ce265d4', + ppmShipment: { + actualDestinationPostalCode: null, + actualMoveDate: null, + actualPickupPostalCode: null, + advanceAmountReceived: null, + advanceAmountRequested: 400000, + advanceStatus: 'APPROVED', + approvedAt: '2024-02-20T18:01:14.760Z', + createdAt: '2024-02-20T17:40:25.842Z', + destinationPostalCode: '73503', + eTag: 'MjAyNC0wMi0yMFQxODowMToxNC43NjAyNTha', + estimatedIncentive: 678255, + estimatedWeight: 4000, + expectedDepartureDate: '2024-02-24', + finalIncentive: null, + hasProGear: false, + hasReceivedAdvance: null, + hasRequestedAdvance: true, + id: 'd18b865f-fd12-495d-91fa-65b53d72705a', + movingExpenses: [], + pickupPostalCode: '74133', + proGearWeight: null, + proGearWeightTickets: [], + reviewedAt: null, + secondaryDestinationPostalCode: null, + secondaryPickupPostalCode: null, + shipmentId: '322ebc9f-0ca8-4943-a7a8-39235f4e680b', + sitEstimatedCost: null, + sitEstimatedDepartureDate: null, + sitEstimatedEntryDate: null, + sitEstimatedWeight: null, + sitExpected: false, + spouseProGearWeight: null, + status: 'WAITING_ON_CUSTOMER', + submittedAt: null, + updatedAt: '2024-02-20T18:01:14.760Z', + weightTickets: [], + }, + shipmentType: 'PPM', + status: 'APPROVED', + updatedAt: '2024-02-20T18:01:14.756Z', + }, + ], + orders: { + authorizedWeight: 11000, + created_at: '2024-02-20T17:11:08.815Z', + department_indicator: 'ARMY', + entitlement: { + proGear: 2000, + proGearSpouse: 500, + }, + grade: 'E_7', + has_dependents: false, + id: '9db91886-40eb-4910-9c87-968fecd44d4b', + issue_date: '2024-02-22', + new_duty_location: { + address: { + city: 'Fort Sill', + country: 'United States', + id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + postalCode: '73503', + state: 'OK', + streetAddress1: 'n/a', + }, + address_id: 'ed62ba0b-a3cb-47ac-81ae-5b27ade4592b', + affiliation: 'ARMY', + created_at: '2024-02-15T14:42:58.875Z', + id: '5c182566-0e6e-46f2-9eef-f07963783575', + name: 'Fort Sill, OK 73503', + transportation_office: { + address: { + city: 'Fort Sill', + country: 'United States', + id: 'abbc0af9-2394-4e36-be84-811ad8f6060b', + postalCode: '73503', + state: 'OK', + streetAddress1: '4700 Mow Way Rd', + streetAddress2: 'Room 110', + }, + created_at: '2018-05-28T14:27:35.547Z', + gbloc: 'JEAT', + id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + name: 'PPPO Fort Sill - USA', + phone_lines: [], + updated_at: '2018-05-28T14:27:35.547Z', + }, + transportation_office_id: '7f5b64b8-979c-4cbd-890b-bffd6fdf56d9', + updated_at: '2024-02-15T14:42:58.875Z', + }, + orders_number: '12345678901234', + orders_type: 'PERMANENT_CHANGE_OF_STATION', + orders_type_detail: 'PCS_TDY', + originDutyLocationGbloc: 'HAFC', + origin_duty_location: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + postalCode: '73145', + state: 'OK', + streetAddress1: 'n/a', + }, + address_id: '7e3ea97c-da9f-4fa1-8a11-87063c857635', + affiliation: 'AIR_FORCE', + created_at: '2024-02-15T14:42:58.875Z', + id: '2d6eab7d-1a21-4f29-933e-ee8fa7dbc314', + name: 'Tinker AFB, OK 73145', + transportation_office: { + address: { + city: 'Tinker AFB', + country: 'United States', + id: '410b18bc-b270-4b52-9211-532fffc6f59e', + postalCode: '73145', + state: 'OK', + streetAddress1: '7330 Century Blvd', + streetAddress2: 'Bldg 469', + }, + created_at: '2018-05-28T14:27:40.605Z', + gbloc: 'HAFC', + id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + name: 'PPPO Tinker AFB - USAF', + phone_lines: [], + updated_at: '2018-05-28T14:27:40.605Z', + }, + transportation_office_id: '7876373d-57e4-4cde-b11f-c26a8feee9e8', + updated_at: '2024-02-15T14:42:58.875Z', + }, + report_by_date: '2024-02-24', + service_member_id: 'd6d26f51-a8f2-4294-aba4-2f38a759afe2', + spouse_has_pro_gear: false, + status: 'DRAFT', + tac: '1111', + updated_at: '2024-02-20T18:01:06.825Z', + uploaded_amended_orders: { + id: '33c8773e-3409-457f-b94e-b8683514cbcd', + service_member_id: 'd6d26f51-a8f2-4294-aba4-2f38a759afe2', + uploads: [ + { + bytes: 1578588, + contentType: 'image/png', + createdAt: '2024-02-20T17:40:58.233Z', + filename: 'Screenshot 2024-02-15 at 12.22.53 PM (2).png', + id: 'f26f3427-a289-4faf-90da-2d02f3094a00', + status: 'PROCESSING', + updatedAt: '2024-02-20T17:40:58.233Z', + url: '/storage/user/9e16e5d7-4548-4f70-8a2a-b87d34ab3067/uploads/f26f3427-a289-4faf-90da-2d02f3094a00?contentType=image%2Fpng', + }, + ], + }, + uploaded_orders: { + id: 'fa2e5695-8c95-4460-91d5-e7d29dafa0b0', + service_member_id: 'd6d26f51-a8f2-4294-aba4-2f38a759afe2', + uploads: [ + { + bytes: 84847, + contentType: 'image/png', + createdAt: '2024-02-20T17:12:56.328Z', + filename: 'Screenshot 2024-02-12 at 8.26.20 AM.png', + id: '99fab296-ad63-4e34-8724-a8b73e357480', + status: 'PROCESSING', + updatedAt: '2024-02-20T17:12:56.328Z', + url: '/storage/user/9e16e5d7-4548-4f70-8a2a-b87d34ab3067/uploads/99fab296-ad63-4e34-8724-a8b73e357480?contentType=image%2Fpng', + }, + ], + }, + }, + status: 'APPROVED', + submittedAt: '0001-01-01T00:00:00.000Z', + updatedAt: '0001-01-01T00:00:00.000Z', + }, + ], + previousMoves: [], + }, + uploadedOrderDocuments: [], + uploadedAmendedOrderDocuments: [], +}; + +const mountMoveHomeWithProviders = (defaultProps) => { + const moveId = defaultProps.serviceMemberMoves.currentMove[0].id; + return mount( + + + , + ); +}; + +afterEach(() => { + jest.resetAllMocks(); +}); + +describe('Home component', () => { + describe('with default props, orders but no uploads', () => { + const wrapper = mountMoveHomeWithProviders(defaultPropsNoOrders); + + it('renders Home with the right amount of components', () => { + expect(wrapper.find('ConnectedFlashMessage').length).toBe(1); + expect(wrapper.find('Step').length).toBe(4); + expect(wrapper.find('Helper').length).toBe(1); + expect(wrapper.find('Contact').length).toBe(1); + }); + + it('profile step is editable', () => { + const profileStep = wrapper.find('Step[step="1"]'); + expect(profileStep.prop('editBtnLabel')).toEqual('Edit'); + }); + + it('has appropriate step headers for no orders', () => { + expect(wrapper.text()).toContain('Next step: Add your orders'); + expect(wrapper.text()).toContain('Profile complete'); + expect(wrapper.text()).toContain('Make sure to keep your personal information up to date during your move.'); + expect(wrapper.text()).toContain('Upload orders'); + expect(wrapper.text()).toContain('Upload photos of each page, or upload a PDF.'); + expect(wrapper.text()).toContain('Set up shipments'); + expect(wrapper.text()).toContain( + 'We will collect addresses, dates, and how you want to move your personal property.', + ); + expect(wrapper.text()).toContain( + 'Note: You can change these details later by talking to a move counselor or customer care representative.', + ); + expect(wrapper.text()).toContain('Confirm move request'); + expect(wrapper.text()).toContain( + 'Review your move details and sign the legal paperwork, then send the info on to your move counselor.', + ); + }); + + it('has enabled and disabled buttons based on step', () => { + // shipment step button should have a disabled button + const shipmentStep = wrapper.find('Step[step="3"]'); + expect(shipmentStep.prop('actionBtnDisabled')).toBeTruthy(); + // confirm move request step should have a disabled button + const confirmMoveRequest = wrapper.find('Step[step="4"]'); + expect(confirmMoveRequest.prop('actionBtnDisabled')).toBeTruthy(); + }); + }); + + describe('with default props, orders with uploads', () => { + const wrapper = mountMoveHomeWithProviders(defaultPropsOrdersWithUploads); + + it('renders Home with the right amount of components', () => { + expect(wrapper.find('ConnectedFlashMessage').length).toBe(1); + expect(wrapper.find('Step').length).toBe(4); + expect(wrapper.find('Helper').length).toBe(1); + expect(wrapper.find('Contact').length).toBe(1); + }); + + it('profile and order step is editable', () => { + const profileStep = wrapper.find('Step[step="1"]'); + expect(profileStep.prop('editBtnLabel')).toEqual('Edit'); + const orderStep = wrapper.find('Step[step="2"]'); + expect(orderStep.prop('editBtnLabel')).toEqual('Edit'); + }); + + it('has appropriate step headers for orders with uploads', () => { + expect(wrapper.text()).toContain('Time for step 3: Set up your shipments'); + expect(wrapper.text()).toContain( + "Share where and when you're moving, and how you want your things to be shipped.", + ); + expect(wrapper.text()).toContain('Profile complete'); + expect(wrapper.text()).toContain('Orders uploaded'); + expect(wrapper.find('DocsUploaded').length).toBe(1); + expect(wrapper.text()).toContain('Set up shipments'); + expect(wrapper.text()).toContain('Confirm move request'); + }); + + it('has enabled and disabled buttons based on step', () => { + // shipment step button should now be enabled + const shipmentStep = wrapper.find('Step[step="3"]'); + expect(shipmentStep.prop('actionBtnDisabled')).toBeFalsy(); + // confirm move request step should still be disabled + const confirmMoveRequest = wrapper.find('Step[step="4"]'); + expect(confirmMoveRequest.prop('actionBtnDisabled')).toBeTruthy(); + }); + }); + + describe('with default props, orders and unsubmitted HHG & PPM shipments', () => { + const wrapper = mountMoveHomeWithProviders(defaultPropsOrdersWithUnsubmittedShipments); + + it('renders Home with the right amount of components', () => { + expect(wrapper.find('ConnectedFlashMessage').length).toBe(1); + expect(wrapper.find('Step').length).toBe(4); + expect(wrapper.find('Helper').length).toBe(1); + expect(wrapper.find('Contact').length).toBe(1); + }); + + it('profile and order step is editable', () => { + const profileStep = wrapper.find('Step[step="1"]'); + expect(profileStep.prop('editBtnLabel')).toEqual('Edit'); + const orderStep = wrapper.find('Step[step="2"]'); + expect(orderStep.prop('editBtnLabel')).toEqual('Edit'); + }); + + it('has appropriate step headers for orders with shipments', () => { + expect(wrapper.text()).toContain('Time to submit your move'); + expect(wrapper.text()).toContain('Profile complete'); + expect(wrapper.text()).toContain('Orders uploaded'); + expect(wrapper.find('DocsUploaded').length).toBe(1); + expect(wrapper.text()).toContain('Shipments'); + expect(wrapper.find('ShipmentList').length).toBe(1); + expect(wrapper.text()).toContain('Confirm move request'); + }); + + it('has enabled and disabled buttons based on step', () => { + // shipment step button should now be "Add another shipment" + const shipmentStep = wrapper.find('Step[step="3"]'); + expect(shipmentStep.prop('actionBtnLabel')).toBe('Add another shipment'); + // confirm move request step should now be enabled + const confirmMoveRequest = wrapper.find('Step[step="4"]'); + expect(confirmMoveRequest.prop('actionBtnDisabled')).toBeFalsy(); + }); + }); + + describe('with default props, orders with HHG & PPM shipments and NEEDS_SERVICE_COUNSELING move status', () => { + const wrapper = mountMoveHomeWithProviders(defaultPropsOrdersWithSubmittedShipments); + + it('renders Home with the right amount of components', () => { + expect(wrapper.find('ConnectedFlashMessage').length).toBe(1); + expect(wrapper.find('Step').length).toBe(5); + expect(wrapper.find('Helper').length).toBe(1); + expect(wrapper.find('Contact').length).toBe(1); + }); + + it('profile and order step is editable', () => { + const profileStep = wrapper.find('Step[step="1"]'); + expect(profileStep.prop('editBtnLabel')).toEqual('Edit'); + const orderStep = wrapper.find('Step[step="2"]'); + expect(orderStep.prop('editBtnLabel')).toEqual('Upload documents'); + }); + + it('has appropriate step headers for orders with shipments', () => { + expect(wrapper.text()).toContain('Next step: Your move gets approved'); + expect(wrapper.text()).toContain('Profile complete'); + expect(wrapper.text()).toContain('Orders'); + expect(wrapper.text()).toContain('If you receive amended orders'); + expect(wrapper.text()).toContain('Shipments'); + expect(wrapper.find('ShipmentList').length).toBe(1); + expect(wrapper.text()).toContain( + 'If you need to change, add, or cancel shipments, talk to your move counselor or Customer Care Representative', + ); + expect(wrapper.text()).toContain('Move request confirmed'); + expect(wrapper.text()).toContain('Manage your PPM'); + }); + + it('has enabled and disabled buttons based on step', () => { + // confirm move request step should now be enabled + const confirmMoveRequest = wrapper.find('Step[step="4"]'); + expect(confirmMoveRequest.prop('actionBtnDisabled')).toBeFalsy(); + expect(confirmMoveRequest.prop('actionBtnLabel')).toBe('Review your request'); + }); + }); + + describe('with default props, with amended orders and advance requested', () => { + const wrapper = mountMoveHomeWithProviders(defaultPropsAmendedOrdersWithAdvanceRequested); + + it('renders Home with the right amount of components', () => { + expect(wrapper.find('ConnectedFlashMessage').length).toBe(1); + expect(wrapper.find('Step').length).toBe(6); + expect(wrapper.find('Helper').length).toBe(1); + expect(wrapper.find('Contact').length).toBe(1); + }); + + it('profile and order step is editable', () => { + const profileStep = wrapper.find('Step[step="1"]'); + expect(profileStep.prop('editBtnLabel')).toEqual('Edit'); + const orderStep = wrapper.find('Step[step="2"]'); + expect(orderStep.prop('editBtnLabel')).toEqual('Upload documents'); + }); + + it('has appropriate step headers for orders with shipments', () => { + expect(wrapper.text()).toContain( + 'The transportation office will review your new documents and update your move info. Contact your movers to coordinate any changes to your move.', + ); + expect(wrapper.text()).toContain('Next step: Contact your movers (if you have them)'); + expect(wrapper.text()).toContain('Profile complete'); + expect(wrapper.text()).toContain('Orders'); + expect(wrapper.text()).toContain('If you receive amended orders'); + expect(wrapper.text()).toContain('Shipments'); + expect(wrapper.find('ShipmentList').length).toBe(1); + expect(wrapper.text()).toContain( + 'If you need to change, add, or cancel shipments, talk to your move counselor or Customer Care Representative', + ); + expect(wrapper.text()).toContain('Move request confirmed'); + expect(wrapper.text()).toContain('Advance request submitted'); + expect(wrapper.text()).toContain('Manage your PPM'); + expect(wrapper.find('PPMSummaryList').length).toBe(1); + }); + + it('has enabled and disabled buttons based on step', () => { + // confirm move request step should now be enabled + const confirmMoveRequest = wrapper.find('Step[step="4"]'); + expect(confirmMoveRequest.prop('actionBtnDisabled')).toBeFalsy(); + expect(confirmMoveRequest.prop('actionBtnLabel')).toBe('Review your request'); + }); + }); + + describe('with default props, with approved PPM and advance', () => { + const wrapper = mountMoveHomeWithProviders(defaultPropsWithAdvanceAndPPMApproved); + + it('renders Home with the right amount of components', () => { + expect(wrapper.find('ConnectedFlashMessage').length).toBe(1); + expect(wrapper.find('Step').length).toBe(6); + expect(wrapper.find('Helper').length).toBe(1); + expect(wrapper.find('Contact').length).toBe(1); + }); + + it('profile and order step is editable', () => { + const profileStep = wrapper.find('Step[step="1"]'); + expect(profileStep.prop('editBtnLabel')).toEqual('Edit'); + const orderStep = wrapper.find('Step[step="2"]'); + expect(orderStep.prop('editBtnLabel')).toEqual('Upload documents'); + const advanceStep = wrapper.find('Step[step="5"]'); + expect(advanceStep.prop('completedHeaderText')).toEqual('Advance request reviewed'); + }); + + it('has appropriate step headers for orders with shipments', () => { + expect(wrapper.text()).toContain('Your move is in progress.'); + expect(wrapper.text()).toContain('Profile complete'); + expect(wrapper.text()).toContain('Orders'); + expect(wrapper.text()).toContain('If you receive amended orders'); + expect(wrapper.text()).toContain('Shipments'); + expect(wrapper.find('ShipmentList').length).toBe(1); + expect(wrapper.text()).toContain( + 'If you need to change, add, or cancel shipments, talk to your move counselor or Customer Care Representative', + ); + expect(wrapper.text()).toContain('Move request confirmed'); + expect(wrapper.text()).toContain( + 'Your Advance Operating Allowance (AOA) request has been reviewed. Download the paperwork for approved requests and submit it to your Finance Office to receive your advance.', + ); + expect(wrapper.text()).toContain('Manage your PPM'); + expect(wrapper.find('PPMSummaryList').length).toBe(1); + }); + + it('has enabled and disabled buttons based on step', () => { + // confirm move request step should be enabled + const confirmMoveRequest = wrapper.find('Step[step="4"]'); + expect(confirmMoveRequest.prop('actionBtnDisabled')).toBeFalsy(); + expect(confirmMoveRequest.prop('actionBtnLabel')).toBe('Review your request'); + }); + }); +}); diff --git a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx index 6b6b1409782..7e10f669e7c 100644 --- a/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx +++ b/src/pages/MyMove/Multi-Moves/MultiMovesMoveContainer/MultiMovesMoveContainer.jsx @@ -77,7 +77,7 @@ const MultiMovesMoveContainer = ({ moves }) => {

        #{m.moveCode}

        - {m.status ? ( + {m.status !== 'APPROVED' ? (