import { Injectable } from '@nestjs/common'; import { Workspace, Prisma } from '@prisma/client'; import { PrismaService } from 'src/database/prisma.service'; @Injectable() export class WorkspaceRepository { constructor(private prisma: PrismaService) {} async findMany(params: { skip?: number; take?: number; cursor?: Prisma.WorkspaceWhereUniqueInput; where?: Prisma.WorkspaceWhereInput; orderBy?: Prisma.WorkspaceOrderByWithRelationInput; }): Promise { const { skip, take, cursor, where, orderBy } = params; return this.prisma.workspace.findMany({ skip, take, cursor, where, orderBy, }); } async findUnique( params: Prisma.WorkspaceFindUniqueArgs, ): Promise { return await this.prisma.workspace.findUnique(params); } async findFirst( params: Prisma.WorkspaceFindFirstArgs, ): Promise { return await this.prisma.workspace.findFirst(params); } }