forked from Prompt-Hash-Stellar/prompt-hash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReport.ts
More file actions
49 lines (45 loc) · 1015 Bytes
/
Copy pathReport.ts
File metadata and controls
49 lines (45 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import mongoose from "mongoose";
const reportSchema = new mongoose.Schema(
{
promptId: {
type: String,
required: true,
index: true,
},
reporterAddress: {
type: String,
required: true,
lowercase: true,
},
reason: {
type: String,
enum: ["quality-issue", "misleading-content", "plagiarism", "harmful-content", "copyright", "other"],
required: true,
},
description: {
type: String,
maxlength: 500,
},
status: {
type: String,
enum: ["pending", "investigating", "resolved", "dismissed"],
default: "pending",
index: true,
},
adminNotes: {
type: String,
default: "",
},
resolvedAt: {
type: Date,
default: null,
},
},
{
timestamps: true,
}
);
// Index for finding reports by prompt
reportSchema.index({ promptId: 1, createdAt: -1 });
const Report = mongoose.models.Report || mongoose.model("Report", reportSchema);
export default Report;