From d9c26908ea98a89316295f11801ca411d86cb31f Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 4 Apr 2024 15:47:47 +0000 Subject: [PATCH 1/7] Created migration file and added gunSafe boolean to "UpdateAllowancePayload" and "CounselingUpdateAllowancePayload" in ghc.yaml --- migrations/app/migrations_manifest.txt | 1 + ...152441_add_gun_safe_to_entitlements.up.sql | 7 +++++++ pkg/gen/ghcapi/embedded_spec.go | 20 +++++++++++++++++++ .../counseling_update_allowance_payload.go | 3 +++ .../ghcmessages/update_allowance_payload.go | 3 +++ swagger-def/ghc.yaml | 8 ++++++++ swagger/ghc.yaml | 12 +++++++++++ 7 files changed, 54 insertions(+) create mode 100644 migrations/app/schema/20240404152441_add_gun_safe_to_entitlements.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index f015c0cc2e4..8420563386d 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -915,3 +915,4 @@ 20240319214733_remove_sit_authorized_end_date.up.sql 20240322144246_updateAddressesCounty.up.sql 20240327210353_add_cac_verified_to_service_members_table.up.sql +20240404152441_add_gun_safe_to_entitlements.up.sql diff --git a/migrations/app/schema/20240404152441_add_gun_safe_to_entitlements.up.sql b/migrations/app/schema/20240404152441_add_gun_safe_to_entitlements.up.sql new file mode 100644 index 00000000000..5991b3695f8 --- /dev/null +++ b/migrations/app/schema/20240404152441_add_gun_safe_to_entitlements.up.sql @@ -0,0 +1,7 @@ +-- Adds new column to entitlements table +-- allows customer to move a gun safe with their move. +ALTER TABLE entitlements +ADD COLUMN IF NOT EXISTS gun_safe BOOLEAN DEFAULT FALSE; + +-- Comments on new column +COMMENT ON COLUMN entitlements.gun_safe IS 'True if customer is entitled to move a gun safe up to 500 lbs without it being charged against their authorized weight allowance.'; \ No newline at end of file diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index abae2b3e21b..1d336ca4411 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -5080,6 +5080,11 @@ func init() { "grade": { "$ref": "#/definitions/Grade" }, + "gunSafe": { + "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", + "type": "boolean", + "x-nullable": true + }, "organizationalClothingAndIndividualEquipment": { "description": "only for Army", "type": "boolean", @@ -9629,6 +9634,11 @@ func init() { "grade": { "$ref": "#/definitions/Grade" }, + "gunSafe": { + "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", + "type": "boolean", + "x-nullable": true + }, "organizationalClothingAndIndividualEquipment": { "description": "only for Army", "type": "boolean", @@ -16945,6 +16955,11 @@ func init() { "grade": { "$ref": "#/definitions/Grade" }, + "gunSafe": { + "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", + "type": "boolean", + "x-nullable": true + }, "organizationalClothingAndIndividualEquipment": { "description": "only for Army", "type": "boolean", @@ -21552,6 +21567,11 @@ func init() { "grade": { "$ref": "#/definitions/Grade" }, + "gunSafe": { + "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", + "type": "boolean", + "x-nullable": true + }, "organizationalClothingAndIndividualEquipment": { "description": "only for Army", "type": "boolean", diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go index 1ede0d87960..8aff2d86426 100644 --- a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go +++ b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go @@ -28,6 +28,9 @@ type CounselingUpdateAllowancePayload struct { // grade Grade *Grade `json:"grade,omitempty"` + // True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. + GunSafe *bool `json:"gunSafe,omitempty"` + // only for Army OrganizationalClothingAndIndividualEquipment *bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go index d57b8145528..aeb83c7caaa 100644 --- a/pkg/gen/ghcmessages/update_allowance_payload.go +++ b/pkg/gen/ghcmessages/update_allowance_payload.go @@ -28,6 +28,9 @@ type UpdateAllowancePayload struct { // grade Grade *Grade `json:"grade,omitempty"` + // True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. + GunSafe *bool `json:"gunSafe,omitempty"` + // only for Army OrganizationalClothingAndIndividualEquipment *bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 196f9d6920e..b6504cb244e 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -4110,6 +4110,10 @@ definitions: description: the number of storage in transit days that the customer is entitled to for a given shipment on their move type: integer minimum: 0 + gunSafe: + description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. + type: boolean + x-nullable: true UpdateBillableWeightPayload: type: object properties: @@ -4179,6 +4183,10 @@ definitions: description: the number of storage in transit days that the customer is entitled to for a given shipment on their move type: integer minimum: 0 + gunSafe: + description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. + type: boolean + x-nullable: true MoveTaskOrder: description: The Move (MoveTaskOrder) properties: diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index ad2ca86a571..afbd7ac2806 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -4262,6 +4262,12 @@ definitions: for a given shipment on their move type: integer minimum: 0 + gunSafe: + description: >- + True if user is entitled to move a gun safe (up to 500 lbs) as part of + their move without it being charged against their weight allowance. + type: boolean + x-nullable: true UpdateBillableWeightPayload: type: object properties: @@ -4333,6 +4339,12 @@ definitions: for a given shipment on their move type: integer minimum: 0 + gunSafe: + description: >- + True if user is entitled to move a gun safe (up to 500 lbs) as part of + their move without it being charged against their weight allowance. + type: boolean + x-nullable: true MoveTaskOrder: description: The Move (MoveTaskOrder) properties: From 82e0486c423eaf5db6aa60e0ebc0748242abd9fb Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 4 Apr 2024 16:02:56 +0000 Subject: [PATCH 2/7] Added gunsafe def to entitlement type in both ghc.yaml and relevant pkg/models file. Added if statement for gunsafe in order_updater.go --- pkg/gen/ghcapi/embedded_spec.go | 8 ++++++++ pkg/gen/ghcmessages/entitlements.go | 4 ++++ pkg/models/ghc_entitlements.go | 1 + pkg/services/order/order_updater.go | 8 ++++++++ swagger-def/ghc.yaml | 3 +++ swagger/admin.yaml | 4 ++-- swagger/ghc.yaml | 3 +++ 7 files changed, 29 insertions(+), 2 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 1d336ca4411..4854ee15c1e 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -5740,6 +5740,10 @@ func init() { "eTag": { "type": "string" }, + "gunSafe": { + "type": "boolean", + "example": true + }, "id": { "type": "string", "format": "uuid", @@ -17619,6 +17623,10 @@ func init() { "eTag": { "type": "string" }, + "gunSafe": { + "type": "boolean", + "example": true + }, "id": { "type": "string", "format": "uuid", diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index 2c0f5d3f0b5..e66e7c6e4a7 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -30,6 +30,10 @@ type Entitlements struct { // e tag ETag string `json:"eTag,omitempty"` + // gun safe + // Example: true + GunSafe bool `json:"gunSafe,omitempty"` + // id // Example: 571008b1-b0de-454d-b843-d71be9f02c04 // Format: uuid diff --git a/pkg/models/ghc_entitlements.go b/pkg/models/ghc_entitlements.go index 337e94776af..86e1f9d3c18 100644 --- a/pkg/models/ghc_entitlements.go +++ b/pkg/models/ghc_entitlements.go @@ -22,6 +22,7 @@ type Entitlement struct { DBAuthorizedWeight *int `db:"authorized_weight"` WeightAllotted *WeightAllotment `db:"-"` StorageInTransit *int `db:"storage_in_transit"` + GunSafe bool `db:"gun_safe"` RequiredMedicalEquipmentWeight int `db:"required_medical_equipment_weight"` OrganizationalClothingAndIndividualEquipment bool `db:"organizational_clothing_and_individual_equipment"` ProGearWeight int `db:"pro_gear_weight"` diff --git a/pkg/services/order/order_updater.go b/pkg/services/order/order_updater.go index 8f42fec6ca0..9c7ed24badf 100644 --- a/pkg/services/order/order_updater.go +++ b/pkg/services/order/order_updater.go @@ -426,6 +426,10 @@ func allowanceFromTOOPayload(existingOrder models.Order, payload ghcmessages.Upd order.Entitlement.StorageInTransit = &newSITAllowance } + if payload.GunSafe != nil { + order.Entitlement.GunSafe = *payload.GunSafe + } + return order } @@ -478,6 +482,10 @@ func allowanceFromCounselingPayload(existingOrder models.Order, payload ghcmessa order.Entitlement.StorageInTransit = &newSITAllowance } + if payload.GunSafe != nil { + order.Entitlement.GunSafe = *payload.GunSafe + } + return order } diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index b6504cb244e..ea25f8d2506 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3465,6 +3465,9 @@ definitions: organizationalClothingAndIndividualEquipment: example: true type: boolean + gunSafe: + example: true + type: boolean eTag: type: string type: object diff --git a/swagger/admin.yaml b/swagger/admin.yaml index 1fde4e3bd88..80482a64a92 100644 --- a/swagger/admin.yaml +++ b/swagger/admin.yaml @@ -59,7 +59,7 @@ tags: description: Information about uploads externalDocs: url: https://transcom.github.io/mymove-docs/docs/api - - name: Requested office users + - name: Requested Office Users description: Information about requested office users externalDocs: url: https://transcom.github.io/mymove-docs/docs/api @@ -1210,7 +1210,7 @@ paths: produces: - application/json summary: Get a Requested Office User - description: Retrieving a single requested office user in any status that will be used in the requested users UI for admins to view data at a glance + description: Retrieving a single office user in any status operationId: getRequestedOfficeUser tags: - Requested office users diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index afbd7ac2806..ebae20be3eb 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3593,6 +3593,9 @@ definitions: organizationalClothingAndIndividualEquipment: example: true type: boolean + gunSafe: + example: true + type: boolean eTag: type: string type: object From ef330741eae678374e1d94641cc848d8d4876dff Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 4 Apr 2024 18:21:25 +0000 Subject: [PATCH 3/7] Added GunSafe bool to payload function in model_to_payload.go --- pkg/handlers/ghcapi/internal/payloads/model_to_payload.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 55eb9c0b2cd..6f014fff7ba 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -574,6 +574,7 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { totalDependents = int64(*entitlement.TotalDependents) } requiredMedicalEquipmentWeight := int64(entitlement.RequiredMedicalEquipmentWeight) + gunSafe := entitlement.GunSafe return &ghcmessages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, @@ -587,7 +588,8 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { TotalWeight: totalWeight, RequiredMedicalEquipmentWeight: requiredMedicalEquipmentWeight, OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + GunSafe: gunSafe, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } From 808e25fffa2a80fdc1cea9610b80ece2a01d4002 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 15 Apr 2024 17:17:14 +0000 Subject: [PATCH 4/7] Edited backend to allow Prime to get gun safe status, set column in DB to NOT NULL and added migration file. --- migrations/app/migrations_manifest.txt | 1 + ...412201837_edit_gun_safe_entitlement_not_null.up.sql | 5 +++++ pkg/gen/ghcapi/embedded_spec.go | 4 ++-- pkg/gen/ghcmessages/entitlements.go | 2 +- pkg/gen/primeapi/embedded_spec.go | 8 ++++++++ pkg/gen/primemessages/entitlements.go | 4 ++++ pkg/gen/primev2api/embedded_spec.go | 8 ++++++++ pkg/gen/primev2messages/entitlements.go | 4 ++++ pkg/gen/supportapi/embedded_spec.go | 8 ++++++++ pkg/gen/supportmessages/entitlement.go | 4 ++++ pkg/handlers/primeapi/payloads/model_to_payload.go | 1 + pkg/handlers/primeapiv2/payloads/model_to_payload.go | 1 + swagger-def/definitions/prime/Entitlements.yaml | 3 +++ swagger-def/ghc.yaml | 6 +++--- swagger-def/support.yaml | 3 +++ swagger/admin.yaml | 10 ++-------- swagger/ghc.yaml | 6 +++--- swagger/prime.yaml | 3 +++ swagger/prime_v2.yaml | 3 +++ swagger/support.yaml | 3 +++ 20 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 migrations/app/schema/20240412201837_edit_gun_safe_entitlement_not_null.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 71507acab8f..7762bcf9327 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -918,3 +918,4 @@ 20240327210353_add_cac_verified_to_service_members_table.up.sql 20240402155228_updateLongBeachGbloc.up.sql 20240404152441_add_gun_safe_to_entitlements.up.sql +20240412201837_edit_gun_safe_entitlement_not_null.up.sql diff --git a/migrations/app/schema/20240412201837_edit_gun_safe_entitlement_not_null.up.sql b/migrations/app/schema/20240412201837_edit_gun_safe_entitlement_not_null.up.sql new file mode 100644 index 00000000000..fe9748b2ee6 --- /dev/null +++ b/migrations/app/schema/20240412201837_edit_gun_safe_entitlement_not_null.up.sql @@ -0,0 +1,5 @@ +-- COALESCE makes sure that any currently NULL gun_safe values are converted to false before setting to NOT NULL. +ALTER TABLE entitlements +ALTER COLUMN gun_safe TYPE boolean USING (COALESCE(gun_safe, false)), +ALTER COLUMN gun_safe SET DEFAULT false, +ALTER COLUMN gun_safe SET NOT NULL; diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index f536144368c..a8bc17eaa6a 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -6004,7 +6004,7 @@ func init() { }, "gunSafe": { "type": "boolean", - "example": true + "example": false }, "id": { "type": "string", @@ -18200,7 +18200,7 @@ func init() { }, "gunSafe": { "type": "boolean", - "example": true + "example": false }, "id": { "type": "string", diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index e66e7c6e4a7..371451ad198 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -31,7 +31,7 @@ type Entitlements struct { ETag string `json:"eTag,omitempty"` // gun safe - // Example: true + // Example: false GunSafe bool `json:"gunSafe,omitempty"` // id diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index 0653079b3a3..bedcf4df1fa 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1995,6 +1995,10 @@ func init() { "type": "string", "readOnly": true }, + "gunSafe": { + "type": "boolean", + "example": false + }, "id": { "type": "string", "format": "uuid", @@ -7107,6 +7111,10 @@ func init() { "type": "string", "readOnly": true }, + "gunSafe": { + "type": "boolean", + "example": false + }, "id": { "type": "string", "format": "uuid", diff --git a/pkg/gen/primemessages/entitlements.go b/pkg/gen/primemessages/entitlements.go index f291a7842ee..7c498cd20a0 100644 --- a/pkg/gen/primemessages/entitlements.go +++ b/pkg/gen/primemessages/entitlements.go @@ -31,6 +31,10 @@ type Entitlements struct { // Read Only: true ETag string `json:"eTag,omitempty"` + // gun safe + // Example: false + GunSafe bool `json:"gunSafe,omitempty"` + // id // Example: 571008b1-b0de-454d-b843-d71be9f02c04 // Format: uuid diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index b957f3a403a..f68ac01500d 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -862,6 +862,10 @@ func init() { "type": "string", "readOnly": true }, + "gunSafe": { + "type": "boolean", + "example": false + }, "id": { "type": "string", "format": "uuid", @@ -4336,6 +4340,10 @@ func init() { "type": "string", "readOnly": true }, + "gunSafe": { + "type": "boolean", + "example": false + }, "id": { "type": "string", "format": "uuid", diff --git a/pkg/gen/primev2messages/entitlements.go b/pkg/gen/primev2messages/entitlements.go index d16cf31733a..f4390a92a35 100644 --- a/pkg/gen/primev2messages/entitlements.go +++ b/pkg/gen/primev2messages/entitlements.go @@ -31,6 +31,10 @@ type Entitlements struct { // Read Only: true ETag string `json:"eTag,omitempty"` + // gun safe + // Example: false + GunSafe bool `json:"gunSafe,omitempty"` + // id // Example: 571008b1-b0de-454d-b843-d71be9f02c04 // Format: uuid diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 2ad643c9e36..4f6235128e3 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1111,6 +1111,10 @@ func init() { "type": "string", "readOnly": true }, + "gunSafe": { + "type": "boolean", + "example": false + }, "id": { "type": "string", "format": "uuid", @@ -3908,6 +3912,10 @@ func init() { "type": "string", "readOnly": true }, + "gunSafe": { + "type": "boolean", + "example": false + }, "id": { "type": "string", "format": "uuid", diff --git a/pkg/gen/supportmessages/entitlement.go b/pkg/gen/supportmessages/entitlement.go index 0f3ce158808..ead88e4d83f 100644 --- a/pkg/gen/supportmessages/entitlement.go +++ b/pkg/gen/supportmessages/entitlement.go @@ -31,6 +31,10 @@ type Entitlement struct { // Read Only: true ETag string `json:"eTag,omitempty"` + // gun safe + // Example: false + GunSafe bool `json:"gunSafe,omitempty"` + // id // Example: 571008b1-b0de-454d-b843-d71be9f02c04 // Format: uuid diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index 62986b84ee2..dc04f44f41f 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -179,6 +179,7 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, DependentsAuthorized: entitlement.DependentsAuthorized, + GunSafe: entitlement.GunSafe, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index bd0f0bedcc9..9f045c39d73 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -147,6 +147,7 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, DependentsAuthorized: entitlement.DependentsAuthorized, + GunSafe: entitlement.GunSafe, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/swagger-def/definitions/prime/Entitlements.yaml b/swagger-def/definitions/prime/Entitlements.yaml index 95696e99866..3f5bc398d06 100644 --- a/swagger-def/definitions/prime/Entitlements.yaml +++ b/swagger-def/definitions/prime/Entitlements.yaml @@ -13,6 +13,9 @@ properties: example: true type: boolean x-nullable: true + gunSafe: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index a5fbbcde821..23ae76e9efd 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3616,6 +3616,9 @@ definitions: example: true type: boolean x-nullable: true + gunSafe: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean @@ -3650,9 +3653,6 @@ definitions: organizationalClothingAndIndividualEquipment: example: true type: boolean - gunSafe: - example: true - type: boolean eTag: type: string type: object diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index f39caa7d702..28a7444c758 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -858,6 +858,9 @@ definitions: example: true type: boolean x-nullable: true + gunSafe: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/admin.yaml b/swagger/admin.yaml index a3bfcf914c2..7807577ac2b 100644 --- a/swagger/admin.yaml +++ b/swagger/admin.yaml @@ -43,10 +43,6 @@ tags: description: Information about notifications externalDocs: url: https://transcom.github.io/mymove-docs/docs/api - - name: Requested office users - description: Information about Requested Office UI users - externalDocs: - url: https://transcom.github.io/mymove-docs/docs/api - name: Transportation offices description: Information about transportation offices externalDocs: @@ -1256,7 +1252,7 @@ paths: produces: - application/json summary: Get a Requested Office User - description: Retrieving a single office user in any status. This endpoint is used in the Admin UI that will allow the admin user to view the user's relevant data. + description: Retrieving a single office user in any status operationId: getRequestedOfficeUser tags: - Requested office users @@ -1282,10 +1278,8 @@ paths: patch: produces: - application/json - consumes: - - application/json summary: Update a Requested Office User - description: Updates a requested office user to include profile data and status. This will be used in the Admin UI for approving/rejecting/updating a user. + description: Updates a requested office user to include profile data and status operationId: updateRequestedOfficeUser tags: - Requested office users diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index d8ca3a1910f..985b4fb936f 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3749,6 +3749,9 @@ definitions: example: true type: boolean x-nullable: true + gunSafe: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean @@ -3783,9 +3786,6 @@ definitions: organizationalClothingAndIndividualEquipment: example: true type: boolean - gunSafe: - example: true - type: boolean eTag: type: string type: object diff --git a/swagger/prime.yaml b/swagger/prime.yaml index b5086c40b27..a3e61a781b0 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -3101,6 +3101,9 @@ definitions: example: true type: boolean x-nullable: true + gunSafe: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index a36d5e1e487..475537f7452 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1484,6 +1484,9 @@ definitions: example: true type: boolean x-nullable: true + gunSafe: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/support.yaml b/swagger/support.yaml index ead961341fa..468da25ad51 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -931,6 +931,9 @@ definitions: example: true type: boolean x-nullable: true + gunSafe: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean From a53c5aa3cc5c6e8611580c0a6166ec3cced1ef24 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Tue, 23 Apr 2024 17:46:26 +0000 Subject: [PATCH 5/7] Fix generated code error. --- swagger/admin.yaml | 54 +++++++++--- swagger/ghc.yaml | 200 +++++++++++++++++++++++++++++++++++++++++- swagger/prime.yaml | 7 ++ swagger/prime_v2.yaml | 7 ++ swagger/support.yaml | 7 ++ 5 files changed, 259 insertions(+), 16 deletions(-) diff --git a/swagger/admin.yaml b/swagger/admin.yaml index 7807577ac2b..55dca6c2b03 100644 --- a/swagger/admin.yaml +++ b/swagger/admin.yaml @@ -1,23 +1,21 @@ -schemes: - - https swagger: '2.0' -host: admin.move.mil info: + contact: + email: milmove-developers@caci.com description: > The Admin API is a RESTful API that enables the Admin application for MilMove. All endpoints are located under `/admin/v1`. - version: 1.0.0 - title: MilMove Admin API license: name: MIT - url: https://github.com/transcom/mymove/blob/main/LICENSE.md - contact: - name: MilMove AppEng - email: support@movemil.pagerduty.com + url: https://opensource.org/licenses/MIT + title: MilMove Admin API + version: 1.0.0 basePath: /admin/v1 +schemes: + - https consumes: - application/json produces: @@ -72,6 +70,21 @@ tags: externalDocs: url: https://transcom.github.io/mymove-docs/docs/api definitions: + OktaAccountInfoResponse: + type: object + properties: + id: + type: string + status: + type: string + activated: + type: string + created: + type: string + profile: + type: object + credentials: + type: object Address: type: object properties: @@ -212,6 +225,11 @@ definitions: x-nullable: true example: USA default: USA + county: + type: string + title: County + x-nullable: true + example: LOS ANGELES required: - streetAddress1 - state @@ -855,6 +873,9 @@ definitions: type: string title: Last Name x-nullable: true + email: + type: string + example: user@userdomain.com telephone: type: string format: telephone @@ -1213,7 +1234,7 @@ paths: as it is meant to be used with the Admin UI exclusively. operationId: indexRequestedOfficeUsers tags: - - Requested office users + - Requested Office Users parameters: - in: query name: filter @@ -1252,10 +1273,13 @@ paths: produces: - application/json summary: Get a Requested Office User - description: Retrieving a single office user in any status + description: >- + Retrieving a single office user in any status. This endpoint is used in + the Admin UI that will allow the admin user to view the user's relevant + data. operationId: getRequestedOfficeUser tags: - - Requested office users + - Requested Office Users parameters: - in: path name: officeUserId @@ -1279,10 +1303,12 @@ paths: produces: - application/json summary: Update a Requested Office User - description: Updates a requested office user to include profile data and status + description: >- + Updates a requested office user to include profile data and status. This + will be used in the Admin UI for approving/rejecting/updating a user. operationId: updateRequestedOfficeUser tags: - - Requested office users + - Requested Office Users parameters: - in: path name: officeUserId diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 985b4fb936f..4d1ed9944ff 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -38,6 +38,8 @@ tags: - name: ppm - name: tac - name: transportationOffice + - name: uploads + - name: paymentRequests paths: /customer: post: @@ -336,6 +338,40 @@ paths: $ref: '#/responses/UnprocessableEntity' '500': $ref: '#/responses/ServerError' + /orders: + post: + summary: Creates an orders model for a logged-in user + description: >- + Creates an instance of orders tied to a service member, which allow for + creation of a move and an entitlement. Orders are required before the + creation of a move + operationId: createOrder + tags: + - order + consumes: + - application/json + produces: + - application/json + parameters: + - in: body + name: createOrders + schema: + $ref: '#/definitions/CreateOrders' + responses: + '200': + description: created instance of orders + schema: + $ref: '#/definitions/Order' + '400': + description: invalid request + '401': + description: request requires user authentication + '403': + description: user is not authorized + '422': + $ref: '#/responses/UnprocessableEntity' + '500': + description: internal server error /orders/{orderID}: parameters: - description: ID of order to use @@ -3106,6 +3142,7 @@ paths: - in: query name: orderType type: string + description: order type responses: '200': description: >- @@ -3468,6 +3505,81 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' + /open/transportation-offices: + get: + produces: + - application/json + summary: Returns the transportation offices matching the search query + description: >- + This endpoint is publicly accessible as it is utilized to access + transportation office information without having an office + account.Returns the transportation offices matching the search query. + operationId: getTransportationOfficesOpen + tags: + - transportationOffice + parameters: + - in: query + name: search + type: string + required: true + minLength: 2 + description: Search string for transportation offices + responses: + '200': + description: Successfully retrieved transportation offices + schema: + $ref: '#/definitions/TransportationOffices' + '400': + $ref: '#/responses/InvalidRequest' + '401': + $ref: '#/responses/PermissionDenied' + '403': + $ref: '#/responses/PermissionDenied' + '404': + $ref: '#/responses/NotFound' + '500': + $ref: '#/responses/ServerError' + /uploads: + post: + summary: Create a new upload + description: >- + Uploads represent a single digital file, such as a JPEG or PDF. + Currently, office application uploads are only for Services Counselors + to upload files for orders, but this may be expanded in the future. + operationId: createUpload + tags: + - uploads + consumes: + - multipart/form-data + produces: + - application/json + parameters: + - in: query + name: documentId + type: string + format: uuid + required: false + description: UUID of the document to add an upload to + - in: formData + name: file + type: file + description: The file to upload. + required: true + responses: + '201': + description: created upload + schema: + $ref: '#/definitions/Upload' + '400': + description: invalid request + '403': + description: not authorized + '404': + description: not found + '413': + description: payload is too large + '500': + description: server error definitions: ClientError: type: object @@ -3575,7 +3687,7 @@ definitions: secondaryTelephone: type: string format: telephone - pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + pattern: ^[2-9]\d{2}-\d{3}-\d{4}$|^$ x-nullable: true backupAddress: $ref: '#/definitions/Address' @@ -3677,7 +3789,7 @@ definitions: secondaryTelephone: type: string format: telephone - pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + pattern: ^[2-9]\d{2}-\d{3}-\d{4}$|^$ x-nullable: true backupAddress: allOf: @@ -3958,6 +4070,8 @@ definitions: format: date-time eTag: type: string + shipmentGBLOC: + $ref: '#/definitions/GBLOC' MoveHistory: properties: id: @@ -4279,6 +4393,76 @@ definitions: eTag: type: string type: object + OrderBody: + type: object + properties: + id: + type: string + format: uuid + CreateOrders: + type: object + properties: + serviceMemberId: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + issueDate: + type: string + description: The date and time that these orders were cut. + format: date + title: Orders date + reportByDate: + type: string + description: Report By Date + format: date + title: Report-by date + ordersType: + $ref: '#/definitions/OrdersType' + ordersTypeDetail: + $ref: '#/definitions/OrdersTypeDetail' + hasDependents: + type: boolean + title: Are dependents included in your orders? + spouseHasProGear: + type: boolean + title: >- + Do you have a spouse who will need to move items related to their + occupation (also known as spouse pro-gear)? + newDutyLocationId: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + ordersNumber: + type: string + title: Orders Number + x-nullable: true + example: 030-00362 + tac: + type: string + title: TAC + example: F8J1 + x-nullable: true + sac: + type: string + title: SAC + example: N002214CSW32Y9 + x-nullable: true + departmentIndicator: + $ref: '#/definitions/DeptIndicator' + grade: + $ref: '#/definitions/Grade' + originDutyLocationId: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + required: + - serviceMemberId + - issueDate + - reportByDate + - ordersType + - hasDependents + - spouseHasProGear + - newDutyLocationId CounselingUpdateOrderPayload: type: object properties: @@ -6055,6 +6239,11 @@ definitions: x-nullable: true example: USA default: USA + county: + type: string + title: County + x-nullable: true + example: LOS ANGELES required: - streetAddress1 - city @@ -6086,12 +6275,14 @@ definitions: - LOCAL_MOVE - RETIREMENT - SEPARATION + - WOUNDED_WARRIOR - BLUEBARK x-display-value: PERMANENT_CHANGE_OF_STATION: Permanent Change Of Station LOCAL_MOVE: Local Move RETIREMENT: Retirement SEPARATION: Separation + WOUNDED_WARRIOR: Wounded Warrior BLUEBARK: BLUEBARK TransportationOffice: type: object @@ -7825,6 +8016,11 @@ definitions: $ref: '#/definitions/PPMShipment' deliveryAddressUpdate: $ref: '#/definitions/ShipmentAddressUpdate' + shipmentLocator: + type: string + x-nullable: true + readOnly: true + example: 1K43AR-01 LOATypeNullable: description: The Line of accounting (TAC/SAC) type that will be used for the shipment type: string diff --git a/swagger/prime.yaml b/swagger/prime.yaml index a3e61a781b0..782cd87202d 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -3045,6 +3045,11 @@ definitions: x-nullable: true example: USA default: USA + county: + type: string + title: County + x-nullable: true + example: LOS ANGELES required: - streetAddress1 - city @@ -3167,12 +3172,14 @@ definitions: - LOCAL_MOVE - RETIREMENT - SEPARATION + - WOUNDED_WARRIOR - BLUEBARK x-display-value: PERMANENT_CHANGE_OF_STATION: Permanent Change Of Station LOCAL_MOVE: Local Move RETIREMENT: Retirement SEPARATION: Separation + WOUNDED_WARRIOR: Wounded Warrior BLUEBARK: BLUEBARK Order: type: object diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index 475537f7452..3b94464953c 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1428,6 +1428,11 @@ definitions: x-nullable: true example: USA default: USA + county: + type: string + title: County + x-nullable: true + example: LOS ANGELES required: - streetAddress1 - city @@ -1550,12 +1555,14 @@ definitions: - LOCAL_MOVE - RETIREMENT - SEPARATION + - WOUNDED_WARRIOR - BLUEBARK x-display-value: PERMANENT_CHANGE_OF_STATION: Permanent Change Of Station LOCAL_MOVE: Local Move RETIREMENT: Retirement SEPARATION: Separation + WOUNDED_WARRIOR: Wounded Warrior BLUEBARK: BLUEBARK Order: type: object diff --git a/swagger/support.yaml b/swagger/support.yaml index 468da25ad51..c281fddc312 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -804,6 +804,11 @@ definitions: x-nullable: true example: USA default: USA + county: + type: string + title: County + x-nullable: true + example: LOS ANGELES required: - streetAddress1 - city @@ -1700,6 +1705,7 @@ definitions: - SEPARATION - GHC - NTS + - WOUNDED_WARRIOR - BLUEBARK x-display-value: PERMANENT_CHANGE_OF_STATION: Permanent Change Of Station (PCS) @@ -1708,6 +1714,7 @@ definitions: SEPARATION: Separation GHC: GHC NTS: NTS + WOUNDED_WARRIOR: Wounded Warrior BLUEBARK: BLUEBARK OrdersTypeDetail: type: string From 200690c307b0f3e10eefedf7a839aa0af4b27828 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Tue, 23 Apr 2024 18:02:41 +0000 Subject: [PATCH 6/7] More gen fixes --- pkg/gen/ghcapi/embedded_spec.go | 552 +++++++++++++++++++++++++++- pkg/gen/primeapi/embedded_spec.go | 20 +- pkg/gen/primev2api/embedded_spec.go | 20 +- pkg/gen/supportapi/embedded_spec.go | 20 +- 4 files changed, 600 insertions(+), 12 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index a8bc17eaa6a..b177a072e98 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -2215,6 +2215,100 @@ func init() { } } }, + "/open/transportation-offices": { + "get": { + "description": "This endpoint is publicly accessible as it is utilized to access transportation office information without having an office account.Returns the transportation offices matching the search query.", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns the transportation offices matching the search query", + "operationId": "getTransportationOfficesOpen", + "parameters": [ + { + "minLength": 2, + "type": "string", + "description": "Search string for transportation offices", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/TransportationOffices" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/orders": { + "post": { + "description": "Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Creates an orders model for a logged-in user", + "operationId": "createOrder", + "parameters": [ + { + "name": "createOrders", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateOrders" + } + } + ], + "responses": { + "200": { + "description": "created instance of orders", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "description": "internal server error" + } + } + } + }, "/orders/{orderID}": { "get": { "description": "Gets an order", @@ -3715,6 +3809,7 @@ func init() { }, { "type": "string", + "description": "order type", "name": "orderType", "in": "query" } @@ -4875,6 +4970,61 @@ func init() { } } } + }, + "/uploads": { + "post": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "uploads" + ], + "summary": "Create a new upload", + "operationId": "createUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to add an upload to", + "name": "documentId", + "in": "query" + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } } }, "definitions": { @@ -4900,6 +5050,12 @@ func init() { "x-nullable": true, "example": "USA" }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, "eTag": { "type": "string", "readOnly": true @@ -5555,6 +5711,85 @@ func init() { } } }, + "CreateOrders": { + "type": "object", + "required": [ + "serviceMemberId", + "issueDate", + "reportByDate", + "ordersType", + "hasDependents", + "spouseHasProGear", + "newDutyLocationId" + ], + "properties": { + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "hasDependents": { + "type": "boolean", + "title": "Are dependents included in your orders?" + }, + "issueDate": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date" + }, + "newDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reportByDate": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "serviceMemberId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "spouseHasProGear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + } + } + }, "CreatePPMShipment": { "description": "A personally procured move is a type of shipment that a service members moves themselves.", "required": [ @@ -5788,7 +6023,7 @@ func init() { "secondaryTelephone": { "type": "string", "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", "x-nullable": true }, "suffix": { @@ -7107,6 +7342,12 @@ func init() { "type": "string", "x-nullable": true }, + "shipmentLocator": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "1K43AR-01" + }, "shipmentType": { "$ref": "#/definitions/MTOShipmentType" }, @@ -7281,6 +7522,9 @@ func init() { "format": "date-time", "x-nullable": true }, + "shipmentGBLOC": { + "$ref": "#/definitions/GBLOC" + }, "status": { "$ref": "#/definitions/MoveStatus" }, @@ -7909,6 +8153,15 @@ func init() { } } }, + "OrderBody": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + } + }, "OrdersType": { "type": "string", "title": "Orders type", @@ -7917,6 +8170,7 @@ func init() { "LOCAL_MOVE", "RETIREMENT", "SEPARATION", + "WOUNDED_WARRIOR", "BLUEBARK" ], "x-display-value": { @@ -7924,7 +8178,8 @@ func init() { "LOCAL_MOVE": "Local Move", "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", "RETIREMENT": "Retirement", - "SEPARATION": "Separation" + "SEPARATION": "Separation", + "WOUNDED_WARRIOR": "Wounded Warrior" } }, "OrdersTypeDetail": { @@ -10025,7 +10280,7 @@ func init() { "secondaryTelephone": { "type": "string", "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", "x-nullable": true }, "suffix": { @@ -10900,6 +11155,12 @@ func init() { }, { "name": "transportationOffice" + }, + { + "name": "uploads" + }, + { + "name": "paymentRequests" } ] }`)) @@ -13713,6 +13974,118 @@ func init() { } } }, + "/open/transportation-offices": { + "get": { + "description": "This endpoint is publicly accessible as it is utilized to access transportation office information without having an office account.Returns the transportation offices matching the search query.", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns the transportation offices matching the search query", + "operationId": "getTransportationOfficesOpen", + "parameters": [ + { + "minLength": 2, + "type": "string", + "description": "Search string for transportation offices", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/TransportationOffices" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/orders": { + "post": { + "description": "Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Creates an orders model for a logged-in user", + "operationId": "createOrder", + "parameters": [ + { + "name": "createOrders", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateOrders" + } + } + ], + "responses": { + "200": { + "description": "created instance of orders", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, "/orders/{orderID}": { "get": { "description": "Gets an order", @@ -15580,6 +15953,7 @@ func init() { }, { "type": "string", + "description": "order type", "name": "orderType", "in": "query" } @@ -17067,6 +17441,61 @@ func init() { } } } + }, + "/uploads": { + "post": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "uploads" + ], + "summary": "Create a new upload", + "operationId": "createUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to add an upload to", + "name": "documentId", + "in": "query" + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } } }, "definitions": { @@ -17092,6 +17521,12 @@ func init() { "x-nullable": true, "example": "USA" }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, "eTag": { "type": "string", "readOnly": true @@ -17751,6 +18186,85 @@ func init() { } } }, + "CreateOrders": { + "type": "object", + "required": [ + "serviceMemberId", + "issueDate", + "reportByDate", + "ordersType", + "hasDependents", + "spouseHasProGear", + "newDutyLocationId" + ], + "properties": { + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "hasDependents": { + "type": "boolean", + "title": "Are dependents included in your orders?" + }, + "issueDate": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date" + }, + "newDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reportByDate": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "serviceMemberId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "spouseHasProGear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + } + } + }, "CreatePPMShipment": { "description": "A personally procured move is a type of shipment that a service members moves themselves.", "required": [ @@ -17984,7 +18498,7 @@ func init() { "secondaryTelephone": { "type": "string", "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", "x-nullable": true }, "suffix": { @@ -19303,6 +19817,12 @@ func init() { "type": "string", "x-nullable": true }, + "shipmentLocator": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "1K43AR-01" + }, "shipmentType": { "$ref": "#/definitions/MTOShipmentType" }, @@ -19477,6 +19997,9 @@ func init() { "format": "date-time", "x-nullable": true }, + "shipmentGBLOC": { + "$ref": "#/definitions/GBLOC" + }, "status": { "$ref": "#/definitions/MoveStatus" }, @@ -20105,6 +20628,15 @@ func init() { } } }, + "OrderBody": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + } + }, "OrdersType": { "type": "string", "title": "Orders type", @@ -20113,6 +20645,7 @@ func init() { "LOCAL_MOVE", "RETIREMENT", "SEPARATION", + "WOUNDED_WARRIOR", "BLUEBARK" ], "x-display-value": { @@ -20120,7 +20653,8 @@ func init() { "LOCAL_MOVE": "Local Move", "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", "RETIREMENT": "Retirement", - "SEPARATION": "Separation" + "SEPARATION": "Separation", + "WOUNDED_WARRIOR": "Wounded Warrior" } }, "OrdersTypeDetail": { @@ -22279,7 +22813,7 @@ func init() { "secondaryTelephone": { "type": "string", "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", "x-nullable": true }, "suffix": { @@ -23166,6 +23700,12 @@ func init() { }, { "name": "transportationOffice" + }, + { + "name": "uploads" + }, + { + "name": "paymentRequests" } ] }`)) diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index bedcf4df1fa..00bcd8e80be 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1463,6 +1463,12 @@ func init() { "x-nullable": true, "example": "USA" }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, "eTag": { "type": "string", "readOnly": true @@ -3089,6 +3095,7 @@ func init() { "LOCAL_MOVE", "RETIREMENT", "SEPARATION", + "WOUNDED_WARRIOR", "BLUEBARK" ], "x-display-value": { @@ -3096,7 +3103,8 @@ func init() { "LOCAL_MOVE": "Local Move", "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", "RETIREMENT": "Retirement", - "SEPARATION": "Separation" + "SEPARATION": "Separation", + "WOUNDED_WARRIOR": "Wounded Warrior" } }, "PPMShipment": { @@ -6579,6 +6587,12 @@ func init() { "x-nullable": true, "example": "USA" }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, "eTag": { "type": "string", "readOnly": true @@ -8205,6 +8219,7 @@ func init() { "LOCAL_MOVE", "RETIREMENT", "SEPARATION", + "WOUNDED_WARRIOR", "BLUEBARK" ], "x-display-value": { @@ -8212,7 +8227,8 @@ func init() { "LOCAL_MOVE": "Local Move", "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", "RETIREMENT": "Retirement", - "SEPARATION": "Separation" + "SEPARATION": "Separation", + "WOUNDED_WARRIOR": "Wounded Warrior" } }, "PPMShipment": { diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index f68ac01500d..32f32526a63 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -353,6 +353,12 @@ func init() { "x-nullable": true, "example": "USA" }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, "eTag": { "type": "string", "readOnly": true @@ -1880,6 +1886,7 @@ func init() { "LOCAL_MOVE", "RETIREMENT", "SEPARATION", + "WOUNDED_WARRIOR", "BLUEBARK" ], "x-display-value": { @@ -1887,7 +1894,8 @@ func init() { "LOCAL_MOVE": "Local Move", "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", "RETIREMENT": "Retirement", - "SEPARATION": "Separation" + "SEPARATION": "Separation", + "WOUNDED_WARRIOR": "Wounded Warrior" } }, "PPMShipment": { @@ -3831,6 +3839,12 @@ func init() { "x-nullable": true, "example": "USA" }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, "eTag": { "type": "string", "readOnly": true @@ -5358,6 +5372,7 @@ func init() { "LOCAL_MOVE", "RETIREMENT", "SEPARATION", + "WOUNDED_WARRIOR", "BLUEBARK" ], "x-display-value": { @@ -5365,7 +5380,8 @@ func init() { "LOCAL_MOVE": "Local Move", "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", "RETIREMENT": "Retirement", - "SEPARATION": "Separation" + "SEPARATION": "Separation", + "WOUNDED_WARRIOR": "Wounded Warrior" } }, "PPMShipment": { diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 4f6235128e3..cbd38050953 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -807,6 +807,12 @@ func init() { "x-nullable": true, "example": "USA" }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, "eTag": { "type": "string", "readOnly": true @@ -2016,6 +2022,7 @@ func init() { "SEPARATION", "GHC", "NTS", + "WOUNDED_WARRIOR", "BLUEBARK" ], "x-display-value": { @@ -2025,7 +2032,8 @@ func init() { "NTS": "NTS", "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station (PCS)", "RETIREMENT": "Retirement", - "SEPARATION": "Separation" + "SEPARATION": "Separation", + "WOUNDED_WARRIOR": "Wounded Warrior" } }, "OrdersTypeDetail": { @@ -3608,6 +3616,12 @@ func init() { "x-nullable": true, "example": "USA" }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, "eTag": { "type": "string", "readOnly": true @@ -4817,6 +4831,7 @@ func init() { "SEPARATION", "GHC", "NTS", + "WOUNDED_WARRIOR", "BLUEBARK" ], "x-display-value": { @@ -4826,7 +4841,8 @@ func init() { "NTS": "NTS", "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station (PCS)", "RETIREMENT": "Retirement", - "SEPARATION": "Separation" + "SEPARATION": "Separation", + "WOUNDED_WARRIOR": "Wounded Warrior" } }, "OrdersTypeDetail": { From 8921e5ffbe28fbef32008a835e81cee973b567eb Mon Sep 17 00:00:00 2001 From: brooklyn-welsh Date: Fri, 10 May 2024 09:55:38 -0400 Subject: [PATCH 7/7] Updated generated code --- pkg/gen/primev3api/embedded_spec.go | 8 ++++++++ pkg/gen/primev3messages/entitlements.go | 4 ++++ swagger/prime_v3.yaml | 3 +++ 3 files changed, 15 insertions(+) diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index 3b3a281dfce..7a42de8d8b0 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -871,6 +871,10 @@ func init() { "type": "string", "readOnly": true }, + "gunSafe": { + "type": "boolean", + "example": false + }, "id": { "type": "string", "format": "uuid", @@ -4332,6 +4336,10 @@ func init() { "type": "string", "readOnly": true }, + "gunSafe": { + "type": "boolean", + "example": false + }, "id": { "type": "string", "format": "uuid", diff --git a/pkg/gen/primev3messages/entitlements.go b/pkg/gen/primev3messages/entitlements.go index bcef1357f49..84abf8674a0 100644 --- a/pkg/gen/primev3messages/entitlements.go +++ b/pkg/gen/primev3messages/entitlements.go @@ -31,6 +31,10 @@ type Entitlements struct { // Read Only: true ETag string `json:"eTag,omitempty"` + // gun safe + // Example: false + GunSafe bool `json:"gunSafe,omitempty"` + // id // Example: 571008b1-b0de-454d-b843-d71be9f02c04 // Format: uuid diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index 690093621b8..ddb65523502 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -1462,6 +1462,9 @@ definitions: example: true type: boolean x-nullable: true + gunSafe: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean