2019-10-14 15:46:10 -04:00
|
|
|
import { Document, Schema, model } from 'mongoose';
|
2019-10-26 00:02:26 -04:00
|
|
|
import { ModerationInterface } from '.';
|
2019-10-14 15:46:10 -04:00
|
|
|
|
|
|
|
export interface ModerationInterface extends Document {
|
2019-10-26 00:02:26 -04:00
|
|
|
username: string,
|
2019-10-14 15:46:10 -04:00
|
|
|
userID: string,
|
|
|
|
logID: string,
|
2019-10-14 23:37:04 -04:00
|
|
|
moderatorID: string,
|
2019-10-14 15:46:10 -04:00
|
|
|
reason: string,
|
2019-10-26 00:02:26 -04:00
|
|
|
/**
|
|
|
|
* @field 0 - Create
|
|
|
|
* @field 1 - Warn
|
|
|
|
* @field 2 - Lock
|
|
|
|
* @field 3 - Unlock
|
|
|
|
* @field 4 - Delete
|
|
|
|
*/
|
|
|
|
type: 0 | 1 | 2 | 3 | 4
|
|
|
|
date: Date,
|
|
|
|
expiration: {
|
|
|
|
date: Date,
|
|
|
|
processed: boolean
|
|
|
|
}
|
2019-10-14 15:46:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
const Moderation: Schema = new Schema({
|
2019-10-26 00:02:26 -04:00
|
|
|
username: String,
|
2019-10-14 15:46:10 -04:00
|
|
|
userID: String,
|
2019-10-28 16:21:04 -04:00
|
|
|
logID: String,
|
2019-10-14 15:46:10 -04:00
|
|
|
moderatorID: String,
|
|
|
|
reason: String,
|
2019-10-28 16:21:04 -04:00
|
|
|
type: Number,
|
2019-10-14 23:37:04 -04:00
|
|
|
date: Date,
|
2019-10-26 00:02:26 -04:00
|
|
|
expiration: {
|
|
|
|
date: Date,
|
|
|
|
processed: Boolean,
|
|
|
|
},
|
2019-10-14 15:46:10 -04:00
|
|
|
});
|
2019-10-14 23:37:04 -04:00
|
|
|
|
|
|
|
export default model<ModerationInterface>('Moderation', Moderation);
|