feat: usage base billed - license key check - move to private api (#15222)
Co-authored-by: Omar López <[email protected]>
This commit is contained in:
1 parent
53c37a9ddf
commit
e16662e655
16 files changed
+586
-59
No files matched your search
@@ -1,9 +1,13 @@
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
|
||||
export async function getDeploymentKey(prisma: PrismaClient) {
|
||||
if (process.env.CALCOM_LICENSE_KEY) {
|
||||
return process.env.CALCOM_LICENSE_KEY;
|
||||
}
|
||||
const deployment = await prisma.deployment.findUnique({
|
||||
where: { id: 1 },
|
||||
select: { licenseKey: true },
|
||||
});
|
||||
return deployment?.licenseKey || process.env.CALCOM_LICENSE_KEY || "";
|
||||
|
||||
return deployment?.licenseKey || "";
|
||||
}
|
||||
@@ -72,7 +72,7 @@ const CreateANewLicenseKeyFormChild = ({ session }: { session: Ensure<SessionCon
|
||||
function calculateMonthlyPrice() {
|
||||
const occurrence = watchedBillingPeriod === "MONTHLY" ? 1 : 12;
|
||||
|
||||
const sum = watchedEntityCount * watchedEntityPrice * occurrence;
|
||||
const sum = watchedEntityCount * watchedEntityPrice;
|
||||
return `$ ${sum / 100} / ${occurrence} months`;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user