refactor: platform org event types (#15961)
* chore: platform-libraries export updateNewTeamMemberEventTypes * chore: platform-libraries export updateNewTeamMemberEventTypes * chore: v2 api bump platform-libraries to 0.0.22 * fix: add created managed user to assignAllMembers: true team event-types * fix: add created organizations user to assignAllMembers: true team event-types * refactor: organization teams chose if team creator is auto-accepted * refactor: managed users have only 2 default event types with video * refactor: lowercase schedulingType for creating team event-types * refactor: lowercase schedulingType for creating team event-types * feat: separate platform teams by OAuth client * swagger regenerate * refactor: delete platform team when oauth client deleted * revert: keep 4 default event-types * fix: tests && merge of main into this branch * fix: typecheck --------- Co-authored-by: Morgan <[email protected]>
This commit is contained in:
1 parent
2f946fc5da
commit
41e565fcf8
45 files changed
+1186
-296
No files matched your search
@@ -4,6 +4,8 @@ import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
|
||||
import { TestingModule } from "@nestjs/testing";
|
||||
import { EventType } from "@prisma/client";
|
||||
|
||||
import { Prisma } from "@calcom/prisma/client";
|
||||
|
||||
export class EventTypesRepositoryFixture {
|
||||
private primaReadClient: PrismaReadService["prisma"];
|
||||
private prismaWriteClient: PrismaWriteService["prisma"];
|
||||
@@ -26,6 +28,9 @@ export class EventTypesRepositoryFixture {
|
||||
where: {
|
||||
teamId,
|
||||
},
|
||||
include: {
|
||||
hosts: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -41,6 +46,10 @@ export class EventTypesRepositoryFixture {
|
||||
});
|
||||
}
|
||||
|
||||
async createTeamEventType(data: Prisma.EventTypeCreateInput) {
|
||||
return this.prismaWriteClient.eventType.create({ data });
|
||||
}
|
||||
|
||||
async delete(eventTypeId: EventType["id"]) {
|
||||
return this.prismaWriteClient.eventType.delete({ where: { id: eventTypeId } });
|
||||
}
|
||||
|
||||
@@ -23,4 +23,13 @@ export class TeamRepositoryFixture {
|
||||
async delete(teamId: Team["id"]) {
|
||||
return this.prismaWriteClient.team.delete({ where: { id: teamId } });
|
||||
}
|
||||
|
||||
async getPlatformOrgTeams(organizationId: number, oAuthClientId: string) {
|
||||
return this.primaReadClient.team.findMany({
|
||||
where: {
|
||||
parentId: organizationId,
|
||||
createdByOAuthClientId: oAuthClientId,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user