Add missing "payment never made" subscription status to superadmin org list (#2457)

This commit is contained in:
Emma Segal-Grossman 2025-03-07 15:38:09 -05:00 committed by GitHub
parent fa05d68292
commit 8078f3866b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 0 deletions

View File

@ -703,6 +703,17 @@ export class OrgsList extends BtrixElement {
description: msg("Canceled"),
};
break;
case SubscriptionStatus.PaymentNeverMade:
subscription = {
icon: html`<sl-icon
class="text-base text-neutral-400"
name="dash-square-fill"
label=${msg("Payment Never Made")}
>
</sl-icon>`,
description: msg("Payment Never Made"),
};
break;
default:
break;
}

View File

@ -22,6 +22,7 @@ export function computeStats(orgData: OrgData[] = []) {
trialing: 0,
trialingCancelled: 0,
pausedPaymentFailed: 0,
paymentNeverMade: 0,
cancelled: 0,
};
@ -50,6 +51,9 @@ export function computeStats(orgData: OrgData[] = []) {
case SubscriptionStatus.PausedPaymentFailed:
subscriptions.pausedPaymentFailed++;
break;
case SubscriptionStatus.PaymentNeverMade:
subscriptions.paymentNeverMade++;
break;
case SubscriptionStatus.Cancelled:
subscriptions.cancelled++;
break;
@ -164,6 +168,12 @@ export class Component extends BtrixElement {
subscriptions.pausedPaymentFailed,
)}`}</span
>
${msg("Payment never made")}:
<span class="text-left font-bold text-white"
>${html`${this.localize.number(
subscriptions.paymentNeverMade,
)}`}</span
>
${msg("Cancelled subscriptions")}:
<span class="text-left font-bold text-white"
>${html`${this.localize.number(subscriptions.cancelled)}`}</span

View File

@ -7,6 +7,7 @@ export enum SubscriptionStatus {
Trialing = "trialing",
TrialingCanceled = "trialing_canceled",
PausedPaymentFailed = "paused_payment_failed",
PaymentNeverMade = "payment_never_made",
Cancelled = "cancelled",
}
export const subscriptionStatusSchema = z.nativeEnum(SubscriptionStatus);