community-relations/src/models/Score.ts

71 lines
1.6 KiB
TypeScript
Raw Normal View History

2020-09-03 03:47:24 -04:00
// Community Score
import { Document, Schema, model } from 'mongoose';
export interface ScoreInterface extends Document {
userID: string
/**
* total will be between 800-200 - 0 signfies "No Score", too little information is available or other variable are too low
* - CALCULATION: `(COMBINED SUBSCORES x 5) * 5.13; Math.floor()`
*/
total: number,
/**
* 10 - 55
*/
activity: number,
/**
* 0 - 54
*/
roles: number,
/**
* -50 - 2
* all users start out with 2 moderation points, the number of points decreases for each moderation.
*/
moderation: number,
/**
* -20 - 50
* processed by CSD
*/
cloudServices: number,
// 0 or 20, 20 points are added if the user is a staff member
staff: number,
2020-09-13 23:55:45 -04:00
other: number,
2020-09-10 00:54:19 -04:00
notify: boolean,
2020-09-14 11:21:00 -04:00
locked: boolean,
2020-09-07 01:22:06 -04:00
inquiries: [{ name: string, reason: string, date: Date }],
2020-09-20 22:33:56 -04:00
softInquiries: [{ name: string, date: Date }],
2020-09-13 18:58:58 -04:00
lastUpdate: Date,
2020-09-19 16:30:44 -04:00
pin: number[],
// general & media
/* generalMessagesRatio: number,
// programming-support channels and cloud-support
supportMessagesRatio: number,
totalModerations: number,
notes: number, */
2020-09-03 03:47:24 -04:00
}
const Score: Schema = new Schema({
userID: String,
total: Number,
activity: Number,
roles: Number,
moderation: Number,
cloudServices: Number,
staff: Number,
2020-09-13 23:55:45 -04:00
other: Number,
2020-09-10 00:54:19 -04:00
notify: Boolean,
2020-09-14 11:21:00 -04:00
locked: Boolean,
2020-09-03 03:47:24 -04:00
inquiries: Array,
2020-09-20 22:33:56 -04:00
softInquiries: Array,
2020-09-13 18:58:58 -04:00
lastUpdate: Date,
2020-09-19 16:30:44 -04:00
pin: Array,
/* generalMessagesRatio: Number,
supportMessagesRatio: Number,
totalModerations: Number,
notes: Number, */
2020-09-03 03:47:24 -04:00
});
export default model<ScoreInterface>('Score', Score);