adds CommunityReport.ts and Inquiry.ts database models

master
Matthew 2024-03-25 14:26:25 -04:00
parent b122dd3867
commit f673b1573c
Signed by: matthew
SSH Key Fingerprint: SHA256:piIXekA9q1p0ZGi4ogFbNY1embip5Ytbi3v8AZ8UYq4
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,29 @@
import { prop, getModelForClass, Ref } from "@typegoose/typegoose"
import Member, { MemberAdditionalAcknowledgement, MemberUsedLanguages, MemberUsedOperatingSystems } from "./Member";
interface AddtlScoreData {
activity: number;
roles: number;
moderation: number;
cloudServices: number;
misc: number;
}
/* TODO
* Comments
* Further attributes for class
* */
export default class CommunityReport {
@prop({ required: true, index: true, ref: () => Member })
public member: Ref<Member> | undefined;
@prop()
public lastUpdated: Date | undefined;
@prop()
public score: number | undefined;
@prop()
public additionalScoreData: AddtlScoreData | undefined;
}

25
database/Inquiry.ts Normal file
View File

@ -0,0 +1,25 @@
import { prop, getModelForClass, Ref } from "@typegoose/typegoose"
import Member, { MemberAdditionalAcknowledgement, MemberUsedLanguages, MemberUsedOperatingSystems } from "./Member";
import CommunityReport from "./CommunityReport"
/**
* TODO:
* - Comments
* - Inquiry identifier
* - Reason
*/
export default abstract class Inquiry {
@prop({ required: true, index: true, ref: () => Member })
public member: Ref<Member> | undefined;
@prop({ required: true })
public date: Date | undefined;
@prop({ required: true, ref: () => Member })
public initiatedBy: Ref<Member> | string | undefined;
@prop({ required: true, ref: () => CommunityReport })
public report: Ref<CommunityReport> | undefined;
}