feat: add manual invitation generator

This commit is contained in:
Remi
2025-09-17 20:26:33 +02:00
parent f1d18a267b
commit 3e4c1093b8
6 changed files with 221 additions and 2 deletions

View File

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