add WIP Member and Partner database model classes

pull/1/head
Matthew 2024-03-22 00:15:45 -04:00
parent 2582212fb6
commit e8f730c967
Signed by: matthew
SSH Key Fingerprint: SHA256:piIXekA9q1p0ZGi4ogFbNY1embip5Ytbi3v8AZ8UYq4
2 changed files with 112 additions and 0 deletions

54
database/Member.ts Normal file
View File

@ -0,0 +1,54 @@
import { prop, getModelForClass } from "@typegoose/typegoose"
/* TODO
* Comments
* Further attributes for class
* */
export type MemberAdditionalAcknowledgement =
"Chair of the Board of Governors" |
"Vice Chair of the Board of Governors" |
"Voting Seat Member of the Board of Governors" |
string;
// enum for the used programming languages in whois information
export enum MemberUsedLanguages {
ASM = "lang-asm",
CFAM = "lang-cfam",
CSHARP = "lang-csharp",
GO = "lang-go",
JAVA = "lang-java",
JS = "lang-js",
KT = "lang-kt",
PY = "lang-py",
RB = "lang-rb",
RS = "lang-rs",
SWIFT = "lang-swift",
TS = "lang-ts"
}
// enum for the used operating systems in the whois information
export enum MemberUsedOperatingSystems {
ARCH = "os-arch",
DEB = "os-deb",
CENT = "os-cent",
FEDORA = "os-fedora",
MDARWIN = "os-mdarwin",
MANJARO = "os-manjaro",
REDHAT = "os-redhat",
UBUNTU = "os-ubuntu",
WIN = "os-win"
}
export default class Member {
@prop({ required: true, unique: true })
public discordID: string | undefined;
@prop()
public usedOperatingSystems: MemberUsedOperatingSystems[] | undefined;
@prop()
public usedLanguages: MemberUsedLanguages[] | undefined;
@prop()
public additionalAcknowledgement: MemberAdditionalAcknowledgement[] | undefined;
}

58
database/Partner.ts Normal file
View File

@ -0,0 +1,58 @@
import { prop, getModelForClass } from "@typegoose/typegoose";
import Member from "./Member";
/* TODO
* Comments
* Further attributes for class
* */
export type PartnerTitle =
"Director of Engineering" |
"Director of Operations" |
"Deputy Director of Engineering" |
"Deputy Director of Operations" |
"Services Manager" |
"Project Manager" |
"Engineering Core Partner" |
"Operations Core Partner" |
"Community Moderator" |
"Technician" |
string;
export enum PartnerDepartment {
INDEPENDENT_AGENCY,
ENGINEERING, // Department of Engineering
OPERATIONS // Department of Operations
}
export enum PartnerRoleType {
MANAGERIAL,
NONMANAGERIAL,
}
export enum PartnerCommissionType {
TENURE,
PROVISIONAL,
CONTRACTUAL,
ACTING,
INTERIM,
TRIAL,
}
export default class Partner extends Member {
@prop({ required: true })
public roleType: PartnerRoleType | undefined;
@prop({ required: true })
public commissionType: PartnerCommissionType | undefined;
@prop({ required: true })
public department: PartnerDepartment | undefined;
@prop({ required: true })
public title: PartnerTitle | "Partner" | undefined;
@prop()
public directReport: Partner | string | undefined;
}