feat: v2 routing forms responses endpoints (#19319)
* wip: routing forms responses * refactor structure * Revert "refactor structure" This reverts commit b641c06592cd9314008e81c4584039bd42393ac7. * routing forms * remove unused file
This commit is contained in:
1 parent
0b3aa4fd34
commit
e6daed762b
19 files changed
+714
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
|
||||
import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
|
||||
import { TestingModule } from "@nestjs/testing";
|
||||
import { Prisma, App_RoutingForms_Form } from "@prisma/client";
|
||||
|
||||
export class RoutingFormsRepositoryFixture {
|
||||
private prismaReadClient: PrismaReadService["prisma"];
|
||||
private prismaWriteClient: PrismaWriteService["prisma"];
|
||||
|
||||
constructor(private readonly module: TestingModule) {
|
||||
this.prismaReadClient = module.get(PrismaReadService).prisma;
|
||||
this.prismaWriteClient = module.get(PrismaWriteService).prisma;
|
||||
}
|
||||
|
||||
async get(routingFormId: App_RoutingForms_Form["id"]) {
|
||||
return this.prismaReadClient.app_RoutingForms_Form.findUnique({ where: { id: routingFormId } });
|
||||
}
|
||||
|
||||
async create(data: Prisma.App_RoutingForms_FormCreateInput) {
|
||||
return this.prismaWriteClient.app_RoutingForms_Form.create({ data });
|
||||
}
|
||||
|
||||
async delete(routingFormId: App_RoutingForms_Form["id"]) {
|
||||
return this.prismaWriteClient.app_RoutingForms_Form.delete({ where: { id: routingFormId } });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user