-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActivity.js
More file actions
22 lines (18 loc) · 766 Bytes
/
Activity.js
File metadata and controls
22 lines (18 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import mongoose from "mongoose";
import { TYPE_MODEL_NAME } from "./ActivityType.js";
const { Schema } = mongoose;
const ActivitySchema = new Schema({
type: { type: Schema.Types.ObjectId, ref: TYPE_MODEL_NAME, required: true },
startTime: { type: Date, required: true },
endTime: { type: Date, required: false },
comment: { type: String, required: false },
trashed: { type: Boolean, required: true },
});
export const ACTIVITY_MODEL_NAME = "Activity";
/**
* An Activity represents something the user did between particular points in time.
* Activities are of a certain Type, and can include information such as comments
* made by the user.
*/
const Activity = mongoose.model(ACTIVITY_MODEL_NAME, ActivitySchema);
export default Activity;