feat: api v2 webhooks for users and event-types (#15996)
* feat: webhooks for users * fixup! feat: webhooks for users * feat: webhooks for user event types * feat: webhooks for user event types * fixup! Merge branch 'main' into feat-webhooks-api-v2 * doc * chore: split webhook service * chore: webhook repo only depends on prisma * chore: split webhook outputs * fixup! chore: split webhook outputs * chore: describe payload template * chore: pipe webhook input and output * chore: use partialType for update dtos * chore: improve dto
This commit is contained in:
1 parent
b91c767d0c
commit
c059d79a51
21 files changed
+1934
-208
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
|
||||
import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
|
||||
import { TestingModule } from "@nestjs/testing";
|
||||
import { Prisma } from "@prisma/client";
|
||||
|
||||
export class WebhookRepositoryFixture {
|
||||
private primaReadClient: PrismaReadService["prisma"];
|
||||
private prismaWriteClient: PrismaWriteService["prisma"];
|
||||
|
||||
constructor(private readonly module: TestingModule) {
|
||||
this.primaReadClient = module.get(PrismaReadService).prisma;
|
||||
this.prismaWriteClient = module.get(PrismaWriteService).prisma;
|
||||
}
|
||||
|
||||
async create(data: Prisma.WebhookCreateInput) {
|
||||
return this.prismaWriteClient.webhook.create({ data });
|
||||
}
|
||||
|
||||
async delete(webhookId: string) {
|
||||
return this.prismaWriteClient.webhook.delete({ where: { id: webhookId } });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user