{"size": 1060, "ext": "js", "max_stars_repo_path": "CMPE451/backend/models/activity.js", "max_stars_repo_name": "oztasoi/bachelor-projects", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "CMPE451/backend/models/activity.js", "max_issues_repo_name": "oztasoi/bachelor-projects", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "CMPE451/backend/models/activity.js", "max_forks_repo_name": "oztasoi/bachelor-projects", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.5555555556, "max_line_length": 83, "alphanum_fraction": 0.6122641509}
const mongoose = require("mongoose");
const Schema = mongoose.Schema;

var actorDefinition = {
  id: { type: String },
  type: { type: String },
  name: { type: String },
  url: { type: String },
};

var objectDefinition = {
  id: { type: Number },
  type: { type: String },
  url: { type: String },
  name: { type: String },
};

var targetDefinition = {
  id: { type: String, default: "http://www.carousel.com" },
  type: { type: String, default: "Website" },
  name: { type: String, default: "Carousel E-Commerce Platform" },
};

var activitySchema = new Schema(
  {
    "@context": { type: String, default: "https://www.w3.org/ns/activitystreams" },
    summary: { type: String },
    published: {
      type: String,
      default: function () {
        return Date.now().toString();
      },
    },
    type: { type: String, default: "Authorized Activity" },
    actor: actorDefinition,
    object: objectDefinition,
    target: targetDefinition,
  },
  {
    collection: "Activities",
  }
);

module.exports = mongoose.model("Activity", activitySchema);
