Add roadmap voting and waitlist stats updates

This commit is contained in:
Remi
2025-09-16 18:37:13 +02:00
parent 147761311d
commit c46ac3765d
10 changed files with 637 additions and 63 deletions

View File

@@ -4,20 +4,24 @@ const { Schema } = mongoose
export interface InvitationCodeDocument extends mongoose.Document {
code: string
createdBy: mongoose.Types.ObjectId
createdBy?: mongoose.Types.ObjectId
createdAt: Date
expiresAt?: Date
usedBy?: mongoose.Types.ObjectId
usedAt?: Date
channel: 'user' | 'bootstrap'
label?: string
}
const invitationSchema = new mongoose.Schema<InvitationCodeDocument>({
code: { type: String, required: true, unique: true, uppercase: true, trim: true },
createdBy: { type: Schema.Types.ObjectId, ref: 'User', required: true },
createdBy: { type: Schema.Types.ObjectId, ref: 'User' },
createdAt: { type: Date, default: () => new Date() },
expiresAt: { type: Date },
usedBy: { type: Schema.Types.ObjectId, ref: 'User' },
usedAt: { type: Date },
channel: { type: String, enum: ['user', 'bootstrap'], default: 'user' },
label: { type: String, trim: true },
})
export const InvitationCode =