@dynamatix/gb-schemas 0.4.0 → 0.4.2

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.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "All the schemas for gatehouse bank back-end.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,7 +18,8 @@ const alertSchema = new mongoose.Schema({
18
18
  statusLid: {
19
19
  type: mongoose.Schema.Types.ObjectId,
20
20
  ref: "Lookup"
21
- }
21
+ },
22
+ isActive: { type: Boolean, default: true },
22
23
  }, { timestamps: true });
23
24
 
24
25
  const AlertModel = mongoose.model("Alert", alertSchema);
@@ -8,7 +8,7 @@ const checklistSchema = new mongoose.Schema({
8
8
  },
9
9
  checkSource:{ // [Applicant, Property, Application]
10
10
  type: String,
11
- required: true
11
+ required: false
12
12
  },
13
13
  applicationId: {
14
14
  type: mongoose.Schema.Types.ObjectId,
@@ -17,7 +17,7 @@ const checklistSchema = new mongoose.Schema({
17
17
  },
18
18
  checkDescription: { type: String },
19
19
  checkStatusLid: {
20
- type: String,
20
+ type: mongoose.Schema.Types.ObjectId,
21
21
  ref: "Lookup",
22
22
  required: true
23
23
  }
package/shared/index.js CHANGED
@@ -4,4 +4,5 @@ export { default as LookupModel } from './lookup.model.js';
4
4
  export { default as SystemParameterModel } from './system-parameter.model.js';
5
5
  export { default as AlertModel} from './alert.model.js';
6
6
  export { default as CheckListModel } from './checklist.model.js'
7
- export { default as JobSettingModel } from './job-setting.model.js'
7
+ export { default as JobSettingModel } from './job-setting.model.js'
8
+ export { default as TaskModel} from './task.model.js';
@@ -0,0 +1,20 @@
1
+ import mongoose from "mongoose";
2
+
3
+ const { Schema } = mongoose;
4
+
5
+ const ActionSchema = new Schema({
6
+ type: { type: String, required: true }, // Type of the action
7
+ message: { type: String, required: false },
8
+ target: { type: String, required: false },
9
+ });
10
+
11
+
12
+ const TaskSchema = new Schema({
13
+ name: { type: String, required: true },
14
+ description: { type: String, required: true },
15
+ actionsOnFailure: { type: [ActionSchema], default: [] },
16
+ actionsOnSuccess: { type: [ActionSchema], default: [] },
17
+ }, { timestamps: true });
18
+
19
+ const TaskModel = mongoose.model("Task", TaskSchema);
20
+ export default TaskModel;