Hubspot updates (#10442)

* Hubspot updates for per user pricing

* Lint
This commit is contained in:
Rory Powell 2023-04-28 11:12:04 +01:00 committed by GitHub
parent a20dfa588a
commit 56f43d3f45
2 changed files with 17 additions and 2 deletions

View File

@ -9,7 +9,8 @@ import {
LicenseCheckoutSuccessEvent, LicenseCheckoutSuccessEvent,
LicenseCheckoutOpenedEvent, LicenseCheckoutOpenedEvent,
LicensePaymentFailedEvent, LicensePaymentFailedEvent,
LicensePaymentRecoveredEvent, PriceDuration, LicensePaymentRecoveredEvent,
PriceDuration,
} from "@budibase/types" } from "@budibase/types"
async function planChanged( async function planChanged(
@ -24,7 +25,7 @@ async function planChanged(
to, to,
from, from,
quantity, quantity,
duration duration,
} }
await publishEvent(Event.LICENSE_PLAN_CHANGED, properties) await publishEvent(Event.LICENSE_PLAN_CHANGED, properties)
} }

View File

@ -7,16 +7,30 @@ import {
PlanType, PlanType,
PriceDuration, PriceDuration,
PurchasedPlan, PurchasedPlan,
PurchasedPrice,
Quotas, Quotas,
Subscription, Subscription,
} from "@budibase/types" } 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 => { export const plan = (type: PlanType = PlanType.FREE): PurchasedPlan => {
return { return {
type, type,
usesInvoicing: false, usesInvoicing: false,
minUsers: 1, minUsers: 1,
model: PlanModel.PER_USER, model: PlanModel.PER_USER,
price: price(),
} }
} }