2019-10-14 15:46:10 -04:00
|
|
|
import { Document, Schema, model } from 'mongoose';
|
|
|
|
|
|
|
|
export interface AccountInterface extends Document {
|
2019-10-26 00:02:09 -04:00
|
|
|
username: string,
|
2019-10-14 15:46:10 -04:00
|
|
|
userID: string,
|
2019-12-27 14:08:04 -05:00
|
|
|
homepath: string,
|
2019-10-14 15:46:10 -04:00
|
|
|
emailAddress: string,
|
|
|
|
createdBy: string,
|
|
|
|
createdAt: Date,
|
|
|
|
locked: boolean,
|
2020-03-29 04:32:17 -04:00
|
|
|
tier: number,
|
|
|
|
supportKey: string,
|
2019-10-14 15:46:10 -04:00
|
|
|
permissions: {
|
2020-03-28 12:10:58 -04:00
|
|
|
staff: boolean,
|
2020-04-20 16:04:38 -04:00
|
|
|
technician: boolean,
|
|
|
|
director: boolean,
|
2019-10-14 15:46:10 -04:00
|
|
|
},
|
2020-05-03 17:49:40 -04:00
|
|
|
ramLimitNotification: number,
|
2019-11-16 23:24:36 -05:00
|
|
|
root: boolean,
|
2019-11-19 08:26:15 -05:00
|
|
|
hash: boolean,
|
2019-11-16 23:58:11 -05:00
|
|
|
salt: string,
|
|
|
|
authTag: Buffer
|
2019-10-14 15:46:10 -04:00
|
|
|
}
|
|
|
|
|
2020-06-09 07:56:14 -04:00
|
|
|
const Account = new Schema<AccountInterface>({
|
2019-10-26 00:02:09 -04:00
|
|
|
username: String,
|
2019-10-14 15:46:10 -04:00
|
|
|
userID: String,
|
2019-12-23 12:08:42 -05:00
|
|
|
homepath: String,
|
2019-10-14 15:46:10 -04:00
|
|
|
emailAddress: String,
|
|
|
|
createdBy: String,
|
|
|
|
createdAt: Date,
|
|
|
|
locked: Boolean,
|
2020-03-23 22:26:42 -04:00
|
|
|
tier: Number,
|
2020-03-29 04:32:17 -04:00
|
|
|
supportKey: String,
|
2019-10-14 15:46:10 -04:00
|
|
|
permissions: {
|
2020-03-28 12:10:58 -04:00
|
|
|
staff: Boolean,
|
2020-04-20 16:04:38 -04:00
|
|
|
technician: Boolean,
|
|
|
|
director: Boolean,
|
2019-10-14 15:46:10 -04:00
|
|
|
},
|
2020-05-03 17:49:40 -04:00
|
|
|
ramLimitNotification: Number,
|
2019-10-14 23:37:04 -04:00
|
|
|
root: Boolean,
|
2019-11-19 08:26:15 -05:00
|
|
|
hash: Boolean,
|
2019-11-16 23:24:36 -05:00
|
|
|
salt: String,
|
2019-11-16 23:58:11 -05:00
|
|
|
authTag: Buffer,
|
2019-10-14 15:46:10 -04:00
|
|
|
});
|
|
|
|
|
2019-10-14 23:37:04 -04:00
|
|
|
export default model<AccountInterface>('Account', Account);
|