@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "0.21.19",
3
+ "version": "0.21.21",
4
4
  "description": "All the schemas for gatehouse bank back-end.",
5
5
  "main": "index.js",
6
6
  "scripts": {
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;