cloudservices/src/models/Moderation.ts

40 lines
772 B
TypeScript
Raw Normal View History

2019-10-14 15:46:10 -04:00
import { Document, Schema, model } from 'mongoose';
import { ModerationInterface } from '.';
2019-10-14 15:46:10 -04:00
export interface ModerationInterface extends Document {
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,
/**
* @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({
username: String,
2019-10-14 15:46:10 -04:00
userID: String,
logID: Number,
moderatorID: String,
reason: String,
type: String,
2019-10-14 23:37:04 -04:00
date: Date,
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);