Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B-21569-INT 2 #14577

Merged
merged 31 commits into from
Jan 23, 2025
Merged

B-21569-INT 2 #14577

merged 31 commits into from
Jan 23, 2025

Conversation

stevengleason-caci
Copy link
Contributor

@stevengleason-caci stevengleason-caci commented Jan 13, 2025

B-21569 INT Part 2

B-21569

Summary

Fix the order of the service items. I did this by retrieving the sort column and using that in the jsx code.
I also changed "International UB" to "International UB price."

Previous PR: #14491

Verification Steps for the Author

These are to be checked by the author.

  • Have the Agility acceptance criteria been met for this change?

Verification Steps for Reviewers

These are to be checked by a reviewer.

  • Has the branch been pulled in and checked out?
  • Have the BL acceptance criteria been met for this change?
  • Was the CircleCI build successful?
  • Has the code been reviewed from a standards and best practices point of view?

Setup to Run the Code

How to test

  1. Run with feature flags on: FEATURE_FLAG_UNACCOMPANIED_BAGGAGE=true FEATURE_FLAG_ENABLE_ALASKA=true make server_run
  2. Login as a Customer and create an OCONUS-to-CONUS UB shipment
  3. And create an OCONUS-to-OCONUS UB shipment
  4. Log in as a Counselor and complete and approve both shipments
  5. Log in as a TOO and submit the OCONUS-to-CONUS shipment
  6. See the 4 service items in order
    a. International UB price
    b. International POD Fuel Surcharge
    c. International UB pack
    d. International UB unpack
  7. Submit the OCONUS-to-OCONUS shipment
  8. See only 3 service items (no Fuel Surcharge) in order:
    a. International UB price
    b. International UB pack
    c. International UB unpack

Frontend

  • There are no aXe warnings for UI.
  • This works in Supported Browsers and their phone views (Chrome, Firefox, Edge).
  • There are no new console errors in the browser devtools.
  • There are no new console errors in the test output.
  • If this PR adds a new component to Storybook, it ensures the component is fully responsive, OR if it is intentionally not, a wrapping div using the officeApp class or custom min-width styling is used to hide any states the would not be visible to the user.
  • This change meets the standards for Section 508 compliance.

Backend

Database

Any new migrations/schema changes:

  • Follows our guidelines for Zero-Downtime Deploys.
  • Have been communicated to #g-database.
  • Secure migrations have been tested following the instructions in our docs.

Screenshots

CONUS-OCONUS with POE FSC

image
Screenshot 2025-01-16 at 12 07 29 PM

OCONUS-CONUS with POD FSC

image
Screenshot 2025-01-16 at 12 05 58 PM

OCONUS-OCONUS (no FSC)

image
image

Instead of inserting them as we encounter them in the proc,
collect them into a temp table, sort them, and then insert.
@stevengleason-caci stevengleason-caci self-assigned this Jan 13, 2025
@stevengleason-caci stevengleason-caci requested review from a team as code owners January 13, 2025 21:58
Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I like this approach of adjusting the stored proc for a UI ordering issue.

I know we do have the sort value in the re_service_items table that would fix this issue if we can leverage that in the UI. Can you take a look at that approach and passing that sort value to the service item payload that's being used in the MTO tab?

Another option would be to add a variable that we can use to handle sorting based on shipment type and market code.

Feel free to share your thoughts! Not trying to derail your PR, but I do think we can use existing data we have and/or create a UI variable we can use for sorting.

@stevengleason-caci
Copy link
Contributor Author

Not sure if I like this approach of adjusting the stored proc for a UI ordering issue.

I know we do have the sort value in the re_service_items table that would fix this issue if we can leverage that in the UI. Can you take a look at that approach and passing that sort value to the service item payload that's being used in the MTO tab?

I looked at it as if the data being inserted out of order was the underlying issue. I am using the re_service_items.sort value now in the proc, but if that's not ideal I'll look into bringing that into the UI layer.

@danieljordan-caci
Copy link
Contributor

Not sure if I like this approach of adjusting the stored proc for a UI ordering issue.
I know we do have the sort value in the re_service_items table that would fix this issue if we can leverage that in the UI. Can you take a look at that approach and passing that sort value to the service item payload that's being used in the MTO tab?

I looked at it as if the data being inserted out of order was the underlying issue. I am using the re_service_items.sort value now in the proc, but if that's not ideal I'll look into bringing that into the UI layer.

Would you mind looking into bringing that value into the UI as an alternate approach? I would much prefer that - let me know if it gets too wild or something and I'll reconsider! Thank you!

Include the sort field in listMTOServiceItems operation.
Update the sorting logic in ServiceItemsTable.jsx.
Remove my changes to the stored procedure.
Move testing from shipment_approver to the service and UI tests.
@stevengleason-caci
Copy link
Contributor Author

stevengleason-caci commented Jan 16, 2025

. . .

Would you mind looking into bringing that value into the UI as an alternate approach? I would much prefer that - let me know if it gets too wild or something and I'll reconsider! Thank you!

Updated

Edit: Happo is showing some errors with my sort comparison. I'll see what's happening.
Edit2: Updated to handle null sort values, with test.

msaki-caci
msaki-caci previously approved these changes Jan 16, 2025
pkg/models/re_service.go Outdated Show resolved Hide resolved
@stevengleason-caci stevengleason-caci marked this pull request as draft January 21, 2025 19:44
Add logic in model_to_payload to match on ShipmentType and MarketCode.
Update test to use matching shipment info.
@stevengleason-caci stevengleason-caci marked this pull request as ready for review January 22, 2025 14:47
Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Thanks for going with this approach! Just one little test and the rest looks good!

pkg/handlers/ghcapi/internal/payloads/model_to_payload.go Outdated Show resolved Hide resolved
pkg/handlers/ghcapi/internal/payloads/model_to_payload.go Outdated Show resolved Hide resolved
pkg/handlers/ghcapi/mto_service_items.go Outdated Show resolved Hide resolved
pkg/handlers/ghcapi/mto_service_items_test.go Outdated Show resolved Hide resolved
@brianmanley-caci
Copy link
Contributor

Warnings
⚠️
Files located in legacy directories (src/shared or src/scenes) have been edited. Are you sure you don’t want to also relocate them to the new file structure?
View the frontend file org ADR for more information
Generated by 🚫 dangerJS against a946e9c

Do I need to move my code from src/shared/utils.js? I don't think so since there have been other additions there recently.

@stevengleason-caci there is a guide for getting away from these "legacy" directories. Frontend File Layout Guide. I see there is a src/utils directory that may be more appropriate to add a utility function to.

@stevengleason-caci
Copy link
Contributor Author

Warnings
⚠️
Files located in legacy directories (src/shared or src/scenes) have been edited. Are you sure you don’t want to also relocate them to the new file structure?
View the frontend file org ADR for more information
Generated by 🚫 dangerJS against a946e9c

Do I need to move my code from src/shared/utils.js? I don't think so since there have been other additions there recently.

@stevengleason-caci there is a guide for getting away from these "legacy" directories. Frontend File Layout Guide. I see there is a src/utils directory that may be more appropriate to add a utility function to.

The files in src/utils/ all seem pretty specific. Should I make a new one, strings.js or stringUtils.js or something?

@brianmanley-caci
Copy link
Contributor

The files in src/utils/ all seem pretty specific. Should I make a new one, strings.js or stringUtils.js or something?

Sounds good to me.

additional test in model_to_payload_test,
no need to compare to blank strings because those are non-null DB enums,
fix the multiple joins on the MTOServiceItem query,
remove the unneeded UUID generation in mto_service_items_test.
Copy link
Contributor

@msaki-caci msaki-caci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might want to update your main B-21569 branch with the latest from main because I was running your latest changes with a fresh merge from main on my branch (B-21659) and I get a crash when I approve the requested shipment as a TOO.

ERROR ghcapi/mto_shipment.go:531 ghcapi.ApproveShipmentHandler {"git_branch": "MAIN-B-21659_Display_estimated_prices_UB", "git_commit": "3f08f4a4ee05e5d6ac8672256c000b565d868ef2", "host": "officelocal:3000", "milmove_trace_id": "87d79eac-ffe8-4f6a-8292-782605d236d5", "session_id": "ioprjFRnZx9Nk4vnAC3D5VEbWRmpS5BJMQC-Qq6r1lo", "error": "error creating approved service items: pq: Error creating POEFSC service item for shipment 8c948d8b-7c73-49c9-8e68-050e7f36dcbd: Service item already exists for service_id f75758d8-2fcd-40ba-9432-3ff3032a71d1 and shipment_id 8c948d8b-7c73-49c9-8e68-050e7f36dcbd"}

Copy link
Contributor

@brianmanley-caci brianmanley-caci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working well for me. Thanks for all the changes.

Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding that test!

@stevengleason-caci stevengleason-caci merged commit ccdf409 into integrationTesting Jan 23, 2025
34 of 35 checks passed
@stevengleason-caci stevengleason-caci deleted the B-21569-INT branch January 23, 2025 21:56
@stevengleason-caci stevengleason-caci mentioned this pull request Jan 28, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend database frontend Go-Rillaz Go-Rillaz INTEGRATION Slated for Integration Testing
Development

Successfully merging this pull request may close these issues.

4 participants