mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* feat: Cal.diy — community-driven MIT-licensed fork of Cal.com This squashed commit contains all Cal.diy changes applied on top of calcom/cal.com main: - Rebrand Cal.com to Cal.diy across the entire codebase - Remove Enterprise Edition (EE) features, license checks, and AGPL restrictions - Switch license from AGPL-3.0 to MIT - Remove docs/ directory (migrated to Nextra at cal.diy) - Remove dead code: org tests, EE tips, platform nav, premium username, SAML/SSO, etc. - Clean up .env.example for self-hosted Cal.diy - Update Docker image references to calcom/cal.diy - Update README, CONTRIBUTING.md, and issue templates for Cal.diy community fork - Add PR welcome bot for Cal.diy contributors - Fix API v2 breaking changes oasdiff ignore entries - Replace Blacksmith CI runners with default GitHub Actions 3893 files changed, 20789 insertions(+), 411020 deletions(-) Co-Authored-By: [email protected] <[email protected]> * refactor: remove org-specific /organizations/:orgId endpoints from API v2 atoms controllers (#1701) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: revert Cal.diy Inc to Cal.com, Inc. in license files, copyright notices, and package metadata (#1702) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * rip out org related comments in api v2 --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
162 lines
5.3 KiB
TypeScript
162 lines
5.3 KiB
TypeScript
import { MembershipRole } from "@calcom/prisma/enums";
|
|
import authedProcedure from "../../../procedures/authedProcedure";
|
|
import { createTeamPbacProcedure } from "../../../procedures/pbacProcedures";
|
|
import publicProcedure from "../../../procedures/publicProcedure";
|
|
import { router } from "../../../trpc";
|
|
import { ZAddGuestsInputSchema } from "./addGuests.schema";
|
|
import { ZConfirmInputSchema } from "./confirm.schema";
|
|
import { ZEditLocationInputSchema } from "./editLocation.schema";
|
|
import { ZFindInputSchema } from "./find.schema";
|
|
import { ZGetInputSchema } from "./get.schema";
|
|
import { ZGetBookingAttendeesInputSchema } from "./getBookingAttendees.schema";
|
|
import { ZGetBookingDetailsInputSchema } from "./getBookingDetails.schema";
|
|
import { ZGetBookingHistoryInputSchema } from "./getBookingHistory.schema";
|
|
import { ZGetWrongAssignmentReportsInputSchema } from "./getWrongAssignmentReports.schema";
|
|
import { ZHasWrongAssignmentReportInputSchema } from "./hasWrongAssignmentReport.schema";
|
|
import { ZReportBookingInputSchema } from "./reportBooking.schema";
|
|
import { ZReportWrongAssignmentInputSchema } from "./reportWrongAssignment.schema";
|
|
import { ZRequestRescheduleInputSchema } from "./requestReschedule.schema";
|
|
import { ZUpdateWrongAssignmentReportStatusInputSchema } from "./updateWrongAssignmentReportStatus.schema";
|
|
import { bookingsProcedure } from "./util";
|
|
|
|
export const bookingsRouter = router({
|
|
get: authedProcedure.input(ZGetInputSchema).query(async ({ input, ctx }) => {
|
|
const { getHandler } = await import("./get.handler");
|
|
|
|
return getHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
|
|
requestReschedule: authedProcedure.input(ZRequestRescheduleInputSchema).mutation(async ({ input, ctx }) => {
|
|
const { requestRescheduleHandler } = await import("./requestReschedule.handler");
|
|
|
|
return requestRescheduleHandler({
|
|
ctx,
|
|
input,
|
|
source: "WEBAPP",
|
|
});
|
|
}),
|
|
|
|
editLocation: bookingsProcedure.input(ZEditLocationInputSchema).mutation(async ({ input, ctx }) => {
|
|
const { editLocationHandler } = await import("./editLocation.handler");
|
|
|
|
return editLocationHandler({
|
|
ctx,
|
|
input,
|
|
actionSource: "WEBAPP",
|
|
});
|
|
}),
|
|
|
|
addGuests: authedProcedure.input(ZAddGuestsInputSchema).mutation(async ({ input, ctx }) => {
|
|
const { addGuestsHandler } = await import("./addGuests.handler");
|
|
|
|
return addGuestsHandler({
|
|
ctx,
|
|
input,
|
|
actionSource: "WEBAPP",
|
|
});
|
|
}),
|
|
|
|
confirm: authedProcedure.input(ZConfirmInputSchema).mutation(async ({ input, ctx }) => {
|
|
const { confirmHandler } = await import("./confirm.handler");
|
|
|
|
return confirmHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
|
|
getBookingAttendees: authedProcedure
|
|
.input(ZGetBookingAttendeesInputSchema)
|
|
.query(async ({ input, ctx }) => {
|
|
const { getBookingAttendeesHandler } = await import("./getBookingAttendees.handler");
|
|
|
|
return getBookingAttendeesHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
|
|
getBookingDetails: authedProcedure.input(ZGetBookingDetailsInputSchema).query(async ({ input, ctx }) => {
|
|
const { getBookingDetailsHandler } = await import("./getBookingDetails.handler");
|
|
|
|
return getBookingDetailsHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
|
|
find: publicProcedure.input(ZFindInputSchema).query(async ({ input, ctx }) => {
|
|
const { getHandler } = await import("./find.handler");
|
|
|
|
return getHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
|
|
reportBooking: authedProcedure.input(ZReportBookingInputSchema).mutation(async ({ input, ctx }) => {
|
|
const { reportBookingHandler } = await import("./reportBooking.handler");
|
|
|
|
return reportBookingHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
reportWrongAssignment: authedProcedure
|
|
.input(ZReportWrongAssignmentInputSchema)
|
|
.mutation(async ({ input, ctx }) => {
|
|
const { reportWrongAssignmentHandler } = await import("./reportWrongAssignment.handler");
|
|
|
|
return reportWrongAssignmentHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
hasWrongAssignmentReport: authedProcedure
|
|
.input(ZHasWrongAssignmentReportInputSchema)
|
|
.query(async ({ input, ctx }) => {
|
|
const { hasWrongAssignmentReportHandler } = await import("./hasWrongAssignmentReport.handler");
|
|
|
|
return hasWrongAssignmentReportHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
getBookingHistory: authedProcedure.input(ZGetBookingHistoryInputSchema).query(async ({ input, ctx }) => {
|
|
const { getBookingHistoryHandler } = await import("./getBookingHistory.handler");
|
|
|
|
return getBookingHistoryHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
getWrongAssignmentReports: createTeamPbacProcedure("booking.readTeamBookings", [
|
|
MembershipRole.ADMIN,
|
|
MembershipRole.OWNER,
|
|
MembershipRole.MEMBER,
|
|
])
|
|
.input(ZGetWrongAssignmentReportsInputSchema)
|
|
.query(async ({ input }) => {
|
|
const { getWrongAssignmentReportsHandler } = await import("./getWrongAssignmentReports.handler");
|
|
|
|
return getWrongAssignmentReportsHandler({
|
|
input,
|
|
});
|
|
}),
|
|
updateWrongAssignmentReportStatus: authedProcedure
|
|
.input(ZUpdateWrongAssignmentReportStatusInputSchema)
|
|
.mutation(async ({ input, ctx }) => {
|
|
const { updateWrongAssignmentReportStatusHandler } = await import(
|
|
"./updateWrongAssignmentReportStatus.handler"
|
|
);
|
|
|
|
return updateWrongAssignmentReportStatusHandler({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
});
|