feat: certification rules, content sanitization, handle draft course updates and reset content, better redis logging

This commit is contained in:
Rotimi Best
2026-03-30 08:24:55 +01:00
parent ff2ad59377
commit 5a8f50f67b
131 changed files with 5643 additions and 2134 deletions
@@ -0,0 +1,28 @@
import { and, db, eq, organizationPlan } from '@db/drizzle';
export async function seedEnterpriseOrganizationPlan({ enterpriseOrgId }: { enterpriseOrgId: string }) {
const existing = await db
.select()
.from(organizationPlan)
.where(
and(
eq(organizationPlan.orgId, enterpriseOrgId),
eq(organizationPlan.planName, 'ENTERPRISE'),
eq(organizationPlan.isActive, true)
)
);
if (existing.length > 0) {
console.log(' ✓ Enterprise organization plan already exists, skipping');
return;
}
await db.insert(organizationPlan).values({
orgId: enterpriseOrgId,
planName: 'ENTERPRISE',
isActive: true,
subscriptionId: 'seed-coursera-test-enterprise',
provider: 'seed'
});
console.log(' ✓ Inserted enterprise organization plan');
}