Skip to content

Commit

Permalink
fix: Prevent assigning non-active plans
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCizmar committed Feb 20, 2025
1 parent d3f46a3 commit 8f85996
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion backend/data/src/main/kotlin/io/tolgee/api/SubscriptionStatus.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ enum class SubscriptionStatus(
ERROR(false),
TRIALING(true),

// might be stored on the EE side, but not license server (billing) side
/** might be stored on the EE side, but not license server (billing) side */
KEY_USED_BY_ANOTHER_INSTANCE(false),

/** when we cannot map from stripe status */
UNKNOWN(false),
;

companion object {
fun fromStripeStatus(stripeStatus: String?): SubscriptionStatus {
return when (stripeStatus) {
"active" -> ACTIVE
"canceled" -> CANCELED
"past_due" -> PAST_DUE
"unpaid" -> UNPAID
"trialing" -> TRIALING
else -> UNKNOWN
}
}
}
}

0 comments on commit 8f85996

Please sign in to comment.