mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-06 17:53:19 +08:00
Add roadmap voting and waitlist stats updates
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user