good forst commit

This commit is contained in:
2026-06-09 02:02:40 +05:30
parent 801c1d7121
commit 249d759e6a
215 changed files with 15425 additions and 1240 deletions
+28
View File
@@ -0,0 +1,28 @@
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const total = await prisma.group.count({ where: { claimStatus: 'PENDING_CLAIM' } });
const perTenant = await prisma.tenant.findMany({
where: { groups: { some: { claimStatus: 'PENDING_CLAIM' } } },
select: {
id: true,
name: true,
slug: true,
_count: { select: { groups: { where: { claimStatus: 'PENDING_CLAIM' } } } },
},
});
const sample = await prisma.group.findMany({
where: { claimStatus: 'PENDING_CLAIM' },
take: 3,
select: { id: true, name: true, platform: true, platformId: true, createdAt: true },
});
console.log('TOTAL PENDING_CLAIM:', total);
console.log('PER TENANT:', JSON.stringify(perTenant, null, 2));
console.log('SAMPLE:', JSON.stringify(sample, null, 2));
}
main()
.catch((e) => { console.error(e); process.exit(1); })
.finally(() => prisma.$disconnect());