AnnouncementModel - IEEE-Team-3/map GitHub Wiki
Announcements are official messages broadcasted to teams or subteams. They may include rich content and scheduling.
-
id
: Unique announcement ID -
title
: Brief title -
body
: Rich text content -
createdBy
: User ID of the announcer -
teamId
: Targeted team -
audience
: Specific roles or users -
scheduledFor
: Date for publishing -
status
: "draft" | "scheduled" | "published" -
readBy
: Array of user IDs who have read it
const AnnouncementSchema = new Schema({
title: String,
body: String,
createdBy: { type: Schema.Types.ObjectId, ref: 'User' },
teamId: { type: Schema.Types.ObjectId, ref: 'Team' },
audience: [{ type: String }], // Roles or custom group names
scheduledFor: Date,
status: { type: String, enum: ['draft', 'scheduled', 'published'], default: 'draft' },
readBy: [{ type: Schema.Types.ObjectId, ref: 'User' }]
});