crra/database/Partner.ts

73 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

import { prop, getModelForClass, Ref } from "@typegoose/typegoose";
import Member from "./Member";
/* TODO
2024-10-25 16:57:33 -04:00
* Comments
* Further attributes for class
* */
import { SharedMemberAttributes } from "./Member";
export type PartnerTitle =
2024-10-25 16:57:33 -04:00
| "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 {
2024-10-25 16:57:33 -04:00
INDEPENDENT_AGENCY,
ENGINEERING, // Department of Engineering
OPERATIONS, // Department of Operations
}
export enum PartnerRoleType {
2024-10-25 16:57:33 -04:00
MANAGERIAL,
NONMANAGERIAL,
}
export enum PartnerCommissionType {
2024-10-25 16:57:33 -04:00
TENURE,
PROVISIONAL,
CONTRACTUAL,
ACTING,
INTERIM,
TRIAL,
}
export default class Partner implements SharedMemberAttributes {
2024-10-25 16:57:33 -04:00
@prop({ required: true, unique: true })
public discordID: string | undefined;
2024-10-25 16:57:33 -04:00
@prop()
public emailAddress: string | undefined;
2024-10-25 16:57:33 -04:00
@prop({ required: true })
public roleType: PartnerRoleType | undefined;
2024-10-25 16:57:33 -04:00
@prop({ required: true })
public commissionType: PartnerCommissionType | undefined;
2024-10-25 16:57:33 -04:00
@prop({ required: true })
public department: PartnerDepartment | undefined;
2024-10-25 16:57:33 -04:00
@prop({ required: true })
public title: PartnerTitle | "Partner" | undefined;
@prop({ ref: () => Partner })
2024-10-25 16:57:33 -04:00
//
public directReport?: Ref<Partner> | string | undefined;
2024-10-25 16:57:33 -04:00
@prop()
// this field dictates if the partner is able to perform developer commands, such as "eval"
public canPerformDevCommands: boolean | undefined;
}
export const PartnerModel = getModelForClass(Partner);