@dynamatix/cat-shared 0.0.33 → 0.0.35

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.
@@ -1,5 +1,10 @@
1
1
  import mongoose from 'mongoose';
2
2
 
3
+ const optionSchema = new mongoose.Schema({
4
+ key: { type: mongoose.Schema.Types.Mixed },
5
+ value: { type: mongoose.Schema.Types.Mixed }
6
+ }, { _id: false });
7
+
3
8
  const formfieldSchema = new mongoose.Schema({
4
9
  fieldName: {
5
10
  type: String,
@@ -56,10 +61,7 @@ const formfieldSchema = new mongoose.Schema({
56
61
  type: mongoose.Schema.Types.Mixed,
57
62
  default: null
58
63
  },
59
- options: [{
60
- key: { type: mongoose.Schema.Types.Number || mongoose.Schema.Types.String },
61
- value: { type: mongoose.Schema.Types.String || mongoose.Schema.Types.Number },
62
- }],
64
+ options: [optionSchema],
63
65
  section: {
64
66
  type: String,
65
67
  default: null
@@ -107,8 +109,16 @@ const formfieldSchema = new mongoose.Schema({
107
109
  isReadOnly: {
108
110
  type: Boolean,
109
111
  default: false
110
- }
111
- }, { timestamps: true });
112
+ },
113
+ collectionName:{ // name of collection for field if field doesnt belong to main collection
114
+ type: String,
115
+ default: null
116
+ },
117
+ foreignReferenceField: { // Ex: when field is from forieng collection then foreignReferenceField could be applicationId(which refers to the application)
118
+ type: String,
119
+ default: null
120
+ },
121
+ }, { timestamps: true , _id: false });
112
122
 
113
123
  const formConfigurationSchema = new mongoose.Schema({
114
124
  formName: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/cat-shared",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"