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-21941 INT - I-13733-I-13739 TOO Queue Destination Requests Filtering Updates #14586

Draft
wants to merge 229 commits into
base: integrationTesting
Choose a base branch
from

Conversation

traskowskycaci
Copy link
Contributor

@traskowskycaci traskowskycaci commented Jan 15, 2025

Agility ticket

First INT PR: https://github.com/transcom/mymove/pull/14465/files

Summary

Overhauled the query using one that Cameron and I had brainstormed on a bit during the first peer review process and I then expanded on here to not over-filter. This query is IMO much, much better. No locator as part of it, no checking for specific cases such as excess weight or SIT extensions, like the original query. This should reduce the issues as well as not require future updates to this query if we want something to appear in the TOO queue, it should just "fall in" like it does now and will only be filtered out if it has destination only requests.

Make moves to test this out, here are the moves I made:

  1. One with only destination address update - should NOT appear in TOO queue and should appear in destination queue
  2. One that has only origin SIT - should appear in TOO queue
  3. One that has only dest SIT - should NOT appear in TOO queue and should appear in destination queue
  4. One that has BOTH origin and dest SIT - should appear in TOO queue and should appear in destination queue
  5. One that has only origin shuttle - should appear in TOO queue
  6. One that has only dest shuttle - should NOT appear in TOO queue and should appear in destination queue
  7. One that has BOTH origin and dest shuttle - should appear in TOO queue and should appear in destination queue
  8. One that has a SIT extension - should appear in TOO queue
  9. One that has excess weight - should appear in TOO queue
  10. One that has excess UB weight - should appear in TOO queue
  11. Test that the moves with excess weight only show up in the expected GBLOC office user TOO queue and not others (relic of the old query that was an issue but should not be now)

Any other moves you can think of, go ahead and test those out as well.

JonSpight and others added 30 commits December 2, 2024 09:28
…im-Shipment-Create' into B-21460-Fix-Prime-Sim-Shipment-Create
@traskowskycaci
Copy link
Contributor Author

Added a commit to cleanup some test comments, rerequesting @TevinAdams's review. What I added:

  • cleanup commit, no change to functionality: cdad4c6
  • merge of main to int: 588caaf

@danieljordan-caci
Copy link
Contributor

Per our convo/huddle in Slack, this will be approved once the query is updated to:

			NOT (
				(
					-- find moves with destination requests (submitted destination re_services codes)
					EXISTS (
						SELECT 1
						FROM mto_service_items msi
						JOIN re_services rs ON msi.re_service_id = rs.id
						WHERE msi.mto_shipment_id = mto_shipments.id
						AND msi.status = 'SUBMITTED'
						AND rs.code IN ('DDFSIT', 'DDASIT', 'DDDSIT', 'DDSHUT', 'DDSFSC', 'IDFSIT', 'IDASIT', 'IDDSIT', 'IDSHUT')
					)
					-- moves with destination requests (destination address update requested)
					OR
					EXISTS (
						SELECT 1
						FROM shipment_address_updates sau
						WHERE sau.shipment_id = mto_shipments.id
						AND sau.status = 'REQUESTED'
					)
				)
				-- find moves with no origin requests
				-- find moves without submitted destination re_services codes
				AND NOT EXISTS (
					SELECT 1
					FROM mto_service_items msi
					JOIN re_services rs ON msi.re_service_id = rs.id
					WHERE msi.mto_shipment_id = mto_shipments.id
					AND msi.status = 'SUBMITTED'
					AND rs.code NOT IN ('DDFSIT', 'DDASIT', 'DDDSIT', 'DDSHUT', 'DDSFSC', 'IDFSIT', 'IDASIT', 'IDDSIT', 'IDSHUT')
				)
				-- find moves without excess weight risk to acknowledge
				AND NOT (
					moves.excess_weight_qualified_at IS NOT NULL 
					AND moves.excess_weight_acknowledged_at IS NULL
				)
				-- find moves without UB excess weight risk to acknowledge
				AND NOT (
					moves.excess_unaccompanied_baggage_weight_qualified_at IS NOT NULL 
					AND moves.excess_unaccompanied_baggage_weight_acknowledged_at IS NULL
				)
			)

was the age old issue of excess weight, but seems to be fixed with this query. Nice job! I'll await the next commit with paired tests.

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.

Screenshot 2025-01-16 at 11 29 35 AM

Tested several moves:

  • only origin SIT (showed up in TOO queue)
  • only dest SIT (did not show in TOO queue, but showed in dest)
  • both o & d SIT (showed up in both)
  • only origin shuttle (showed up in TOO queue)
  • only dest shuttle (showed up in dest queue only)
  • both shuttles (both queues)
  • excess weight with only destination (showed up in TOO queue)
  • excess UB weight with destination SIT (showed up in TOO queue - although couldn't approve SIT)

Exhausting work, I'm sure. Awaiting next commit, will verify query has changed to what I have that's working.

@traskowskycaci
Copy link
Contributor Author

Per our convo/huddle in Slack, this will be approved once the query is updated to:

			NOT (
				(
					-- find moves with destination requests (submitted destination re_services codes)
					EXISTS (
						SELECT 1
						FROM mto_service_items msi
						JOIN re_services rs ON msi.re_service_id = rs.id
						WHERE msi.mto_shipment_id = mto_shipments.id
						AND msi.status = 'SUBMITTED'
						AND rs.code IN ('DDFSIT', 'DDASIT', 'DDDSIT', 'DDSHUT', 'DDSFSC', 'IDFSIT', 'IDASIT', 'IDDSIT', 'IDSHUT')
					)
					-- moves with destination requests (destination address update requested)
					OR
					EXISTS (
						SELECT 1
						FROM shipment_address_updates sau
						WHERE sau.shipment_id = mto_shipments.id
						AND sau.status = 'REQUESTED'
					)
				)
				-- find moves with no origin requests
				-- find moves without submitted destination re_services codes
				AND NOT EXISTS (
					SELECT 1
					FROM mto_service_items msi
					JOIN re_services rs ON msi.re_service_id = rs.id
					WHERE msi.mto_shipment_id = mto_shipments.id
					AND msi.status = 'SUBMITTED'
					AND rs.code NOT IN ('DDFSIT', 'DDASIT', 'DDDSIT', 'DDSHUT', 'DDSFSC', 'IDFSIT', 'IDASIT', 'IDDSIT', 'IDSHUT')
				)
				-- find moves without excess weight risk to acknowledge
				AND NOT (
					moves.excess_weight_qualified_at IS NOT NULL 
					AND moves.excess_weight_acknowledged_at IS NULL
				)
				-- find moves without UB excess weight risk to acknowledge
				AND NOT (
					moves.excess_unaccompanied_baggage_weight_qualified_at IS NOT NULL 
					AND moves.excess_unaccompanied_baggage_weight_acknowledged_at IS NULL
				)
			)

was the age old issue of excess weight, but seems to be fixed with this query. Nice job! I'll await the next commit with paired tests.

Found that this query is over-filtering (filtering out a move with origin SIT and excess weight) so still working on the final solution. Marking PR as draft for now.

@traskowskycaci traskowskycaci marked this pull request as draft January 16, 2025 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INTEGRATION Slated for Integration Testing Mountain Movers Movin' Mountains 1 Sprint at a time
Development

Successfully merging this pull request may close these issues.