{"size": 540, "ext": "js", "max_stars_repo_path": "models/Announcement.js", "max_stars_repo_name": "jeesonjohnson/ChatApp", "max_stars_repo_stars_event_min_datetime": "2020-06-24T22:21:19.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-26T16:19:46.000Z", "max_issues_repo_path": "models/Announcement.js", "max_issues_repo_name": "jeesonjohnson/ChatApp", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/Announcement.js", "max_forks_repo_name": "jeesonjohnson/ChatApp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 16.875, "max_line_length": 54, "alphanum_fraction": 0.6111111111}
const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const AnnouncementSchema = new Schema({
  company_id: {
    type: Object,
    required:[true,"A company id is needed"]
    },
  user: {
    type: String,
    required: [true, "Error with user name"]
  },
  isOwner:{
    type:Boolean,
  },
  isAdmin: {
    type: Boolean,
  },
  time: {
    type: Date,
    default: Date.now()
  },
  content: {
    type: String
  },
});

const Announcement = (module.exports = mongoose.model(
  "Announcement",
  AnnouncementSchema
));
