diff --git a/pkg/gen/internalapi/configure_mymove.go b/pkg/gen/internalapi/configure_mymove.go index 78c9689af16..09395d30b85 100644 --- a/pkg/gen/internalapi/configure_mymove.go +++ b/pkg/gen/internalapi/configure_mymove.go @@ -232,21 +232,11 @@ func configureAPI(api *internaloperations.MymoveAPI) http.Handler { return middleware.NotImplemented("operation moves.PatchMove has not yet been implemented") }) } - if api.PpmPatchPersonallyProcuredMoveHandler == nil { - api.PpmPatchPersonallyProcuredMoveHandler = ppm.PatchPersonallyProcuredMoveHandlerFunc(func(params ppm.PatchPersonallyProcuredMoveParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.PatchPersonallyProcuredMove has not yet been implemented") - }) - } if api.ServiceMembersPatchServiceMemberHandler == nil { api.ServiceMembersPatchServiceMemberHandler = service_members.PatchServiceMemberHandlerFunc(func(params service_members.PatchServiceMemberParams) middleware.Responder { return middleware.NotImplemented("operation service_members.PatchServiceMember has not yet been implemented") }) } - if api.PpmRequestPPMPaymentHandler == nil { - api.PpmRequestPPMPaymentHandler = ppm.RequestPPMPaymentHandlerFunc(func(params ppm.RequestPPMPaymentParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.RequestPPMPayment has not yet been implemented") - }) - } if api.PpmResubmitPPMShipmentDocumentationHandler == nil { api.PpmResubmitPPMShipmentDocumentationHandler = ppm.ResubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.ResubmitPPMShipmentDocumentationParams) middleware.Responder { return middleware.NotImplemented("operation ppm.ResubmitPPMShipmentDocumentation has not yet been implemented") @@ -352,11 +342,6 @@ func configureAPI(api *internaloperations.MymoveAPI) http.Handler { return middleware.NotImplemented("operation ppm.SubmitPPMShipmentDocumentation has not yet been implemented") }) } - if api.PpmSubmitPersonallyProcuredMoveHandler == nil { - api.PpmSubmitPersonallyProcuredMoveHandler = ppm.SubmitPersonallyProcuredMoveHandlerFunc(func(params ppm.SubmitPersonallyProcuredMoveParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.SubmitPersonallyProcuredMove has not yet been implemented") - }) - } if api.MtoShipmentUpdateMTOShipmentHandler == nil { api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index 473c56f1c7b..915b152fdce 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -1071,68 +1071,6 @@ func init() { } } }, - "/moves/{moveId}/personally_procured_move/{personallyProcuredMoveId}": { - "patch": { - "description": "Any fields sent in this request will be set on the PPM referenced", - "tags": [ - "ppm" - ], - "summary": "Patches the PPM", - "operationId": "patchPersonallyProcuredMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM being patched", - "name": "personallyProcuredMoveId", - "in": "path", - "required": true - }, - { - "name": "patchPersonallyProcuredMovePayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchPersonallyProcuredMovePayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of personally_procured_move", - "schema": { - "$ref": "#/definitions/PersonallyProcuredMovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "ppm is not found or ppm discount not found for provided postal codes and original move date" - }, - "422": { - "description": "cannot process request with given information" - }, - "500": { - "description": "internal server error" - } - } - } - }, "/moves/{moveId}/shipment_summary_worksheet": { "get": { "description": "Generates pre-filled PDF using data already collected", @@ -1911,100 +1849,6 @@ func init() { } } }, - "/personally_procured_move/{personallyProcuredMoveId}/request_payment": { - "post": { - "description": "Moves the PPM and the move into the PAYMENT_REQUESTED state", - "tags": [ - "ppm" - ], - "summary": "Moves the PPM and the move into the PAYMENT_REQUESTED state", - "operationId": "requestPPMPayment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM", - "name": "personallyProcuredMoveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Sucesssfully requested payment", - "schema": { - "$ref": "#/definitions/PersonallyProcuredMovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/personally_procured_move/{personallyProcuredMoveId}/submit": { - "post": { - "description": "Submits a PPM for approval by the office. The status of the PPM will be updated to SUBMITTED", - "tags": [ - "ppm" - ], - "summary": "Submits a PPM for approval", - "operationId": "submitPersonallyProcuredMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM being submitted", - "name": "personallyProcuredMoveId", - "in": "path", - "required": true - }, - { - "name": "submitPersonallyProcuredMovePayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SubmitPersonallyProcuredMovePayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of personally_procured_move", - "schema": { - "$ref": "#/definitions/PersonallyProcuredMovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "ppm is not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, "/personally_procured_moves/{personallyProcuredMoveId}/approve": { "post": { "description": "Sets the status of the PPM to APPROVED.", @@ -6120,128 +5964,6 @@ func init() { } } }, - "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 - }, - "has_requested_advance": { - "type": "boolean", - "title": "Would you like an advance of up to 60% of your PPM incentive?", - "default": false - }, - "has_sit": { - "type": "boolean", - "title": "Will you put anything in storage?", - "x-nullable": true - }, - "incentive_estimate_max": { - "type": "integer", - "title": "Incentive Estimate Max", - "minimum": 1, - "x-nullable": true - }, - "incentive_estimate_min": { - "type": "integer", - "title": "Incentive Estimate Min", - "minimum": 1, - "x-nullable": true - }, - "net_weight": { - "type": "integer", - "title": "Net Weight", - "minimum": 1, - "x-nullable": true - }, - "original_move_date": { - "type": "string", - "format": "date", - "title": "When do you plan to move?", - "x-nullable": true, - "example": "2018-04-26" - }, - "pickup_postal_code": { - "type": "string", - "format": "zip", - "title": "ZIP code", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "size": { - "$ref": "#/definitions/TShirtSize" - }, - "total_sit_cost": { - "type": "integer", - "title": "How much does your storage cost?", - "minimum": 1, - "x-nullable": true - }, - "weight_estimate": { - "type": "integer", - "title": "Weight Estimate", - "x-nullable": true - } - } - }, "PatchServiceMemberPayload": { "type": "object", "properties": { @@ -7203,20 +6925,6 @@ func init() { } } }, - "SubmitPersonallyProcuredMovePayload": { - "type": "object", - "required": [ - "submit_date" - ], - "properties": { - "submit_date": { - "type": "string", - "format": "date-time", - "title": "When was the ppm move submitted?", - "example": "2019-03-26T13:19:56-04:00" - } - } - }, "TShirtSize": { "type": "string", "title": "Size", @@ -9173,82 +8881,39 @@ func init() { "required": true, "schema": { "$ref": "#/definitions/CreateGenericMoveDocumentPayload" - } - } - ], - "responses": { - "200": { - "description": "returns new move document object", - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to modify this move" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/orders": { - "get": { - "description": "Returns orders information for a move for office use", - "tags": [ - "office" - ], - "summary": "Returns orders information for a move for office use", - "operationId": "showOfficeOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true + } } ], "responses": { "200": { - "description": "the orders information for a move for office use", + "description": "returns new move document object", "schema": { - "$ref": "#/definitions/Orders" + "$ref": "#/definitions/MoveDocumentPayload" } }, "400": { "description": "invalid request" }, "401": { - "description": "request requires user authentication" + "description": "must be authenticated to use this endpoint" }, "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move not found" + "description": "not authorized to modify this move" }, "500": { - "description": "internal server error" + "description": "server error" } } } }, - "/moves/{moveId}/personally_procured_move/{personallyProcuredMoveId}": { - "patch": { - "description": "Any fields sent in this request will be set on the PPM referenced", + "/moves/{moveId}/orders": { + "get": { + "description": "Returns orders information for a move for office use", "tags": [ - "ppm" + "office" ], - "summary": "Patches the PPM", - "operationId": "patchPersonallyProcuredMove", + "summary": "Returns orders information for a move for office use", + "operationId": "showOfficeOrders", "parameters": [ { "type": "string", @@ -9257,29 +8922,13 @@ func init() { "name": "moveId", "in": "path", "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM being patched", - "name": "personallyProcuredMoveId", - "in": "path", - "required": true - }, - { - "name": "patchPersonallyProcuredMovePayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchPersonallyProcuredMovePayload" - } } ], "responses": { "200": { - "description": "updated instance of personally_procured_move", + "description": "the orders information for a move for office use", "schema": { - "$ref": "#/definitions/PersonallyProcuredMovePayload" + "$ref": "#/definitions/Orders" } }, "400": { @@ -9292,10 +8941,7 @@ func init() { "description": "user is not authorized" }, "404": { - "description": "ppm is not found or ppm discount not found for provided postal codes and original move date" - }, - "422": { - "description": "cannot process request with given information" + "description": "move not found" }, "500": { "description": "internal server error" @@ -10153,100 +9799,6 @@ func init() { } } }, - "/personally_procured_move/{personallyProcuredMoveId}/request_payment": { - "post": { - "description": "Moves the PPM and the move into the PAYMENT_REQUESTED state", - "tags": [ - "ppm" - ], - "summary": "Moves the PPM and the move into the PAYMENT_REQUESTED state", - "operationId": "requestPPMPayment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM", - "name": "personallyProcuredMoveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Sucesssfully requested payment", - "schema": { - "$ref": "#/definitions/PersonallyProcuredMovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/personally_procured_move/{personallyProcuredMoveId}/submit": { - "post": { - "description": "Submits a PPM for approval by the office. The status of the PPM will be updated to SUBMITTED", - "tags": [ - "ppm" - ], - "summary": "Submits a PPM for approval", - "operationId": "submitPersonallyProcuredMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM being submitted", - "name": "personallyProcuredMoveId", - "in": "path", - "required": true - }, - { - "name": "submitPersonallyProcuredMovePayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SubmitPersonallyProcuredMovePayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of personally_procured_move", - "schema": { - "$ref": "#/definitions/PersonallyProcuredMovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "ppm is not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, "/personally_procured_moves/{personallyProcuredMoveId}/approve": { "post": { "description": "Sets the status of the PPM to APPROVED.", @@ -14709,130 +14261,6 @@ func init() { } } }, - "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, - "minimum": 0, - "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 - }, - "has_requested_advance": { - "type": "boolean", - "title": "Would you like an advance of up to 60% of your PPM incentive?", - "default": false - }, - "has_sit": { - "type": "boolean", - "title": "Will you put anything in storage?", - "x-nullable": true - }, - "incentive_estimate_max": { - "type": "integer", - "title": "Incentive Estimate Max", - "minimum": 1, - "x-nullable": true - }, - "incentive_estimate_min": { - "type": "integer", - "title": "Incentive Estimate Min", - "minimum": 1, - "x-nullable": true - }, - "net_weight": { - "type": "integer", - "title": "Net Weight", - "minimum": 1, - "x-nullable": true - }, - "original_move_date": { - "type": "string", - "format": "date", - "title": "When do you plan to move?", - "x-nullable": true, - "example": "2018-04-26" - }, - "pickup_postal_code": { - "type": "string", - "format": "zip", - "title": "ZIP code", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "size": { - "$ref": "#/definitions/TShirtSize" - }, - "total_sit_cost": { - "type": "integer", - "title": "How much does your storage cost?", - "minimum": 1, - "x-nullable": true - }, - "weight_estimate": { - "type": "integer", - "title": "Weight Estimate", - "minimum": 0, - "x-nullable": true - } - } - }, "PatchServiceMemberPayload": { "type": "object", "properties": { @@ -15797,20 +15225,6 @@ func init() { } } }, - "SubmitPersonallyProcuredMovePayload": { - "type": "object", - "required": [ - "submit_date" - ], - "properties": { - "submit_date": { - "type": "string", - "format": "date-time", - "title": "When was the ppm move submitted?", - "example": "2019-03-26T13:19:56-04:00" - } - } - }, "TShirtSize": { "type": "string", "title": "Size", diff --git a/pkg/gen/internalapi/internaloperations/mymove_api.go b/pkg/gen/internalapi/internaloperations/mymove_api.go index 6a71027ab7b..eb69d44b833 100644 --- a/pkg/gen/internalapi/internaloperations/mymove_api.go +++ b/pkg/gen/internalapi/internaloperations/mymove_api.go @@ -165,15 +165,9 @@ func NewMymoveAPI(spec *loads.Document) *MymoveAPI { MovesPatchMoveHandler: moves.PatchMoveHandlerFunc(func(params moves.PatchMoveParams) middleware.Responder { return middleware.NotImplemented("operation moves.PatchMove has not yet been implemented") }), - PpmPatchPersonallyProcuredMoveHandler: ppm.PatchPersonallyProcuredMoveHandlerFunc(func(params ppm.PatchPersonallyProcuredMoveParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.PatchPersonallyProcuredMove has not yet been implemented") - }), ServiceMembersPatchServiceMemberHandler: service_members.PatchServiceMemberHandlerFunc(func(params service_members.PatchServiceMemberParams) middleware.Responder { return middleware.NotImplemented("operation service_members.PatchServiceMember has not yet been implemented") }), - PpmRequestPPMPaymentHandler: ppm.RequestPPMPaymentHandlerFunc(func(params ppm.RequestPPMPaymentParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.RequestPPMPayment has not yet been implemented") - }), PpmResubmitPPMShipmentDocumentationHandler: ppm.ResubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.ResubmitPPMShipmentDocumentationParams) middleware.Responder { return middleware.NotImplemented("operation ppm.ResubmitPPMShipmentDocumentation has not yet been implemented") }), @@ -237,9 +231,6 @@ func NewMymoveAPI(spec *loads.Document) *MymoveAPI { PpmSubmitPPMShipmentDocumentationHandler: ppm.SubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.SubmitPPMShipmentDocumentationParams) middleware.Responder { return middleware.NotImplemented("operation ppm.SubmitPPMShipmentDocumentation has not yet been implemented") }), - PpmSubmitPersonallyProcuredMoveHandler: ppm.SubmitPersonallyProcuredMoveHandlerFunc(func(params ppm.SubmitPersonallyProcuredMoveParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.SubmitPersonallyProcuredMove has not yet been implemented") - }), MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") }), @@ -386,12 +377,8 @@ type MymoveAPI struct { MtoShipmentListMTOShipmentsHandler mto_shipment.ListMTOShipmentsHandler // MovesPatchMoveHandler sets the operation handler for the patch move operation MovesPatchMoveHandler moves.PatchMoveHandler - // PpmPatchPersonallyProcuredMoveHandler sets the operation handler for the patch personally procured move operation - PpmPatchPersonallyProcuredMoveHandler ppm.PatchPersonallyProcuredMoveHandler // ServiceMembersPatchServiceMemberHandler sets the operation handler for the patch service member operation ServiceMembersPatchServiceMemberHandler service_members.PatchServiceMemberHandler - // PpmRequestPPMPaymentHandler sets the operation handler for the request p p m payment operation - PpmRequestPPMPaymentHandler ppm.RequestPPMPaymentHandler // PpmResubmitPPMShipmentDocumentationHandler sets the operation handler for the resubmit p p m shipment documentation operation PpmResubmitPPMShipmentDocumentationHandler ppm.ResubmitPPMShipmentDocumentationHandler // DutyLocationsSearchDutyLocationsHandler sets the operation handler for the search duty locations operation @@ -434,8 +421,6 @@ type MymoveAPI struct { MovesSubmitMoveForApprovalHandler moves.SubmitMoveForApprovalHandler // PpmSubmitPPMShipmentDocumentationHandler sets the operation handler for the submit p p m shipment documentation operation PpmSubmitPPMShipmentDocumentationHandler ppm.SubmitPPMShipmentDocumentationHandler - // PpmSubmitPersonallyProcuredMoveHandler sets the operation handler for the submit personally procured move operation - PpmSubmitPersonallyProcuredMoveHandler ppm.SubmitPersonallyProcuredMoveHandler // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler // MoveDocsUpdateMoveDocumentHandler sets the operation handler for the update move document operation @@ -640,15 +625,9 @@ func (o *MymoveAPI) Validate() error { if o.MovesPatchMoveHandler == nil { unregistered = append(unregistered, "moves.PatchMoveHandler") } - if o.PpmPatchPersonallyProcuredMoveHandler == nil { - unregistered = append(unregistered, "ppm.PatchPersonallyProcuredMoveHandler") - } if o.ServiceMembersPatchServiceMemberHandler == nil { unregistered = append(unregistered, "service_members.PatchServiceMemberHandler") } - if o.PpmRequestPPMPaymentHandler == nil { - unregistered = append(unregistered, "ppm.RequestPPMPaymentHandler") - } if o.PpmResubmitPPMShipmentDocumentationHandler == nil { unregistered = append(unregistered, "ppm.ResubmitPPMShipmentDocumentationHandler") } @@ -712,9 +691,6 @@ func (o *MymoveAPI) Validate() error { if o.PpmSubmitPPMShipmentDocumentationHandler == nil { unregistered = append(unregistered, "ppm.SubmitPPMShipmentDocumentationHandler") } - if o.PpmSubmitPersonallyProcuredMoveHandler == nil { - unregistered = append(unregistered, "ppm.SubmitPersonallyProcuredMoveHandler") - } if o.MtoShipmentUpdateMTOShipmentHandler == nil { unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") } @@ -975,15 +951,7 @@ func (o *MymoveAPI) initHandlerCache() { if o.handlers["PATCH"] == nil { o.handlers["PATCH"] = make(map[string]http.Handler) } - o.handlers["PATCH"]["/moves/{moveId}/personally_procured_move/{personallyProcuredMoveId}"] = ppm.NewPatchPersonallyProcuredMove(o.context, o.PpmPatchPersonallyProcuredMoveHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } o.handlers["PATCH"]["/service_members/{serviceMemberId}"] = service_members.NewPatchServiceMember(o.context, o.ServiceMembersPatchServiceMemberHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/personally_procured_move/{personallyProcuredMoveId}/request_payment"] = ppm.NewRequestPPMPayment(o.context, o.PpmRequestPPMPaymentHandler) if o.handlers["PUT"] == nil { o.handlers["PUT"] = make(map[string]http.Handler) } @@ -1068,10 +1036,6 @@ func (o *MymoveAPI) initHandlerCache() { o.handlers["POST"] = make(map[string]http.Handler) } o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation"] = ppm.NewSubmitPPMShipmentDocumentation(o.context, o.PpmSubmitPPMShipmentDocumentationHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/personally_procured_move/{personallyProcuredMoveId}/submit"] = ppm.NewSubmitPersonallyProcuredMove(o.context, o.PpmSubmitPersonallyProcuredMoveHandler) if o.handlers["PATCH"] == nil { o.handlers["PATCH"] = make(map[string]http.Handler) } diff --git a/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move.go b/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move.go deleted file mode 100644 index 098252687e3..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// PatchPersonallyProcuredMoveHandlerFunc turns a function with the right signature into a patch personally procured move handler -type PatchPersonallyProcuredMoveHandlerFunc func(PatchPersonallyProcuredMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchPersonallyProcuredMoveHandlerFunc) Handle(params PatchPersonallyProcuredMoveParams) middleware.Responder { - return fn(params) -} - -// PatchPersonallyProcuredMoveHandler interface for that can handle valid patch personally procured move params -type PatchPersonallyProcuredMoveHandler interface { - Handle(PatchPersonallyProcuredMoveParams) middleware.Responder -} - -// NewPatchPersonallyProcuredMove creates a new http.Handler for the patch personally procured move operation -func NewPatchPersonallyProcuredMove(ctx *middleware.Context, handler PatchPersonallyProcuredMoveHandler) *PatchPersonallyProcuredMove { - return &PatchPersonallyProcuredMove{Context: ctx, Handler: handler} -} - -/* - PatchPersonallyProcuredMove swagger:route PATCH /moves/{moveId}/personally_procured_move/{personallyProcuredMoveId} ppm patchPersonallyProcuredMove - -# Patches the PPM - -Any fields sent in this request will be set on the PPM referenced -*/ -type PatchPersonallyProcuredMove struct { - Context *middleware.Context - Handler PatchPersonallyProcuredMoveHandler -} - -func (o *PatchPersonallyProcuredMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchPersonallyProcuredMoveParams() - 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/ppm/patch_personally_procured_move_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move_parameters.go deleted file mode 100644 index f4aa4ac38f4..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move_parameters.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewPatchPersonallyProcuredMoveParams creates a new PatchPersonallyProcuredMoveParams object -// -// There are no default values defined in the spec. -func NewPatchPersonallyProcuredMoveParams() PatchPersonallyProcuredMoveParams { - - return PatchPersonallyProcuredMoveParams{} -} - -// PatchPersonallyProcuredMoveParams contains all the bound params for the patch personally procured move operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchPersonallyProcuredMove -type PatchPersonallyProcuredMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID - /* - Required: true - In: body - */ - PatchPersonallyProcuredMovePayload *internalmessages.PatchPersonallyProcuredMovePayload - /*UUID of the PPM being patched - Required: true - In: path - */ - PersonallyProcuredMoveID 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 NewPatchPersonallyProcuredMoveParams() beforehand. -func (o *PatchPersonallyProcuredMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.PatchPersonallyProcuredMovePayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("patchPersonallyProcuredMovePayload", "body", "")) - } else { - res = append(res, errors.NewParseError("patchPersonallyProcuredMovePayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.PatchPersonallyProcuredMovePayload = &body - } - } - } else { - res = append(res, errors.Required("patchPersonallyProcuredMovePayload", "body", "")) - } - - rPersonallyProcuredMoveID, rhkPersonallyProcuredMoveID, _ := route.Params.GetOK("personallyProcuredMoveId") - if err := o.bindPersonallyProcuredMoveID(rPersonallyProcuredMoveID, rhkPersonallyProcuredMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *PatchPersonallyProcuredMoveParams) bindMoveID(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("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *PatchPersonallyProcuredMoveParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} - -// bindPersonallyProcuredMoveID binds and validates parameter PersonallyProcuredMoveID from path. -func (o *PatchPersonallyProcuredMoveParams) bindPersonallyProcuredMoveID(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("personallyProcuredMoveId", "path", "strfmt.UUID", raw) - } - o.PersonallyProcuredMoveID = *(value.(*strfmt.UUID)) - - if err := o.validatePersonallyProcuredMoveID(formats); err != nil { - return err - } - - return nil -} - -// validatePersonallyProcuredMoveID carries on validations for parameter PersonallyProcuredMoveID -func (o *PatchPersonallyProcuredMoveParams) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("personallyProcuredMoveId", "path", "uuid", o.PersonallyProcuredMoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move_responses.go b/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move_responses.go deleted file mode 100644 index dc856ff89b0..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move_responses.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// PatchPersonallyProcuredMoveOKCode is the HTTP code returned for type PatchPersonallyProcuredMoveOK -const PatchPersonallyProcuredMoveOKCode int = 200 - -/* -PatchPersonallyProcuredMoveOK updated instance of personally_procured_move - -swagger:response patchPersonallyProcuredMoveOK -*/ -type PatchPersonallyProcuredMoveOK struct { - - /* - In: Body - */ - Payload *internalmessages.PersonallyProcuredMovePayload `json:"body,omitempty"` -} - -// NewPatchPersonallyProcuredMoveOK creates PatchPersonallyProcuredMoveOK with default headers values -func NewPatchPersonallyProcuredMoveOK() *PatchPersonallyProcuredMoveOK { - - return &PatchPersonallyProcuredMoveOK{} -} - -// WithPayload adds the payload to the patch personally procured move o k response -func (o *PatchPersonallyProcuredMoveOK) WithPayload(payload *internalmessages.PersonallyProcuredMovePayload) *PatchPersonallyProcuredMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch personally procured move o k response -func (o *PatchPersonallyProcuredMoveOK) SetPayload(payload *internalmessages.PersonallyProcuredMovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchPersonallyProcuredMoveOK) 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 - } - } -} - -// PatchPersonallyProcuredMoveBadRequestCode is the HTTP code returned for type PatchPersonallyProcuredMoveBadRequest -const PatchPersonallyProcuredMoveBadRequestCode int = 400 - -/* -PatchPersonallyProcuredMoveBadRequest invalid request - -swagger:response patchPersonallyProcuredMoveBadRequest -*/ -type PatchPersonallyProcuredMoveBadRequest struct { -} - -// NewPatchPersonallyProcuredMoveBadRequest creates PatchPersonallyProcuredMoveBadRequest with default headers values -func NewPatchPersonallyProcuredMoveBadRequest() *PatchPersonallyProcuredMoveBadRequest { - - return &PatchPersonallyProcuredMoveBadRequest{} -} - -// WriteResponse to the client -func (o *PatchPersonallyProcuredMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// PatchPersonallyProcuredMoveUnauthorizedCode is the HTTP code returned for type PatchPersonallyProcuredMoveUnauthorized -const PatchPersonallyProcuredMoveUnauthorizedCode int = 401 - -/* -PatchPersonallyProcuredMoveUnauthorized request requires user authentication - -swagger:response patchPersonallyProcuredMoveUnauthorized -*/ -type PatchPersonallyProcuredMoveUnauthorized struct { -} - -// NewPatchPersonallyProcuredMoveUnauthorized creates PatchPersonallyProcuredMoveUnauthorized with default headers values -func NewPatchPersonallyProcuredMoveUnauthorized() *PatchPersonallyProcuredMoveUnauthorized { - - return &PatchPersonallyProcuredMoveUnauthorized{} -} - -// WriteResponse to the client -func (o *PatchPersonallyProcuredMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// PatchPersonallyProcuredMoveForbiddenCode is the HTTP code returned for type PatchPersonallyProcuredMoveForbidden -const PatchPersonallyProcuredMoveForbiddenCode int = 403 - -/* -PatchPersonallyProcuredMoveForbidden user is not authorized - -swagger:response patchPersonallyProcuredMoveForbidden -*/ -type PatchPersonallyProcuredMoveForbidden struct { -} - -// NewPatchPersonallyProcuredMoveForbidden creates PatchPersonallyProcuredMoveForbidden with default headers values -func NewPatchPersonallyProcuredMoveForbidden() *PatchPersonallyProcuredMoveForbidden { - - return &PatchPersonallyProcuredMoveForbidden{} -} - -// WriteResponse to the client -func (o *PatchPersonallyProcuredMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// PatchPersonallyProcuredMoveNotFoundCode is the HTTP code returned for type PatchPersonallyProcuredMoveNotFound -const PatchPersonallyProcuredMoveNotFoundCode int = 404 - -/* -PatchPersonallyProcuredMoveNotFound ppm is not found or ppm discount not found for provided postal codes and original move date - -swagger:response patchPersonallyProcuredMoveNotFound -*/ -type PatchPersonallyProcuredMoveNotFound struct { -} - -// NewPatchPersonallyProcuredMoveNotFound creates PatchPersonallyProcuredMoveNotFound with default headers values -func NewPatchPersonallyProcuredMoveNotFound() *PatchPersonallyProcuredMoveNotFound { - - return &PatchPersonallyProcuredMoveNotFound{} -} - -// WriteResponse to the client -func (o *PatchPersonallyProcuredMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// PatchPersonallyProcuredMoveUnprocessableEntityCode is the HTTP code returned for type PatchPersonallyProcuredMoveUnprocessableEntity -const PatchPersonallyProcuredMoveUnprocessableEntityCode int = 422 - -/* -PatchPersonallyProcuredMoveUnprocessableEntity cannot process request with given information - -swagger:response patchPersonallyProcuredMoveUnprocessableEntity -*/ -type PatchPersonallyProcuredMoveUnprocessableEntity struct { -} - -// NewPatchPersonallyProcuredMoveUnprocessableEntity creates PatchPersonallyProcuredMoveUnprocessableEntity with default headers values -func NewPatchPersonallyProcuredMoveUnprocessableEntity() *PatchPersonallyProcuredMoveUnprocessableEntity { - - return &PatchPersonallyProcuredMoveUnprocessableEntity{} -} - -// WriteResponse to the client -func (o *PatchPersonallyProcuredMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(422) -} - -// PatchPersonallyProcuredMoveInternalServerErrorCode is the HTTP code returned for type PatchPersonallyProcuredMoveInternalServerError -const PatchPersonallyProcuredMoveInternalServerErrorCode int = 500 - -/* -PatchPersonallyProcuredMoveInternalServerError internal server error - -swagger:response patchPersonallyProcuredMoveInternalServerError -*/ -type PatchPersonallyProcuredMoveInternalServerError struct { -} - -// NewPatchPersonallyProcuredMoveInternalServerError creates PatchPersonallyProcuredMoveInternalServerError with default headers values -func NewPatchPersonallyProcuredMoveInternalServerError() *PatchPersonallyProcuredMoveInternalServerError { - - return &PatchPersonallyProcuredMoveInternalServerError{} -} - -// WriteResponse to the client -func (o *PatchPersonallyProcuredMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move_urlbuilder.go deleted file mode 100644 index f8b2374788d..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/patch_personally_procured_move_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// PatchPersonallyProcuredMoveURL generates an URL for the patch personally procured move operation -type PatchPersonallyProcuredMoveURL struct { - MoveID strfmt.UUID - PersonallyProcuredMoveID 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 *PatchPersonallyProcuredMoveURL) WithBasePath(bp string) *PatchPersonallyProcuredMoveURL { - 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 *PatchPersonallyProcuredMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchPersonallyProcuredMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/personally_procured_move/{personallyProcuredMoveId}" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on PatchPersonallyProcuredMoveURL") - } - - personallyProcuredMoveID := o.PersonallyProcuredMoveID.String() - if personallyProcuredMoveID != "" { - _path = strings.Replace(_path, "{personallyProcuredMoveId}", personallyProcuredMoveID, -1) - } else { - return nil, errors.New("personallyProcuredMoveId is required on PatchPersonallyProcuredMoveURL") - } - - _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 *PatchPersonallyProcuredMoveURL) 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 *PatchPersonallyProcuredMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchPersonallyProcuredMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchPersonallyProcuredMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchPersonallyProcuredMoveURL") - } - - 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 *PatchPersonallyProcuredMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment.go b/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment.go deleted file mode 100644 index 81bdf145bd9..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// RequestPPMPaymentHandlerFunc turns a function with the right signature into a request p p m payment handler -type RequestPPMPaymentHandlerFunc func(RequestPPMPaymentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn RequestPPMPaymentHandlerFunc) Handle(params RequestPPMPaymentParams) middleware.Responder { - return fn(params) -} - -// RequestPPMPaymentHandler interface for that can handle valid request p p m payment params -type RequestPPMPaymentHandler interface { - Handle(RequestPPMPaymentParams) middleware.Responder -} - -// NewRequestPPMPayment creates a new http.Handler for the request p p m payment operation -func NewRequestPPMPayment(ctx *middleware.Context, handler RequestPPMPaymentHandler) *RequestPPMPayment { - return &RequestPPMPayment{Context: ctx, Handler: handler} -} - -/* - RequestPPMPayment swagger:route POST /personally_procured_move/{personallyProcuredMoveId}/request_payment ppm requestPPMPayment - -Moves the PPM and the move into the PAYMENT_REQUESTED state - -Moves the PPM and the move into the PAYMENT_REQUESTED state -*/ -type RequestPPMPayment struct { - Context *middleware.Context - Handler RequestPPMPaymentHandler -} - -func (o *RequestPPMPayment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRequestPPMPaymentParams() - 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/ppm/request_p_p_m_payment_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment_parameters.go deleted file mode 100644 index a6e1c1e37ce..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// NewRequestPPMPaymentParams creates a new RequestPPMPaymentParams object -// -// There are no default values defined in the spec. -func NewRequestPPMPaymentParams() RequestPPMPaymentParams { - - return RequestPPMPaymentParams{} -} - -// RequestPPMPaymentParams contains all the bound params for the request p p m payment operation -// typically these are obtained from a http.Request -// -// swagger:parameters requestPPMPayment -type RequestPPMPaymentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM - Required: true - In: path - */ - PersonallyProcuredMoveID 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 NewRequestPPMPaymentParams() beforehand. -func (o *RequestPPMPaymentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPersonallyProcuredMoveID, rhkPersonallyProcuredMoveID, _ := route.Params.GetOK("personallyProcuredMoveId") - if err := o.bindPersonallyProcuredMoveID(rPersonallyProcuredMoveID, rhkPersonallyProcuredMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPersonallyProcuredMoveID binds and validates parameter PersonallyProcuredMoveID from path. -func (o *RequestPPMPaymentParams) bindPersonallyProcuredMoveID(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("personallyProcuredMoveId", "path", "strfmt.UUID", raw) - } - o.PersonallyProcuredMoveID = *(value.(*strfmt.UUID)) - - if err := o.validatePersonallyProcuredMoveID(formats); err != nil { - return err - } - - return nil -} - -// validatePersonallyProcuredMoveID carries on validations for parameter PersonallyProcuredMoveID -func (o *RequestPPMPaymentParams) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("personallyProcuredMoveId", "path", "uuid", o.PersonallyProcuredMoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment_responses.go b/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment_responses.go deleted file mode 100644 index 9f6e65bfbb4..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// RequestPPMPaymentOKCode is the HTTP code returned for type RequestPPMPaymentOK -const RequestPPMPaymentOKCode int = 200 - -/* -RequestPPMPaymentOK Sucesssfully requested payment - -swagger:response requestPPMPaymentOK -*/ -type RequestPPMPaymentOK struct { - - /* - In: Body - */ - Payload *internalmessages.PersonallyProcuredMovePayload `json:"body,omitempty"` -} - -// NewRequestPPMPaymentOK creates RequestPPMPaymentOK with default headers values -func NewRequestPPMPaymentOK() *RequestPPMPaymentOK { - - return &RequestPPMPaymentOK{} -} - -// WithPayload adds the payload to the request p p m payment o k response -func (o *RequestPPMPaymentOK) WithPayload(payload *internalmessages.PersonallyProcuredMovePayload) *RequestPPMPaymentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request p p m payment o k response -func (o *RequestPPMPaymentOK) SetPayload(payload *internalmessages.PersonallyProcuredMovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestPPMPaymentOK) 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 - } - } -} - -// RequestPPMPaymentBadRequestCode is the HTTP code returned for type RequestPPMPaymentBadRequest -const RequestPPMPaymentBadRequestCode int = 400 - -/* -RequestPPMPaymentBadRequest invalid request - -swagger:response requestPPMPaymentBadRequest -*/ -type RequestPPMPaymentBadRequest struct { -} - -// NewRequestPPMPaymentBadRequest creates RequestPPMPaymentBadRequest with default headers values -func NewRequestPPMPaymentBadRequest() *RequestPPMPaymentBadRequest { - - return &RequestPPMPaymentBadRequest{} -} - -// WriteResponse to the client -func (o *RequestPPMPaymentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// RequestPPMPaymentUnauthorizedCode is the HTTP code returned for type RequestPPMPaymentUnauthorized -const RequestPPMPaymentUnauthorizedCode int = 401 - -/* -RequestPPMPaymentUnauthorized request requires user authentication - -swagger:response requestPPMPaymentUnauthorized -*/ -type RequestPPMPaymentUnauthorized struct { -} - -// NewRequestPPMPaymentUnauthorized creates RequestPPMPaymentUnauthorized with default headers values -func NewRequestPPMPaymentUnauthorized() *RequestPPMPaymentUnauthorized { - - return &RequestPPMPaymentUnauthorized{} -} - -// WriteResponse to the client -func (o *RequestPPMPaymentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// RequestPPMPaymentForbiddenCode is the HTTP code returned for type RequestPPMPaymentForbidden -const RequestPPMPaymentForbiddenCode int = 403 - -/* -RequestPPMPaymentForbidden user is not authorized - -swagger:response requestPPMPaymentForbidden -*/ -type RequestPPMPaymentForbidden struct { -} - -// NewRequestPPMPaymentForbidden creates RequestPPMPaymentForbidden with default headers values -func NewRequestPPMPaymentForbidden() *RequestPPMPaymentForbidden { - - return &RequestPPMPaymentForbidden{} -} - -// WriteResponse to the client -func (o *RequestPPMPaymentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// RequestPPMPaymentNotFoundCode is the HTTP code returned for type RequestPPMPaymentNotFound -const RequestPPMPaymentNotFoundCode int = 404 - -/* -RequestPPMPaymentNotFound move not found - -swagger:response requestPPMPaymentNotFound -*/ -type RequestPPMPaymentNotFound struct { -} - -// NewRequestPPMPaymentNotFound creates RequestPPMPaymentNotFound with default headers values -func NewRequestPPMPaymentNotFound() *RequestPPMPaymentNotFound { - - return &RequestPPMPaymentNotFound{} -} - -// WriteResponse to the client -func (o *RequestPPMPaymentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// RequestPPMPaymentInternalServerErrorCode is the HTTP code returned for type RequestPPMPaymentInternalServerError -const RequestPPMPaymentInternalServerErrorCode int = 500 - -/* -RequestPPMPaymentInternalServerError server error - -swagger:response requestPPMPaymentInternalServerError -*/ -type RequestPPMPaymentInternalServerError struct { -} - -// NewRequestPPMPaymentInternalServerError creates RequestPPMPaymentInternalServerError with default headers values -func NewRequestPPMPaymentInternalServerError() *RequestPPMPaymentInternalServerError { - - return &RequestPPMPaymentInternalServerError{} -} - -// WriteResponse to the client -func (o *RequestPPMPaymentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment_urlbuilder.go deleted file mode 100644 index fe430b8e3c4..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/request_p_p_m_payment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// RequestPPMPaymentURL generates an URL for the request p p m payment operation -type RequestPPMPaymentURL struct { - PersonallyProcuredMoveID 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 *RequestPPMPaymentURL) WithBasePath(bp string) *RequestPPMPaymentURL { - 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 *RequestPPMPaymentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RequestPPMPaymentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/personally_procured_move/{personallyProcuredMoveId}/request_payment" - - personallyProcuredMoveID := o.PersonallyProcuredMoveID.String() - if personallyProcuredMoveID != "" { - _path = strings.Replace(_path, "{personallyProcuredMoveId}", personallyProcuredMoveID, -1) - } else { - return nil, errors.New("personallyProcuredMoveId is required on RequestPPMPaymentURL") - } - - _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 *RequestPPMPaymentURL) 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 *RequestPPMPaymentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RequestPPMPaymentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RequestPPMPaymentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RequestPPMPaymentURL") - } - - 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 *RequestPPMPaymentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move.go b/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move.go deleted file mode 100644 index 72a7c071d7c..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// SubmitPersonallyProcuredMoveHandlerFunc turns a function with the right signature into a submit personally procured move handler -type SubmitPersonallyProcuredMoveHandlerFunc func(SubmitPersonallyProcuredMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SubmitPersonallyProcuredMoveHandlerFunc) Handle(params SubmitPersonallyProcuredMoveParams) middleware.Responder { - return fn(params) -} - -// SubmitPersonallyProcuredMoveHandler interface for that can handle valid submit personally procured move params -type SubmitPersonallyProcuredMoveHandler interface { - Handle(SubmitPersonallyProcuredMoveParams) middleware.Responder -} - -// NewSubmitPersonallyProcuredMove creates a new http.Handler for the submit personally procured move operation -func NewSubmitPersonallyProcuredMove(ctx *middleware.Context, handler SubmitPersonallyProcuredMoveHandler) *SubmitPersonallyProcuredMove { - return &SubmitPersonallyProcuredMove{Context: ctx, Handler: handler} -} - -/* - SubmitPersonallyProcuredMove swagger:route POST /personally_procured_move/{personallyProcuredMoveId}/submit ppm submitPersonallyProcuredMove - -# Submits a PPM for approval - -Submits a PPM for approval by the office. The status of the PPM will be updated to SUBMITTED -*/ -type SubmitPersonallyProcuredMove struct { - Context *middleware.Context - Handler SubmitPersonallyProcuredMoveHandler -} - -func (o *SubmitPersonallyProcuredMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSubmitPersonallyProcuredMoveParams() - 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/ppm/submit_personally_procured_move_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move_parameters.go deleted file mode 100644 index 283e30e1e92..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewSubmitPersonallyProcuredMoveParams creates a new SubmitPersonallyProcuredMoveParams object -// -// There are no default values defined in the spec. -func NewSubmitPersonallyProcuredMoveParams() SubmitPersonallyProcuredMoveParams { - - return SubmitPersonallyProcuredMoveParams{} -} - -// SubmitPersonallyProcuredMoveParams contains all the bound params for the submit personally procured move operation -// typically these are obtained from a http.Request -// -// swagger:parameters submitPersonallyProcuredMove -type SubmitPersonallyProcuredMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM being submitted - Required: true - In: path - */ - PersonallyProcuredMoveID strfmt.UUID - /* - Required: true - In: body - */ - SubmitPersonallyProcuredMovePayload *internalmessages.SubmitPersonallyProcuredMovePayload -} - -// 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 NewSubmitPersonallyProcuredMoveParams() beforehand. -func (o *SubmitPersonallyProcuredMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPersonallyProcuredMoveID, rhkPersonallyProcuredMoveID, _ := route.Params.GetOK("personallyProcuredMoveId") - if err := o.bindPersonallyProcuredMoveID(rPersonallyProcuredMoveID, rhkPersonallyProcuredMoveID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.SubmitPersonallyProcuredMovePayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("submitPersonallyProcuredMovePayload", "body", "")) - } else { - res = append(res, errors.NewParseError("submitPersonallyProcuredMovePayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.SubmitPersonallyProcuredMovePayload = &body - } - } - } else { - res = append(res, errors.Required("submitPersonallyProcuredMovePayload", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPersonallyProcuredMoveID binds and validates parameter PersonallyProcuredMoveID from path. -func (o *SubmitPersonallyProcuredMoveParams) bindPersonallyProcuredMoveID(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("personallyProcuredMoveId", "path", "strfmt.UUID", raw) - } - o.PersonallyProcuredMoveID = *(value.(*strfmt.UUID)) - - if err := o.validatePersonallyProcuredMoveID(formats); err != nil { - return err - } - - return nil -} - -// validatePersonallyProcuredMoveID carries on validations for parameter PersonallyProcuredMoveID -func (o *SubmitPersonallyProcuredMoveParams) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("personallyProcuredMoveId", "path", "uuid", o.PersonallyProcuredMoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move_responses.go b/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move_responses.go deleted file mode 100644 index 2960eb34c09..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// SubmitPersonallyProcuredMoveOKCode is the HTTP code returned for type SubmitPersonallyProcuredMoveOK -const SubmitPersonallyProcuredMoveOKCode int = 200 - -/* -SubmitPersonallyProcuredMoveOK updated instance of personally_procured_move - -swagger:response submitPersonallyProcuredMoveOK -*/ -type SubmitPersonallyProcuredMoveOK struct { - - /* - In: Body - */ - Payload *internalmessages.PersonallyProcuredMovePayload `json:"body,omitempty"` -} - -// NewSubmitPersonallyProcuredMoveOK creates SubmitPersonallyProcuredMoveOK with default headers values -func NewSubmitPersonallyProcuredMoveOK() *SubmitPersonallyProcuredMoveOK { - - return &SubmitPersonallyProcuredMoveOK{} -} - -// WithPayload adds the payload to the submit personally procured move o k response -func (o *SubmitPersonallyProcuredMoveOK) WithPayload(payload *internalmessages.PersonallyProcuredMovePayload) *SubmitPersonallyProcuredMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit personally procured move o k response -func (o *SubmitPersonallyProcuredMoveOK) SetPayload(payload *internalmessages.PersonallyProcuredMovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPersonallyProcuredMoveOK) 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 - } - } -} - -// SubmitPersonallyProcuredMoveBadRequestCode is the HTTP code returned for type SubmitPersonallyProcuredMoveBadRequest -const SubmitPersonallyProcuredMoveBadRequestCode int = 400 - -/* -SubmitPersonallyProcuredMoveBadRequest invalid request - -swagger:response submitPersonallyProcuredMoveBadRequest -*/ -type SubmitPersonallyProcuredMoveBadRequest struct { -} - -// NewSubmitPersonallyProcuredMoveBadRequest creates SubmitPersonallyProcuredMoveBadRequest with default headers values -func NewSubmitPersonallyProcuredMoveBadRequest() *SubmitPersonallyProcuredMoveBadRequest { - - return &SubmitPersonallyProcuredMoveBadRequest{} -} - -// WriteResponse to the client -func (o *SubmitPersonallyProcuredMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// SubmitPersonallyProcuredMoveUnauthorizedCode is the HTTP code returned for type SubmitPersonallyProcuredMoveUnauthorized -const SubmitPersonallyProcuredMoveUnauthorizedCode int = 401 - -/* -SubmitPersonallyProcuredMoveUnauthorized request requires user authentication - -swagger:response submitPersonallyProcuredMoveUnauthorized -*/ -type SubmitPersonallyProcuredMoveUnauthorized struct { -} - -// NewSubmitPersonallyProcuredMoveUnauthorized creates SubmitPersonallyProcuredMoveUnauthorized with default headers values -func NewSubmitPersonallyProcuredMoveUnauthorized() *SubmitPersonallyProcuredMoveUnauthorized { - - return &SubmitPersonallyProcuredMoveUnauthorized{} -} - -// WriteResponse to the client -func (o *SubmitPersonallyProcuredMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// SubmitPersonallyProcuredMoveForbiddenCode is the HTTP code returned for type SubmitPersonallyProcuredMoveForbidden -const SubmitPersonallyProcuredMoveForbiddenCode int = 403 - -/* -SubmitPersonallyProcuredMoveForbidden user is not authorized - -swagger:response submitPersonallyProcuredMoveForbidden -*/ -type SubmitPersonallyProcuredMoveForbidden struct { -} - -// NewSubmitPersonallyProcuredMoveForbidden creates SubmitPersonallyProcuredMoveForbidden with default headers values -func NewSubmitPersonallyProcuredMoveForbidden() *SubmitPersonallyProcuredMoveForbidden { - - return &SubmitPersonallyProcuredMoveForbidden{} -} - -// WriteResponse to the client -func (o *SubmitPersonallyProcuredMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// SubmitPersonallyProcuredMoveNotFoundCode is the HTTP code returned for type SubmitPersonallyProcuredMoveNotFound -const SubmitPersonallyProcuredMoveNotFoundCode int = 404 - -/* -SubmitPersonallyProcuredMoveNotFound ppm is not found - -swagger:response submitPersonallyProcuredMoveNotFound -*/ -type SubmitPersonallyProcuredMoveNotFound struct { -} - -// NewSubmitPersonallyProcuredMoveNotFound creates SubmitPersonallyProcuredMoveNotFound with default headers values -func NewSubmitPersonallyProcuredMoveNotFound() *SubmitPersonallyProcuredMoveNotFound { - - return &SubmitPersonallyProcuredMoveNotFound{} -} - -// WriteResponse to the client -func (o *SubmitPersonallyProcuredMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// SubmitPersonallyProcuredMoveInternalServerErrorCode is the HTTP code returned for type SubmitPersonallyProcuredMoveInternalServerError -const SubmitPersonallyProcuredMoveInternalServerErrorCode int = 500 - -/* -SubmitPersonallyProcuredMoveInternalServerError internal server error - -swagger:response submitPersonallyProcuredMoveInternalServerError -*/ -type SubmitPersonallyProcuredMoveInternalServerError struct { -} - -// NewSubmitPersonallyProcuredMoveInternalServerError creates SubmitPersonallyProcuredMoveInternalServerError with default headers values -func NewSubmitPersonallyProcuredMoveInternalServerError() *SubmitPersonallyProcuredMoveInternalServerError { - - return &SubmitPersonallyProcuredMoveInternalServerError{} -} - -// WriteResponse to the client -func (o *SubmitPersonallyProcuredMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move_urlbuilder.go deleted file mode 100644 index a2d3d1f82c8..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/submit_personally_procured_move_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// 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" -) - -// SubmitPersonallyProcuredMoveURL generates an URL for the submit personally procured move operation -type SubmitPersonallyProcuredMoveURL struct { - PersonallyProcuredMoveID 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 *SubmitPersonallyProcuredMoveURL) WithBasePath(bp string) *SubmitPersonallyProcuredMoveURL { - 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 *SubmitPersonallyProcuredMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SubmitPersonallyProcuredMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/personally_procured_move/{personallyProcuredMoveId}/submit" - - personallyProcuredMoveID := o.PersonallyProcuredMoveID.String() - if personallyProcuredMoveID != "" { - _path = strings.Replace(_path, "{personallyProcuredMoveId}", personallyProcuredMoveID, -1) - } else { - return nil, errors.New("personallyProcuredMoveId is required on SubmitPersonallyProcuredMoveURL") - } - - _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 *SubmitPersonallyProcuredMoveURL) 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 *SubmitPersonallyProcuredMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SubmitPersonallyProcuredMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SubmitPersonallyProcuredMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SubmitPersonallyProcuredMoveURL") - } - - 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 *SubmitPersonallyProcuredMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalmessages/patch_personally_procured_move_payload.go b/pkg/gen/internalmessages/patch_personally_procured_move_payload.go deleted file mode 100644 index df319945936..00000000000 --- a/pkg/gen/internalmessages/patch_personally_procured_move_payload.go +++ /dev/null @@ -1,558 +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" -) - -// PatchPersonallyProcuredMovePayload patch personally procured move payload -// -// swagger:model PatchPersonallyProcuredMovePayload -type PatchPersonallyProcuredMovePayload struct { - - // When did you actually move? - // Example: 2018-04-26 - // Format: date - ActualMoveDate *strfmt.Date `json:"actual_move_date,omitempty"` - - // ZIP code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - AdditionalPickupPostalCode *string `json:"additional_pickup_postal_code,omitempty"` - - // advance - Advance *Reimbursement `json:"advance,omitempty"` - - // advance worksheet - AdvanceWorksheet *Document `json:"advance_worksheet,omitempty"` - - // How many days of storage do you think you'll need? - // Maximum: 90 - // Minimum: 0 - DaysInStorage *int64 `json:"days_in_storage,omitempty"` - - // ZIP code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - DestinationPostalCode *string `json:"destination_postal_code,omitempty"` - - // Will you move anything from another pickup location? - HasAdditionalPostalCode *bool `json:"has_additional_postal_code,omitempty"` - - // Has Pro-Gear - // Enum: [NOT SURE YES NO] - HasProGear *string `json:"has_pro_gear,omitempty"` - - // Has Pro-Gear Over Thousand Pounds - // Enum: [NOT SURE YES NO] - HasProGearOverThousand *string `json:"has_pro_gear_over_thousand,omitempty"` - - // Would you like an advance of up to 60% of your PPM incentive? - HasRequestedAdvance *bool `json:"has_requested_advance,omitempty"` - - // Will you put anything in storage? - HasSit *bool `json:"has_sit,omitempty"` - - // Incentive Estimate Max - // Minimum: 1 - IncentiveEstimateMax *int64 `json:"incentive_estimate_max,omitempty"` - - // Incentive Estimate Min - // Minimum: 1 - IncentiveEstimateMin *int64 `json:"incentive_estimate_min,omitempty"` - - // Net Weight - // Minimum: 1 - NetWeight *int64 `json:"net_weight,omitempty"` - - // When do you plan to move? - // Example: 2018-04-26 - // Format: date - OriginalMoveDate *strfmt.Date `json:"original_move_date,omitempty"` - - // ZIP code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - PickupPostalCode *string `json:"pickup_postal_code,omitempty"` - - // size - Size *TShirtSize `json:"size,omitempty"` - - // How much does your storage cost? - // Minimum: 1 - TotalSitCost *int64 `json:"total_sit_cost,omitempty"` - - // Weight Estimate - // Minimum: 0 - WeightEstimate *int64 `json:"weight_estimate,omitempty"` -} - -// Validate validates this patch personally procured move payload -func (m *PatchPersonallyProcuredMovePayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAdditionalPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAdvance(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAdvanceWorksheet(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDaysInStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHasProGear(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHasProGearOverThousand(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIncentiveEstimateMax(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIncentiveEstimateMin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginalMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalSitCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightEstimate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actual_move_date", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateAdditionalPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.AdditionalPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("additional_pickup_postal_code", "body", *m.AdditionalPickupPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateAdvance(formats strfmt.Registry) error { - if swag.IsZero(m.Advance) { // not required - return nil - } - - if m.Advance != nil { - if err := m.Advance.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advance") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advance") - } - return err - } - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateAdvanceWorksheet(formats strfmt.Registry) error { - if swag.IsZero(m.AdvanceWorksheet) { // not required - return nil - } - - if m.AdvanceWorksheet != nil { - if err := m.AdvanceWorksheet.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advance_worksheet") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advance_worksheet") - } - return err - } - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateDaysInStorage(formats strfmt.Registry) error { - if swag.IsZero(m.DaysInStorage) { // not required - return nil - } - - if err := validate.MinimumInt("days_in_storage", "body", *m.DaysInStorage, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("days_in_storage", "body", *m.DaysInStorage, 90, false); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("destination_postal_code", "body", *m.DestinationPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -var patchPersonallyProcuredMovePayloadTypeHasProGearPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["NOT SURE","YES","NO"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - patchPersonallyProcuredMovePayloadTypeHasProGearPropEnum = append(patchPersonallyProcuredMovePayloadTypeHasProGearPropEnum, v) - } -} - -const ( - - // PatchPersonallyProcuredMovePayloadHasProGearNOTSURE captures enum value "NOT SURE" - PatchPersonallyProcuredMovePayloadHasProGearNOTSURE string = "NOT SURE" - - // PatchPersonallyProcuredMovePayloadHasProGearYES captures enum value "YES" - PatchPersonallyProcuredMovePayloadHasProGearYES string = "YES" - - // PatchPersonallyProcuredMovePayloadHasProGearNO captures enum value "NO" - PatchPersonallyProcuredMovePayloadHasProGearNO string = "NO" -) - -// prop value enum -func (m *PatchPersonallyProcuredMovePayload) validateHasProGearEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, patchPersonallyProcuredMovePayloadTypeHasProGearPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateHasProGear(formats strfmt.Registry) error { - if swag.IsZero(m.HasProGear) { // not required - return nil - } - - // value enum - if err := m.validateHasProGearEnum("has_pro_gear", "body", *m.HasProGear); err != nil { - return err - } - - return nil -} - -var patchPersonallyProcuredMovePayloadTypeHasProGearOverThousandPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["NOT SURE","YES","NO"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - patchPersonallyProcuredMovePayloadTypeHasProGearOverThousandPropEnum = append(patchPersonallyProcuredMovePayloadTypeHasProGearOverThousandPropEnum, v) - } -} - -const ( - - // PatchPersonallyProcuredMovePayloadHasProGearOverThousandNOTSURE captures enum value "NOT SURE" - PatchPersonallyProcuredMovePayloadHasProGearOverThousandNOTSURE string = "NOT SURE" - - // PatchPersonallyProcuredMovePayloadHasProGearOverThousandYES captures enum value "YES" - PatchPersonallyProcuredMovePayloadHasProGearOverThousandYES string = "YES" - - // PatchPersonallyProcuredMovePayloadHasProGearOverThousandNO captures enum value "NO" - PatchPersonallyProcuredMovePayloadHasProGearOverThousandNO string = "NO" -) - -// prop value enum -func (m *PatchPersonallyProcuredMovePayload) validateHasProGearOverThousandEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, patchPersonallyProcuredMovePayloadTypeHasProGearOverThousandPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateHasProGearOverThousand(formats strfmt.Registry) error { - if swag.IsZero(m.HasProGearOverThousand) { // not required - return nil - } - - // value enum - if err := m.validateHasProGearOverThousandEnum("has_pro_gear_over_thousand", "body", *m.HasProGearOverThousand); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateIncentiveEstimateMax(formats strfmt.Registry) error { - if swag.IsZero(m.IncentiveEstimateMax) { // not required - return nil - } - - if err := validate.MinimumInt("incentive_estimate_max", "body", *m.IncentiveEstimateMax, 1, false); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateIncentiveEstimateMin(formats strfmt.Registry) error { - if swag.IsZero(m.IncentiveEstimateMin) { // not required - return nil - } - - if err := validate.MinimumInt("incentive_estimate_min", "body", *m.IncentiveEstimateMin, 1, false); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateNetWeight(formats strfmt.Registry) error { - if swag.IsZero(m.NetWeight) { // not required - return nil - } - - if err := validate.MinimumInt("net_weight", "body", *m.NetWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateOriginalMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.OriginalMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("original_move_date", "body", "date", m.OriginalMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validatePickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.PickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("pickup_postal_code", "body", *m.PickupPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateSize(formats strfmt.Registry) error { - if swag.IsZero(m.Size) { // not required - return nil - } - - if m.Size != nil { - if err := m.Size.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("size") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("size") - } - return err - } - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateTotalSitCost(formats strfmt.Registry) error { - if swag.IsZero(m.TotalSitCost) { // not required - return nil - } - - if err := validate.MinimumInt("total_sit_cost", "body", *m.TotalSitCost, 1, false); err != nil { - return err - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) validateWeightEstimate(formats strfmt.Registry) error { - if swag.IsZero(m.WeightEstimate) { // not required - return nil - } - - if err := validate.MinimumInt("weight_estimate", "body", *m.WeightEstimate, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this patch personally procured move payload based on the context it is used -func (m *PatchPersonallyProcuredMovePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvance(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAdvanceWorksheet(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSize(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) contextValidateAdvance(ctx context.Context, formats strfmt.Registry) error { - - if m.Advance != nil { - - if swag.IsZero(m.Advance) { // not required - return nil - } - - if err := m.Advance.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advance") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advance") - } - return err - } - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) contextValidateAdvanceWorksheet(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvanceWorksheet != nil { - - if swag.IsZero(m.AdvanceWorksheet) { // not required - return nil - } - - if err := m.AdvanceWorksheet.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advance_worksheet") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advance_worksheet") - } - return err - } - } - - return nil -} - -func (m *PatchPersonallyProcuredMovePayload) contextValidateSize(ctx context.Context, formats strfmt.Registry) error { - - if m.Size != nil { - - if swag.IsZero(m.Size) { // not required - return nil - } - - if err := m.Size.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("size") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("size") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PatchPersonallyProcuredMovePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PatchPersonallyProcuredMovePayload) UnmarshalBinary(b []byte) error { - var res PatchPersonallyProcuredMovePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/submit_personally_procured_move_payload.go b/pkg/gen/internalmessages/submit_personally_procured_move_payload.go deleted file mode 100644 index 25520b2dc61..00000000000 --- a/pkg/gen/internalmessages/submit_personally_procured_move_payload.go +++ /dev/null @@ -1,77 +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" -) - -// SubmitPersonallyProcuredMovePayload submit personally procured move payload -// -// swagger:model SubmitPersonallyProcuredMovePayload -type SubmitPersonallyProcuredMovePayload struct { - - // When was the ppm move submitted? - // Example: 2019-03-26T13:19:56-04:00 - // Required: true - // Format: date-time - SubmitDate *strfmt.DateTime `json:"submit_date"` -} - -// Validate validates this submit personally procured move payload -func (m *SubmitPersonallyProcuredMovePayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSubmitDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SubmitPersonallyProcuredMovePayload) validateSubmitDate(formats strfmt.Registry) error { - - if err := validate.Required("submit_date", "body", m.SubmitDate); err != nil { - return err - } - - if err := validate.FormatOf("submit_date", "body", "date-time", m.SubmitDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this submit personally procured move payload based on context it is used -func (m *SubmitPersonallyProcuredMovePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SubmitPersonallyProcuredMovePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SubmitPersonallyProcuredMovePayload) UnmarshalBinary(b []byte) error { - var res SubmitPersonallyProcuredMovePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/handlers/internalapi/api.go b/pkg/handlers/internalapi/api.go index af4d2434914..aeaf21ff919 100644 --- a/pkg/handlers/internalapi/api.go +++ b/pkg/handlers/internalapi/api.go @@ -66,10 +66,6 @@ func NewInternalAPI(handlerConfig handlers.HandlerConfig) *internalops.MymoveAPI internalAPI.CertificationCreateSignedCertificationHandler = CreateSignedCertificationHandler{handlerConfig} internalAPI.CertificationIndexSignedCertificationHandler = IndexSignedCertificationsHandler{handlerConfig} - internalAPI.PpmPatchPersonallyProcuredMoveHandler = PatchPersonallyProcuredMoveHandler{handlerConfig} - internalAPI.PpmSubmitPersonallyProcuredMoveHandler = SubmitPersonallyProcuredMoveHandler{handlerConfig} - internalAPI.PpmRequestPPMPaymentHandler = RequestPPMPaymentHandler{handlerConfig} - internalAPI.DutyLocationsSearchDutyLocationsHandler = SearchDutyLocationsHandler{handlerConfig} internalAPI.AddressesShowAddressHandler = ShowAddressHandler{handlerConfig} diff --git a/pkg/handlers/internalapi/moves.go b/pkg/handlers/internalapi/moves.go index 2094c97ccdf..c5693a54dfc 100644 --- a/pkg/handlers/internalapi/moves.go +++ b/pkg/handlers/internalapi/moves.go @@ -28,6 +28,75 @@ import ( "github.com/transcom/mymove/pkg/storage" ) +func payloadForPPMModel(storer storage.FileStorer, personallyProcuredMove models.PersonallyProcuredMove) (*internalmessages.PersonallyProcuredMovePayload, error) { + + documentPayload, err := payloads.PayloadForDocumentModel(storer, personallyProcuredMove.AdvanceWorksheet) + var hasProGear *string + if personallyProcuredMove.HasProGear != nil { + hpg := string(*personallyProcuredMove.HasProGear) + hasProGear = &hpg + } + var hasProGearOverThousand *string + if personallyProcuredMove.HasProGearOverThousand != nil { + hpgot := string(*personallyProcuredMove.HasProGearOverThousand) + hasProGearOverThousand = &hpgot + } + if err != nil { + return nil, err + } + ppmPayload := internalmessages.PersonallyProcuredMovePayload{ + ID: handlers.FmtUUID(personallyProcuredMove.ID), + MoveID: *handlers.FmtUUID(personallyProcuredMove.MoveID), + CreatedAt: handlers.FmtDateTime(personallyProcuredMove.CreatedAt), + UpdatedAt: handlers.FmtDateTime(personallyProcuredMove.UpdatedAt), + WeightEstimate: handlers.FmtPoundPtr(personallyProcuredMove.WeightEstimate), + OriginalMoveDate: handlers.FmtDatePtr(personallyProcuredMove.OriginalMoveDate), + ActualMoveDate: handlers.FmtDatePtr(personallyProcuredMove.ActualMoveDate), + SubmitDate: handlers.FmtDateTimePtr(personallyProcuredMove.SubmitDate), + ApproveDate: handlers.FmtDateTimePtr(personallyProcuredMove.ApproveDate), + PickupPostalCode: personallyProcuredMove.PickupPostalCode, + HasAdditionalPostalCode: personallyProcuredMove.HasAdditionalPostalCode, + AdditionalPickupPostalCode: personallyProcuredMove.AdditionalPickupPostalCode, + DestinationPostalCode: personallyProcuredMove.DestinationPostalCode, + HasSit: personallyProcuredMove.HasSit, + DaysInStorage: personallyProcuredMove.DaysInStorage, + EstimatedStorageReimbursement: personallyProcuredMove.EstimatedStorageReimbursement, + Status: internalmessages.PPMStatus(personallyProcuredMove.Status), + HasRequestedAdvance: &personallyProcuredMove.HasRequestedAdvance, + Advance: payloadForReimbursementModel(personallyProcuredMove.Advance), + AdvanceWorksheet: documentPayload, + Mileage: personallyProcuredMove.Mileage, + TotalSitCost: handlers.FmtCost(personallyProcuredMove.TotalSITCost), + HasProGear: hasProGear, + HasProGearOverThousand: hasProGearOverThousand, + } + if personallyProcuredMove.IncentiveEstimateMin != nil { + min := (*personallyProcuredMove.IncentiveEstimateMin).Int64() + ppmPayload.IncentiveEstimateMin = &min + } + if personallyProcuredMove.IncentiveEstimateMax != nil { + max := (*personallyProcuredMove.IncentiveEstimateMax).Int64() + ppmPayload.IncentiveEstimateMax = &max + } + if personallyProcuredMove.PlannedSITMax != nil { + max := (*personallyProcuredMove.PlannedSITMax).Int64() + ppmPayload.PlannedSitMax = &max + } + if personallyProcuredMove.SITMax != nil { + max := (*personallyProcuredMove.SITMax).Int64() + ppmPayload.SitMax = &max + } + if personallyProcuredMove.HasProGear != nil { + hasProGear := string(*personallyProcuredMove.HasProGear) + ppmPayload.HasProGear = &hasProGear + } + if personallyProcuredMove.HasProGearOverThousand != nil { + hasProGearOverThousand := string(*personallyProcuredMove.HasProGearOverThousand) + ppmPayload.HasProGearOverThousand = &hasProGearOverThousand + } + return &ppmPayload, nil +} + func payloadForMoveModel(storer storage.FileStorer, order models.Order, move models.Move) (*internalmessages.MovePayload, error) { var ppmPayloads internalmessages.IndexPersonallyProcuredMovePayload diff --git a/pkg/handlers/internalapi/personally_procured_move.go b/pkg/handlers/internalapi/personally_procured_move.go deleted file mode 100644 index 14537f4d79d..00000000000 --- a/pkg/handlers/internalapi/personally_procured_move.go +++ /dev/null @@ -1,293 +0,0 @@ -package internalapi - -import ( - "time" - - "github.com/go-openapi/runtime/middleware" - "github.com/gofrs/uuid" - "go.uber.org/zap" - - "github.com/transcom/mymove/pkg/appcontext" - "github.com/transcom/mymove/pkg/apperror" - ppmop "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/ppm" - "github.com/transcom/mymove/pkg/gen/internalmessages" - "github.com/transcom/mymove/pkg/handlers" - "github.com/transcom/mymove/pkg/handlers/internalapi/internal/payloads" - "github.com/transcom/mymove/pkg/models" - "github.com/transcom/mymove/pkg/storage" - "github.com/transcom/mymove/pkg/unit" -) - -func payloadForPPMModel(storer storage.FileStorer, personallyProcuredMove models.PersonallyProcuredMove) (*internalmessages.PersonallyProcuredMovePayload, error) { - - documentPayload, err := payloads.PayloadForDocumentModel(storer, personallyProcuredMove.AdvanceWorksheet) - var hasProGear *string - if personallyProcuredMove.HasProGear != nil { - hpg := string(*personallyProcuredMove.HasProGear) - hasProGear = &hpg - } - var hasProGearOverThousand *string - if personallyProcuredMove.HasProGearOverThousand != nil { - hpgot := string(*personallyProcuredMove.HasProGearOverThousand) - hasProGearOverThousand = &hpgot - } - if err != nil { - return nil, err - } - ppmPayload := internalmessages.PersonallyProcuredMovePayload{ - ID: handlers.FmtUUID(personallyProcuredMove.ID), - MoveID: *handlers.FmtUUID(personallyProcuredMove.MoveID), - CreatedAt: handlers.FmtDateTime(personallyProcuredMove.CreatedAt), - UpdatedAt: handlers.FmtDateTime(personallyProcuredMove.UpdatedAt), - WeightEstimate: handlers.FmtPoundPtr(personallyProcuredMove.WeightEstimate), - OriginalMoveDate: handlers.FmtDatePtr(personallyProcuredMove.OriginalMoveDate), - ActualMoveDate: handlers.FmtDatePtr(personallyProcuredMove.ActualMoveDate), - SubmitDate: handlers.FmtDateTimePtr(personallyProcuredMove.SubmitDate), - ApproveDate: handlers.FmtDateTimePtr(personallyProcuredMove.ApproveDate), - PickupPostalCode: personallyProcuredMove.PickupPostalCode, - HasAdditionalPostalCode: personallyProcuredMove.HasAdditionalPostalCode, - AdditionalPickupPostalCode: personallyProcuredMove.AdditionalPickupPostalCode, - DestinationPostalCode: personallyProcuredMove.DestinationPostalCode, - HasSit: personallyProcuredMove.HasSit, - DaysInStorage: personallyProcuredMove.DaysInStorage, - EstimatedStorageReimbursement: personallyProcuredMove.EstimatedStorageReimbursement, - Status: internalmessages.PPMStatus(personallyProcuredMove.Status), - HasRequestedAdvance: &personallyProcuredMove.HasRequestedAdvance, - Advance: payloadForReimbursementModel(personallyProcuredMove.Advance), - AdvanceWorksheet: documentPayload, - Mileage: personallyProcuredMove.Mileage, - TotalSitCost: handlers.FmtCost(personallyProcuredMove.TotalSITCost), - HasProGear: hasProGear, - HasProGearOverThousand: hasProGearOverThousand, - } - if personallyProcuredMove.IncentiveEstimateMin != nil { - min := (*personallyProcuredMove.IncentiveEstimateMin).Int64() - ppmPayload.IncentiveEstimateMin = &min - } - if personallyProcuredMove.IncentiveEstimateMax != nil { - max := (*personallyProcuredMove.IncentiveEstimateMax).Int64() - ppmPayload.IncentiveEstimateMax = &max - } - if personallyProcuredMove.PlannedSITMax != nil { - max := (*personallyProcuredMove.PlannedSITMax).Int64() - ppmPayload.PlannedSitMax = &max - } - if personallyProcuredMove.SITMax != nil { - max := (*personallyProcuredMove.SITMax).Int64() - ppmPayload.SitMax = &max - } - if personallyProcuredMove.HasProGear != nil { - hasProGear := string(*personallyProcuredMove.HasProGear) - ppmPayload.HasProGear = &hasProGear - } - if personallyProcuredMove.HasProGearOverThousand != nil { - hasProGearOverThousand := string(*personallyProcuredMove.HasProGearOverThousand) - ppmPayload.HasProGearOverThousand = &hasProGearOverThousand - } - return &ppmPayload, nil -} - -func patchPPMWithPayload(ppm *models.PersonallyProcuredMove, payload *internalmessages.PatchPersonallyProcuredMovePayload) { - - if payload.WeightEstimate != nil { - ppm.WeightEstimate = handlers.PoundPtrFromInt64Ptr(payload.WeightEstimate) - } - if payload.IncentiveEstimateMax != nil { - incentiveEstimateMax := unit.Cents(int(*payload.IncentiveEstimateMax)) - ppm.IncentiveEstimateMax = &incentiveEstimateMax - } - if payload.IncentiveEstimateMin != nil { - incentiveEstimateMin := unit.Cents(int(*payload.IncentiveEstimateMin)) - ppm.IncentiveEstimateMin = &incentiveEstimateMin - } - if payload.OriginalMoveDate != nil { - ppm.OriginalMoveDate = (*time.Time)(payload.OriginalMoveDate) - } - if payload.ActualMoveDate != nil { - ppm.ActualMoveDate = (*time.Time)(payload.ActualMoveDate) - } - if payload.PickupPostalCode != nil { - ppm.PickupPostalCode = payload.PickupPostalCode - } - if payload.HasAdditionalPostalCode != nil { - if !*payload.HasAdditionalPostalCode { - ppm.AdditionalPickupPostalCode = nil - } else if *payload.HasAdditionalPostalCode { - ppm.AdditionalPickupPostalCode = payload.AdditionalPickupPostalCode - } - ppm.HasAdditionalPostalCode = payload.HasAdditionalPostalCode - } - if payload.DestinationPostalCode != nil { - ppm.DestinationPostalCode = payload.DestinationPostalCode - } - if payload.HasSit != nil { - ppm.HasSit = payload.HasSit - } - - if payload.TotalSitCost != nil { - cost := unit.Cents(*payload.TotalSitCost) - ppm.TotalSITCost = &cost - } - - if payload.DaysInStorage != nil { - ppm.DaysInStorage = payload.DaysInStorage - } - - if payload.HasRequestedAdvance != nil { - ppm.HasRequestedAdvance = *payload.HasRequestedAdvance - } else if payload.Advance != nil { - ppm.HasRequestedAdvance = true - } - if ppm.HasRequestedAdvance { - if payload.Advance != nil { - methodOfReceipt := models.MethodOfReceipt(*payload.Advance.MethodOfReceipt) - requestedAmount := unit.Cents(*payload.Advance.RequestedAmount) - - if ppm.Advance != nil { - ppm.Advance.MethodOfReceipt = methodOfReceipt - ppm.Advance.RequestedAmount = requestedAmount - } else { - var advance models.Reimbursement - if ppm.Status == models.PPMStatusDRAFT { - advance = models.BuildDraftReimbursement(requestedAmount, methodOfReceipt) - } else { - advance = models.BuildRequestedReimbursement(requestedAmount, methodOfReceipt) - } - ppm.Advance = &advance - } - } - } - if payload.HasProGear != nil { - hasProGear := models.ProGearStatus(*payload.HasProGear) - ppm.HasProGear = &hasProGear - } - if payload.HasProGearOverThousand != nil { - hasProGearOverThousand := models.ProGearStatus(*payload.HasProGearOverThousand) - ppm.HasProGearOverThousand = &hasProGearOverThousand - } -} - -// PatchPersonallyProcuredMoveHandler Patches a PPM -type PatchPersonallyProcuredMoveHandler struct { - handlers.HandlerConfig -} - -// Handle is the handler -func (h PatchPersonallyProcuredMoveHandler) Handle(params ppmop.PatchPersonallyProcuredMoveParams) middleware.Responder { - return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, - func(appCtx appcontext.AppContext) (middleware.Responder, error) { - moveID, err := uuid.FromString(params.MoveID.String()) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - ppmID, err := uuid.FromString(params.PersonallyProcuredMoveID.String()) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - ppm, err := models.FetchPersonallyProcuredMove(appCtx.DB(), appCtx.Session(), ppmID) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - if ppm.MoveID != moveID { - errMsg := "Move ID for PPM does not match requested PPM Move ID" - appCtx.Logger().Info(errMsg, zap.String("requested move_id", moveID.String()), zap.String("actual move_id", ppm.MoveID.String())) - return ppmop.NewPatchPersonallyProcuredMoveBadRequest(), apperror.NewBadDataError(errMsg) - } - - patchPPMWithPayload(ppm, params.PatchPersonallyProcuredMovePayload) - - verrs, err := models.SavePersonallyProcuredMove(appCtx.DB(), ppm) - if err != nil || verrs.HasAny() { - return handlers.ResponseForVErrors(appCtx.Logger(), verrs, err), err - } - - ppmPayload, err := payloadForPPMModel(h.FileStorer(), *ppm) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - return ppmop.NewPatchPersonallyProcuredMoveOK().WithPayload(ppmPayload), nil - }) -} - -// SubmitPersonallyProcuredMoveHandler Submits a PPM -type SubmitPersonallyProcuredMoveHandler struct { - handlers.HandlerConfig -} - -// Handle Submits a PPM to change its status to SUBMITTED -func (h SubmitPersonallyProcuredMoveHandler) Handle(params ppmop.SubmitPersonallyProcuredMoveParams) middleware.Responder { - return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, - func(appCtx appcontext.AppContext) (middleware.Responder, error) { - ppmID, err := uuid.FromString(params.PersonallyProcuredMoveID.String()) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - ppm, err := models.FetchPersonallyProcuredMove(appCtx.DB(), appCtx.Session(), ppmID) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - var submitDate time.Time - if params.SubmitPersonallyProcuredMovePayload.SubmitDate != nil { - submitDate = time.Time(*params.SubmitPersonallyProcuredMovePayload.SubmitDate) - } - err = ppm.Submit(submitDate) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - verrs, err := models.SavePersonallyProcuredMove(appCtx.DB(), ppm) - if err != nil || verrs.HasAny() { - return handlers.ResponseForVErrors(appCtx.Logger(), verrs, err), err - } - - ppmPayload, err := payloadForPPMModel(h.FileStorer(), *ppm) - - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - return ppmop.NewSubmitPersonallyProcuredMoveOK().WithPayload(ppmPayload), nil - }) -} - -// RequestPPMPaymentHandler requests a payment for a PPM -type RequestPPMPaymentHandler struct { - handlers.HandlerConfig -} - -// Handle is the handler -func (h RequestPPMPaymentHandler) Handle(params ppmop.RequestPPMPaymentParams) middleware.Responder { - return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, - func(appCtx appcontext.AppContext) (middleware.Responder, error) { - ppmID, err := uuid.FromString(params.PersonallyProcuredMoveID.String()) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - ppm, err := models.FetchPersonallyProcuredMove(appCtx.DB(), appCtx.Session(), ppmID) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - err = ppm.RequestPayment() - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - - verrs, err := models.SavePersonallyProcuredMove(appCtx.DB(), ppm) - if err != nil || verrs.HasAny() { - return handlers.ResponseForVErrors(appCtx.Logger(), verrs, err), err - } - - ppmPayload, err := payloadForPPMModel(h.FileStorer(), *ppm) - if err != nil { - return handlers.ResponseForError(appCtx.Logger(), err), err - } - return ppmop.NewRequestPPMPaymentOK().WithPayload(ppmPayload), nil - }) -} diff --git a/pkg/services/event/internal_endpoint.go b/pkg/services/event/internal_endpoint.go index d53ce15acc8..909296fb5b0 100644 --- a/pkg/services/event/internal_endpoint.go +++ b/pkg/services/event/internal_endpoint.go @@ -43,15 +43,6 @@ const InternalCreateSignedCertificationEndpointKey = "Internal.CreateSignedCerti // InternalIndexSignedCertificationEndpointKey is the key for the indexSignedCertification endpoint in internal const InternalIndexSignedCertificationEndpointKey = "Internal.IndexSignedCertification" -// InternalPatchPersonallyProcuredMoveEndpointKey is the key for the patchPersonallyProcuredMove endpoint in internal -const InternalPatchPersonallyProcuredMoveEndpointKey = "Internal.PatchPersonallyProcuredMove" - -// InternalSubmitPersonallyProcuredMoveEndpointKey is the key for the submitPersonallyProcuredMove endpoint in internal -const InternalSubmitPersonallyProcuredMoveEndpointKey = "Internal.SubmitPersonallyProcuredMove" - -// InternalRequestPPMPaymentEndpointKey is the key for the requestPPMPayment endpoint in internal -const InternalRequestPPMPaymentEndpointKey = "Internal.RequestPPMPayment" - // InternalApproveReimbursementEndpointKey is the key for the approveReimbursement endpoint in internal const InternalApproveReimbursementEndpointKey = "Internal.ApproveReimbursement" @@ -213,18 +204,6 @@ var internalEndpoints = EndpointMapType{ APIName: InternalAPIName, OperationID: "indexSignedCertification", }, - InternalPatchPersonallyProcuredMoveEndpointKey: { - APIName: InternalAPIName, - OperationID: "patchPersonallyProcuredMove", - }, - InternalSubmitPersonallyProcuredMoveEndpointKey: { - APIName: InternalAPIName, - OperationID: "submitPersonallyProcuredMove", - }, - InternalRequestPPMPaymentEndpointKey: { - APIName: InternalAPIName, - OperationID: "requestPPMPayment", - }, InternalApproveReimbursementEndpointKey: { APIName: InternalAPIName, OperationID: "approveReimbursement", diff --git a/src/services/internalApi.js b/src/services/internalApi.js index d3256bc7dcd..43c65e78bc2 100644 --- a/src/services/internalApi.js +++ b/src/services/internalApi.js @@ -412,20 +412,6 @@ export async function deleteProGearWeightTicket(ppmShipmentId, proGearWeightTick } /** PPMS */ -export async function patchPPM(moveId, ppm) { - return makeInternalRequest( - 'ppm.patchPersonallyProcuredMove', - { - moveId, - personallyProcuredMoveId: ppm.id, - patchPersonallyProcuredMovePayload: ppm, - }, - { - normalize: false, - }, - ); -} - export async function calculatePPMEstimate(moveDate, originZip, originDutyLocationZip, ordersId, weightEstimate) { return makeInternalRequest( 'ppm.showPPMEstimate', @@ -459,18 +445,6 @@ export async function calculatePPMSITEstimate(ppmId, moveDate, sitDays, originZi ); } -export async function requestPayment(ppmId) { - return makeInternalRequest( - 'ppm.requestPPMPayment', - { - personallyProcuredMoveId: ppmId, - }, - { - normalize: false, - }, - ); -} - export async function createMovingExpense(ppmShipmentId) { return makeInternalRequest( 'ppm.createMovingExpense', diff --git a/src/shared/Entities/modules/ppms.js b/src/shared/Entities/modules/ppms.js index 67dd62a6278..5f65218f809 100644 --- a/src/shared/Entities/modules/ppms.js +++ b/src/shared/Entities/modules/ppms.js @@ -4,11 +4,9 @@ import { fetchActivePPM } from '../../utils'; import { swaggerRequest } from 'shared/Swagger/request'; import { getClient } from 'shared/Swagger/api'; -import { formatDateForSwagger } from 'shared/dates'; const approvePpmLabel = 'PPMs.approvePPM'; export const downloadPPMAttachmentsLabel = 'PPMs.downloadAttachments'; -const updatePPMLabel = 'office.updatePPM'; const approveReimbursementLabel = 'office.approveReimbursement'; export function approvePPM(personallyProcuredMoveId, personallyProcuredMoveApproveDate, label = approvePpmLabel) { @@ -26,27 +24,6 @@ export function approvePPM(personallyProcuredMoveId, personallyProcuredMoveAppro ); } -export function updatePPM( - moveId, - personallyProcuredMoveId, - payload /* shape: {size, weightEstimate, estimatedIncentive} */, - label = updatePPMLabel, -) { - const swaggerTag = 'ppm.patchPersonallyProcuredMove'; - payload.original_move_date = formatDateForSwagger(payload.original_move_date); - payload.actual_move_date = formatDateForSwagger(payload.actual_move_date); - return swaggerRequest( - getClient, - swaggerTag, - { - moveId, - personallyProcuredMoveId, - patchPersonallyProcuredMovePayload: payload, - }, - { label }, - ); -} - export function approveReimbursement(reimbursementId, label = approveReimbursementLabel) { const swaggerTag = 'office.approveReimbursement'; return swaggerRequest(getClient, swaggerTag, { reimbursementId }, { label }); diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 2133c8272fc..d6e1abf83f0 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -286,107 +286,6 @@ definitions: - 'YES' - 'NO' x-nullable: true - PatchPersonallyProcuredMovePayload: - type: object - properties: - size: - $ref: '#/definitions/TShirtSize' - original_move_date: - type: string - example: '2018-04-26' - format: date - title: When do you plan to move? - x-nullable: true - actual_move_date: - type: string - example: '2018-04-26' - format: date - title: When did you actually move? - x-nullable: true - pickup_postal_code: - type: string - format: zip - title: ZIP code - example: '90210' - pattern: '^(\d{5}([\-]\d{4})?)$' - x-nullable: true - has_additional_postal_code: - type: boolean - x-nullable: true - title: Will you move anything from another pickup location? - additional_pickup_postal_code: - type: string - format: zip - title: ZIP code - example: '90210' - pattern: '^(\d{5}([\-]\d{4})?)$' - x-nullable: true - destination_postal_code: - type: string - format: zip - title: ZIP code - example: '90210' - pattern: '^(\d{5}([\-]\d{4})?)$' - x-nullable: true - has_sit: - type: boolean - x-nullable: true - title: Will you put anything in storage? - days_in_storage: - type: integer - title: How many days of storage do you think you'll need? - minimum: 0 - maximum: 90 - x-nullable: true - total_sit_cost: - type: integer - minimum: 1 - title: How much does your storage cost? - x-nullable: true - weight_estimate: - type: integer - minimum: 0 - title: Weight Estimate - x-nullable: true - net_weight: - type: integer - minimum: 1 - title: Net Weight - x-nullable: true - incentive_estimate_max: - type: integer - minimum: 1 - title: Incentive Estimate Max - x-nullable: true - incentive_estimate_min: - type: integer - minimum: 1 - title: Incentive Estimate Min - x-nullable: true - has_requested_advance: - type: boolean - default: false - title: Would you like an advance of up to 60% of your PPM incentive? - advance: - $ref: '#/definitions/Reimbursement' - advance_worksheet: - $ref: 'definitions/Document.yaml' - 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 PersonallyProcuredMovePayload: type: object properties: @@ -549,16 +448,6 @@ definitions: properties: certificate: $ref: '#/definitions/CreateSignedCertificationPayload' - SubmitPersonallyProcuredMovePayload: - type: object - properties: - submit_date: - type: string - format: date-time - title: When was the ppm move submitted? - example: '2019-03-26T13:19:56-04:00' - required: - - submit_date PPMSitEstimate: type: object properties: @@ -3163,111 +3052,6 @@ paths: description: move not found '500': description: internal server error - /moves/{moveId}/personally_procured_move/{personallyProcuredMoveId}: - patch: - summary: Patches the PPM - description: Any fields sent in this request will be set on the PPM referenced - operationId: patchPersonallyProcuredMove - tags: - - ppm - parameters: - - in: path - name: moveId - type: string - format: uuid - required: true - description: UUID of the move - - in: path - name: personallyProcuredMoveId - type: string - format: uuid - required: true - description: UUID of the PPM being patched - - in: body - name: patchPersonallyProcuredMovePayload - required: true - schema: - $ref: '#/definitions/PatchPersonallyProcuredMovePayload' - responses: - '200': - description: updated instance of personally_procured_move - schema: - $ref: '#/definitions/PersonallyProcuredMovePayload' - '400': - description: invalid request - '401': - description: request requires user authentication - '403': - description: user is not authorized - '404': - description: ppm is not found or ppm discount not found for provided postal codes and original move date - '422': - description: cannot process request with given information - '500': - description: internal server error - /personally_procured_move/{personallyProcuredMoveId}/submit: - post: - summary: Submits a PPM for approval - description: Submits a PPM for approval by the office. The status of the PPM will be updated to SUBMITTED - operationId: submitPersonallyProcuredMove - tags: - - ppm - parameters: - - in: path - name: personallyProcuredMoveId - type: string - format: uuid - required: true - description: UUID of the PPM being submitted - - name: submitPersonallyProcuredMovePayload - in: body - required: true - schema: - $ref: '#/definitions/SubmitPersonallyProcuredMovePayload' - responses: - '200': - description: updated instance of personally_procured_move - schema: - $ref: '#/definitions/PersonallyProcuredMovePayload' - '400': - description: invalid request - '401': - description: request requires user authentication - '403': - description: user is not authorized - '404': - description: ppm is not found - '500': - description: internal server error - /personally_procured_move/{personallyProcuredMoveId}/request_payment: - post: - summary: Moves the PPM and the move into the PAYMENT_REQUESTED state - description: Moves the PPM and the move into the PAYMENT_REQUESTED state - operationId: requestPPMPayment - tags: - - ppm - parameters: - - in: path - name: personallyProcuredMoveId - type: string - format: uuid - required: true - description: UUID of the PPM - responses: - '200': - description: Sucesssfully requested payment - schema: - $ref: '#/definitions/PersonallyProcuredMovePayload' - '400': - description: invalid request - '401': - description: request requires user authentication - '403': - description: user is not authorized - '404': - description: move not found - '500': - description: server error /reimbursement/{reimbursementId}/approve: post: summary: Approves the reimbursement diff --git a/swagger/internal.yaml b/swagger/internal.yaml index 032fe2b15c5..204c6e78a51 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -287,107 +287,6 @@ definitions: - 'YES' - 'NO' x-nullable: true - PatchPersonallyProcuredMovePayload: - type: object - properties: - size: - $ref: '#/definitions/TShirtSize' - original_move_date: - type: string - example: '2018-04-26' - format: date - title: When do you plan to move? - x-nullable: true - actual_move_date: - type: string - example: '2018-04-26' - format: date - title: When did you actually move? - x-nullable: true - pickup_postal_code: - type: string - format: zip - title: ZIP code - example: '90210' - pattern: ^(\d{5}([\-]\d{4})?)$ - x-nullable: true - has_additional_postal_code: - type: boolean - x-nullable: true - title: Will you move anything from another pickup location? - additional_pickup_postal_code: - type: string - format: zip - title: ZIP code - example: '90210' - pattern: ^(\d{5}([\-]\d{4})?)$ - x-nullable: true - destination_postal_code: - type: string - format: zip - title: ZIP code - example: '90210' - pattern: ^(\d{5}([\-]\d{4})?)$ - x-nullable: true - has_sit: - type: boolean - x-nullable: true - title: Will you put anything in storage? - days_in_storage: - type: integer - title: How many days of storage do you think you'll need? - minimum: 0 - maximum: 90 - x-nullable: true - total_sit_cost: - type: integer - minimum: 1 - title: How much does your storage cost? - x-nullable: true - weight_estimate: - type: integer - minimum: 0 - title: Weight Estimate - x-nullable: true - net_weight: - type: integer - minimum: 1 - title: Net Weight - x-nullable: true - incentive_estimate_max: - type: integer - minimum: 1 - title: Incentive Estimate Max - x-nullable: true - incentive_estimate_min: - type: integer - minimum: 1 - title: Incentive Estimate Min - x-nullable: true - has_requested_advance: - type: boolean - default: false - title: Would you like an advance of up to 60% of your PPM incentive? - advance: - $ref: '#/definitions/Reimbursement' - advance_worksheet: - $ref: '#/definitions/Document' - 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 PersonallyProcuredMovePayload: type: object properties: @@ -550,16 +449,6 @@ definitions: properties: certificate: $ref: '#/definitions/CreateSignedCertificationPayload' - SubmitPersonallyProcuredMovePayload: - type: object - properties: - submit_date: - type: string - format: date-time - title: When was the ppm move submitted? - example: '2019-03-26T13:19:56-04:00' - required: - - submit_date PPMSitEstimate: type: object properties: @@ -4394,115 +4283,6 @@ paths: description: move not found '500': description: internal server error - /moves/{moveId}/personally_procured_move/{personallyProcuredMoveId}: - patch: - summary: Patches the PPM - description: Any fields sent in this request will be set on the PPM referenced - operationId: patchPersonallyProcuredMove - tags: - - ppm - parameters: - - in: path - name: moveId - type: string - format: uuid - required: true - description: UUID of the move - - in: path - name: personallyProcuredMoveId - type: string - format: uuid - required: true - description: UUID of the PPM being patched - - in: body - name: patchPersonallyProcuredMovePayload - required: true - schema: - $ref: '#/definitions/PatchPersonallyProcuredMovePayload' - responses: - '200': - description: updated instance of personally_procured_move - schema: - $ref: '#/definitions/PersonallyProcuredMovePayload' - '400': - description: invalid request - '401': - description: request requires user authentication - '403': - description: user is not authorized - '404': - description: >- - ppm is not found or ppm discount not found for provided postal codes - and original move date - '422': - description: cannot process request with given information - '500': - description: internal server error - /personally_procured_move/{personallyProcuredMoveId}/submit: - post: - summary: Submits a PPM for approval - description: >- - Submits a PPM for approval by the office. The status of the PPM will be - updated to SUBMITTED - operationId: submitPersonallyProcuredMove - tags: - - ppm - parameters: - - in: path - name: personallyProcuredMoveId - type: string - format: uuid - required: true - description: UUID of the PPM being submitted - - name: submitPersonallyProcuredMovePayload - in: body - required: true - schema: - $ref: '#/definitions/SubmitPersonallyProcuredMovePayload' - responses: - '200': - description: updated instance of personally_procured_move - schema: - $ref: '#/definitions/PersonallyProcuredMovePayload' - '400': - description: invalid request - '401': - description: request requires user authentication - '403': - description: user is not authorized - '404': - description: ppm is not found - '500': - description: internal server error - /personally_procured_move/{personallyProcuredMoveId}/request_payment: - post: - summary: Moves the PPM and the move into the PAYMENT_REQUESTED state - description: Moves the PPM and the move into the PAYMENT_REQUESTED state - operationId: requestPPMPayment - tags: - - ppm - parameters: - - in: path - name: personallyProcuredMoveId - type: string - format: uuid - required: true - description: UUID of the PPM - responses: - '200': - description: Sucesssfully requested payment - schema: - $ref: '#/definitions/PersonallyProcuredMovePayload' - '400': - description: invalid request - '401': - description: request requires user authentication - '403': - description: user is not authorized - '404': - description: move not found - '500': - description: server error /reimbursement/{reimbursementId}/approve: post: summary: Approves the reimbursement