storemw-core-api 1.0.140 → 1.0.141

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.
Files changed (58) hide show
  1. package/dist/controllers/user/userController.js +8 -4
  2. package/dist/controllers/user/userController.js.map +1 -1
  3. package/dist/models/account/AccountModel.d.ts +13 -13
  4. package/dist/models/branch_user/BranchUserModel.d.ts +13 -13
  5. package/dist/models/user/AgentModel.d.ts +2 -24
  6. package/dist/models/user/MemberModel.d.ts +2 -24
  7. package/dist/models/user/UserModel.d.ts +13 -2
  8. package/dist/schema/payload/account/schemaAccount.d.ts +7 -0
  9. package/dist/schema/payload/user/schemaUser.d.ts +3 -0
  10. package/dist/schema/payload/user/schemaUser.js +1 -0
  11. package/dist/schema/payload/user/schemaUser.js.map +1 -1
  12. package/dist/schema/payload/user/schemaUserAdministrator.d.ts +14 -0
  13. package/dist/schema/payload/user/schemaUserAgent.d.ts +15 -12
  14. package/dist/schema/payload/user/schemaUserAgent.js +2 -2
  15. package/dist/schema/payload/user/schemaUserAgent.js.map +1 -1
  16. package/dist/schema/payload/user/schemaUserCustomer.d.ts +14 -0
  17. package/dist/schema/payload/user/schemaUserDriver.d.ts +14 -0
  18. package/dist/schema/payload/user/schemaUserMember.d.ts +15 -12
  19. package/dist/schema/payload/user/schemaUserMember.js +2 -2
  20. package/dist/schema/payload/user/schemaUserMember.js.map +1 -1
  21. package/dist/schema/payload/user/schemaUserOperator.d.ts +14 -0
  22. package/dist/schema/payload/user/schemaUserRetailer.d.ts +14 -0
  23. package/dist/schema/payload/user/schemaUserWorker.d.ts +14 -0
  24. package/dist/services/account/AccountService.js +14 -4
  25. package/dist/services/account/AccountService.js.map +1 -1
  26. package/dist/services/index.d.ts +1 -1
  27. package/dist/services/index.js +2 -1
  28. package/dist/services/index.js.map +1 -1
  29. package/dist/services/user/AdministratorService.d.ts +1 -0
  30. package/dist/services/user/AdministratorService.js +7 -0
  31. package/dist/services/user/AdministratorService.js.map +1 -1
  32. package/dist/services/user/AgentService.d.ts +2 -12
  33. package/dist/services/user/AgentService.js +35 -26
  34. package/dist/services/user/AgentService.js.map +1 -1
  35. package/dist/services/user/CustomerService.d.ts +1 -0
  36. package/dist/services/user/CustomerService.js +7 -0
  37. package/dist/services/user/CustomerService.js.map +1 -1
  38. package/dist/services/user/DriverService.d.ts +1 -0
  39. package/dist/services/user/DriverService.js +7 -0
  40. package/dist/services/user/DriverService.js.map +1 -1
  41. package/dist/services/user/MemberService.d.ts +2 -12
  42. package/dist/services/user/MemberService.js +35 -26
  43. package/dist/services/user/MemberService.js.map +1 -1
  44. package/dist/services/user/OperatorService.d.ts +4 -2
  45. package/dist/services/user/OperatorService.js +11 -3
  46. package/dist/services/user/OperatorService.js.map +1 -1
  47. package/dist/services/user/RetailerService.d.ts +1 -0
  48. package/dist/services/user/RetailerService.js +7 -0
  49. package/dist/services/user/RetailerService.js.map +1 -1
  50. package/dist/services/user/UserMeService.d.ts +1 -0
  51. package/dist/services/user/UserService.d.ts +5 -0
  52. package/dist/services/user/UserService.js +34 -17
  53. package/dist/services/user/UserService.js.map +1 -1
  54. package/dist/services/user/WorkerService.d.ts +1 -0
  55. package/dist/services/user/WorkerService.js +52 -44
  56. package/dist/services/user/WorkerService.js.map +1 -1
  57. package/package.json +1 -1
  58. package/prisma/schema.prisma +44 -47
@@ -20,8 +20,6 @@ export declare const ModelAgentFields: {
20
20
  user_id: "user_id";
21
21
  remark: "remark";
22
22
  company_name: "company_name";
23
- owner_user_type: "owner_user_type";
24
- owner_user_id: "owner_user_id";
25
23
  identity_no: "identity_no";
26
24
  gender: "gender";
27
25
  dob: "dob";
@@ -53,7 +51,7 @@ export type ModelAgentListProps = {
53
51
  };
54
52
  export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
55
53
  selectedPrisma: any;
56
- primaryKey: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "code" | "address_1" | "address_2" | "postcode" | "state_id" | "country_id" | "area_id" | "user_id" | "remark" | "company_name" | "owner_user_type" | "owner_user_id" | "identity_no" | "gender" | "dob" | "agent_id";
54
+ primaryKey: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "code" | "address_1" | "address_2" | "postcode" | "state_id" | "country_id" | "area_id" | "user_id" | "remark" | "company_name" | "identity_no" | "gender" | "dob" | "agent_id";
57
55
  getFields: (prefix?: string, excludeKeywords?: string[]) => Promise<{
58
56
  name: string;
59
57
  type: string;
@@ -78,8 +76,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
78
76
  user_id: bigint;
79
77
  remark: string | null;
80
78
  company_name: string | null;
81
- owner_user_type: string | null;
82
- owner_user_id: bigint;
83
79
  identity_no: string | null;
84
80
  gender: string | null;
85
81
  dob: Date | null;
@@ -106,8 +102,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
106
102
  user_id: bigint;
107
103
  remark: string | null;
108
104
  company_name: string | null;
109
- owner_user_type: string | null;
110
- owner_user_id: bigint;
111
105
  identity_no: string | null;
112
106
  gender: string | null;
113
107
  dob: Date | null;
@@ -135,8 +129,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
135
129
  user_id: bigint;
136
130
  remark: string | null;
137
131
  company_name: string | null;
138
- owner_user_type: string | null;
139
- owner_user_id: bigint;
140
132
  identity_no: string | null;
141
133
  gender: string | null;
142
134
  dob: Date | null;
@@ -160,8 +152,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
160
152
  user_id: bigint;
161
153
  remark: string | null;
162
154
  company_name: string | null;
163
- owner_user_type: string | null;
164
- owner_user_id: bigint;
165
155
  identity_no: string | null;
166
156
  gender: string | null;
167
157
  dob: Date | null;
@@ -171,7 +161,7 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
171
161
  where?: Record<string, any>;
172
162
  }) => Promise<number>;
173
163
  aggregate: ({ field, operation, where, }: {
174
- field: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "code" | "address_1" | "address_2" | "postcode" | "state_id" | "country_id" | "area_id" | "user_id" | "remark" | "company_name" | "owner_user_type" | "owner_user_id" | "identity_no" | "gender" | "dob" | "agent_id";
164
+ field: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "code" | "address_1" | "address_2" | "postcode" | "state_id" | "country_id" | "area_id" | "user_id" | "remark" | "company_name" | "identity_no" | "gender" | "dob" | "agent_id";
175
165
  operation?: "sum" | "avg" | "min" | "max" | "count";
176
166
  where?: Record<string, any>;
177
167
  }) => Promise<number>;
@@ -196,8 +186,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
196
186
  user_id: bigint;
197
187
  remark: string | null;
198
188
  company_name: string | null;
199
- owner_user_type: string | null;
200
- owner_user_id: bigint;
201
189
  identity_no: string | null;
202
190
  gender: string | null;
203
191
  dob: Date | null;
@@ -222,8 +210,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
222
210
  user_id: bigint;
223
211
  remark: string | null;
224
212
  company_name: string | null;
225
- owner_user_type: string | null;
226
- owner_user_id: bigint;
227
213
  identity_no: string | null;
228
214
  gender: string | null;
229
215
  dob: Date | null;
@@ -250,8 +236,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
250
236
  user_id: bigint;
251
237
  remark: string | null;
252
238
  company_name: string | null;
253
- owner_user_type: string | null;
254
- owner_user_id: bigint;
255
239
  identity_no: string | null;
256
240
  gender: string | null;
257
241
  dob: Date | null;
@@ -277,8 +261,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
277
261
  user_id: bigint;
278
262
  remark: string | null;
279
263
  company_name: string | null;
280
- owner_user_type: string | null;
281
- owner_user_id: bigint;
282
264
  identity_no: string | null;
283
265
  gender: string | null;
284
266
  dob: Date | null;
@@ -304,8 +286,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
304
286
  user_id: bigint;
305
287
  remark: string | null;
306
288
  company_name: string | null;
307
- owner_user_type: string | null;
308
- owner_user_id: bigint;
309
289
  identity_no: string | null;
310
290
  gender: string | null;
311
291
  dob: Date | null;
@@ -332,8 +312,6 @@ export declare const AgentModel: ({ ...rest }: DefaultServiceProps) => {
332
312
  user_id: bigint;
333
313
  remark: string | null;
334
314
  company_name: string | null;
335
- owner_user_type: string | null;
336
- owner_user_id: bigint;
337
315
  identity_no: string | null;
338
316
  gender: string | null;
339
317
  dob: Date | null;
@@ -22,8 +22,6 @@ export declare const ModelMemberFields: {
22
22
  remark: "remark";
23
23
  company_name: "company_name";
24
24
  member_id: "member_id";
25
- owner_user_type: "owner_user_type";
26
- owner_user_id: "owner_user_id";
27
25
  identity_no: "identity_no";
28
26
  gender: "gender";
29
27
  dob: "dob";
@@ -54,7 +52,7 @@ export type ModelMemberListProps = {
54
52
  };
55
53
  export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
56
54
  selectedPrisma: any;
57
- primaryKey: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "code" | "address_1" | "address_2" | "postcode" | "state_id" | "area" | "country_id" | "area_id" | "user_id" | "remark" | "company_name" | "member_id" | "owner_user_type" | "owner_user_id" | "identity_no" | "gender" | "dob";
55
+ primaryKey: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "code" | "address_1" | "address_2" | "postcode" | "state_id" | "area" | "country_id" | "area_id" | "user_id" | "remark" | "company_name" | "member_id" | "identity_no" | "gender" | "dob";
58
56
  getFields: (prefix?: string, excludeKeywords?: string[]) => Promise<{
59
57
  name: string;
60
58
  type: string;
@@ -81,8 +79,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
81
79
  remark: string | null;
82
80
  company_name: string | null;
83
81
  member_id: bigint;
84
- owner_user_type: string | null;
85
- owner_user_id: bigint | null;
86
82
  identity_no: string | null;
87
83
  gender: string | null;
88
84
  dob: Date | null;
@@ -110,8 +106,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
110
106
  remark: string | null;
111
107
  company_name: string | null;
112
108
  member_id: bigint;
113
- owner_user_type: string | null;
114
- owner_user_id: bigint | null;
115
109
  identity_no: string | null;
116
110
  gender: string | null;
117
111
  dob: Date | null;
@@ -140,8 +134,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
140
134
  remark: string | null;
141
135
  company_name: string | null;
142
136
  member_id: bigint;
143
- owner_user_type: string | null;
144
- owner_user_id: bigint | null;
145
137
  identity_no: string | null;
146
138
  gender: string | null;
147
139
  dob: Date | null;
@@ -166,8 +158,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
166
158
  remark: string | null;
167
159
  company_name: string | null;
168
160
  member_id: bigint;
169
- owner_user_type: string | null;
170
- owner_user_id: bigint | null;
171
161
  identity_no: string | null;
172
162
  gender: string | null;
173
163
  dob: Date | null;
@@ -176,7 +166,7 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
176
166
  where?: Record<string, any>;
177
167
  }) => Promise<number>;
178
168
  aggregate: ({ field, operation, where, }: {
179
- field: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "code" | "address_1" | "address_2" | "postcode" | "state_id" | "area" | "country_id" | "area_id" | "user_id" | "remark" | "company_name" | "member_id" | "owner_user_type" | "owner_user_id" | "identity_no" | "gender" | "dob";
169
+ field: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "code" | "address_1" | "address_2" | "postcode" | "state_id" | "area" | "country_id" | "area_id" | "user_id" | "remark" | "company_name" | "member_id" | "identity_no" | "gender" | "dob";
180
170
  operation?: "sum" | "avg" | "min" | "max" | "count";
181
171
  where?: Record<string, any>;
182
172
  }) => Promise<number>;
@@ -203,8 +193,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
203
193
  remark: string | null;
204
194
  company_name: string | null;
205
195
  member_id: bigint;
206
- owner_user_type: string | null;
207
- owner_user_id: bigint | null;
208
196
  identity_no: string | null;
209
197
  gender: string | null;
210
198
  dob: Date | null;
@@ -230,8 +218,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
230
218
  remark: string | null;
231
219
  company_name: string | null;
232
220
  member_id: bigint;
233
- owner_user_type: string | null;
234
- owner_user_id: bigint | null;
235
221
  identity_no: string | null;
236
222
  gender: string | null;
237
223
  dob: Date | null;
@@ -259,8 +245,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
259
245
  remark: string | null;
260
246
  company_name: string | null;
261
247
  member_id: bigint;
262
- owner_user_type: string | null;
263
- owner_user_id: bigint | null;
264
248
  identity_no: string | null;
265
249
  gender: string | null;
266
250
  dob: Date | null;
@@ -287,8 +271,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
287
271
  remark: string | null;
288
272
  company_name: string | null;
289
273
  member_id: bigint;
290
- owner_user_type: string | null;
291
- owner_user_id: bigint | null;
292
274
  identity_no: string | null;
293
275
  gender: string | null;
294
276
  dob: Date | null;
@@ -315,8 +297,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
315
297
  remark: string | null;
316
298
  company_name: string | null;
317
299
  member_id: bigint;
318
- owner_user_type: string | null;
319
- owner_user_id: bigint | null;
320
300
  identity_no: string | null;
321
301
  gender: string | null;
322
302
  dob: Date | null;
@@ -344,8 +324,6 @@ export declare const MemberModel: ({ ...rest }: DefaultServiceProps) => {
344
324
  remark: string | null;
345
325
  company_name: string | null;
346
326
  member_id: bigint;
347
- owner_user_type: string | null;
348
- owner_user_id: bigint | null;
349
327
  identity_no: string | null;
350
328
  gender: string | null;
351
329
  dob: Date | null;
@@ -21,6 +21,7 @@ export declare const ModelUserFields: {
21
21
  address: "address";
22
22
  contact_country_code: "contact_country_code";
23
23
  contact_phone_number: "contact_phone_number";
24
+ parent_user_id: "parent_user_id";
24
25
  };
25
26
  export type ModelUser = users;
26
27
  export type ModelUserOmitFields = typeof primaryKey | DefaultOmitFields;
@@ -48,7 +49,7 @@ export type ModelUserListProps = {
48
49
  };
49
50
  export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
50
51
  selectedPrisma: any;
51
- primaryKey: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "status" | "user_id" | "login_username" | "login_password" | "user_type" | "firstname" | "lastname" | "email" | "address" | "contact_country_code" | "contact_phone_number";
52
+ primaryKey: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "status" | "user_id" | "login_username" | "login_password" | "user_type" | "firstname" | "lastname" | "email" | "address" | "contact_country_code" | "contact_phone_number" | "parent_user_id";
52
53
  getFields: (prefix?: string, excludeKeywords?: string[]) => Promise<{
53
54
  name: string;
54
55
  type: string;
@@ -74,6 +75,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
74
75
  address: string | null;
75
76
  contact_country_code: number;
76
77
  contact_phone_number: string | null;
78
+ parent_user_id: bigint;
77
79
  }>;
78
80
  createMany: ({ dataList, disableRollback, }: {
79
81
  dataList: Omit<any, DefaultOmitFields>[];
@@ -97,6 +99,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
97
99
  address: string | null;
98
100
  contact_country_code: number;
99
101
  contact_phone_number: string | null;
102
+ parent_user_id: bigint;
100
103
  }[]>;
101
104
  get: ({ id, where, include, }: {
102
105
  id?: number;
@@ -121,6 +124,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
121
124
  address: string | null;
122
125
  contact_country_code: number;
123
126
  contact_phone_number: string | null;
127
+ parent_user_id: bigint;
124
128
  } | null>;
125
129
  list: ({ where, orderBy, offset, limit, include }?: any) => Promise<{
126
130
  createdatetime: Date | null;
@@ -141,12 +145,13 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
141
145
  address: string | null;
142
146
  contact_country_code: number;
143
147
  contact_phone_number: string | null;
148
+ parent_user_id: bigint;
144
149
  }[]>;
145
150
  count: ({ where }?: {
146
151
  where?: Record<string, any>;
147
152
  }) => Promise<number>;
148
153
  aggregate: ({ field, operation, where, }: {
149
- field: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "status" | "user_id" | "login_username" | "login_password" | "user_type" | "firstname" | "lastname" | "email" | "address" | "contact_country_code" | "contact_phone_number";
154
+ field: "createdatetime" | "createuserid" | "updatedatetime" | "updateuserid" | "isdelete" | "istrash" | "accountid" | "status" | "user_id" | "login_username" | "login_password" | "user_type" | "firstname" | "lastname" | "email" | "address" | "contact_country_code" | "contact_phone_number" | "parent_user_id";
150
155
  operation?: "sum" | "avg" | "min" | "max" | "count";
151
156
  where?: Record<string, any>;
152
157
  }) => Promise<number>;
@@ -172,6 +177,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
172
177
  address: string | null;
173
178
  contact_country_code: number;
174
179
  contact_phone_number: string | null;
180
+ parent_user_id: bigint;
175
181
  }>;
176
182
  disableRollback?: Boolean;
177
183
  }) => Promise<{
@@ -193,6 +199,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
193
199
  address: string | null;
194
200
  contact_country_code: number;
195
201
  contact_phone_number: string | null;
202
+ parent_user_id: bigint;
196
203
  }>;
197
204
  updateMany: ({ dataList, disableRollback, }: {
198
205
  dataList: {
@@ -216,6 +223,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
216
223
  address: string | null;
217
224
  contact_country_code: number;
218
225
  contact_phone_number: string | null;
226
+ parent_user_id: bigint;
219
227
  }>;
220
228
  }[];
221
229
  disableRollback?: boolean;
@@ -238,6 +246,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
238
246
  address: string | null;
239
247
  contact_country_code: number;
240
248
  contact_phone_number: string | null;
249
+ parent_user_id: bigint;
241
250
  }[]>;
242
251
  trash: ({ ids }: {
243
252
  ids: number[];
@@ -260,6 +269,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
260
269
  address: string | null;
261
270
  contact_country_code: number;
262
271
  contact_phone_number: string | null;
272
+ parent_user_id: bigint;
263
273
  }[]>;
264
274
  remove: ({ ids, where }: {
265
275
  ids?: number[];
@@ -283,6 +293,7 @@ export declare const UserModel: ({ ...rest }: DefaultServiceProps) => {
283
293
  address: string | null;
284
294
  contact_country_code: number;
285
295
  contact_phone_number: string | null;
296
+ parent_user_id: bigint;
286
297
  }[]>;
287
298
  raw: <T = any>(query: string, params?: any[]) => Promise<T[]>;
288
299
  rawExec: (query: string, params?: any[]) => Promise<number>;
@@ -97,6 +97,7 @@ export declare const schemaAccountCreatePayload: z.ZodObject<{
97
97
  }>;
98
98
  address: z.ZodOptional<z.ZodString>;
99
99
  email: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
100
+ parentUserId: z.ZodOptional<z.ZodNumber>;
100
101
  status: z.ZodBoolean;
101
102
  }, "status">, "strip", z.ZodTypeAny, {
102
103
  firstname: string;
@@ -109,6 +110,7 @@ export declare const schemaAccountCreatePayload: z.ZodObject<{
109
110
  username: string;
110
111
  password: string;
111
112
  address?: string | undefined;
113
+ parentUserId?: number | undefined;
112
114
  }, {
113
115
  firstname: string;
114
116
  lastname: string;
@@ -120,6 +122,7 @@ export declare const schemaAccountCreatePayload: z.ZodObject<{
120
122
  username: string;
121
123
  password: string;
122
124
  address?: string | undefined;
125
+ parentUserId?: number | undefined;
123
126
  }>;
124
127
  }, "strip", z.ZodTypeAny, {
125
128
  administrator: {
@@ -133,6 +136,7 @@ export declare const schemaAccountCreatePayload: z.ZodObject<{
133
136
  username: string;
134
137
  password: string;
135
138
  address?: string | undefined;
139
+ parentUserId?: number | undefined;
136
140
  };
137
141
  account: {
138
142
  status: boolean;
@@ -164,6 +168,7 @@ export declare const schemaAccountCreatePayload: z.ZodObject<{
164
168
  username: string;
165
169
  password: string;
166
170
  address?: string | undefined;
171
+ parentUserId?: number | undefined;
167
172
  };
168
173
  account: {
169
174
  status: boolean;
@@ -201,6 +206,7 @@ export declare const schemaAccountCreatePayload: z.ZodObject<{
201
206
  username: string;
202
207
  password: string;
203
208
  address?: string | undefined;
209
+ parentUserId?: number | undefined;
204
210
  };
205
211
  account: {
206
212
  status: boolean;
@@ -238,6 +244,7 @@ export declare const schemaAccountCreatePayload: z.ZodObject<{
238
244
  username: string;
239
245
  password: string;
240
246
  address?: string | undefined;
247
+ parentUserId?: number | undefined;
241
248
  };
242
249
  account: {
243
250
  status: boolean;
@@ -17,6 +17,7 @@ export declare const schemaUserCredential: z.ZodObject<{
17
17
  }>;
18
18
  address: z.ZodOptional<z.ZodString>;
19
19
  email: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
20
+ parentUserId: z.ZodOptional<z.ZodNumber>;
20
21
  status: z.ZodBoolean;
21
22
  }, "strip", z.ZodTypeAny, {
22
23
  status: boolean;
@@ -30,6 +31,7 @@ export declare const schemaUserCredential: z.ZodObject<{
30
31
  username: string;
31
32
  password: string;
32
33
  address?: string | undefined;
34
+ parentUserId?: number | undefined;
33
35
  }, {
34
36
  status: boolean;
35
37
  firstname: string;
@@ -42,6 +44,7 @@ export declare const schemaUserCredential: z.ZodObject<{
42
44
  username: string;
43
45
  password: string;
44
46
  address?: string | undefined;
47
+ parentUserId?: number | undefined;
45
48
  }>;
46
49
  /** Delete */
47
50
  export declare const schemaUserDeletePayload: z.ZodObject<{
@@ -22,6 +22,7 @@ exports.schemaUserCredential = zod_1.z.object({
22
22
  }),
23
23
  address: zod_1.z.string().optional(),
24
24
  email: zod_1.z.string().email().or(zod_1.z.literal("")), // allow "" or valid email
25
+ parentUserId: zod_1.z.number().optional(),
25
26
  status: zod_1.z.boolean()
26
27
  });
27
28
  /** Delete */
@@ -1 +1 @@
1
- {"version":3,"file":"schemaUser.js","sourceRoot":"","sources":["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IACF,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,sCAAsC,CAAC;KAC1E,CAAC;CACL,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { _, dayjs } from \"@/utils\";\n\nimport { userTypes } from \"@/services\";\n\n/** General */\nexport const schemaUserCredential = z.object({\n username: z.string().min(1),\n password: z.string().min(1),\n firstname: z.string().min(1),\n lastname: z.string(),\n // contact: z.string(),\n contact: z.object({\n countryCode: z.number({\n required_error: \"Country code is required\",\n invalid_type_error: \"Country code must be a number\",\n }),\n phoneNumber: z.string()\n .min(4, \"Phone number is too short\")\n .max(20, \"Phone number is too long\")\n .regex(/^\\d+$/, \"Phone number must contain digits only\"),\n }),\n address: z.string().optional(),\n email: z.string().email().or(z.literal(\"\")), // allow \"\" or valid email\n status: z.boolean()\n})\n\n/** Delete */\nexport const schemaUserDeletePayload = z.object({\n scope: z.object({\n // target: z.enum([\"operator\", \"customer\", \"administrator\", \"worker\", \"retailer\"]), // only allowed values\n target: z.enum(Object.keys(userTypes) as [string, ...string[]])\n }),\n payload: z.object({\n ids: z.array(z.number()).min(1, \"ids must contain at least one number\"),\n }),\n});\n\nexport type SchemaUserDeletePayload = z.infer<typeof schemaUserDeletePayload>;"]}
1
+ {"version":3,"file":"schemaUser.js","sourceRoot":"","sources":["../../../../src/schema/payload/user/schemaUser.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAIxB,yCAAuC;AAEvC,cAAc;AACD,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,SAAS,EAAE,OAAC,CAAC,MAAM,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\n\n/** General */\nexport const schemaUserCredential = z.object({\n username: z.string().min(1),\n password: z.string().min(1),\n firstname: z.string().min(1),\n lastname: z.string(),\n // contact: z.string(),\n contact: z.object({\n countryCode: z.number({\n required_error: \"Country code is required\",\n invalid_type_error: \"Country code must be a number\",\n }),\n phoneNumber: z.string()\n .min(4, \"Phone number is too short\")\n .max(20, \"Phone number is too long\")\n .regex(/^\\d+$/, \"Phone number must contain digits only\"),\n }),\n address: z.string().optional(),\n email: z.string().email().or(z.literal(\"\")), // allow \"\" or valid email\n parentUserId: z.number().optional(),\n status: z.boolean()\n})\n\n/** Delete */\nexport const schemaUserDeletePayload = z.object({\n scope: z.object({\n // target: z.enum([\"operator\", \"customer\", \"administrator\", \"worker\", \"retailer\"]), // only allowed values\n target: z.enum(Object.keys(userTypes) as [string, ...string[]])\n }),\n payload: z.object({\n ids: z.array(z.number()).min(1, \"ids must contain at least one number\"),\n }),\n});\n\nexport type SchemaUserDeletePayload = z.infer<typeof schemaUserDeletePayload>;"]}
@@ -29,6 +29,7 @@ export declare const schemaUserAdministratorCreatePayload: z.ZodObject<{
29
29
  }>;
30
30
  address: z.ZodOptional<z.ZodString>;
31
31
  email: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
32
+ parentUserId: z.ZodOptional<z.ZodNumber>;
32
33
  status: z.ZodBoolean;
33
34
  }, "strip", z.ZodTypeAny, {
34
35
  status: boolean;
@@ -42,6 +43,7 @@ export declare const schemaUserAdministratorCreatePayload: z.ZodObject<{
42
43
  username: string;
43
44
  password: string;
44
45
  address?: string | undefined;
46
+ parentUserId?: number | undefined;
45
47
  }, {
46
48
  status: boolean;
47
49
  firstname: string;
@@ -54,6 +56,7 @@ export declare const schemaUserAdministratorCreatePayload: z.ZodObject<{
54
56
  username: string;
55
57
  password: string;
56
58
  address?: string | undefined;
59
+ parentUserId?: number | undefined;
57
60
  }>;
58
61
  administrator: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
59
62
  props: z.ZodObject<{
@@ -80,6 +83,7 @@ export declare const schemaUserAdministratorCreatePayload: z.ZodObject<{
80
83
  username: string;
81
84
  password: string;
82
85
  address?: string | undefined;
86
+ parentUserId?: number | undefined;
83
87
  };
84
88
  }, {
85
89
  administrator: {};
@@ -98,6 +102,7 @@ export declare const schemaUserAdministratorCreatePayload: z.ZodObject<{
98
102
  username: string;
99
103
  password: string;
100
104
  address?: string | undefined;
105
+ parentUserId?: number | undefined;
101
106
  };
102
107
  }>;
103
108
  }, "strip", z.ZodTypeAny, {
@@ -122,6 +127,7 @@ export declare const schemaUserAdministratorCreatePayload: z.ZodObject<{
122
127
  username: string;
123
128
  password: string;
124
129
  address?: string | undefined;
130
+ parentUserId?: number | undefined;
125
131
  };
126
132
  };
127
133
  }, {
@@ -146,6 +152,7 @@ export declare const schemaUserAdministratorCreatePayload: z.ZodObject<{
146
152
  username: string;
147
153
  password: string;
148
154
  address?: string | undefined;
155
+ parentUserId?: number | undefined;
149
156
  };
150
157
  };
151
158
  }>;
@@ -180,6 +187,7 @@ export declare const schemaUserAdministratorUpdatePayload: z.ZodObject<{
180
187
  phoneNumber: string;
181
188
  }>;
182
189
  username: z.ZodString;
190
+ parentUserId: z.ZodOptional<z.ZodNumber>;
183
191
  password: z.ZodOptional<z.ZodString>;
184
192
  }, "strip", z.ZodTypeAny, {
185
193
  status: boolean;
@@ -192,6 +200,7 @@ export declare const schemaUserAdministratorUpdatePayload: z.ZodObject<{
192
200
  };
193
201
  username: string;
194
202
  address?: string | undefined;
203
+ parentUserId?: number | undefined;
195
204
  password?: string | undefined;
196
205
  }, {
197
206
  status: boolean;
@@ -204,6 +213,7 @@ export declare const schemaUserAdministratorUpdatePayload: z.ZodObject<{
204
213
  };
205
214
  username: string;
206
215
  address?: string | undefined;
216
+ parentUserId?: number | undefined;
207
217
  password?: string | undefined;
208
218
  }>;
209
219
  administrator: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
@@ -230,6 +240,7 @@ export declare const schemaUserAdministratorUpdatePayload: z.ZodObject<{
230
240
  };
231
241
  username: string;
232
242
  address?: string | undefined;
243
+ parentUserId?: number | undefined;
233
244
  password?: string | undefined;
234
245
  };
235
246
  }, {
@@ -248,6 +259,7 @@ export declare const schemaUserAdministratorUpdatePayload: z.ZodObject<{
248
259
  };
249
260
  username: string;
250
261
  address?: string | undefined;
262
+ parentUserId?: number | undefined;
251
263
  password?: string | undefined;
252
264
  };
253
265
  }>;
@@ -272,6 +284,7 @@ export declare const schemaUserAdministratorUpdatePayload: z.ZodObject<{
272
284
  };
273
285
  username: string;
274
286
  address?: string | undefined;
287
+ parentUserId?: number | undefined;
275
288
  password?: string | undefined;
276
289
  };
277
290
  };
@@ -296,6 +309,7 @@ export declare const schemaUserAdministratorUpdatePayload: z.ZodObject<{
296
309
  };
297
310
  username: string;
298
311
  address?: string | undefined;
312
+ parentUserId?: number | undefined;
299
313
  password?: string | undefined;
300
314
  };
301
315
  };