pristine-member-nest-api-database 1.0.81 → 1.0.83

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.
@@ -31,10 +31,12 @@ const ApplicationSchemSchema = new mongoose_1.Schema({
31
31
  BPCompanyTypeId: {
32
32
  type: mongoose_1.Schema.Types.ObjectId,
33
33
  ref: "Editor.BPCompany.Types",
34
+ default: null,
34
35
  },
35
36
  membershipTypeId: {
36
37
  type: mongoose_1.Schema.Types.ObjectId,
37
38
  ref: "Membership.Types",
39
+ default: null,
38
40
  },
39
41
  applicationName: { type: String },
40
42
  applicationDescription: { type: String },
@@ -54,7 +56,7 @@ const ApplicationSchemSchema = new mongoose_1.Schema({
54
56
  {
55
57
  fieldId: {
56
58
  type: mongoose_1.Schema.Types.ObjectId,
57
- ref: "Field.Categories", // (optional: should be Field.Master probably)
59
+ ref: "Editor.Fields.Master",
58
60
  required: true,
59
61
  },
60
62
  fieldSequence: {
@@ -82,7 +84,7 @@ const ApplicationSchemSchema = new mongoose_1.Schema({
82
84
  organizationApplicationEnabled: { type: Boolean, default: true },
83
85
  SLITOptionEnabled: { type: Boolean, default: true },
84
86
  OtherInfoEnabled: { type: Boolean, default: true },
85
- createdDate: { type: Date, default: null },
87
+ createdDate: { type: Date, default: Date.now },
86
88
  isActive: { type: Boolean, default: true },
87
89
  audit: [
88
90
  {
@@ -92,5 +94,15 @@ const ApplicationSchemSchema = new mongoose_1.Schema({
92
94
  },
93
95
  ],
94
96
  });
97
+ ApplicationSchemSchema.index({
98
+ branchId: 1,
99
+ BPCompanyTypeId: 1,
100
+ membershipTypeId: 1,
101
+ }, {
102
+ unique: true,
103
+ partialFilterExpression: {
104
+ branchId: { $exists: true },
105
+ },
106
+ });
95
107
  const mongoApplicationSchema = mongoose_1.default.model("Editor.Application", ApplicationSchemSchema);
96
108
  exports.mongoApplicationSchema = mongoApplicationSchema;
@@ -36,10 +36,12 @@ const ApplicationSchemSchema = new Schema<IApplicationDocument>({
36
36
  BPCompanyTypeId: {
37
37
  type: Schema.Types.ObjectId,
38
38
  ref: "Editor.BPCompany.Types",
39
+ default: null,
39
40
  },
40
41
  membershipTypeId: {
41
42
  type: Schema.Types.ObjectId,
42
43
  ref: "Membership.Types",
44
+ default: null,
43
45
  },
44
46
  applicationName: { type: String },
45
47
  applicationDescription: { type: String },
@@ -61,7 +63,7 @@ const ApplicationSchemSchema = new Schema<IApplicationDocument>({
61
63
  {
62
64
  fieldId: {
63
65
  type: Schema.Types.ObjectId,
64
- ref: "Field.Categories", // (optional: should be Field.Master probably)
66
+ ref: "Editor.Fields.Master",
65
67
  required: true,
66
68
  },
67
69
 
@@ -92,7 +94,7 @@ const ApplicationSchemSchema = new Schema<IApplicationDocument>({
92
94
  organizationApplicationEnabled: { type: Boolean, default: true },
93
95
  SLITOptionEnabled: { type: Boolean, default: true },
94
96
  OtherInfoEnabled: { type: Boolean, default: true },
95
- createdDate: { type: Date, default: null },
97
+ createdDate: { type: Date, default: Date.now },
96
98
  isActive: { type: Boolean, default: true },
97
99
  audit: [
98
100
  {
@@ -103,8 +105,22 @@ const ApplicationSchemSchema = new Schema<IApplicationDocument>({
103
105
  ],
104
106
  });
105
107
 
108
+ ApplicationSchemSchema.index(
109
+ {
110
+ branchId: 1,
111
+ BPCompanyTypeId: 1,
112
+ membershipTypeId: 1,
113
+ },
114
+ {
115
+ unique: true,
116
+ partialFilterExpression: {
117
+ branchId: { $exists: true },
118
+ },
119
+ },
120
+ );
106
121
  const mongoApplicationSchema = mongoose.model<IApplicationDocument>(
107
122
  "Editor.Application",
108
123
  ApplicationSchemSchema,
109
124
  );
125
+
110
126
  export { IApplicationDocument, mongoApplicationSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pristine-member-nest-api-database",
3
- "version": "1.0.81",
3
+ "version": "1.0.83",
4
4
  "description": "application verification database changes with gs1 branch. not tested. ",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {