import { Schema, model } from 'mongoose';
const organizationSchema = new Schema({
    name: { type: String, required: true, unique: true },
    createdBy: { type: Schema.Types.ObjectId, required: true },
    users: [{ type: Schema.Types.ObjectId, required: true }],
}, {
    timestamps: true,
});
organizationSchema.index({ name: 1, createdBy: 1 }, { unique: true });
export const OrganizationModel = model('Organization', organizationSchema);
