From 8c1dd98052c7794c9613bee090a7957c345a953b Mon Sep 17 00:00:00 2001 From: Michael Inthavongsay Date: Tue, 17 Sep 2024 15:52:51 +0000 Subject: [PATCH 1/2] add migration file to update 7 records to transportation_offices table to align with Danny M's spreadsheet. Update GHC handler to pass in forPpm parameter to ensure filteriing on ppm_closeout col. --- migrations/app/migrations_manifest.txt | 1 + ...ppm_closeout_transportation_offices.up.sql | 20 +++++++++++++++++++ pkg/handlers/ghcapi/tranportation_offices.go | 5 ++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 migrations/app/schema/20240917132411_update_provides_ppm_closeout_transportation_offices.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index ab0cc2e13f5..44e34a7170c 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -993,3 +993,4 @@ 20240819164156_update_pws_violations_pt3.up.sql 20240820125856_allow_pptas_migration.up.sql 20240820151043_add_gsr_role.up.sql +20240917132411_update_provides_ppm_closeout_transportation_offices.up.sql diff --git a/migrations/app/schema/20240917132411_update_provides_ppm_closeout_transportation_offices.up.sql b/migrations/app/schema/20240917132411_update_provides_ppm_closeout_transportation_offices.up.sql new file mode 100644 index 00000000000..07cc0505623 --- /dev/null +++ b/migrations/app/schema/20240917132411_update_provides_ppm_closeout_transportation_offices.up.sql @@ -0,0 +1,20 @@ +-- PPPO Fort Belvoir - USA +UPDATE transportation_offices SET provides_ppm_closeout = true WHERE id = 'a877a317-be5f-482b-a126-c91a34be9290'; + +-- Personal Property Activity HQ (PPA HQ) - USAF +UPDATE transportation_offices SET provides_ppm_closeout = false WHERE id = 'ebdacf64-353a-4014-91db-0d04d88320f0'; + +-- PPPO Base Miami - USCG +UPDATE transportation_offices SET provides_ppm_closeout = true WHERE id = '1b3e7496-efa7-48aa-ba22-b630d6fea98b'; + +-- JPPSO - North West (JEAT) - USA +UPDATE transportation_offices SET provides_ppm_closeout = false WHERE id = '5a3388e1-6d46-4639-ac8f-a8937dc26938'; + +-- PPPO NSWC Panama City Division - USN +UPDATE transportation_offices SET provides_ppm_closeout = true WHERE id = '57cf1e81-8113-4a52-bc50-3cb8902c2efd'; + +-- JPPSO - Mid Atlantic (BGAC) - USA +UPDATE transportation_offices SET provides_ppm_closeout = false WHERE id = '8e25ccc1-7891-4146-a9d0-cd0d48b59a50'; + +-- JPPSO - South West (LKNQ) - USN +UPDATE transportation_offices SET provides_ppm_closeout = false WHERE id = '27002d34-e9ea-4ef5-a086-f23d07c4088c'; \ No newline at end of file diff --git a/pkg/handlers/ghcapi/tranportation_offices.go b/pkg/handlers/ghcapi/tranportation_offices.go index d60f4b0a70a..405580923bb 100644 --- a/pkg/handlers/ghcapi/tranportation_offices.go +++ b/pkg/handlers/ghcapi/tranportation_offices.go @@ -20,7 +20,10 @@ func (h GetTransportationOfficesHandler) Handle(params transportationofficeop.Ge return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, func(appCtx appcontext.AppContext) (middleware.Responder, error) { - transportationOffices, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, params.Search, false) + // B-21022: forPpm param is set true. This is used by PPM closeout widget. Need to ensure certain offices are included/excluded + // if location has ppm closedout enabled. + transportationOffices, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, params.Search, true) + if err != nil { appCtx.Logger().Error("Error searching for Transportation Offices: ", zap.Error(err)) return transportationofficeop.NewGetTransportationOfficesInternalServerError(), err From b11e81711c041ff4286c0d18f14bed07f54757a7 Mon Sep 17 00:00:00 2001 From: Michael Inthavongsay Date: Wed, 18 Sep 2024 14:12:29 +0000 Subject: [PATCH 2/2] update swagger description and summary for API to align with change related to making forPPM param to true. --- pkg/gen/ghcapi/embedded_spec.go | 8 ++++---- .../transportation_office/get_transportation_offices.go | 4 ++-- swagger-def/ghc.yaml | 4 ++-- swagger/ghc.yaml | 8 ++++++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 7388e1b61d5..a0a15f445da 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -5607,14 +5607,14 @@ func init() { }, "/transportation-offices": { "get": { - "description": "Returns the transportation offices matching the search query", + "description": "Returns the transportation offices matching the search query that is enabled for PPM closeout", "produces": [ "application/json" ], "tags": [ "transportationOffice" ], - "summary": "Returns the transportation offices matching the search query", + "summary": "Returns the transportation offices matching the search query that is enabled for PPM closeout", "operationId": "getTransportationOffices", "parameters": [ { @@ -20925,14 +20925,14 @@ func init() { }, "/transportation-offices": { "get": { - "description": "Returns the transportation offices matching the search query", + "description": "Returns the transportation offices matching the search query that is enabled for PPM closeout", "produces": [ "application/json" ], "tags": [ "transportationOffice" ], - "summary": "Returns the transportation offices matching the search query", + "summary": "Returns the transportation offices matching the search query that is enabled for PPM closeout", "operationId": "getTransportationOffices", "parameters": [ { diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go index 13c260a5655..fd19356220f 100644 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go @@ -32,9 +32,9 @@ func NewGetTransportationOffices(ctx *middleware.Context, handler GetTransportat /* GetTransportationOffices swagger:route GET /transportation-offices transportationOffice getTransportationOffices -# Returns the transportation offices matching the search query +# Returns the transportation offices matching the search query that is enabled for PPM closeout -Returns the transportation offices matching the search query +Returns the transportation offices matching the search query that is enabled for PPM closeout */ type GetTransportationOffices struct { Context *middleware.Context diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 0bb252d0846..36ed6d93795 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3756,8 +3756,8 @@ paths: get: produces: - application/json - summary: Returns the transportation offices matching the search query - description: Returns the transportation offices matching the search query + summary: Returns the transportation offices matching the search query that is enabled for PPM closeout + description: Returns the transportation offices matching the search query that is enabled for PPM closeout operationId: getTransportationOffices tags: - transportationOffice diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 62feecb4062..73987c93126 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3931,8 +3931,12 @@ paths: get: produces: - application/json - summary: Returns the transportation offices matching the search query - description: Returns the transportation offices matching the search query + summary: >- + Returns the transportation offices matching the search query that is + enabled for PPM closeout + description: >- + Returns the transportation offices matching the search query that is + enabled for PPM closeout operationId: getTransportationOffices tags: - transportationOffice