Merge pull request #11885 from overleaf/ab-personal-sub-custom-react

[web] Display a message for custom personal subscriptions in React dash

GitOrigin-RevId: c70986ffacfdfdeccd3675385e2e5dba1a2ad61f
This commit is contained in:
Alexandre Bourdin
2023-02-23 09:05:13 +00:00
committed by Copybot
parent 8b00a496e7
commit d2fb800174
15 changed files with 135 additions and 70 deletions
@@ -5,6 +5,40 @@ import { User } from '../../../types/user'
type SubscriptionState = 'active' | 'canceled' | 'expired'
type Recurly = {
tax: number
taxRate: number
billingDetailsLink: string
accountManagementLink: string
additionalLicenses: number
totalLicenses: number
nextPaymentDueAt: string
currency: CurrencyCode
state?: SubscriptionState
trialEndsAtFormatted: Nullable<string>
trial_ends_at: Nullable<string>
activeCoupons: any[] // TODO: confirm type in array
account: {
// data via Recurly API
has_canceled_subscription: {
_: 'false' | 'true'
$: {
type: 'boolean'
}
}
has_past_due_invoice: {
_: 'false' | 'true'
$: {
type: 'boolean'
}
}
}
displayPrice: string
currentPlanDisplayPrice?: string
pendingAdditionalLicenses?: number
pendingTotalLicenses?: number
}
export type Subscription = {
_id: string
admin_id: string
@@ -17,44 +51,19 @@ export type Subscription = {
planCode: string
recurlySubscription_id: string
plan: Plan
recurly: {
tax: number
taxRate: number
billingDetailsLink: string
accountManagementLink: string
additionalLicenses: number
totalLicenses: number
nextPaymentDueAt: string
currency: CurrencyCode
state?: SubscriptionState
trialEndsAtFormatted: Nullable<string>
trial_ends_at: Nullable<string>
activeCoupons: any[] // TODO: confirm type in array
account: {
// data via Recurly API
has_canceled_subscription: {
_: 'false' | 'true'
$: {
type: 'boolean'
}
}
has_past_due_invoice: {
_: 'false' | 'true'
$: {
type: 'boolean'
}
}
}
displayPrice: string
currentPlanDisplayPrice?: string
pendingAdditionalLicenses?: number
pendingTotalLicenses?: number
}
pendingPlan?: Plan
}
export type GroupSubscription = Subscription & {
teamName?: string
export type RecurlySubscription = Subscription & {
recurly: Recurly
}
export type CustomSubscription = Subscription & {
customAccount: boolean
}
export type GroupSubscription = RecurlySubscription & {
teamName: string
teamNotice?: string
}