Skip to content

Add in-app house (villa) purchase + Home picker dialog (RND-1965)#2949

Open
hugokallstrom wants to merge 9 commits into
feat/in-app-vacation-home-purchasefrom
feat/in-app-house-purchase
Open

Add in-app house (villa) purchase + Home picker dialog (RND-1965)#2949
hugokallstrom wants to merge 9 commits into
feat/in-app-vacation-home-purchasefrom
feat/in-app-house-purchase

Conversation

@hugokallstrom
Copy link
Copy Markdown
Contributor

Summary

Stacked on top of #2947 (vacation home). Adds the SE_HOUSE (villa) form as a sibling to VacationHomeFormDestination inside feature-purchase-house, plus a modal "Home" picker dialog that disambiguates the generic hemforsakring / home-insurance cross-sell.

  • HouseFormDestination + HouseFormViewModel in feature-purchase-house/ui/house/. Same form pattern as pet/vacation home (RadioChoiceRow with RadioGroupStyle.Labeled.HorizontalFlow, yesNoOptions() helper, radio values held in ViewModel state with Update* events, text/stepper values in rememberSaveable).
  • SubmitHouseFormAndGetOffersUseCase — new use case, reuses the existing HouseShopSessionCreate/HousePriceIntentCreate/HousePriceIntentDataUpdate/HousePriceIntentConfirm Apollo operations (same mutations, different form-data keys).
  • HousePurchaseNavGraph.Form branches on productNameSE_VACATION_HOMEVacationHomeFormDestination, SE_HOUSEHouseFormDestination. Both share the post-form flow (SelectTier → Summary → Signing → Success).
  • HomePickerDialog in feature-insurances/insurance/. Modal HedvigDialog with three options: Rental apartment (Hyresrätt), Owned apartment (Bostadsrätt), House (Villa). State held local to the InsuranceGraph navdestination via rememberSaveable.
  • Cross-sell URL routing reordered. Specific subpaths now match before the generic hemforsakring / home-insurance rule (which previously silently routed to APARTMENT_RENT). New routes:
    • villaforsakring / home-insurance/houseSE_HOUSE shortcut (no dialog)
    • bostadsratt / home-insurance/homeownerSE_APARTMENT_BRF (existing)
    • hyresratt / home-insurance/rentalSE_APARTMENT_RENT (existing, slug-narrowed)
    • bare hemforsakring / home-insurance → opens the picker dialog
  • No app module changesonNavigateToHousePurchase(productName) already accepts arbitrary product names from the vacation home PR.

Form fields (v1): street, zipCode, livingSpace, ancillaryArea (biarea), numberCoInsured (stepper 1–5), yearOfConstruction, numberOfBathrooms (stepper 1–10), isSubleted. ssn + email auto-injected from currentMember. extraBuildings: [], currentInsurance: null, useRegistrationAddress: null all sent / omitted in v1.

Design spec: docs/superpowers/specs/2026-05-21-in-app-house-purchase-design.md.
Plan: docs/superpowers/plans/2026-05-21-in-app-house-purchase.md.

Base branch: feat/in-app-vacation-home-purchase. Retarget to develop once #2947 merges.

Test plan

  • App builds (./gradlew :app:assemble); Compose previews render for PreviewHouseFormEmpty / Filled / Errors and PreviewHomePickerDialog.
  • Generic "Home" cross-sell URL (hemforsakring / home-insurance) opens the HomePickerDialog.
  • Tap "House (Villa)" → HouseFormDestination opens.
  • Tap "Owned apartment (Bostadsrätt)" → apartment form opens with BRF productName.
  • Tap "Rental apartment (Hyresrätt)" → apartment form opens with RENT productName.
  • Dialog cancel / scrim-tap / system back dismisses with no navigation.
  • Specific URL shortcuts bypass the dialog: hemforsakring/villaforsakring → house form, hemforsakring/bostadsratt → apartment-BRF, hemforsakring/hyresratt → apartment-RENT.
  • House form validation: empty street, zipCode < 5 digits, livingSpace 0, year < 1700, missing sublet radio → field-level errors.
  • Filling all valid fields → tier select shows SE_HOUSE offer → summary → BankID signing → success → back to insurances.
  • Vacation home flow still works (regression check from Add in-app vacation home (fritidshus) purchase flow (RND-1965) #2947).

Out of scope (separate follow-up PRs)

  • useRegistrationAddress prefill toggle (needs a member-address query)
  • currentInsurance dropdown + insurer query + cancellation flow
  • extraBuildings add/remove dialog UI (shared with vacation home)
  • SE_APARTMENT_STUDENT (5th hem variant)
  • Removing specific URL shortcuts in favor of dialog-only flow

🤖 Generated with Claude Code

hugokallstrom and others added 9 commits May 21, 2026 11:43
…r dialog

Sibling SE_HOUSE form in feature-purchase-house module, modal Home picker
dialog in feature-insurances. Defers useRegistrationAddress, currentInsurance,
and extraBuildings UI to follow-up PRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
10 tasks: SubmitHouseFormAndGetOffersUseCase, HouseFormViewModel,
HouseFormDestination + previews, HousePurchaseNavGraph branch on productName,
DI registration, HomePickerDialog in feature-insurances, cross-sell URL routing
update, full-app build, emulator verification, PR prep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hugokallstrom hugokallstrom requested a review from a team as a code owner May 22, 2026 06:39
@hugokallstrom hugokallstrom changed the title Add in-app house (villa) purchase + Home picker dialog Add in-app house (villa) purchase + Home picker dialog (RND-1965) May 22, 2026
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