add Inquiries and various comments

master
Matthew 2024-03-25 15:12:04 -04:00
parent 95f5a864d3
commit c1945a0bcd
Signed by: matthew
SSH Key Fingerprint: SHA256:piIXekA9q1p0ZGi4ogFbNY1embip5Ytbi3v8AZ8UYq4
3 changed files with 31 additions and 1 deletions

11
database/HardInquiry.ts Normal file
View File

@ -0,0 +1,11 @@
import { prop, getModelForClass, Ref } from "@typegoose/typegoose"
import Inquiry from "./Inquiry";
/**
* HardInquiry is a class which extends Inquiry.
* Structure is performed this way to have two separate collections for Hard and Soft inquiries.
*/
export default class HardInquiry extends Inquiry {
@prop({ required: true })
public reason: string | undefined;
}

View File

@ -1,5 +1,5 @@
import { prop, getModelForClass, Ref } from "@typegoose/typegoose"
import Member, { MemberAdditionalAcknowledgement, MemberUsedLanguages, MemberUsedOperatingSystems } from "./Member";
import Member from "./Member";
import CommunityReport from "./CommunityReport"
/**
@ -11,15 +11,27 @@ import CommunityReport from "./CommunityReport"
export default abstract class Inquiry {
@prop({ required: true, unique: true })
// the Inquiry Identifier (previously known as `iid`). this is an UUIDv4 string
public id: string | undefined;
@prop({ required: true, index: true, ref: () => Member })
// the member on which this inquiry was performed on
public member: Ref<Member> | undefined;
@prop({ required: true })
// the date in which this inquiry was performed
public date: Date | undefined;
@prop({ required: true, ref: () => Member })
// the reference to the member who initiated this inquiry or a string value representing the name of a system that initiated the inquiry
public initiatedBy: Ref<Member> | string | undefined;
@prop({ required: true, ref: () => CommunityReport })
// the report that was generated or fetched from this inquiry as of current date
public report: Ref<CommunityReport> | undefined;
@prop()
// a reason for the inquiry, if applicable. this value is required for HardInquiry
public reason: string | "N/A" | undefined;
}

7
database/SoftInquiry.ts Normal file
View File

@ -0,0 +1,7 @@
import Inquiry from "./Inquiry";
/**
* SoftInquiry is a class which extends Inquiry.
* Structure is performed this way to have two separate collections for Hard and Soft inquiries.
*/
export default class SoftInquiry extends Inquiry {}