Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat(organization-repository): enhance organization filtering and user selection fields

Enno Gelhaus6d661f760dae
diff --git a/libraries/nestjs-libraries/src/database/prisma/organizations/organization.repository.ts b/libraries/nestjs-libraries/src/database/prisma/organizations/organization.repository.ts
index 947d5e964..cb8292518 100644
--- a/libraries/nestjs-libraries/src/database/prisma/organizations/organization.repository.ts
+++ b/libraries/nestjs-libraries/src/database/prisma/organizations/organization.repository.ts
@@ -126,6 +126,38 @@ export class OrganizationRepository {
contains: name,
},
},
+ {
+ organization: {
+ OR: [
+ {
+ paymentId: {
+ equals: name,
+ },
+ },
+ {
+ subscription: {
+ identifier: {
+ equals: name,
+ },
+ },
+ },
+ {
+ Integration: {
+ some: {
+ id: name,
+ },
+ },
+ },
+ {
+ post: {
+ some: {
+ id: name,
+ },
+ },
+ },
+ ],
+ },
+ },
{
user: {
OR: [
@@ -154,13 +186,20 @@ export class OrganizationRepository {
select: {
id: true,
role: true,
+ disabled: true,
organization: {
select: {
id: true,
name: true,
+ paymentId: true,
+ deletedAt: true,
subscription: {
select: {
subscriptionTier: true,
+ identifier: true,
+ isLifetime: true,
+ period: true,
+ cancelAt: true,
},
},
},
@@ -170,6 +209,9 @@ export class OrganizationRepository {
id: true,
name: true,
email: true,
+ activated: true,
+ providerName: true,
+ deletedAt: true,
},
},
},