From 8029ea9e707c35ad9d180c5442d0d444de09e0b4 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Tue, 23 Jan 2024 18:49:58 +0000 Subject: [PATCH 01/12] 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/12] 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 80b91d66b1f39da01d022a7c23e6a07dddb12779 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Thu, 25 Jan 2024 03:44:19 +0000 Subject: [PATCH 03/12] 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 04/12] 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 05/12] 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 06/12] 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 07/12] 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 08/12] 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 09/12] 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 10/12] 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 11/12] 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 fe351aee1a05d3fd702b06c3525bd20694ebfe51 Mon Sep 17 00:00:00 2001 From: TevinAdams Date: Thu, 22 Feb 2024 17:20:45 +0000 Subject: [PATCH 12/12] 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 }