Moderation model

merge-requests/5/head
Matthew 2020-04-15 15:12:26 -04:00
parent 74ddbf1c13
commit 33165dd0c9
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
2 changed files with 38 additions and 0 deletions

37
src/models/Moderation.ts Normal file
View File

@ -0,0 +1,37 @@
import { Document, Schema, model } from 'mongoose';
export interface ModerationInterface extends Document {
userID: string,
logID: string,
moderatorID: string,
reason: string,
/**
* @field 0 - Warn
* @field 1 - Unmute
* @field 2 - Mute
* @field 3 - Kick
* @field 4 - Unban
* @field 5 - Ban
*/
type: 0 | 1 | 2 | 3 | 4 | 5
date: Date,
expiration: {
date: Date,
processed: boolean
}
}
const Moderation: Schema = new Schema({
userID: String,
logID: String,
moderatorID: String,
reason: String,
type: Number,
date: Date,
expiration: {
date: Date,
processed: Boolean,
},
});
export default model<ModerationInterface>('Moderation', Moderation);

1
src/models/index.ts Normal file
View File

@ -0,0 +1 @@
export { default as Moderation, ModerationInterface } from './Moderation';