AnnouncementModel - IEEE-Team-3/map GitHub Wiki

Purpose

Announcements are official messages broadcasted to teams or subteams. They may include rich content and scheduling.

Schema

  • 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

Example (Mongoose)

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' }]
});
⚠️ **GitHub.com Fallback** ⚠️