Files
calendar/packages/trpc/server/routers/viewer/admin/createSelfHostedLicenseKey.schema.ts
T
2a41cd0770 feat: license creation admin PR (#15024)
* WIP: UI created to see if it matches RFC idea

* Remove schema as we validate on the backend with old+new key schemas

* Add comment about proxy URL request when on older versions

* feat: create custom axios instance to use signature middleware

* fix: update form to respect new schema

* Add cal signature token to trubo env

* use backend mutation for creating license keys

* add loading state to creation button

* update form to have a success state

* fix type error for console.warning :')

* use api version v1

* restore checkLicense from main

* Add env vars to example

* nit: rename page export

* use US spelling

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2024-06-06 18:34:32 +00:00

16 lines
516 B
TypeScript

import { z } from "zod";
const BillingType = z.enum(["PER_BOOKING", "PER_USER"]);
const BillingPeriod = z.enum(["MONTHLY", "ANNUALLY"]);
export const ZCreateSelfHostedLicenseSchema = z.object({
billingType: BillingType,
entityCount: z.number().int().nonnegative(),
entityPrice: z.number().nonnegative(),
billingPeriod: BillingPeriod,
overages: z.number().nonnegative(),
billingEmail: z.string().email(),
});
export type TCreateSelfHostedLicenseSchema = z.infer<typeof ZCreateSelfHostedLicenseSchema>;