48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
|
// 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,
|
||
|
inquiries: [{ name: string, reason: string}],
|
||
|
}
|
||
|
|
||
|
const Score: Schema = new Schema({
|
||
|
userID: String,
|
||
|
total: Number,
|
||
|
activity: Number,
|
||
|
roles: Number,
|
||
|
moderation: Number,
|
||
|
cloudServices: Number,
|
||
|
staff: Number,
|
||
|
inquiries: Array,
|
||
|
});
|
||
|
|
||
|
export default model<ScoreInterface>('Score', Score);
|