-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy patheventSchema.js
More file actions
118 lines (116 loc) · 2.24 KB
/
Copy patheventSchema.js
File metadata and controls
118 lines (116 loc) · 2.24 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
const mongoose = require("mongoose");
//events collection
const eventSchema = new mongoose.Schema({
event_id: {
type: String,
required: true,
unique: true,
},
title: {
type: String,
required: true,
},
description: String,
category: {
type: String,
enum: ["cultural", "technical", "sports", "academic", "other"],
},
type: {
type: String,
},
organizing_unit_id: {
type: mongoose.Schema.Types.ObjectId,
ref: "Organizational_Unit",
required: true,
},
organizers: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "User",
},
],
schedule: {
start: Date,
end: Date,
venue: String,
mode: {
type: String,
enum: ["online", "offline", "hybrid"],
},
},
registration: {
required: Boolean,
start: Date,
end: Date,
fees: Number,
max_participants: Number,
},
budget: {
allocated: Number,
spent: Number,
sponsors: [
{
type: String,
},
],
},
status: {
type: String,
enum: ["planned", "ongoing", "completed", "cancelled"],
default: "planned",
},
participants: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "User",
},
],
winners: [
{
user: {
type: mongoose.Schema.Types.ObjectId,
ref: "User",
},
position: String, // e.g., "1st", "2nd", "Best Speaker", etc.
},
],
feedback_summary: {
type: Object, // You can define structure if fixed
},
media: {
images: [String],
videos: [String],
documents: [String],
},
room_requests: [
{
date: { type: Date, required: true },
time: { type: String, required: true },
room: { type: String, required: true },
description: { type: String },
status: {
type: String,
enum: ["Pending", "Approved", "Rejected"],
default: "Pending",
},
requested_at: {
type: Date,
default: Date.now,
},
reviewed_by: {
type: mongoose.Schema.Types.ObjectId,
ref: "User",
},
},
],
created_at: {
type: Date,
default: Date.now,
},
updated_at: {
type: Date,
default: Date.now,
},
});
const Event = mongoose.model("Event", eventSchema);
module.exports = Event;