Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
23f019f
data use cases and mocks
panasetskaya Oct 14, 2026
f939d56
navigation
panasetskaya Oct 14, 2026
57595f4
screens 1,3,4 first iteration
panasetskaya Oct 14, 2026
06decd5
screens 1 redo
panasetskaya Oct 15, 2026
460c2d6
details screen
panasetskaya Oct 15, 2026
c49e190
change to real schema
panasetskaya Oct 19, 2026
ed83002
show QR
panasetskaya Oct 19, 2026
f5daf53
use code, fix lastState and crossSell cache
panasetskaya Oct 19, 2026
34ff8b1
publ to staging
panasetskaya Oct 19, 2026
2d23463
add new module and data layer
panasetskaya Nov 6, 2026
2d11561
add nullable discount badge
panasetskaya Nov 6, 2026
e586882
product page UI
panasetskaya Nov 6, 2026
232a65e
Merge branch 'develop' into feat/product-pages
panasetskaya Nov 9, 2026
2327e36
Merge branch 'develop' into feat/product-pages
panasetskaya Nov 11, 2026
d02255d
put fakes
panasetskaya Nov 11, 2026
a370863
back to real queries
panasetskaya Nov 12, 2026
e13cc06
remove video prepare for webP instead
panasetskaya Nov 13, 2026
51044ec
Add design for native cross-sell purchase
hugokallstrom Nov 18, 2026
498ac36
Add implementation plans for native cross-sell purchase
hugokallstrom Nov 18, 2026
33a64fc
Merge remote-tracking branch 'origin/feat/product-pages' into feat/na…
hugokallstrom Nov 18, 2026
568c948
Combine product pages with the in-app purchase flow
hugokallstrom Nov 18, 2026
e15de80
Map every in-app product and the product page's FAQ
hugokallstrom Nov 18, 2026
aeeac39
Let in-app purchase fields hold several values
hugokallstrom Nov 18, 2026
00a439a
Render text and searchable select purchase fields
hugokallstrom Nov 18, 2026
f55f487
Render the extra buildings purchase field
hugokallstrom Nov 18, 2026
5902c83
Buy natively from the product page
hugokallstrom Nov 18, 2026
90b6a5f
Start purchase questions unanswered and type wide numbers
hugokallstrom Nov 18, 2026
30b004f
Show purchase success in place of the product page
hugokallstrom Nov 18, 2026
68c43b1
Run ktlint and reattach the options sheet KDoc
hugokallstrom Nov 18, 2026
a23357a
Let purchase presenter tests run without a mocked Log
hugokallstrom Nov 18, 2026
823b505
Download the schema with the in-app purchase API from staging
hugokallstrom Nov 18, 2026
5989881
Merge develop into feat/native-cross-sell-purchase
hugokallstrom Nov 19, 2026
9509ea1
List the purchase modules in the app and desktop graphs
hugokallstrom Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,31 @@ type CrossSell {
Products to choose between, e.g. dog or cat for pet. Empty for a single product.
"""
options: [CrossSell!]!
"""
Set when this cross-sell can be bought natively in the app: pass it to `Query.inAppPurchaseForm`.
Null means open `storeUrl`, as for every cross-sell before the native flow.
"""
inAppProduct: InAppProduct
}
type CrossSellCarouselItem {
title: String!
subtitle: String
"""
The slide image, or the poster when the slide is a video
"""
image: StoryblokImageAsset!
"""
HEVC mp4 for iOS, set when the slide is a video; play it over the image
"""
videoUrlMp4: String
"""
VP9 webm for Android, same clip as videoUrlMp4
"""
videoUrlWebm: String
"""
Replay the video while the slide is shown; otherwise play once and hold the last frame
"""
loop: Boolean!
}
"""
A/B testing experiment (name and variant must be SCREAMING_SNAKE_CASE)
Expand All @@ -1953,14 +1978,19 @@ input CrossSellExperimentInput {
name: String!
variant: String!
}
type CrossSellHeroIntro {
title: String!
description: String!
}
input CrossSellInput {
userFlow: UserFlow!
"""
REQUIRED for SMART_X_SELL, must be NULL for HOME_X_SELL, INSURANCES, ONBOARDING and HOME
"""
flowSource: FlowSource
"""
A/B test experiments for attribution tracking
A/B test experiments for attribution tracking. ACCIDENT_DISCOUNT with variant NO_DISCOUNT withholds the accident
cross-sell's discount.
"""
experiments: [CrossSellExperimentInput!]!
"""
Expand All @@ -1972,6 +2002,29 @@ input CrossSellInput {
"""
claimId: UUID
}
type CrossSellProductInfo {
heroImage: StoryblokImageAsset!
"""
The intro text under the hero on the product's web page; null when the page has none
"""
heroIntro: CrossSellHeroIntro
"""
Selling points from the product's web page's image-text sections, in page order
"""
usps: [CrossSellUsp!]!
"""
Story-style slides from the product's web page, in page order
"""
carousel: [CrossSellCarouselItem!]!
"""
Set when the product can be bought natively in the app, as on `CrossSell.inAppProduct`
"""
inAppProduct: InAppProduct
"""
Questions and answers from the FAQ on the product's web page, in the member's language. Empty when it has none.
"""
faq: [ProductFaqItem!]!
}
enum CrossSellSource {
HOME
CLOSED_CLAIM
Expand All @@ -1980,6 +2033,10 @@ enum CrossSellSource {
EDIT_COINSURED
MOVING_FLOW
}
type CrossSellUsp {
title: String!
description: String!
}
type CrossSellV2 {
"""
Prioritized recommendation (null for INSURANCES)
Expand Down Expand Up @@ -2712,6 +2769,144 @@ type IconVariants {
light: IconVariant!
dark: IconVariant!
}
enum InAppProduct {
ACCIDENT
PAYMENT_PROTECTION
DOG
CAT
CAR
APARTMENT_RENT
APARTMENT_BRF
APARTMENT_STUDENT
HOUSE
VACATION_HOME
}
type InAppPurchaseEligibility {
isEligible: Boolean!
"""
Set when `isEligible` is false.
"""
reason: InAppPurchaseIneligibilityReason
"""
Set when `reason` is ALREADY_INSURED.
"""
existingContractId: UUID
}
type InAppPurchaseFieldError {
fieldId: ID!
"""
Localized message.
"""
message: String!
}
input InAppPurchaseFieldInput {
fieldId: ID!
"""
See `InAppPurchaseFormFieldType` for how many values each type takes and their format.
"""
values: [String!]!
}
"""
A single field to render in the form. Send its value back with `InAppPurchaseFieldInput.fieldId = id`.
"""
type InAppPurchaseFormField {
"""
Echo back when submitting. Clients shouldn't branch on it.
"""
id: ID!
type: InAppPurchaseFormFieldType!
"""
Localized label.
"""
title: String!
"""
Present for SINGLE_SELECT and SEARCHABLE_SELECT; for EXTRA_BUILDINGS, the building types.
"""
options: [InAppPurchaseFormFieldOption!]
"""
Values to prefill the field with. Empty means no default.
"""
defaultValues: [String!]!
"""
Present for NUMBER and DATE, in the same format as the value.
"""
minValue: String
maxValue: String
"""
SEARCHABLE_SELECT only: how many options may be chosen. Null means one.
"""
maxSelections: Int
}
type InAppPurchaseFormFieldOption {
value: String!
"""
Localized label.
"""
title: String!
"""
False: show the option, but it can't be selected.
"""
isSelectable: Boolean!
"""
Localized explanation, e.g. why the option can't be selected.
"""
additionalInfo: String
}
"""
Value format per type: NUMBER is an integer like "2", DATE is ISO "2026-11-01", SINGLE_SELECT is the
option's `value`, TEXT is free text. SEARCHABLE_SELECT sends one value per chosen option. EXTRA_BUILDINGS sends
one value per building, as JSON `{"type":"GARAGE","area":25,"hasWaterConnected":false}` with `type` one of the
field's options; no values means no buildings. Every other type takes exactly one value.
"""
enum InAppPurchaseFormFieldType {
NUMBER
DATE
SINGLE_SELECT
TEXT
SEARCHABLE_SELECT
EXTRA_BUILDINGS
}
type InAppPurchaseFormOutput {
product: Product!
eligibility: InAppPurchaseEligibility!
fields: [InAppPurchaseFormField!]!
}
enum InAppPurchaseIneligibilityReason {
ALREADY_INSURED
NOT_AVAILABLE
}
input InAppPurchaseQuoteInput {
product: InAppProduct!
fields: [InAppPurchaseFieldInput!]!
attribution: PriceIntentConfirmAttributionInput
"""
Discount code the member entered. Send it with every quote: each quote sets the discount from this input
alone, so leaving it out or sending an empty string removes a code sent earlier.
A valid code replaces the Accident discount the app's cross-sell banner promises, since only one discount
applies. An invalid code returns a field error with `fieldId: "campaignCode"` and no offers.
"""
campaignCode: String
}
type InAppPurchaseQuoteOutput {
"""
Null unless `offers` is non-empty.
"""
shopSessionId: UUID
offers: [ProductOffer!]!
"""
Problems with specific fields, to show next to them. Nothing was quoted when this is non-empty.
"""
fieldErrors: [InAppPurchaseFieldError!]!
"""
A problem that isn't about one field.
"""
userError: UserError
}
input InAppPurchaseSignInput {
shopSessionId: UUID!
offerId: UUID!
useBankIdSandbox: Boolean! = false
}
scalar Instant
type InsurableLimit {
label: String!
Expand Down Expand Up @@ -2971,6 +3166,10 @@ type Member {
"""
crossSellV2(input: CrossSellInput!): CrossSellV2!
"""
Product details for a tapped cross-sell, in the Hedvig-Language of the request. Errors for an unknown id and for the generic HOME, PET and ALL cross-sells.
"""
crossSellProductInfo(crossSellId: ID!): CrossSellProductInfo!
"""
Shop sessions started by this member that have not yet been signed and are not expired.
Ordered by most recent activity first.
"""
Expand Down Expand Up @@ -4135,6 +4334,17 @@ type Mutation {
"""
productOffersCancellationRequestedUpdate(productOfferIds: [UUID!]!, requested: Boolean!): ProductOffersMutationOutput!
"""
Submit the form from `inAppPurchaseForm` and get priced offers.
Call again after the member changes any value. Every call returns new offer ids, and only offers from the
latest response can be signed.
"""
inAppPurchaseQuote(input: InAppPurchaseQuoteInput!): InAppPurchaseQuoteOutput!
"""
Sign the chosen offer with Swedish BankID. Poll `Query.shopSessionSigning` with the returned signing id.
`useBankIdSandbox` behaves as in `Mutation.shopSessionStartSign`.
"""
inAppPurchaseSign(input: InAppPurchaseSignInput!): ShopSessionSigningMutationOutput!
"""
Called to save insurance recommendation form and save recommendation email.
"""
insuranceGuide(input: InsuranceGuideInput!): InsuranceGuideOutput!
Expand Down Expand Up @@ -4696,10 +4906,23 @@ type Product {
"""
multiple: Boolean
"""
Questions and answers from the FAQ on the product's page on the website, in the member's language.
Empty when the page has none.
"""
faq: [ProductFaqItem!]!
"""
A list of the external insurers valid for this specific product.
"""
externalInsurers: [ExternalInsurer!]!
}
type ProductFaqItem {
question: String!
"""
Storyblok rich text document (`"type": "doc"`), rendered by the client. Links to other website pages are
absolute URLs.
"""
answer: JSON!
}
type ProductOffer {
"""
The id of this item, which can be used to add to cart.
Expand Down Expand Up @@ -5086,6 +5309,11 @@ type Query {
shopSession(id: UUID!): ShopSession!
carTrial(contractId: UUID!): TrialExtension
"""
Screen 1 of the in-app purchase: product content, whether the member can buy it, and the form to fill in.
Has no side effects. When the member isn't eligible, `fields` is empty.
"""
inAppPurchaseForm(product: InAppProduct!): InAppPurchaseFormOutput!
"""
Outcome of shopSession. Requires authentication
Available forever, unlike shopSession which becomes hidden some time after creation
"""
Expand Down
3 changes: 3 additions & 0 deletions app/app-desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ kotlin {
implementation(projects.featureHelpCenterNavigation)
implementation(projects.featureHome)
implementation(projects.featureImageViewer)
implementation(projects.featureInAppPurchase)
implementation(projects.featureInAppPurchaseNavigation)
implementation(projects.featureInsuranceCertificate)
implementation(projects.featureInsurances)
implementation(projects.featureLogin)
Expand All @@ -98,6 +100,7 @@ kotlin {
implementation(projects.featurePayments)
implementation(projects.featurePaymentsNavigation)
implementation(projects.featurePayoutAccount)
implementation(projects.featureProductInApp)
implementation(projects.featureProfile)
implementation(projects.featureRemoveAddons)
implementation(projects.featureTerminateInsurance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import assertk.assertions.containsExactly
import assertk.assertions.isEmpty
import assertk.assertions.isTrue
import assertk.assertions.startsWith
import com.hedvig.android.data.contract.CrossSell
import com.hedvig.android.design.system.hedvig.GlobalSnackBarState
import com.hedvig.android.feature.chat.navigation.ChatKey
import com.hedvig.android.feature.chat.navigation.InboxKey
Expand Down Expand Up @@ -165,6 +166,7 @@ private fun registerSharedEntries(scope: EntryProviderScope<HedvigNavKey>, graph
DesktopAppHost(showNotice = {}),
{ _: String -> },
{ _: String -> true },
{ _: CrossSell -> true },
graph.imageLoader,
graph.languageService,
graph.hedvigBuildConstants,
Expand Down
3 changes: 3 additions & 0 deletions app/app-shell/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ kotlin {
implementation(projects.featureHelpCenterNavigation)
implementation(projects.featureHome)
implementation(projects.featureImageViewer)
implementation(projects.featureInAppPurchase)
implementation(projects.featureInAppPurchaseNavigation)
implementation(projects.featureInsuranceCertificate)
implementation(projects.featureInsurances)
implementation(projects.featureLogin)
Expand All @@ -77,6 +79,7 @@ kotlin {
implementation(projects.featurePayments)
implementation(projects.featurePaymentsNavigation)
implementation(projects.featurePayoutAccount)
implementation(projects.featureProductInApp)
implementation(projects.featureProfile)
implementation(projects.featureRemoveAddons)
implementation(projects.featureTerminateInsurance)
Expand Down
Loading
Loading