crv2/database/Inquiry.ts

37 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2024-10-25 16:57:33 -04:00
import { prop, getModelForClass, Ref } from "@typegoose/typegoose";
2024-03-25 15:12:04 -04:00
import Member from "./Member";
2024-10-25 16:57:33 -04:00
import CommunityReport from "./CommunityReport";
/**
* TODO:
* - Comments
* - Inquiry identifier
* - Reason
*/
export default abstract class Inquiry {
2024-10-25 16:57:33 -04:00
@prop({ required: true, unique: true })
// the Inquiry Identifier (previously known as `iid`). this is an UUIDv4 string
public id: string | undefined;
2024-03-25 15:12:04 -04:00
2024-10-25 16:57:33 -04:00
@prop({ required: true, index: true, ref: () => Member })
// the member on which this inquiry was performed on
public member: Ref<Member> | undefined;
2024-10-25 16:57:33 -04:00
@prop({ required: true })
// the date in which this inquiry was performed
public date: Date | undefined;
2024-10-25 16:57:33 -04:00
@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;
2024-10-25 16:57:33 -04:00
@prop({ required: true, ref: () => CommunityReport })
// the report that was generated or fetched from this inquiry as of current date
public report: Ref<CommunityReport> | undefined;
2024-03-25 15:12:04 -04:00
2024-10-25 16:57:33 -04:00
@prop()
// a reason for the inquiry, if applicable. this value is required for HardInquiry
public reason: string | "N/A" | undefined;
}