openhim-core
Version:
The OpenHIM core application that provides logging and routing of http requests
51 lines (43 loc) • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UserModel = exports.UserModelAPI = void 0;
var _mongoose = require("mongoose");
var _config = require("../config");
const UserSchema = new _mongoose.Schema({
firstname: {
type: String,
required: true
},
surname: {
type: String,
required: true
},
email: {
type: String,
required: true,
unique: true
},
passwordAlgorithm: String,
passwordHash: String,
passwordSalt: String,
groups: [String],
msisdn: String,
dailyReport: Boolean,
weeklyReport: Boolean,
settings: Object,
token: String,
tokenType: {
type: String,
enum: ['newUser', 'existingUser', null]
},
// null is needed as we used nulls to clear to token and tokenType
expiry: Date,
locked: Boolean
}); // compile the User Schema into a Model
const UserModelAPI = _config.connectionAPI.model('User', UserSchema);
exports.UserModelAPI = UserModelAPI;
const UserModel = _config.connectionDefault.model('User', UserSchema);
exports.UserModel = UserModel;
//# sourceMappingURL=users.js.map