mirror of
https://github.com/hanzoai/calendar.git
synced 2026-09-24 22:42:24 +00:00
089a39f59f
* init: improvements for update location endpoint * chore: init function to update calendar event * fix: bad imports * chore: update calendar event when updating location * chore: update platform libraries * fix: update calendar event * chore: update platform libraries * chore: cleanup * feat: add logic for video conferecing integrations * chore: update platform libraries * feat: add sms and email notifications * chore: update e2e tests * chore: update openapi spec * chore: implement cubic feedback * chore: update openapi spec * fix: add Jest mock for Daily.co video adapter in e2e test Co-Authored-By: [email protected] <[email protected]> * fix: mock createMeeting directly to bypass database check in e2e test Co-Authored-By: [email protected] <[email protected]> * chore: implement PR feedback * chore: implement feedback * fix: mock throttler guard to prevent rate limiting in e2e tests Co-Authored-By: [email protected] <[email protected]> * fix: merge conflicts * chore: update platform libraries * chore: implement feedback part 1 * chore: implement feedback part 2 * chore: remove unnecessary type casting * chore: implement cubic feedback * chore: implement devin feedback * chore: implement PR feedback * fix: type error * chore: update openapi spec * test: add mocks and tests for Google Meet and Microsoft Teams integration location updates Co-Authored-By: [email protected] <[email protected]> * refactor: simplify service code - extract shared helpers, remove duplication Co-Authored-By: [email protected] <[email protected]> * feat: implement fixtures for bookings references --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import type { Booking, BookingReference, Prisma } from "@calcom/prisma/client";
|
|
import { TestingModule } from "@nestjs/testing";
|
|
import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
|
|
import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
|
|
|
|
export class BookingReferenceRepositoryFixture {
|
|
private prismaReadClient: PrismaReadService["prisma"];
|
|
private prismaWriteClient: PrismaWriteService["prisma"];
|
|
|
|
constructor(module: TestingModule) {
|
|
this.prismaReadClient = module.get(PrismaReadService).prisma;
|
|
this.prismaWriteClient = module.get(PrismaWriteService).prisma;
|
|
}
|
|
|
|
async getById(id: BookingReference["id"]) {
|
|
return this.prismaReadClient.bookingReference.findFirst({ where: { id } });
|
|
}
|
|
|
|
async getByBookingId(bookingId: Booking["id"]) {
|
|
return this.prismaReadClient.bookingReference.findMany({ where: { bookingId } });
|
|
}
|
|
|
|
async create(bookingReference: Prisma.BookingReferenceCreateInput) {
|
|
return this.prismaWriteClient.bookingReference.create({ data: bookingReference });
|
|
}
|
|
|
|
async deleteById(id: BookingReference["id"]) {
|
|
return this.prismaWriteClient.bookingReference.deleteMany({ where: { id } });
|
|
}
|
|
|
|
async deleteByBookingId(bookingId: Booking["id"]) {
|
|
return this.prismaWriteClient.bookingReference.deleteMany({ where: { bookingId } });
|
|
}
|
|
}
|