44 lines
856 B
TypeScript
44 lines
856 B
TypeScript
import { Document, Schema, model } from 'mongoose';
|
|
|
|
export interface AccountInterface extends Document {
|
|
username: string,
|
|
userID: string,
|
|
homepath: string,
|
|
emailAddress: string,
|
|
createdBy: string,
|
|
createdAt: Date,
|
|
locked: boolean,
|
|
tier: number;
|
|
permissions: {
|
|
associate: boolean,
|
|
sheriff: boolean,
|
|
facultyMarshal: boolean,
|
|
},
|
|
root: boolean,
|
|
hash: boolean,
|
|
salt: string,
|
|
authTag: Buffer
|
|
}
|
|
|
|
const Account: Schema = new Schema({
|
|
username: String,
|
|
userID: String,
|
|
homepath: String,
|
|
emailAddress: String,
|
|
createdBy: String,
|
|
createdAt: Date,
|
|
locked: Boolean,
|
|
tier: Number,
|
|
permissions: {
|
|
associate: Boolean,
|
|
sheriff: Boolean,
|
|
facultyMarshal: Boolean,
|
|
},
|
|
root: Boolean,
|
|
hash: Boolean,
|
|
salt: String,
|
|
authTag: Buffer,
|
|
});
|
|
|
|
export default model<AccountInterface>('Account', Account);
|