crra/database/Inquiry.ts

38 lines
1.3 KiB
TypeScript

import { prop, getModelForClass, Ref } from "@typegoose/typegoose"
import Member from "./Member";
import CommunityReport from "./CommunityReport"
/**
* TODO:
* - Comments
* - Inquiry identifier
* - Reason
*/
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;
}