{"size": 653, "ext": "js", "max_stars_repo_path": "models/UserModel.js", "max_stars_repo_name": "firmanJS/express-boillerplate-restfullapi", "max_stars_repo_stars_event_min_datetime": "2020-07-28T11:35:53.000Z", "max_stars_repo_stars_event_max_datetime": "2020-12-31T05:14:46.000Z", "max_issues_repo_path": "models/UserModel.js", "max_issues_repo_name": "firmanJS/express-boillerplate-restfullapi", "max_issues_repo_issues_event_min_datetime": "2020-12-08T09:16:53.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-13T01:56:37.000Z", "max_forks_repo_path": "models/UserModel.js", "max_forks_repo_name": "firmanJS/express-boillerplate-restfullapi", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 32.65, "max_line_length": 64, "alphanum_fraction": 0.6860643185}
const mongoose = require('mongoose')
const attributes = require('./attributes/user_attr')
const remap = require('./functions/user_func')

const { Schema } = mongoose

const UserSchema = new Schema({
  fullname: { type: String, upercase: true, index: true },
  ...attributes,
  password: { type: String, index: true, required: true },
  createdBy: { type: String, index: true, default: null },
  last_login: { type: Date, default: new Date().toISOString() },
  updatedBy: { type: String, index: true, default: null }
}, { timestamps: true })

UserSchema.methods.userList = () => {
  remap.list(this)
}
module.exports = mongoose.model('User', UserSchema)
