cloud-ide-lms-model 1.0.356 → 1.0.358

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.
@@ -46,6 +46,132 @@ class AuthUserMstCreatePayload {
46
46
  }
47
47
  Validate() {
48
48
  let errorLogger = {};
49
+ // Validate required fields in auth_user_mst
50
+ if (!this.auth_user_mst) {
51
+ errorLogger.auth_user_mst = 'User data (auth_user_mst) is required';
52
+ return errorLogger;
53
+ }
54
+ // Validate user_username is required (min 5, max 20 characters)
55
+ if (!this.auth_user_mst.user_username || !this.auth_user_mst.user_username.trim()) {
56
+ errorLogger.auth_user_mst = 'Username (user_username) is required';
57
+ }
58
+ else {
59
+ const username = this.auth_user_mst.user_username.trim();
60
+ if (username.length < 5) {
61
+ errorLogger.auth_user_mst = 'Username must be at least 5 characters long';
62
+ }
63
+ else if (username.length > 20) {
64
+ errorLogger.auth_user_mst = 'Username must not exceed 20 characters';
65
+ }
66
+ }
67
+ // Validate user_fullname is required (min 8, max 80 characters)
68
+ if (!this.auth_user_mst.user_fullname || !this.auth_user_mst.user_fullname.trim()) {
69
+ if (!errorLogger.auth_user_mst) {
70
+ errorLogger.auth_user_mst = 'Full name (user_fullname) is required';
71
+ }
72
+ else {
73
+ errorLogger.auth_user_mst += '; Full name (user_fullname) is required';
74
+ }
75
+ }
76
+ else {
77
+ const fullname = this.auth_user_mst.user_fullname.trim();
78
+ if (fullname.length < 8) {
79
+ if (!errorLogger.auth_user_mst) {
80
+ errorLogger.auth_user_mst = 'Full name must be at least 8 characters long';
81
+ }
82
+ else {
83
+ errorLogger.auth_user_mst += '; Full name must be at least 8 characters long';
84
+ }
85
+ }
86
+ else if (fullname.length > 80) {
87
+ if (!errorLogger.auth_user_mst) {
88
+ errorLogger.auth_user_mst = 'Full name must not exceed 80 characters';
89
+ }
90
+ else {
91
+ errorLogger.auth_user_mst += '; Full name must not exceed 80 characters';
92
+ }
93
+ }
94
+ }
95
+ // Validate user_emailid is required and valid format (min 8, max 50 characters)
96
+ if (!this.auth_user_mst.user_emailid || !this.auth_user_mst.user_emailid.trim()) {
97
+ if (!errorLogger.auth_user_mst) {
98
+ errorLogger.auth_user_mst = 'Email (user_emailid) is required';
99
+ }
100
+ else {
101
+ errorLogger.auth_user_mst += '; Email (user_emailid) is required';
102
+ }
103
+ }
104
+ else {
105
+ const email = this.auth_user_mst.user_emailid.trim();
106
+ if (email.length < 8) {
107
+ if (!errorLogger.auth_user_mst) {
108
+ errorLogger.auth_user_mst = 'Email must be at least 8 characters long';
109
+ }
110
+ else {
111
+ errorLogger.auth_user_mst += '; Email must be at least 8 characters long';
112
+ }
113
+ }
114
+ else if (email.length > 50) {
115
+ if (!errorLogger.auth_user_mst) {
116
+ errorLogger.auth_user_mst = 'Email must not exceed 50 characters';
117
+ }
118
+ else {
119
+ errorLogger.auth_user_mst += '; Email must not exceed 50 characters';
120
+ }
121
+ }
122
+ else {
123
+ // Basic email format validation
124
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
125
+ if (!emailRegex.test(email)) {
126
+ if (!errorLogger.auth_user_mst) {
127
+ errorLogger.auth_user_mst = 'Email format is invalid';
128
+ }
129
+ else {
130
+ errorLogger.auth_user_mst += '; Email format is invalid';
131
+ }
132
+ }
133
+ }
134
+ }
135
+ // Validate user_firstname if provided (min 3, max 20 characters)
136
+ if (this.auth_user_mst.user_firstname && this.auth_user_mst.user_firstname.trim()) {
137
+ const firstname = this.auth_user_mst.user_firstname.trim();
138
+ if (firstname.length < 3) {
139
+ if (!errorLogger.auth_user_mst) {
140
+ errorLogger.auth_user_mst = 'First name must be at least 3 characters long';
141
+ }
142
+ else {
143
+ errorLogger.auth_user_mst += '; First name must be at least 3 characters long';
144
+ }
145
+ }
146
+ else if (firstname.length > 20) {
147
+ if (!errorLogger.auth_user_mst) {
148
+ errorLogger.auth_user_mst = 'First name must not exceed 20 characters';
149
+ }
150
+ else {
151
+ errorLogger.auth_user_mst += '; First name must not exceed 20 characters';
152
+ }
153
+ }
154
+ }
155
+ // Validate user_lastname if provided (min 3, max 20 characters)
156
+ if (this.auth_user_mst.user_lastname && this.auth_user_mst.user_lastname.trim()) {
157
+ const lastname = this.auth_user_mst.user_lastname.trim();
158
+ if (lastname.length < 3) {
159
+ if (!errorLogger.auth_user_mst) {
160
+ errorLogger.auth_user_mst = 'Last name must be at least 3 characters long';
161
+ }
162
+ else {
163
+ errorLogger.auth_user_mst += '; Last name must be at least 3 characters long';
164
+ }
165
+ }
166
+ else if (lastname.length > 20) {
167
+ if (!errorLogger.auth_user_mst) {
168
+ errorLogger.auth_user_mst = 'Last name must not exceed 20 characters';
169
+ }
170
+ else {
171
+ errorLogger.auth_user_mst += '; Last name must not exceed 20 characters';
172
+ }
173
+ }
174
+ }
49
175
  return errorLogger;
50
176
  }
51
177
  }
@@ -41,6 +41,9 @@ declare class MFeeReceiptTemplateInsertUpdatePayload extends FeeReceiptTemplate
41
41
  }
42
42
  interface feeReceiptTemplateControllerResponse extends controllerResponse {
43
43
  data?: FeeReceiptTemplate[];
44
+ totalDocument?: number;
45
+ page?: number;
46
+ limit?: number;
44
47
  }
45
48
  interface feeReceiptTemplateByIdControllerResponse extends controllerResponse {
46
49
  data?: FeeReceiptTemplate;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "typescript": "^5.4.2"
6
6
  },
7
7
  "name": "cloud-ide-lms-model",
8
- "version": "1.0.356",
8
+ "version": "1.0.358",
9
9
  "description": "Package for Model management of Cloud IDEsys LMS",
10
10
  "main": "lib/index.js",
11
11
  "types": "lib/index.d.ts",