pristine-member-nest-api-database 1.0.26 → 1.0.27
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/dist/interface/ICategory.interface.js +2 -0
- package/dist/interface/IField.interface.js +2 -0
- package/dist/models/DynamicTemplate.model.js +95 -62
- package/interface/ICategory.interface.ts +14 -0
- package/interface/IField.interface.ts +25 -0
- package/models/DynamicTemplate.model.ts +116 -97
- package/package.json +1 -1
|
@@ -38,72 +38,105 @@ const dynamicTemplateModel = mongoose_1.default.model("DynamicTemplates", new mo
|
|
|
38
38
|
type: String,
|
|
39
39
|
required: true,
|
|
40
40
|
},
|
|
41
|
-
|
|
42
|
-
type: mongoose_1.Schema.Types.ObjectId,
|
|
43
|
-
ref: "Field.Categories",
|
|
44
|
-
required: true,
|
|
45
|
-
},
|
|
46
|
-
categoryCode: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: true,
|
|
49
|
-
},
|
|
50
|
-
fieldSequence: {
|
|
51
|
-
type: Number,
|
|
52
|
-
required: true,
|
|
53
|
-
},
|
|
54
|
-
fieldCode: {
|
|
55
|
-
type: String,
|
|
56
|
-
required: true,
|
|
57
|
-
},
|
|
58
|
-
fieldName: {
|
|
59
|
-
type: String,
|
|
60
|
-
required: true,
|
|
61
|
-
},
|
|
62
|
-
fieldDescription: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: "",
|
|
65
|
-
},
|
|
66
|
-
fieldType: {
|
|
67
|
-
type: String,
|
|
68
|
-
required: true,
|
|
69
|
-
},
|
|
70
|
-
isFieldRequired: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
},
|
|
73
|
-
fieldLength: {
|
|
74
|
-
type: Number,
|
|
75
|
-
},
|
|
76
|
-
isLengthValid: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
},
|
|
79
|
-
isEditable: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
},
|
|
82
|
-
multiSelectionEnabled: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
},
|
|
85
|
-
pastDateEnabled: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
},
|
|
88
|
-
futureDateEnabled: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
},
|
|
91
|
-
activeStatus: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
default: true,
|
|
94
|
-
},
|
|
95
|
-
attachment: {
|
|
96
|
-
baseURL: String,
|
|
97
|
-
fileName: String,
|
|
98
|
-
fileExtension: String,
|
|
99
|
-
},
|
|
100
|
-
values: {
|
|
41
|
+
categories: {
|
|
101
42
|
type: [
|
|
102
43
|
{
|
|
103
|
-
|
|
104
|
-
|
|
44
|
+
categoryId: {
|
|
45
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
46
|
+
ref: "Field.Categories",
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
categoryCode: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: true,
|
|
52
|
+
},
|
|
53
|
+
categorySequence: {
|
|
54
|
+
type: Number,
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
fields: {
|
|
58
|
+
type: [
|
|
59
|
+
{
|
|
60
|
+
fieldSequence: {
|
|
61
|
+
type: Number,
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
fieldCode: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: true,
|
|
67
|
+
},
|
|
68
|
+
fieldName: {
|
|
69
|
+
type: String,
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
fieldDescription: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "",
|
|
75
|
+
},
|
|
76
|
+
fieldType: {
|
|
77
|
+
type: String,
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
isFieldRequired: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false,
|
|
83
|
+
},
|
|
84
|
+
fieldLength: {
|
|
85
|
+
type: Number,
|
|
86
|
+
},
|
|
87
|
+
isLengthValid: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
},
|
|
90
|
+
isEditable: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: false,
|
|
93
|
+
},
|
|
94
|
+
multiSelectionEnabled: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
},
|
|
97
|
+
pastDateEnabled: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
},
|
|
100
|
+
futureDateEnabled: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
},
|
|
103
|
+
activeStatus: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: true,
|
|
106
|
+
},
|
|
107
|
+
attachment: {
|
|
108
|
+
baseURL: String,
|
|
109
|
+
fileName: String,
|
|
110
|
+
fileExtension: String,
|
|
111
|
+
},
|
|
112
|
+
values: {
|
|
113
|
+
type: [
|
|
114
|
+
{
|
|
115
|
+
value: { type: String },
|
|
116
|
+
activeStatus: { type: Boolean, default: true },
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
audit: [
|
|
121
|
+
{
|
|
122
|
+
userId: { type: String },
|
|
123
|
+
auditedOn: { type: Date, default: null },
|
|
124
|
+
actionType: { type: String },
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
audit: [
|
|
131
|
+
{
|
|
132
|
+
userId: { type: String },
|
|
133
|
+
auditedOn: { type: Date, default: null },
|
|
134
|
+
actionType: { type: String },
|
|
135
|
+
},
|
|
136
|
+
],
|
|
105
137
|
},
|
|
106
138
|
],
|
|
139
|
+
required: true,
|
|
107
140
|
},
|
|
108
141
|
audit: [
|
|
109
142
|
{
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
import { Audit } from "./Audit.interface";
|
|
3
|
+
import IField from "./IField.interface";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Interface for categories in a dynamic application
|
|
7
|
+
*/
|
|
8
|
+
export default interface ICategory {
|
|
9
|
+
categoryId: Types.ObjectId;
|
|
10
|
+
categoryCode: string;
|
|
11
|
+
categorySequence: number;
|
|
12
|
+
fields: IField[];
|
|
13
|
+
audit: Audit[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Audit } from "./Audit.interface";
|
|
2
|
+
import IFieldValue from "./IFieldValue.interface";
|
|
3
|
+
import IFile from "./IFile.interface";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Interface for a fields contains in a category
|
|
7
|
+
*/
|
|
8
|
+
export default interface IField {
|
|
9
|
+
fieldSequence: number;
|
|
10
|
+
fieldCode: string;
|
|
11
|
+
fieldName: string;
|
|
12
|
+
fieldDescription: string;
|
|
13
|
+
fieldType: string;
|
|
14
|
+
isFieldRequired: boolean;
|
|
15
|
+
fieldLength: number;
|
|
16
|
+
isLengthValid: boolean;
|
|
17
|
+
isEditable: boolean;
|
|
18
|
+
multiSelectionEnabled: boolean;
|
|
19
|
+
pastDateEnabled: boolean;
|
|
20
|
+
futureDateEnabled: boolean;
|
|
21
|
+
activeStatus: boolean;
|
|
22
|
+
attachment: IFile;
|
|
23
|
+
values: IFieldValue[];
|
|
24
|
+
audit: Audit[];
|
|
25
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import mongoose, { Document, Schema, Types } from "mongoose";
|
|
2
2
|
import { Audit } from "../interface/Audit.interface";
|
|
3
|
-
import
|
|
4
|
-
import IFile from "../interface/IFile.interface";
|
|
3
|
+
import ICategory from "../interface/ICategory.interface";
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Interface for Dynamic Template Creation
|
|
@@ -9,23 +8,7 @@ import IFile from "../interface/IFile.interface";
|
|
|
9
8
|
interface IDynamicTemplateDocument extends Document {
|
|
10
9
|
branchId: Types.ObjectId;
|
|
11
10
|
branchCode: string;
|
|
12
|
-
|
|
13
|
-
categoryCode: string;
|
|
14
|
-
fieldSequence: number;
|
|
15
|
-
fieldCode: string;
|
|
16
|
-
fieldName: string;
|
|
17
|
-
fieldDescription: string;
|
|
18
|
-
fieldType: string;
|
|
19
|
-
isFieldRequired: boolean;
|
|
20
|
-
fieldLength: number;
|
|
21
|
-
isLengthValid: boolean;
|
|
22
|
-
isEditable: boolean;
|
|
23
|
-
multiSelectionEnabled: boolean;
|
|
24
|
-
pastDateEnabled: boolean;
|
|
25
|
-
futureDateEnabled: boolean;
|
|
26
|
-
activeStatus: boolean;
|
|
27
|
-
attachment: IFile;
|
|
28
|
-
values: IFieldValue[];
|
|
11
|
+
categories: ICategory[];
|
|
29
12
|
audit: Audit[];
|
|
30
13
|
}
|
|
31
14
|
|
|
@@ -46,88 +29,124 @@ const dynamicTemplateModel = mongoose.model<IDynamicTemplateDocument>(
|
|
|
46
29
|
required: true,
|
|
47
30
|
},
|
|
48
31
|
|
|
49
|
-
|
|
50
|
-
type: Schema.Types.ObjectId,
|
|
51
|
-
ref: "Field.Categories",
|
|
52
|
-
required: true,
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
categoryCode: {
|
|
56
|
-
type: String,
|
|
57
|
-
required: true,
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
fieldSequence: {
|
|
61
|
-
type: Number,
|
|
62
|
-
required: true,
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
fieldCode: {
|
|
66
|
-
type: String,
|
|
67
|
-
required: true,
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
fieldName: {
|
|
71
|
-
type: String,
|
|
72
|
-
required: true,
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
fieldDescription: {
|
|
76
|
-
type: String,
|
|
77
|
-
default: "",
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
fieldType: {
|
|
81
|
-
type: String,
|
|
82
|
-
required: true,
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
isFieldRequired: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
fieldLength: {
|
|
90
|
-
type: Number,
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
isLengthValid: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
isEditable: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
multiSelectionEnabled: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
pastDateEnabled: {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
futureDateEnabled: {
|
|
110
|
-
type: Boolean,
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
activeStatus: {
|
|
114
|
-
type: Boolean,
|
|
115
|
-
default: true,
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
attachment: {
|
|
119
|
-
baseURL: String,
|
|
120
|
-
fileName: String,
|
|
121
|
-
fileExtension: String,
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
values: {
|
|
32
|
+
categories: {
|
|
125
33
|
type: [
|
|
126
34
|
{
|
|
127
|
-
|
|
128
|
-
|
|
35
|
+
categoryId: {
|
|
36
|
+
type: Schema.Types.ObjectId,
|
|
37
|
+
ref: "Field.Categories",
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
categoryCode: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
categorySequence: {
|
|
47
|
+
type: Number,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
fields: {
|
|
52
|
+
type: [
|
|
53
|
+
{
|
|
54
|
+
fieldSequence: {
|
|
55
|
+
type: Number,
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
fieldCode: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
fieldName: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: true,
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
fieldDescription: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: "",
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
fieldType: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: true,
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
isFieldRequired: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false,
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
fieldLength: {
|
|
85
|
+
type: Number,
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
isLengthValid: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
isEditable: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false,
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
multiSelectionEnabled: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
pastDateEnabled: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
futureDateEnabled: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
activeStatus: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: true,
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
attachment: {
|
|
115
|
+
baseURL: String,
|
|
116
|
+
fileName: String,
|
|
117
|
+
fileExtension: String,
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
values: {
|
|
121
|
+
type: [
|
|
122
|
+
{
|
|
123
|
+
value: { type: String },
|
|
124
|
+
activeStatus: { type: Boolean, default: true },
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
audit: [
|
|
130
|
+
{
|
|
131
|
+
userId: { type: String },
|
|
132
|
+
auditedOn: { type: Date, default: null },
|
|
133
|
+
actionType: { type: String },
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
audit: [
|
|
141
|
+
{
|
|
142
|
+
userId: { type: String },
|
|
143
|
+
auditedOn: { type: Date, default: null },
|
|
144
|
+
actionType: { type: String },
|
|
145
|
+
},
|
|
146
|
+
],
|
|
129
147
|
},
|
|
130
148
|
],
|
|
149
|
+
required: true,
|
|
131
150
|
},
|
|
132
151
|
|
|
133
152
|
audit: [
|