pristine-member-nest-api-database 1.0.64 → 1.0.66

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.
@@ -37,8 +37,13 @@ const CategoryFieldMappingSchema = new mongoose_1.Schema({
37
37
  type: mongoose_1.Schema.Types.ObjectId,
38
38
  ref: "Editor.Fields.Master",
39
39
  },
40
+ isSystemDefined: {
41
+ type: Boolean,
42
+ default: true,
43
+ },
40
44
  },
41
45
  ],
46
+ isSystemDefined: { type: Boolean, default: true },
42
47
  isActive: { type: Boolean, default: true },
43
48
  audit: [
44
49
  {
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // import mongoose, { Document, Schema } from "mongoose";
3
+ // import { Audit } from "../interface/Audit.interface";
2
4
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
5
  if (k2 === undefined) k2 = k;
4
6
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -23,22 +25,75 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
25
  return result;
24
26
  };
25
27
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.mongoEditorField = void 0;
28
+ exports.mongoContainerCategory = void 0;
29
+ // interface ContainerCategoryMapping extends Document {
30
+ // ContainerId: mongoose.Types.ObjectId;
31
+ // Categories: [
32
+ // {
33
+ // category: mongoose.Types.ObjectId;
34
+ // isSystemDefined: boolean;
35
+ // },
36
+ // ];
37
+ // isSystemDefined: boolean;
38
+ // isActive: boolean;
39
+ // audit: Audit[];
40
+ // }
41
+ // const ContainerCategoryMappingSchema = new Schema<ContainerCategoryMapping>({
42
+ // ContainerId: {
43
+ // type: Schema.Types.ObjectId,
44
+ // ref: "Editor.Container", // Reference to the ontainers
45
+ // required: false,
46
+ // default: null,
47
+ // },
48
+ // Categories: [
49
+ // {
50
+ // type: Schema.Types.ObjectId,
51
+ // ref: "Field.Categories", // Reference to the Categories
52
+ // required: false,
53
+ // default: null,
54
+ // },
55
+ // isSystemDefined: {
56
+ // type: Boolean, default: true
57
+ // }
58
+ // ],
59
+ // isSystemDefined: { type: Boolean, default: false },
60
+ // isActive: { type: Boolean, default: true },
61
+ // audit: [
62
+ // {
63
+ // userId: { type: String },
64
+ // auditedOn: { type: Date, default: null },
65
+ // actionType: { type: String },
66
+ // },
67
+ // ],
68
+ // });
69
+ // const mongoEditorField = mongoose.model<ContainerCategoryMapping>(
70
+ // "Editor.Container.Category.mapping",
71
+ // ContainerCategoryMappingSchema,
72
+ // );
73
+ // export { ContainerCategoryMapping, mongoEditorField };
27
74
  const mongoose_1 = __importStar(require("mongoose"));
28
75
  const ContainerCategoryMappingSchema = new mongoose_1.Schema({
29
76
  ContainerId: {
30
77
  type: mongoose_1.Schema.Types.ObjectId,
31
- ref: "Editor.Container", // Reference to the ontainers
78
+ ref: "Editor.Container",
32
79
  required: false,
33
80
  default: null,
34
81
  },
35
- CategoryId: {
36
- type: mongoose_1.Schema.Types.ObjectId,
37
- ref: "Field.Categories", // Reference to the Categories
38
- required: false,
39
- default: null,
40
- },
41
- isSystemDefined: { type: Boolean, default: false },
82
+ Categories: [
83
+ {
84
+ category: {
85
+ type: mongoose_1.Schema.Types.ObjectId,
86
+ ref: "Field.Categories",
87
+ required: false,
88
+ default: null,
89
+ },
90
+ isSystemDefined: {
91
+ type: Boolean,
92
+ default: true,
93
+ },
94
+ },
95
+ ],
96
+ isSystemDefined: { type: Boolean, default: true },
42
97
  isActive: { type: Boolean, default: true },
43
98
  audit: [
44
99
  {
@@ -48,5 +103,5 @@ const ContainerCategoryMappingSchema = new mongoose_1.Schema({
48
103
  },
49
104
  ],
50
105
  });
51
- const mongoEditorField = mongoose_1.default.model("Editor.Container.Category.mapping", ContainerCategoryMappingSchema);
52
- exports.mongoEditorField = mongoEditorField;
106
+ const mongoContainerCategory = mongoose_1.default.model("Editor.Container.Category.mapping", ContainerCategoryMappingSchema);
107
+ exports.mongoContainerCategory = mongoContainerCategory;
@@ -5,11 +5,10 @@ import { Audit } from "../interface/Audit.interface";
5
5
 
6
6
  interface CategoryFieldMappingDocument extends Document {
7
7
  categoryId: mongoose.Types.ObjectId;
8
- fields: [
9
- {
10
- field: mongoose.Types.ObjectId;
11
- },
12
- ];
8
+ fields: {
9
+ field: mongoose.Types.ObjectId;
10
+ isSystemDefined: boolean;
11
+ }[];
13
12
  isSystemDefined: boolean;
14
13
  isActive: boolean;
15
14
  audit: Audit[];
@@ -26,8 +25,13 @@ const CategoryFieldMappingSchema = new Schema<CategoryFieldMappingDocument>({
26
25
  type: Schema.Types.ObjectId,
27
26
  ref: "Editor.Fields.Master",
28
27
  },
28
+ isSystemDefined: {
29
+ type: Boolean,
30
+ default: true,
31
+ },
29
32
  },
30
33
  ],
34
+ isSystemDefined: { type: Boolean, default: true },
31
35
  isActive: { type: Boolean, default: true },
32
36
  audit: [
33
37
  {
@@ -1,9 +1,64 @@
1
+ // import mongoose, { Document, Schema } from "mongoose";
2
+ // import { Audit } from "../interface/Audit.interface";
3
+
4
+ // interface ContainerCategoryMapping extends Document {
5
+ // ContainerId: mongoose.Types.ObjectId;
6
+ // Categories: [
7
+ // {
8
+ // category: mongoose.Types.ObjectId;
9
+ // isSystemDefined: boolean;
10
+ // },
11
+ // ];
12
+ // isSystemDefined: boolean;
13
+ // isActive: boolean;
14
+ // audit: Audit[];
15
+ // }
16
+
17
+ // const ContainerCategoryMappingSchema = new Schema<ContainerCategoryMapping>({
18
+ // ContainerId: {
19
+ // type: Schema.Types.ObjectId,
20
+ // ref: "Editor.Container", // Reference to the ontainers
21
+ // required: false,
22
+ // default: null,
23
+ // },
24
+ // Categories: [
25
+ // {
26
+ // type: Schema.Types.ObjectId,
27
+ // ref: "Field.Categories", // Reference to the Categories
28
+ // required: false,
29
+ // default: null,
30
+ // },
31
+ // isSystemDefined: {
32
+ // type: Boolean, default: true
33
+
34
+ // }
35
+ // ],
36
+ // isSystemDefined: { type: Boolean, default: false },
37
+ // isActive: { type: Boolean, default: true },
38
+ // audit: [
39
+ // {
40
+ // userId: { type: String },
41
+ // auditedOn: { type: Date, default: null },
42
+ // actionType: { type: String },
43
+ // },
44
+ // ],
45
+ // });
46
+
47
+ // const mongoEditorField = mongoose.model<ContainerCategoryMapping>(
48
+ // "Editor.Container.Category.mapping",
49
+ // ContainerCategoryMappingSchema,
50
+ // );
51
+
52
+ // export { ContainerCategoryMapping, mongoEditorField };
1
53
  import mongoose, { Document, Schema } from "mongoose";
2
54
  import { Audit } from "../interface/Audit.interface";
3
55
 
4
56
  interface ContainerCategoryMapping extends Document {
5
57
  ContainerId: mongoose.Types.ObjectId;
6
- CategoryId: mongoose.Types.ObjectId;
58
+ Categories: {
59
+ category: mongoose.Types.ObjectId;
60
+ isSystemDefined: boolean;
61
+ }[];
7
62
  isSystemDefined: boolean;
8
63
  isActive: boolean;
9
64
  audit: Audit[];
@@ -12,18 +67,29 @@ interface ContainerCategoryMapping extends Document {
12
67
  const ContainerCategoryMappingSchema = new Schema<ContainerCategoryMapping>({
13
68
  ContainerId: {
14
69
  type: Schema.Types.ObjectId,
15
- ref: "Editor.Container", // Reference to the ontainers
70
+ ref: "Editor.Container",
16
71
  required: false,
17
72
  default: null,
18
73
  },
19
- CategoryId: {
20
- type: Schema.Types.ObjectId,
21
- ref: "Field.Categories", // Reference to the Categories
22
- required: false,
23
- default: null,
24
- },
25
- isSystemDefined: { type: Boolean, default: false },
74
+
75
+ Categories: [
76
+ {
77
+ category: {
78
+ type: Schema.Types.ObjectId,
79
+ ref: "Field.Categories",
80
+ required: false,
81
+ default: null,
82
+ },
83
+ isSystemDefined: {
84
+ type: Boolean,
85
+ default: true,
86
+ },
87
+ },
88
+ ],
89
+
90
+ isSystemDefined: { type: Boolean, default: true },
26
91
  isActive: { type: Boolean, default: true },
92
+
27
93
  audit: [
28
94
  {
29
95
  userId: { type: String },
@@ -33,9 +99,10 @@ const ContainerCategoryMappingSchema = new Schema<ContainerCategoryMapping>({
33
99
  ],
34
100
  });
35
101
 
36
- const mongoEditorField = mongoose.model<ContainerCategoryMapping>(
102
+ const mongoContainerCategory = mongoose.model<ContainerCategoryMapping>(
37
103
  "Editor.Container.Category.mapping",
38
104
  ContainerCategoryMappingSchema,
39
105
  );
40
106
 
41
- export { ContainerCategoryMapping, mongoEditorField };
107
+ //Originally This mapping help to map container and categories without chnaging their masters
108
+ export { ContainerCategoryMapping, mongoContainerCategory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pristine-member-nest-api-database",
3
- "version": "1.0.64",
3
+ "version": "1.0.66",
4
4
  "description": "application verification database changes with gs1 branch. not tested. ",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {