Compare commits

..

No commits in common. "ad9a518b97eb6debbbe80d34bd7703419457024c" and "f673b1573c0a74f9dd04cf204a355ca1cf8c3a24" have entirely different histories.

7 changed files with 8 additions and 76 deletions

View File

@ -1,13 +1,7 @@
import { prop, getModelForClass, Ref } from "@typegoose/typegoose" import { prop, getModelForClass, Ref } from "@typegoose/typegoose"
import Member, { MemberAdditionalAcknowledgement, MemberUsedLanguages, MemberUsedOperatingSystems } from "./Member"; import Member, { MemberAdditionalAcknowledgement, MemberUsedLanguages, MemberUsedOperatingSystems } from "./Member";
export enum GenerationMethod { interface AddtlScoreData {
TIMER_INTERNAL, // generated by the internal cron-job timer automatically
INQUIRY_INTERNAL, // internal inquiry generated internally directly through the system. user checks their own inquiry, hard inquiry is performed by a staff member, etc.
INQUIRY_EXTERNAL, // external inquiry generated externally through the system via an external authorized request, such as via EDS
}
export interface AddtlScoreData {
activity: number; activity: number;
roles: number; roles: number;
moderation: number; moderation: number;
@ -22,21 +16,14 @@ export interface AddtlScoreData {
export default class CommunityReport { export default class CommunityReport {
@prop({ required: true, index: true, ref: () => Member }) @prop({ required: true, index: true, ref: () => Member })
// the member on which this report was generated for
public member: Ref<Member> | undefined; public member: Ref<Member> | undefined;
@prop({ required: true }) @prop()
// the date in which this report was generated on public lastUpdated: Date | undefined;
public date: Date | undefined;
@prop({ required: true }) @prop()
// the CommScore of the member specified
public score: number | undefined; public score: number | undefined;
@prop({ required: true }) @prop()
// the method in which this report was generated under
public generationMethod: GenerationMethod | undefined;
@prop({ required: true })
public additionalScoreData: AddtlScoreData | undefined; public additionalScoreData: AddtlScoreData | undefined;
} }

View File

@ -1,11 +0,0 @@
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 { prop, getModelForClass, Ref } from "@typegoose/typegoose"
import Member from "./Member"; import Member, { MemberAdditionalAcknowledgement, MemberUsedLanguages, MemberUsedOperatingSystems } from "./Member";
import CommunityReport from "./CommunityReport" import CommunityReport from "./CommunityReport"
/** /**
@ -11,27 +11,15 @@ import CommunityReport from "./CommunityReport"
export default abstract class Inquiry { 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 }) @prop({ required: true, index: true, ref: () => Member })
// the member on which this inquiry was performed on
public member: Ref<Member> | undefined; public member: Ref<Member> | undefined;
@prop({ required: true }) @prop({ required: true })
// the date in which this inquiry was performed
public date: Date | undefined; public date: Date | undefined;
@prop({ required: true, ref: () => Member }) @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; public initiatedBy: Ref<Member> | string | undefined;
@prop({ required: true, ref: () => CommunityReport }) @prop({ required: true, ref: () => CommunityReport })
// the report that was generated or fetched from this inquiry as of current date
public report: Ref<CommunityReport> | undefined; 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;
} }

View File

@ -1,7 +0,0 @@
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 {}

View File

@ -1,15 +0,0 @@
import { prop } from '@typegoose/typegoose';
// This class represents a Vendor, which ia an entity that is permitted to access CommunityReport information, and may be permitted to manipulate data, through the HTtP API.
export default class Vendor {
@prop({ required: true })
public name: string | undefined;
@prop({ required: true, unique: true })
// the uuidv4 string identifier of the vendor; this functions as the identifier and api key for the vendor
public key: string | undefined;
@prop({ default: false })
// determines if this vendor can perform a Hard Inquiry and receive additional privileged information
public privileged: boolean | undefined;
}

10
package-lock.json generated
View File

@ -9,11 +9,9 @@
"discord.js": "^14.14.1", "discord.js": "^14.14.1",
"mongoose": "^8.2.2", "mongoose": "^8.2.2",
"stripe": "^14.21.0", "stripe": "^14.21.0",
"typeorm": "^0.3.20", "typeorm": "^0.3.20"
"uuid": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/uuid": "^9.0.8",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "^5.4.2" "typescript": "^5.4.2"
} }
@ -279,12 +277,6 @@
"undici-types": "~5.26.4" "undici-types": "~5.26.4"
} }
}, },
"node_modules/@types/uuid": {
"version": "9.0.8",
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==",
"dev": true
},
"node_modules/@types/webidl-conversions": { "node_modules/@types/webidl-conversions": {
"version": "7.0.3", "version": "7.0.3",
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz",

View File

@ -1,6 +1,5 @@
{ {
"devDependencies": { "devDependencies": {
"@types/uuid": "^9.0.8",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
@ -9,7 +8,6 @@
"discord.js": "^14.14.1", "discord.js": "^14.14.1",
"mongoose": "^8.2.2", "mongoose": "^8.2.2",
"stripe": "^14.21.0", "stripe": "^14.21.0",
"typeorm": "^0.3.20", "typeorm": "^0.3.20"
"uuid": "^9.0.1"
} }
} }