cr-database/models/Member.ts

44 lines
1003 B
TypeScript

import { Document, Schema, model } from 'mongoose';
export interface MemberInterface extends Document {
userID: string,
additional?: {
langs: ['js', 'py', 'rb', 'ts', 'rs', 'go', 'cfam', 'csharp', 'swift', 'java', 'kt', 'asm'],
operatingSystems: ['arch', 'deb', 'cent', 'fedora', 'manjaro', 'mdarwin', 'redhat', 'ubuntu', 'win'],
github: string,
gitlab: string,
bio: string,
},
misc?: {
t3TemporaryExpiration?: {
date: Date,
processed: boolean
previousTier: 1 | 2 | 3
}
}
x509?: string,
pgp?: string,
}
const Member: Schema = new Schema({
userID: String,
additional: {
langs: Array,
operatingSystems: Array,
github: String,
gitlab: String,
bio: String,
},
misc: {
t3TemporaryExpiration: {
date: Date,
processed: Boolean,
previousTier: Number,
},
},
x509: String,
pgp: String,
});
export default model<MemberInterface>('Member', Member);