Skip to content

Remove Odyssey from termination flow#2885

Draft
hugokallstrom wants to merge 19 commits intodevelopfrom
eng/removing-odyssey
Draft

Remove Odyssey from termination flow#2885
hugokallstrom wants to merge 19 commits intodevelopfrom
eng/removing-odyssey

Conversation

@hugokallstrom
Copy link
Contributor

@hugokallstrom hugokallstrom commented Mar 12, 2026

Summary

  • Replace 7 Odyssey flow-based GraphQL mutations with 2 direct operations: terminationSurvey query and terminateContract mutation (both served by Underwriter, which internally delegates to Product-Pricing for contract state changes)
  • Client-driven navigation instead of backend state machine — survey options and termination action are fetched upfront, navigation computed locally
  • Unified DeflectSuggestion destination replacing separate DeflectAutoCancel and DeflectAutoDecom screens
  • Net deletion of ~1,100 lines (675 added, 1,804 removed)

What changed

  • GraphQL: 3 new operations, 7 old ones deleted
  • Data models: Flat TerminationSurveyData/TerminationAction/TerminationResult replacing deep TerminateInsuranceStep sealed hierarchy
  • Repository: 2-method interface (getTerminationSurvey, terminateContract) replacing 6 flow-based methods
  • ViewModels: Survey VM navigates locally; Confirmation VM calls terminateContract directly with reason/comment
  • DI: Removed TerminationFlowContextStorage, FeatureManager, DataStore dependencies
  • Tests: Survey presenter tests rewritten; repo tests stubbed pending schema deployment

Blocked on

  • New GraphQL schema not yet deployed — terminationSurvey query and terminateContract mutation types don't exist in the schema yet. Build will fail on Apollo codegen until schema is updated.

Test plan

  • Deploy new GraphQL schema to staging
  • Run ./gradlew downloadOctopusApolloSchemaFromIntrospection and fix any codegen mismatches
  • Verify full termination flow: choose insurance → survey → date picker → confirmation → success
  • Verify deletion flow (no date picker)
  • Verify deflection suggestions (AUTO_DECOMMISSION, AUTO_CANCEL)
  • Verify change tier redirect from survey
  • Run ./gradlew :feature-terminate-insurance:test

🤖 Generated with Claude Code

hugokallstrom and others added 19 commits March 12, 2026 14:30
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…calls

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… query

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ackend call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…act mutation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace Odyssey flow-based navigation with client-driven routing.
Survey VMs now receive action upfront, navigateFromSurvey() routes
based on suggestion type and termination action. Thread selectedReasonId
and feedbackComment through to confirmation. Add DeflectSuggestion
placeholder destination.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove TerminationFlowContextStorage, DeflectAutoDecommissionStepViewModel,
and FeatureManager dependencies. Repository now only needs ApolloClient.
Survey VM receives action and contractId. Confirmation VM receives
selectedReasonId and feedbackComment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…bles

Remove 7 old flow-based GraphQL operations and 3 deflect step files.
Update ChooseInsuranceToTerminateDestination, TerminationSurveyDestination,
and TerminationConfirmationDestination to use new data models and
callback signatures matching the rewritten ViewModels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove coreDatastorePublic, dataProductVariantPublic, featureFlagsPublic,
and navigationActivity now that TerminationFlowContextStorage and
FeatureManager are no longer used.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrite TerminationSurveyPresenterTest to use new constructor
(options, action, changeTierRepository, contractId) and test local
navigation instead of repository-driven steps. Stub out repository
test until new GraphQL schema is deployed. Remove unused test
dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create DeflectSuggestionDestination composable replacing the old
separate DeflectAutoCancel and DeflectAutoDecom screens. Supports
both AUTO_CANCEL (dismiss only) and AUTO_DECOMMISSION (continue
termination or dismiss) suggestion types. Wire it up in the nav graph.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix line length violations, parameter wrapping, import ordering,
and remove empty test file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use a wrapper type (TerminationSuccessResult) instead of bare LocalDate?
so that deletions (null terminationDate) properly trigger navigation to
the success screen. Show userError as a notification card on the
confirmation screen. Use generic "continue" button text for suggestions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update mutation to use terminationSurveyOptionId instead of
terminationReason enum. Update notification query from
Contract.terminationBundleDiscountNotification to
Member.terminationFlowNotification per underwriter PRs #1681/#1682.
Add TerminationSurveyOptionId scalar mapping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…loys

The scalar doesn't exist in the current schema yet, so the mapping
breaks Apollo codegen. It will be added back when the schema is updated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant