* add booking booking to team settings * add update mutation * add missing export * fix dirty state * first version of global team limits in getUserAvailability * add test setup * create seperate test file for global limits * add tests for all units * move limitManager and booking limit functions outside of getUserAvailability * add migration * clean up code * move yearly booking count to booking repository * code clean up * don't count rescheduling booking * add test for getSchedule * fix type error * fix type error * fix type error * fix from and end date for fetching bookings * reuse functions * allow null for bookingLimits * remove bookings from managed event type * fix type error * code clean up * small fixes form clean up * fix type issue * same fixes in teams/_post * fix existing tz issue * tests for fix * adds missingn await * imrove description * remove spreading * fix reschedule issue with booking limits * fix reschedule error with booking durations * remove useeffect * undo commit * add bookingLimits to UpdateOrgTeamDto * fix unit tests * Prepare view for app router migration * throw error if not in ascending order * fix disabled update button --------- Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com> Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
33 lines
909 B
TypeScript
33 lines
909 B
TypeScript
import { z } from "zod";
|
|
|
|
import { _TeamModel as Team } from "@calcom/prisma/zod";
|
|
|
|
export const schemaTeamBaseBodyParams = Team.omit({ id: true, createdAt: true }).partial({
|
|
hideBranding: true,
|
|
metadata: true,
|
|
pendingPayment: true,
|
|
isOrganization: true,
|
|
isPlatform: true,
|
|
smsLockState: true,
|
|
smsLockReviewedByAdmin: true,
|
|
bookingLimits: true,
|
|
});
|
|
|
|
const schemaTeamRequiredParams = z.object({
|
|
name: z.string().max(255),
|
|
});
|
|
|
|
export const schemaTeamBodyParams = schemaTeamBaseBodyParams.merge(schemaTeamRequiredParams).strict();
|
|
|
|
export const schemaTeamUpdateBodyParams = schemaTeamBodyParams.partial();
|
|
|
|
const schemaOwnerId = z.object({
|
|
ownerId: z.number().optional(),
|
|
});
|
|
|
|
export const schemaTeamCreateBodyParams = schemaTeamBodyParams.merge(schemaOwnerId).strict();
|
|
|
|
export const schemaTeamReadPublic = Team.omit({});
|
|
|
|
export const schemaTeamsReadPublic = z.array(schemaTeamReadPublic);
|