2025-11-03 20:35:01 +00:00
|
|
|
const mongoose = require('mongoose');
|
|
|
|
|
|
|
|
|
|
const ReportSchema = new mongoose.Schema({
|
|
|
|
|
reporter: {
|
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
|
ref: 'User',
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
post: {
|
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
2025-12-07 22:15:00 +00:00
|
|
|
ref: 'Post'
|
|
|
|
|
},
|
|
|
|
|
// Тип репорта: 'post' (жалоба на пост) или 'tag_suggestion' (предложение тега)
|
|
|
|
|
type: {
|
|
|
|
|
type: String,
|
|
|
|
|
enum: ['post', 'tag_suggestion'],
|
|
|
|
|
default: 'post'
|
2025-11-03 20:35:01 +00:00
|
|
|
},
|
|
|
|
|
reason: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
|
maxlength: 500
|
|
|
|
|
},
|
2025-12-07 22:15:00 +00:00
|
|
|
// Для предложения тега
|
|
|
|
|
suggestedTag: {
|
|
|
|
|
tagName: String,
|
|
|
|
|
category: {
|
|
|
|
|
type: String,
|
|
|
|
|
enum: ['theme', 'style', 'mood', 'technical']
|
|
|
|
|
},
|
|
|
|
|
description: String
|
|
|
|
|
},
|
2025-11-03 20:35:01 +00:00
|
|
|
status: {
|
|
|
|
|
type: String,
|
|
|
|
|
enum: ['pending', 'reviewed', 'resolved', 'dismissed'],
|
|
|
|
|
default: 'pending'
|
|
|
|
|
},
|
|
|
|
|
reviewedBy: {
|
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
|
ref: 'User'
|
|
|
|
|
},
|
|
|
|
|
createdAt: {
|
|
|
|
|
type: Date,
|
|
|
|
|
default: Date.now
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Report', ReportSchema);
|
|
|
|
|
|