cr-database/mongodb/Score.ts

62 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-02-28 11:51:44 -05:00
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 })
2022-02-28 16:25:37 -05:00
public roles: number;
2022-02-28 11:51:44 -05:00
// -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;
2022-03-01 15:22:10 -05:00
@prop()
2022-02-28 11:51:44 -05:00
public notify: boolean;
2022-03-01 13:34:28 -05:00
@prop()
2022-02-28 11:51:44 -05:00
public locked: boolean;
2022-03-01 13:34:28 -05:00
@prop({ default: [] })
2022-02-28 11:51:44 -05:00
public inquiries: [Inquiry];
2022-03-01 13:34:28 -05:00
@prop({ default: [] })
2022-02-28 11:51:44 -05:00
public softInquiries: [{ name: string, date: Date }];
2022-03-01 13:34:28 -05:00
@prop()
2022-02-28 11:51:44 -05:00
public lastUpdate: Date;
2022-03-01 13:34:28 -05:00
@prop()
2022-02-28 11:51:44 -05:00
public pin: number[];
}