diff --git a/packages/backend-core/src/events/publishers/license.ts b/packages/backend-core/src/events/publishers/license.ts index d86e9f1266..d1ff4d7609 100644 --- a/packages/backend-core/src/events/publishers/license.ts +++ b/packages/backend-core/src/events/publishers/license.ts @@ -9,7 +9,8 @@ import { LicenseCheckoutSuccessEvent, LicenseCheckoutOpenedEvent, LicensePaymentFailedEvent, - LicensePaymentRecoveredEvent, PriceDuration, + LicensePaymentRecoveredEvent, + PriceDuration, } from "@budibase/types" async function planChanged( @@ -24,7 +25,7 @@ async function planChanged( to, from, quantity, - duration + duration, } await publishEvent(Event.LICENSE_PLAN_CHANGED, properties) } diff --git a/packages/backend-core/tests/core/utilities/structures/licenses.ts b/packages/backend-core/tests/core/utilities/structures/licenses.ts index 24b120451e..38392925d9 100644 --- a/packages/backend-core/tests/core/utilities/structures/licenses.ts +++ b/packages/backend-core/tests/core/utilities/structures/licenses.ts @@ -7,16 +7,30 @@ import { PlanType, PriceDuration, PurchasedPlan, + PurchasedPrice, Quotas, Subscription, } from "@budibase/types" +export function price(): PurchasedPrice { + return { + amount: 10000, + amountMonthly: 10000, + currency: "usd", + duration: PriceDuration.MONTHLY, + priceId: "price_123", + dayPasses: undefined, + isPerUser: true, + } +} + export const plan = (type: PlanType = PlanType.FREE): PurchasedPlan => { return { type, usesInvoicing: false, minUsers: 1, model: PlanModel.PER_USER, + price: price(), } }