* feat: RECORDING_TRANSCRIPTION_READY webhook * refactor: split into diff files and restructuring * feat: finish batch processor finished * chore: types * fix: type error * chore: change name of triggger * test: add unit test * fix: type * fix: type err * chore: test * feat: add booking reference repository and other imp * chore: log * fix: import * chore: type error * fix: update test * fix: test * fix: test * fix: add timeout * chore: move beforeEach * Mock missing env variables to test. These vars are not set in CI --------- Co-authored-by: Hariom <hariombalhara@gmail.com>
24 lines
636 B
TypeScript
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,
|
|
});
|
|
}
|
|
}
|