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,
|
|
|
|
emailAddress: string,
|
|
|
|
createdBy: string,
|
|
|
|
createdAt: Date,
|
|
|
|
locked: boolean,
|
|
|
|
permissions: {
|
|
|
|
support: boolean,
|
|
|
|
staff: boolean,
|
|
|
|
supervisor: boolean,
|
|
|
|
communityManager: boolean,
|
|
|
|
engineer: boolean
|
|
|
|
},
|
|
|
|
root: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
const Account: Schema = new Schema({
|
2019-10-26 00:02:09 -04:00
|
|
|
username: String,
|
2019-10-14 15:46:10 -04:00
|
|
|
userID: String,
|
|
|
|
emailAddress: String,
|
|
|
|
createdBy: String,
|
|
|
|
createdAt: Date,
|
|
|
|
locked: Boolean,
|
|
|
|
permissions: {
|
|
|
|
support: Boolean,
|
|
|
|
staff: Boolean,
|
|
|
|
supervisor: Boolean,
|
|
|
|
communityManager: Boolean,
|
2019-10-14 23:37:04 -04:00
|
|
|
engineer: Boolean,
|
2019-10-14 15:46:10 -04:00
|
|
|
},
|
2019-10-14 23:37:04 -04:00
|
|
|
root: Boolean,
|
2019-10-14 15:46:10 -04:00
|
|
|
});
|
|
|
|
|
2019-10-14 23:37:04 -04:00
|
|
|
export default model<AccountInterface>('Account', Account);
|