Skip to content

Instantly share code, notes, and snippets.

View haseeb5555's full-sized avatar
🌴
On vacation

Muhammad Haseeb haseeb5555

🌴
On vacation
View GitHub Profile
@haseeb5555
haseeb5555 / postDistribution.ts
Last active November 26, 2024 04:58
Fair Post Distribution Algorithm
import { PrismaClient, Prisma, DistributionStatus, UserRole } from '@prisma/client';
const prisma = new PrismaClient();
export class PostDistributionManager {
private distributionIntervals = [
1, // 1 day
3, // 3 day
7, // week
14,