cr-database/models/Score.ts

62 lines
1.3 KiB
TypeScript
Raw Normal View History

2021-12-25 13:58:49 -05:00
import { prop } from '@typegoose/typegoose';
2021-12-25 13:37:42 -05:00
2021-12-25 13:58:49 -05:00
// dupe, but the model format is different
2021-12-25 13:37:42 -05:00
export interface Inquiry {
id?: string,
name: string,
reason: string,
date: Date,
2021-12-25 13:58:49 -05:00
report: Score,
2021-12-25 13:37:42 -05:00
}
2021-12-25 13:58:49 -05:00
export default class Score {
@prop({ required: true })
public userID: string;
2021-12-25 14:05:28 -05:00
// total will be between 800-200 - 0 signifies "No Score", too little information is available or other variable are too low
2021-12-25 13:58:49 -05:00
// 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 publicroles: number;
// -50 - 2
@prop({ required: true })
public moderation: number;
// -20 - 50
@prop({ required: true })
public cloudServices: number;
2021-12-25 13:37:42 -05:00
// 0 or 20, 20 points are added if the user is a staff member
2021-12-25 13:58:49 -05:00
@prop({ required: true })
public staff: number;
2021-12-25 13:37:42 -05:00
2021-12-25 13:58:49 -05:00
@prop({ required: true })
public other: number;
2021-12-25 13:37:42 -05:00
2021-12-25 13:58:49 -05:00
@prop({ required: true })
public notify: boolean;
2021-12-25 13:37:42 -05:00
2021-12-25 13:58:49 -05:00
@prop({ required: true })
public locked: boolean;
2021-12-25 13:37:42 -05:00
2021-12-25 13:58:49 -05:00
@prop({ required: true })
public inquiries: [Inquiry];
2021-12-25 13:37:42 -05:00
2021-12-25 13:58:49 -05:00
@prop({ required: true })
public softInquiries: [{ name: string, date: Date }];
@prop({ required: true })
public lastUpdate: Date;
@prop({ required: true })
public pin: number[];
}