forked from engineering/crv2
adds CommunityReport.ts and Inquiry.ts database models
parent
b122dd3867
commit
f673b1573c
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue