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

Product pricing phase type SinglePayment renamed #541

Merged
merged 1 commit into from
Jan 9, 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 @@ -41,7 +41,7 @@ data class QProductPricingPhase(
val type: Type = when {
recurrenceMode != RecurrenceMode.FiniteRecurring -> Type.Regular
price.isFree -> Type.FreeTrial
billingCycleCount == 1 -> Type.SinglePayment
billingCycleCount == 1 -> Type.DiscountedSinglePayment
billingCycleCount > 1 -> Type.DiscountedRecurringPayment
else -> Type.Unknown
}
Expand All @@ -55,7 +55,7 @@ data class QProductPricingPhase(
* True, if the current phase is an intro period. False otherwise.
* The intro phase is one of single or recurrent discounted payments.
*/
val isIntro: Boolean = type == Type.SinglePayment || type == Type.DiscountedRecurringPayment
val isIntro: Boolean = type == Type.DiscountedSinglePayment || type == Type.DiscountedRecurringPayment

/**
* True, if the current phase represents the base plan. False otherwise.
Expand Down Expand Up @@ -109,7 +109,7 @@ data class QProductPricingPhase(
/**
* A phase with a discounted payment for a single period.
*/
SinglePayment,
DiscountedSinglePayment,

/**
* A phase with a discounted payment for several periods, described in [billingCycleCount].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ internal val QProductOfferDetails.pricePerMaxDuration: Double get() {
internal val QProductPricingPhase.durationDays get() = when (type) {
QProductPricingPhase.Type.FreeTrial,
QProductPricingPhase.Type.DiscountedRecurringPayment,
QProductPricingPhase.Type.SinglePayment ->
QProductPricingPhase.Type.DiscountedSinglePayment ->
billingPeriod.durationDays * billingCycleCount
else -> 0
}
Expand Down
Loading