Charts
-
+
diff --git a/packages/lib/server-only/admin/get-users-stats.ts b/packages/lib/server-only/admin/get-users-stats.ts
index 13b541d0a..790b9e9a0 100644
--- a/packages/lib/server-only/admin/get-users-stats.ts
+++ b/packages/lib/server-only/admin/get-users-stats.ts
@@ -50,16 +50,6 @@ export const getUserWithAtLeastOneDocumentSignedPerMonth = async () => {
});
};
-export const getUsersWithLastSignedInCount = async () => {
- return await prisma.user.count({
- where: {
- lastSignedIn: {
- gte: DateTime.now().minus({ months: 1 }).toJSDate(),
- },
- },
- });
-};
-
export type GetUserWithDocumentMonthlyGrowth = Array<{
month: string;
count: number;
diff --git a/packages/prisma/mau-seed.ts b/packages/prisma/mau-seed.ts
deleted file mode 100644
index 007550a5d..000000000
--- a/packages/prisma/mau-seed.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-import { DateTime } from 'luxon';
-
-import { hashSync } from '@documenso/lib/server-only/auth/hash';
-
-import { prisma } from '.';
-import { Role } from './client';
-
-const USERS_PER_MONTH = 20;
-const MONTHS_OF_HISTORY = 12;
-
-export const seedMAUData = async () => {
- const now = DateTime.now();
-
- for (let monthsAgo = MONTHS_OF_HISTORY - 1; monthsAgo >= 0; monthsAgo--) {
- const monthStart = now.minus({ months: monthsAgo }).startOf('month');
- const monthEnd = monthStart.endOf('month');
-
- console.log(`Seeding users for ${monthStart.toFormat('yyyy-MM')}`);
-
- const users = await Promise.all(
- Array.from({ length: USERS_PER_MONTH }).map(async (_, index) => {
- const createdAt = DateTime.fromMillis(
- monthStart.toMillis() + Math.random() * (monthEnd.toMillis() - monthStart.toMillis()),
- ).toJSDate();
-
- const lastSignedIn =
- Math.random() > 0.3
- ? DateTime.fromMillis(
- createdAt.getTime() + Math.random() * (now.toMillis() - createdAt.getTime()),
- ).toJSDate()
- : createdAt;
-
- return prisma.user.create({
- data: {
- name: `MAU Test User ${monthsAgo}-${index}`,
- email: `mau-test-${monthsAgo}-${index}@documenso.com`,
- password: hashSync('password'),
- emailVerified: createdAt,
- createdAt,
- lastSignedIn,
- roles: [Role.USER],
- },
- });
- }),
- );
-
- console.log(`Created ${users.length} users for ${monthStart.toFormat('yyyy-MM')}`);
- }
-};
-
-// Run the seed if this file is executed directly
-if (require.main === module) {
- seedMAUData()
- .then(() => {
- console.log('MAU seed completed successfully');
- process.exit(0);
- })
- .catch((error) => {
- console.error('Error seeding MAU data:', error);
- process.exit(1);
- });
-}
diff --git a/packages/prisma/package.json b/packages/prisma/package.json
index 964fbbd01..d42fd701b 100644
--- a/packages/prisma/package.json
+++ b/packages/prisma/package.json
@@ -15,8 +15,7 @@
"prisma:migrate-deploy": "prisma migrate deploy",
"prisma:migrate-reset": "prisma migrate reset",
"prisma:seed": "prisma db seed",
- "prisma:studio": "prisma studio",
- "prisma:seed-mau": "tsx ./mau-seed.ts"
+ "prisma:studio": "prisma studio"
},
"prisma": {
"seed": "tsx ./seed-database.ts"