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