1
0
Fork 0
cloudservices/src/models/Account.ts

50 lines
1013 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,
supportKey: string,
permissions: {
staff: boolean,
technician: boolean,
director: boolean,
},
ramLimitNotification: number,
root: boolean,
hash: boolean,
salt: string,
authTag: Buffer
revokedBearers: string[],
}
const Account = new Schema<AccountInterface>({
username: String,
userID: String,
homepath: String,
emailAddress: String,
createdBy: String,
createdAt: Date,
locked: Boolean,
tier: Number,
supportKey: String,
permissions: {
staff: Boolean,
technician: Boolean,
director: Boolean,
},
ramLimitNotification: Number,
root: Boolean,
hash: Boolean,
salt: String,
authTag: Buffer,
revokedBearers: Array,
});
export default model<AccountInterface>('Account', Account);