cr-database/mongodb/Score.ts

62 lines
1.2 KiB
TypeScript

import { prop } from '@typegoose/typegoose';
// dupe, but the model format is different
export interface Inquiry {
id?: string,
name: string,
reason: string,
date: Date,
report: Score,
}
export default class Score {
@prop({ required: true })
public userID: string;
// total will be between 800-200 - 0 signifies "No Score", too little information is available or other variable are too low
// calculation: Math.floor(COMBINED_SUBSCORES * 5 * 5.13)`
@prop({ required: true })
public total: number;
// 10 - 55
@prop({ required: true })
public activity: number;
// 0 - 54
@prop({ required: true })
public roles: number;
// -50 - 2
@prop({ required: true })
public moderation: number;
// -20 - 50
@prop({ required: true })
public cloudServices: number;
// 0 or 20, 20 points are added if the user is a staff member
@prop({ required: true })
public staff: number;
@prop({ required: true })
public other: number;
@prop()
public notify: boolean;
@prop()
public locked: boolean;
@prop({ default: [] })
public inquiries: [Inquiry];
@prop({ default: [] })
public softInquiries: [{ name: string, date: Date }];
@prop()
public lastUpdate: Date;
@prop()
public pin: number[];
}