chore: platform api usage based billing using queue (#15085)
* chore: platform api usage based billing using queue * fixup! chore: platform api usage based billing using queue * fixup! fixup! chore: platform api usage based billing using queue * fixup! Merge branch 'chore-platformapi-billing-queue' of github.com:calcom/cal.com into chore-platformapi-billing-queue * fixup! fixup! Merge branch 'chore-platformapi-billing-queue' of github.com:calcom/cal.com into chore-platformapi-billing-queue * fixup! Merge branch 'main' into chore-platformapi-billing-queue * chore: platform billing by userId * fix: fix tests requirement team subscirption * fixup! Merge branch 'main' into chore-platformapi-billing-queue * fixup! fixup! Merge branch 'main' into chore-platformapi-billing-queue * fixup! Merge branch 'main' into chore-platformapi-billing-queue * improve tests logs * fix: silently close redis and queue * fixup! Merge branch 'main' into chore-platformapi-billing-queue * fixup! Merge branch 'main' into chore-platformapi-billing-queue * fixup! fixup! Merge branch 'main' into chore-platformapi-billing-queue * fix: upgrade libraries version
This commit is contained in:
1 parent
5983c960a6
commit
e8b36d5b0b
37 files changed
+347
-91
No files matched your search
@@ -70,6 +70,26 @@ export class OrganizationsRepository {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async findPlatformOrgFromUserId(userId: number) {
|
||||
return this.dbRead.prisma.team.findFirstOrThrow({
|
||||
where: {
|
||||
orgProfiles: {
|
||||
some: {
|
||||
userId: userId,
|
||||
},
|
||||
},
|
||||
isPlatform: true,
|
||||
isOrganization: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
isPlatform: true,
|
||||
isOrganization: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async findOrgUser(organizationId: number, userId: number) {
|
||||
return this.dbRead.prisma.user.findUnique({
|
||||
where: {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
|
||||
import { UserWithProfile } from "@/modules/users/users.repository";
|
||||
import { Injectable, NotFoundException } from "@nestjs/common";
|
||||
|
||||
import { createEventType, updateEventType } from "@calcom/platform-libraries-0.0.20";
|
||||
import { createEventType, updateEventType } from "@calcom/platform-libraries-0.0.21";
|
||||
import {
|
||||
CreateTeamEventTypeInput_2024_06_14,
|
||||
UpdateTeamEventTypeInput_2024_06_14,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CreateUserInput } from "@/modules/users/inputs/create-user.input";
|
||||
import { Injectable, ConflictException } from "@nestjs/common";
|
||||
import { plainToInstance } from "class-transformer";
|
||||
|
||||
import { createNewUsersConnectToOrgIfExists } from "@calcom/platform-libraries-0.0.20";
|
||||
import { createNewUsersConnectToOrgIfExists } from "@calcom/platform-libraries-0.0.21";
|
||||
import { Team } from "@calcom/prisma/client";
|
||||
|
||||
@Injectable()
|
||||
|
||||
Reference in new issue
Block a user