2
0
Files
cal/calcom/packages/lib/server/repository/bookingReference.ts
2024-08-09 00:39:27 +02:00

24 lines
636 B
TypeScript

import { Prisma } from "@prisma/client";
import { prisma } from "@calcom/prisma";
const bookingReferenceSelect = Prisma.validator<Prisma.BookingReferenceSelect>()({
id: true,
type: true,
uid: true,
meetingId: true,
meetingUrl: true,
credentialId: true,
deleted: true,
bookingId: true,
});
export class BookingReferenceRepository {
static async findDailyVideoReferenceByRoomName({ roomName }: { roomName: string }) {
return prisma.bookingReference.findFirst({
where: { type: "daily_video", uid: roomName, meetingId: roomName, bookingId: { not: null } },
select: bookingReferenceSelect,
});
}
}