Files
6de715b884 feat: Round Robin timestamp basis (#21337)
* add rrTimeStampBasis to prisma schema

* add rr time stamp basis setting

* update migration

* add getLuckyUser logic

* add rrTimestampBasis to tests

* add load balancing warning message

* disable load balancing logic

* disable load balancing in event type settings

* add missing translations

* fix UI

* disable load balancing on all team event types

* don't show routing forms in router position

* use correct interval times

* fix variable naming

* fix event type update handler

* add test to booking.test.ts

* add test for getting interval times

* remove not needed prop

* fix label

* improve warning message

* fix removing maxLeadTreshold

* fix typo

* fix disabling maxLeadThreshold

* add back missing translation

* improve rr reset interval label

* fix rr_load_balancing_disabled text

* improve test

* fix description

* only use rrTimestampBasis in weights round robin

* fix dropdown width

---------

Co-authored-by: CarinaWolli <[email protected]>
2025-06-12 11:37:38 +01:00

52 lines
1.6 KiB
TypeScript

import { z } from "zod";
import { intervalLimitsType } from "@calcom/lib/intervalLimits/intervalLimitSchema";
import type { IntervalLimit } from "@calcom/lib/intervalLimits/intervalLimitSchema";
import { resizeBase64Image } from "@calcom/lib/server/resizeBase64Image";
import slugify from "@calcom/lib/slugify";
export type TUpdateInputSchema = {
id: number;
bio?: string;
name?: string;
logo?: string | null;
slug?: string;
hideBranding?: boolean;
hideBookATeamMember?: boolean;
hideTeamProfileLink?: boolean;
isPrivate?: boolean;
brandColor?: string;
darkBrandColor?: string;
theme?: string | null;
bookingLimits?: IntervalLimit | null;
includeManagedEventsInLimits?: boolean;
rrResetInterval?: "DAY" | "MONTH";
rrTimestampBasis?: "CREATED_AT" | "START_TIME";
};
export const ZUpdateInputSchema: z.Schema<TUpdateInputSchema> = z.object({
id: z.number(),
bio: z.string().optional(),
name: z.string().optional(),
logo: z
.string()
.transform(async (val) => await resizeBase64Image(val))
.nullable()
.optional(),
slug: z
.string()
.transform((val) => slugify(val.trim()))
.optional(),
hideBranding: z.boolean().optional(),
hideBookATeamMember: z.boolean().optional(),
hideTeamProfileLink: z.boolean().optional(),
isPrivate: z.boolean().optional(),
brandColor: z.string().optional(),
darkBrandColor: z.string().optional(),
theme: z.string().optional().nullable(),
bookingLimits: intervalLimitsType.optional(),
includeManagedEventsInLimits: z.boolean().optional(),
rrResetInterval: z.enum(["DAY", "MONTH"]).optional(),
rrTimestampBasis: z.enum(["CREATED_AT", "START_TIME"]).optional(),
});