community-relations/src/models/Moderation.ts

38 lines
750 B
TypeScript
Raw Normal View History

2020-07-06 03:15:06 -04:00
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?: {
2020-07-06 03:15:06 -04:00
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);