// user-types.js
// Copyright (C) 2022 DTP Technologies, LLC
// License: Apache-2.0

'use strict';

const mongoose = require('mongoose');
const Schema = mongoose.Schema;

module.exports.DTP_THEME_LIST = ['dtp-light', 'dtp-dark'];

module.exports.UserFlagsSchema = new Schema({
  isAdmin: { type: Boolean, default: false, required: true },
  isModerator: { type: Boolean, default: false, required: true },
  isEmailVerified: { type: Boolean, default: false, required: true },
});

module.exports.UserPermissionsSchema = new Schema({
  canLogin: { type: Boolean, default: true, required: true },
  canChat: { type: Boolean, default: true, required: true },
  canComment: { type: Boolean, default: true, required: true },
  canReport: { type: Boolean, default: true, required: true },
  canAuthorPages: { type: Boolean, default: false, required: true },
  canAuthorPosts: { type: Boolean, default: false, required: true },
  canPublishPages: { type: Boolean, default: false, required: true },
  canPublishPosts: { type: Boolean, default: false, required: true },
});

module.exports.UserOptInSchema = new Schema({
  system: { type: Boolean, default: true, required: true },
  marketing: { type: Boolean, default: true, required: true },
});