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

Remove unused type from InsurableLimit #2292

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -17,7 +17,6 @@ fragment ProductVariantFragment on ProductVariant {
label
limit
description
type
}
documents {
displayName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.hedvig.android.data.productvariant.ProductVariant
import com.hedvig.android.data.productvariant.ProductVariantPeril
import hedvig.resources.R
import octopus.fragment.ProductVariantFragment
import octopus.type.InsurableLimitType
import octopus.type.InsuranceDocumentType

fun InsuranceVariantDocument.InsuranceDocumentType.getStringRes() = when (this) {
Expand Down Expand Up @@ -44,28 +43,6 @@ fun ProductVariantFragment.toProductVariant() = ProductVariant(
label = insurableLimit.label,
limit = insurableLimit.limit,
description = insurableLimit.description,
type = when (insurableLimit.type) {
InsurableLimitType.DEDUCTIBLE -> InsurableLimit.InsurableLimitType.DEDUCTIBLE
InsurableLimitType.DEDUCTIBLE_NATURE_DAMAGE -> InsurableLimit.InsurableLimitType.DEDUCTIBLE_NATURE_DAMAGE
InsurableLimitType.DEDUCTIBLE_ALL_RISK -> InsurableLimit.InsurableLimitType.DEDUCTIBLE_ALL_RISK
InsurableLimitType.INSURED_AMOUNT -> InsurableLimit.InsurableLimitType.INSURED_AMOUNT
InsurableLimitType.GOODS_INDIVIDUAL -> InsurableLimit.InsurableLimitType.GOODS_INDIVIDUAL
InsurableLimitType.GOODS_FAMILY -> InsurableLimit.InsurableLimitType.GOODS_FAMILY
InsurableLimitType.TRAVEL_DAYS -> InsurableLimit.InsurableLimitType.TRAVEL_DAYS
InsurableLimitType.MEDICAL_EXPENSES -> InsurableLimit.InsurableLimitType.MEDICAL_EXPENSES
InsurableLimitType.LOST_LUGGAGE -> InsurableLimit.InsurableLimitType.LOST_LUGGAGE
InsurableLimitType.BIKE -> InsurableLimit.InsurableLimitType.BIKE
InsurableLimitType.PERMANENT_INJURY -> InsurableLimit.InsurableLimitType.PERMANENT_INJURY
InsurableLimitType.TREATMENT -> InsurableLimit.InsurableLimitType.TREATMENT
InsurableLimitType.DENTAL_TREATMENT -> InsurableLimit.InsurableLimitType.DENTAL_TREATMENT
InsurableLimitType.TRAVEL_ILLNESS_INJURY_TRANSPORTATION_HOME ->
InsurableLimit.InsurableLimitType.TRAVEL_ILLNESS_INJURY_TRANSPORTATION_HOME

InsurableLimitType.TRAVEL_DELAYED_ON_TRIP -> InsurableLimit.InsurableLimitType.TRAVEL_DELAYED_ON_TRIP
InsurableLimitType.TRAVEL_DELAYED_LUGGAGE -> InsurableLimit.InsurableLimitType.TRAVEL_DELAYED_LUGGAGE
InsurableLimitType.TRAVEL_CANCELLATION -> InsurableLimit.InsurableLimitType.TRAVEL_CANCELLATION
InsurableLimitType.UNKNOWN__ -> InsurableLimit.InsurableLimitType.UNKNOWN
},
)
},
documents = this.documents.map { document ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ data class InsurableLimit(
val label: String,
val limit: String,
val description: String,
val type: InsurableLimitType,
) {
enum class InsurableLimitType {
DEDUCTIBLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ internal data class MoveQuote(
label = "test",
description = "long".repeat(10),
limit = "long".repeat(10),
type = InsurableLimit.InsurableLimitType.BIKE,
),
),
documents = listOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.hedvig.android.core.uidata.UiMoney
import com.hedvig.android.data.contract.ContractGroup
import com.hedvig.android.data.contract.ContractType
import com.hedvig.android.data.productvariant.InsurableLimit
import com.hedvig.android.data.productvariant.InsurableLimit.InsurableLimitType.BIKE
import com.hedvig.android.data.productvariant.ProductVariant
import com.hedvig.android.feature.changeaddress.data.Address
import com.hedvig.android.feature.changeaddress.data.AddressId
Expand Down Expand Up @@ -115,7 +114,6 @@ internal val fakeMoveQuote = MoveQuote(
label = "test",
description = "long".repeat(10),
limit = "long".repeat(10),
type = BIKE,
),
),
documents = listOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ private val previewPerils: List<ProductVariantPeril> = List(4) { index ->
}

private val previewInsurableLimits: List<InsurableLimit> = listOf(
InsurableLimit("Insured amount".repeat(2), "1 000 000 kr", "", InsurableLimit.InsurableLimitType.GOODS_FAMILY),
InsurableLimit("Deductible", "1 500 kr", "", InsurableLimit.InsurableLimitType.DEDUCTIBLE),
InsurableLimit("Travel insurance", "45 days", "", InsurableLimit.InsurableLimitType.BIKE),
InsurableLimit("Insured amount".repeat(2), "1 000 000 kr", ""),
InsurableLimit("Deductible", "1 500 kr", ""),
InsurableLimit("Travel insurance", "45 days", ""),
)
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ private class SummaryUiStateProvider : PreviewParameterProvider<SummaryUiState>
label = "insurable limit label",
limit = "insurable limit limit",
description = "insurable limit description",
type = BIKE,
),
),
documents = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ private fun PreviewQuoteCard(
label = "label#$it",
limit = "limit#$it",
description = "description#$it",
type = BIKE,
)
},
documents = List(3) {
Expand Down
Loading