@dynamatix/gb-schemas 0.21.19 → 0.21.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/users/index.js +2 -1
- package/users/tasks.model.js +20 -0
package/package.json
CHANGED
package/users/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as UserModel } from './user.model.js';
|
|
2
2
|
export { default as RoleModel } from './role.model.js';
|
|
3
3
|
export { default as RoleGroupModel } from './role-group.model.js';
|
|
4
|
-
export { default as PermissionModel } from './permission.model.js';
|
|
4
|
+
export { default as PermissionModel } from './permission.model.js';
|
|
5
|
+
export { default as TasksModel} from './tasks.model.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import mongooseEncryption from "../utils/encryption.middleware.js";
|
|
3
|
+
|
|
4
|
+
const TasksSchema = new mongoose.Schema({
|
|
5
|
+
taskTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null }, // LookupGroup: TaskType ["Document", "Information"]
|
|
6
|
+
actionTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null }, // Example: "Request Document Delete"
|
|
7
|
+
entityId: { type: mongoose.Schema.Types.ObjectId, required: true }, // Could be documentId, applicationId, applicantId
|
|
8
|
+
createdByUserId: { ref: "User", type: mongoose.Schema.Types.ObjectId, required: true },
|
|
9
|
+
assignedToUserId: { ref: "User", type: mongoose.Schema.Types.ObjectId, required: true },
|
|
10
|
+
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null }, // LookupGroup: TaskStatus ["Requested", "Completed", "Cancelled"]
|
|
11
|
+
priorityLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null}, // LookupGroup: TaskPriority ["High", "Medium", "Low"]
|
|
12
|
+
expiryDate: { type: Date, required: true },
|
|
13
|
+
}, {
|
|
14
|
+
timestamps: true
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
TasksSchema.plugin(mongooseEncryption);
|
|
18
|
+
const TasksModel = mongoose.model("Tasks", TasksSchema);
|
|
19
|
+
|
|
20
|
+
export default TasksModel;
|