Files
GPI/src/server/models/Organization.ts
2026-03-12 19:36:34 +00:00

18 lines
554 B
TypeScript

import mongoose, { Schema, Document } from 'mongoose';
export interface IOrganization extends Document {
clerkId: string;
name?: string;
isBanned: boolean;
createdAt: Date;
updatedAt: Date;
}
const OrganizationSchema: Schema = new Schema({
clerkId: { type: String, required: true, unique: true, index: true },
name: { type: String },
isBanned: { type: Boolean, default: false },
}, { timestamps: true });
export default mongoose.models.Organization || mongoose.model<IOrganization>('Organization', OrganizationSchema);